State Variables
Add a State Variables node () under Definitions > Equation Contributions in a model component or under Global Definitions > Equation Contributions to define states that are updated using an update expression once in each completed solver step. States are dependent variables in the model and stored as such in solutions, but they are explicitly updated by the solver before or after each time or parameter step rather than solved for in the usual sense. Use state variables to, for example, store the previous-step value of some expression. This is useful, for example, when implementing material models with history dependence or hysteresis.
The Settings window contains the following sections:
Geometric Entity Selection
For a State Variables node in a component, use this section to define the geometric entities where the state variables should be defined at integration points in each element.
State Components
Enter state variable names in the State column and corresponding initialization expressions in the Initial value column. Then specify an Update expression for each state variable, if Update is not set to Only initialization.
Select a Value type when using splitting of complex variables. By default, only real values will be stored when Split complex variables in real and imaginary parts has been selected.
The Update expression is evaluated once for each step taken by a time-dependent or parametric solver. You can choose at which point during the step this happens. The default is to update At beginning of step, which is appropriate for variables representing a value from the previous converged step. The update expressions are then evaluated on the solution present at the beginning of the step, before time is incremented or parameter values updated. When the solution is stored, often at the end of a step, the state variable values computed at the beginning of the step will be recorded. When the first solution is stored, for the initial time or parameter, no update will have been done, so the stored value is the initial values computed by the Dependent Variables feature preceding the solver.
Choosing At end of step, the update expression is evaluated using the converged solution at the end of the step, and with time or parameter values corresponding to the end of the step. The update expression is also evaluated using the initial solution from the preceding Dependent Variables feature just before storing the solution at the initial time or parameter. The first value stored is therefore not necessarily the value computed from the initial value expression.
Updating After predictor step is only relevant when solving using the Verlet explicit solver. For other time-dependent solvers, the behavior is undefined. The parametric solver will perform the update in the same way as for End of step.
You can also choose Only initialization, if you want that a complicated or expensive expression is evaluated only once. If the state variable is solved for in a study step, its value will be updated after the initial values of variables solved for and values of variables not solved for have been computed by the Dependent Variables feature, but before the solver starts. If the state variable is not solved for, its Initial value expression may be evaluated when computing values of variables not solved for in the Dependent Variables feature, but will not be updated by the solver.
When updates are preformed At end of step, you can also control what value to store if the time-dependent solver stores interpolated solution inside a time step taken by the solver. The default for Value at interpolated times is to store the value computed at the end of the Previous solver step. This is usually appropriate for variables that represent memory of some form. In other cases it may be better to choose Interpolated which will store a value interpolated between the value computed at the end of the previous step and the one computed at the end of the current step.
Note that state variables (and other dependent variables) from previous steps will only be used when the process is of continuation type or when the solution is reused from a previous step. The process is of continuation type for time stepping and when the parametric solver is changing its continuation parameter. At changes of noncontinuation parameters, the Reuse solution from previous step parametric solver setting controls whether the solution will be reset to the initial data or use the previous solution. When state variables are set to update At beginning of step, no update is performed unless the previous solution is reused.
Press Ctrl+Space or use the Insert Expression button () below the table to choose from previously defined parameters, mathematical constants and functions, operators, and physical constants that you can insert into an expression at the position of the cursor.
When the State Variables node belongs to a component, select the Order of integration points in which the state variables will be defined. Allowed orders are even numbers between 0 and 14. The state variable degrees of freedom are defined in the same way as a standard dependent variable using Gauss point data shape functions. Typically choose the same order as the integration order used by the physics equations in the model. States defined in that way are suitable for storing material property history data locally at each point where it is used by the equations.
Optionally specify a custom Description for each state and select the Allow complex values checkbox to allow complex-valued state values when the solver is set to split complex values in real and imaginary parts.
Unit
By default, the state variables are dimensionless. You can assign a unit either by selecting a predefined quantity or by explicitly entering a unit expression.
Click the Select Dependent Variable Quantity button () to open the Physical Quantity dialog to browse to find a physical quantity to use. You can also type a search string in the text field at the top of the dialog and then click the Filter button () to filter the list of physical quantities. For example, type potential and click the Filter button to only list physical quantities that represent some kind of potential.
Alternatively, click the Define Dependent Variable Unit button () to edit the unit directly in the Unit column, typing a unit to define the state variable quantity. The Quantity column then shows Custom unit.