User Tools

Site Tools


tutorial_-_time_events_-_monthly_max

Tutorial 6a - Time events - Monthly maximum

Page 2 of 4

A common request is to find the maximum value of an output. For this one can use the Min/Max block. However, in this experiment we will determine the maximum for each month of the simulation.

This means that we need to reset the Min/Max block every month. We will need the following:

  • A Time point block which allows us to specify the first day of each month
  • A Time event which will fire events based on the time point block
  • A Min/Max block which records the soil concentration.

Create Time Point block

  1. In the Blocks windows, select to create a time point block
  2. Edit the block.
  3. In the Properties screen
    1. change the name to “Month_time_point”.
  4. In the Values screen
    1. Ensure that the Dimension is Scalar (No dependencies)
    2. Click the Settings button.
    3. Change the Mode to Day of month.
    4. Enter the value 1 as the Timepoint in the table, which indicates the 1st of each month.
  5. Close the window

Create Event block

  1. In the Blocks windows, select to create a time event block
  2. Edit the block.
  3. In the Properties screen
    1. change the name to “Month_event”.
  4. In the Values screen
    1. Ensure that the Dimension is Scalar (No dependencies)
    2. Select Month time point and click the > button.
  5. Close the window

Create Min/Max block

  1. In the Blocks windows, select to create a MinMax block
  2. Edit the block
  3. In the Properties screen, change the name to Monthly_max
  4. In the Values screen
    1. Enter the name Soil for the Target expression value
    2. Select Month_event for the Reset value
  5. Close the window

Run a simulation

  1. Run a simulation, then plot Soil together with Monthly max.
  2. The plot should look like this:

You can download the solution here

Previous Next

See also

tutorial_-_time_events_-_monthly_max.txt · Last modified: by Boris Alfonso

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki