Table of Contents

Expression

The expression block can be used to specify an arbitrary function of the model parameters and /or the quantity in other blocks (such as compartments and lookup tables. The value of this block is available for use during the simulations.

Creating an expression

From the Projects window

From the Matrix window

From the Blocks window

Editing an expression

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.

By clicking Settings button Evaluation mode is available. Evaluation mode allows the user to specify when, during simulation, the expression is evaluated.

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

NoteWhen entering an expression, you can also enter names of objects that are not yet created and let Ecolego use automatic object creation to define them.

This page lets you specify the algebraich expression and other index specific properties. See Editing values for more information.

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

Arguments

In some situations it is useful to require arguments to be sent to the expression. These arguments then be used in the equation, together with parameters and other blocks. The expressions then becomes a function, and will only be used as an “abstract”.

Defining arguments

Use the right-hand side table to add (or remove arguments. Click in the table fields to change argument names or to write descriptions for the arguments.

Using arguments

Once an argument has been added, you can use it in the equations of the expressions.

Calling an expression with arguments

You reference an expression by writing the name (or ID) of the expression. If the expression requires arguments, you also add parenthesis and a comma-separated list of argument values - like with any function.

Examples:

See also