=====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: {{ :time_event_tutorial_monthly_max_plot.png?600 |}} However, if we want to use this value for a subsequent calculation, we are often not interested in the current minimum or maximum. We want the maximum from 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==== - Continue with the model from the last experiment and add a [[snapshot]] block. - Edit the block - In the **Properties** screen, - Change the name to "Soil_maximum" - Set the unit to _mg_ - In the **Values** screen, - Enter the name of the min/max block _Monthly max_ in the **Target** field - Select the **Month_event** block in the **Event** field - Enter 0.0 as the **Initial value** ====Run a simulation==== - Run a simulation and make a plot of _Soil_ and _Soil_maximum_ - The plot should look like this: {{ :time_event_tutorial_monthly_max_with_memory.png?600 |}} You can download the solution {{ :monthly_max_model_with_memory.eco |here}} [[tutorial - time events - monthly max|Previous]] [[tutorial - time events - instant pollution|Next]] ===== See also ===== * [[tutorial - time events|First page]] * [[tutorials|Tutorials]]