Expression editing tool

The editor tool appears when a table cell is clicked that contains an expression. It can be hidden by clicking the Toggle button, as shown in the screen shot below.

The equation editor is very useful when your model contains a large number of blocks as it allow you to quickly find either existing blocks or names of blocks in the database.

Screenshot

As you type an expression you will find that some of the tools will adapt to what you are writing. For instance, the Model objects tool will only display objects with the name containing the letters in the word you are writing.

The editor contains several tools at your disposal. By using the buttons in the toolbar you can select which tools to show.

Keypad Keypad

Note For more information about conditions see expression syntax

Use the keypad with the mouse to enter a value or an operator without having to use the keyboard.

&& The logical operator AND is used in conditions. For instance (time>100 && Comp1<1000)*TF.
|| The logical operator OR is used in conditions. For instance (time<10 || time>90)*TF.
== The logical operator EQUALS is used in conditions. For instance "(plantType==Vegetable)*TF".
~= The logical operator NOT EQUALS is used in conditions. For instance "(height~=0)*(volume/height)".
<-- Backspace
< The logical operator LESS THAN is used in conditions. For instance "(Comp1<Max_Conc)*TF".
<= The logical operator LESS THAN OR EQUAL is used in conditions. For instance "(Comp1<=Max_Conc)*TF".
>= The logical operator GREATER THAN OR EQUAL is used in conditions. For instance "(time>=10)*TF".
> The logical operator GREATER THAN is used in conditions. For instance "(time>time_for_accident)*TF".
<- Left. Move the cursor one character to the left
^ The power function. For instance, "10^a" is an alternative way of writing "power(10,a)".
-> Right. Move the cursor one character to the right

 Functions

Note The time function included in the functions list can be used to insert time-dependent conditions in equations.

The functions list contains a list of the available functions in Ecolego. If you want to add your own functions to the list, please see creating custom functions).

 Database

This tool is not visible by default. It displays a list of all parameter names that are available in the database.

Right-click the list to select either the “local” or “external” database.

When a word is being typed, this tool will automatically filter out all parameter names that do not contain the letters in the word.

 Model objects

A list of all available objects that can be used in equations, for instance compartments, expressions and parameters.

Local objects, that is, objects from the same Sub-system as the currently edited object, are highlighted in bold.

As the number of objects quickly becomes very large, the list has options to quickly filter out objects. To the right of this list there is a field containing several criteria according to you can filter the objects. The criteria are selected by using the drop-down list

  • Pattern – Lets to enter a string according to which the items from the list will be filtered. Entering a string here will filter out all objects that do not contain the string. An asterisk “” can be used as a wildcard. As you type a word in the equation, the pattern will automatically be set to the same word as you are writing.

  • Type – Let you to specify the type of object that should appear in the list, that is, compartments, expressions, transfer etc;

  • Indices – Let you to specify the kind of data, vectorised or not, that should be shown in the list;

  • Sub-system – Let you to specify the sub-system.

    See also

  • Expression syntax