Errors in Expressions
When you enter an incorrect expression in an input field or table, you will typically at some point encounter an error message. Syntax errors, for example a missing closing parenthesis, are always reported directly as an error, with a pop-up dialog. Input fields expecting a parameter expression will in general also report errors immediately if the expression cannot be evaluated to a number. Variable names which are not model parameters or physical constants will be reported as Unknown model parameter, also if the name is in fact known but is of a more general type.
There may also be further checks associated with a particular parameter expression input. For example, the input may require that the expression evaluates to a positive number, or to an integer. If a parameter expression input value is invalid in this way or cannot be evaluated, the expression will be marked with red and a red cross will appear on the Model Builder node icon. If the expression can be evaluated correctly but its unit is unexpected or inconsistent it will instead be marked with orange color.
Inputs which allow variable expressions will only be marked red if there is a syntax error. The Model Builder node will never be marked as invalid due to an incorrect variable expression. If parsing the expression results in an unexpected unit (not matching the unit expected by the input), an inconsistent unit, or if the unit cannot be deduced because the expression contains unknown variable names, it will be marked with orange color and the tooltip will explain the reason for the warning.
Computing a Study when the model contains some red-marked expression error will typically immediately result in an error message. When there is an orange warning on some expression, the study may still compute correctly but some caution is warranted. A unit warning may indicate that a model is incorrectly set up and that the result should not be trusted.
The absence of a warning for a variable expression does not guarantee that the expression can actually be evaluated at locations where its value is needed. For example, entering a field expression that depends on coordinate variables in an input field that expects a global expression will not produce any warning, but will generate an error at the time the expression is evaluated.
Similarly, a field expression may use variables that are only defined on some geometric domains but not everywhere. Such expressions may trigger an error message only if they are actually evaluated outside the domain of definition of the variables involved.
Note that field expressions used in Plot nodes under Results do not trigger an error message even if they cannot be evaluated on some of the plotted domains. During results processing, field expressions evaluate to NaN at locations where the expression is undefined. Only if the expression evaluates to NaN at every point an error is thrown. Otherwise points where the value is NaN are silently excluded from the plot.