Initial Values
A dependent variable needs an initial value for nonlinear and transient simulations. In the Initial Values node () you define the initial value for the dependent variable declared in the parent node. This node represents a special type of feature in the Model Builder that you get by default when you add a physics interface.
By default an Initial Values node is added to the Dependent Variable Declaration.
Initial Value Settings
In the Settings window of the variable you specify the initial value in the Default initial expression field. The expression you enter here follow the rules outlined in Entering Names and Expressions, but with an exception. If you use a variable name here, you must specify the scope it uses. As an example, assume that you want to use the interface variable init as initial condition, then enter phys.init in the expression field. Otherwise, the initial value expression becomes init, and at solution time this gets a component scope. Select the Set initial value on time derivatives check box to activate the initial values for the first time derivative. In the Geometric entity level list, choose the entity level that the initial value is placed on. This must match the entity level you put the dependent variable definition on.
Preferences
See the Preferences section for Variable Definition for the Zero out components settings.
If the Add initial value as variable check box is selected, a variable will be added containing the initial value of the dependent variable. This can be used to allow other initial value expressions to depend on a dependent variable’s expression. The variable will get a “physics scope” although the dependent variable itself has a “component scope”. A dependent variable with the fully scoped name root.comp1.u will then add a variable root.comp1.id.u_init for the initial value. The initial value for the time derivative, if present (the Set initial value on time derivatives check box is selected), gets the name root.comp1.id.du_dt_init. From the Physics Builder you can access these variables with the dep prefix using dep.u_init and dep_du_dt_init, respectively.
Using the dep prefix in initial value expressions for other variables than scalars must be done with some care. An initial value feature is typically created at the same time as the physics interface, before the size of the dependent variables have been decided. In such cases it may be necessary to use component syntax to get a proper default expression for the initial value setting — for example, {dep.u_init.1,dep.u_init.2,dep.u_init.3} for a 3-component vector.