User Tools

Site Tools


min_max

Min Max

The min/max block will store the minimum or maximum value of a given expression during the simulation. Although it is possible to create tables that display the minimum or maximum value for an output, the table can only search in the output data which is returned when the simulation is finished. If very few output time points are available it is likely that the real minimum or maximum will not be found. Also, the min/max block can be used during the simulation by other blocks.

In versions prior to Ecolego 6, this functionality was incorporated in the recorder block.

When creating a min/max block, you must specify either the name of the object to monitor, or an expression to monitor. This is called the “Target expression”.

The min/max block makes heavy use of discrete events. By selecting discrete events you can tell the block when to start or stop monitoring or when you want to reset the current value.

Creating a min/max block

From the Projects window

  • Expand the Project to which you wish to add the min/max block by clicking the + symbol next to it. Right-click on ‘Blocks’, or a sub-system in ‘Blocks’, and select Min/Max from the pop-up menu.

From the Matrix window

  • Right click an empty diagonal cell of the matrix and select Min/Max from the the pop-up menu.

From the Blocks window

  • Place the mouse anywhere over the area of this window and right-click on it. Select New | Min/Max from the pop-up menu, or
  • In the title bar, select Min/Max from the Type drop-down list and click on the New button.

Editing a min/max block

NoteMost block properties can be edited directly in the Blocks window.

The block editor is shown by right-clicking the block in a window and selecting Edit. In the Blocks window, you can also show the block editor by selecting the block and clicking the Edit button, or by double-clicking the right-most “validation” column of the block.

The block editor has three tabs:

Properties

This page lets you edit basic properties such as name, sub-system and base unit. See editing properties for more information.

Appearance

This page lets you edit the visual properties of the block in the matrix window and graph window. See editing appearance for more information.

Values

Dimension - You can specify the dimension of the block by using the Type drop down list. Depending on the dimension the index drop down lists are activated.

Data - The data table let you specify index specific properties like target expression and start/stop recording events.

  • Indices - For blocks that are non-scalar, the first columns will specify indices from the index lists. This allows you to specify different expressions for different indices.
  • Target expression - Enter either just the ID of an object to monitor, or enter a full expression.
  • Reset - Select a discrete event which will trigger a reset. The value of the block will then be equal to the current value of target expression.
  • Start recording - Select a discrete event which will indicate when monitoring should start.
  • Stop recording - Select a discrete event which will indicate when monitoring should stop.
  • Information - By using the Table control button you can display more columns that will help you document your model.

Example: Min/Max

For an example of Min/Max, please look at the example for the snapshot block which uses a min/max block.

See also

min_max.txt · Last modified: 2019/11/18 13:34 (external edit)