The Variables page allows defining any user-defined variable, which can be used as a parameter for a control rule and which can be saved as an additional result item. A variable will usually be a function of sensors and may also be a function of other variables.
The primary purpose is to define complex control rules using variables: instead of defining a complex condition for a control rule, it is possible to define a complex variable and then call it in a simpler condition for the control rule. The variable's value can be saved in the result file during the simulations, and it is therefore easier to check that the correct behavior of the regulated structure is modelled, by comparing the applied control strategy with the variable.
Variables are added or deleted using the Append '+' or Delete '-' buttons above the overview table. A variable cannot be added on the map. The order of the variables is changed using the 'Move up' and 'Move down' buttons above the overview table. The order is important only in case one variable is defined as a function of another variable. If Variable1 is used in the expression defining Variable2, then Variable1 must be defined above Variable2 in the table.
Each variable is identified using the data below.
ID. String identification of the variable. It is used to identify the variable and eventually call it when defining another variable.
Description. Any text description relevant for the user may be supplied here.
Expression. The expression defining the mathematical expression of the variable must be typed in this field. The expression can be typed manually or using the Edit button. This button opens a Edit variable window with a list of available sensors, variables, functions and operators, which can be added to the expression by double-clicking them. The Edit variable window also contains a Validate button which evaluates whether the syntax of the expression is correct or not. A full list of functions available can be found in Control Functions.
Example: An example of a syntax for a variable deriving the energy through a structure may be as provided below:
9.81 * [dh] * [Q] * [efficiency]
Where [Q] is a sensor returning the discharge value through the structure and [dh] and [efficiency] are other user-defined variables.
Note: The condition must be written with the syntax from C# programming language. Therefore, the few rules below should apply:
· A path to file must be written with double \. For example, if a variable looks up the time series C:\Data\TS.dfs0, the file path in the function must be written C:\\Data\\TS.dfs0.
· The decimal separator must always be a point.
Note: Circular references (i.e. interdependency of variables) are not supported. That is, a first variable can depend on a second one, but in this case it is not allowed that this second variable also depends on the first one.