Expression Type Overview
Whether a particular expression is valid in a particular input field depends on how the field’s value will eventually be used. Some expressions must be evaluated to a single number before the model is computed. They may therefore not contain variables whose value depends on position in space, and may not depend on the solution. Such expressions are called parameter expressions. Any variable name appearing in the expression must also be defined by a parameter expression and therefore must be a model parameter, or it must be a built-in constant. Function names used in the expression must be built-in or user-defined functions (see Functions and Operators).
A more general expression that may contain variable names that are not model parameters is a variable expression. This type of expression can in addition to model parameters and functions contain both user-defined and built-in variables which may depend on the solution, and may also call operators.
Note that a parameter expression is always a valid variable expression.
Some inputs require a variable expression that may depend on the solution but can be evaluated without specifying an evaluation location in the model geometry. Such expressions are referred to as global expressions. A global expression must only depend on variable and operator names which are themselves defined globally. This includes, for example ODE states, built-in and user-defined global variables and certain coupling operators. Only global expressions can be evaluated in a global context such as a Global plot.
Note that a parameter expression is always a valid global expression, and that a global expression is always a valid variable expression.
The most general type of variable expression is sometimes called a field expression when it is important to stress that its value may explicitly depend on position in space, including for example coordinate variables and dependent variable fields. Not all variable expressions are field expressions. For example, a physics interface may technically allow an input value that is defined only on parts of the geometry where the interface is active, but implicitly assume that its value is constant in space.
The following table provides an overview of the expression types. Some more detailed comparisons follow in separate sections below.