User Tools

Site Tools


tutorial_-_time_events_-_monthly_max_with_memory

This is an old revision of the document!


Tutorial - Time events - Monthly max with memory

The min/max block will continouosly monitor another block (or expression) and report on its current minimum/maximum value since the simulation started, or, as we saw in the last experiment, until it is reset. The result is a plot like this:

However, if we want to use this value for a calculation, we are not interested in the current minimum or maximum. We want the maximum when the block reset last time.

In the example above, one could imagine a conservative calculation which uses the maximum value from the previous month to calculate the dose of a person exposed by the poisoned soil.

The trick is to use another block, the snapshot, in order to capture the maximum value each time a month begins.

Adding a snapshot

  1. Continue with the model from the last experiment and add a snapshot block.
  2. Edit the block
  3. In the Properties screen,
    1. Change the name to “Soil_maximum”
    2. Set the unit to _mg_
  4. In the Values screen,
    1. Enter the name of the min/max block _Monthly max_ in the Target field
    2. Select the Month_event block in the Event field
    3. Enter 0.0 as the Initial value

Run a simulation

  1. Run a simulation and make a plot of _Soil_ and _Soil_maximum_
  2. The plot should look like this:
tutorial_-_time_events_-_monthly_max_with_memory.1602527662.txt.gz · Last modified: 2020/10/12 20:34 by erik