=====Tutorial - Time events - Monthly maximum ===== A common request is to find the maximum value of an output. For this one can use the [[minmax|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|Min/Max]] block which records the soil concentration. **Create time point** - Create a [[time point]] block - Edit the block. - In the **Properties** screen - change the name to "Month_time_point". - In the **Values** screen - Ensure that the **Dimension** is **Scalar** - Click the **Settings** button. - Change the **Mode** to **Day of month**. - Enter the value 1 as the **Timepoint** in the table, which indicates the 1st of each month. - Close the window **Create event** - Create a [[time event]] block - Edit the block. - In the **Properties** screen - change the name to "Month_event". - In the **Values** screen - Ensure that the **Dimension** is **Scalar** - select **Month_time_point** and click the **>** button. - Close the window **Create min/max** - Create a [[min/max]] block - Edit the block - In the **Properties** screen, change the name to **Monthly_max** - In the **Values** screen - Enter the name _Soil_ in the **Target expression** column - Select _Month_event_ in the **Reset** column - Close the window **Run a simulation** - Run a simulation, then plot **Soil** together with **Monthly max**. - The plot should look like this: {{ :time_event_tutorial_monthly_max_plot.png?700 |}} You can download the solution {{ :monthly_max_model.eco |here}} [[tutorial - time events|Previous]] [[tutorial - time events - monthly max with memory|Next]] ===== See also ===== * [[tutorial - time events|First page]] * [[tutorials|Tutorials]]