Please enable JavaScript to view this site.

Vensim Help

Navigation: Reference Guide > Functions > Basic Type Functions

ACTIVE INITIAL(active eq, initial eq) distinct ACTIVE and INITIAL Equations

Scroll Prev Top Next More

Returns the active equation during simulation, except when needed for determining initial conditions, when the initial equation is returned.   Normally this function is used to break a loop of simultaneous initial value equations.

NOTE In the Equation Editor the ACTIVE INITIAL function is automatically entered when you select the variable type Auxiliary and the subtype with Initial.

Restrictions:  Must appear first on the right of the = sign and not be followed by anything else.  It defines a variable as an Auxiliary variable with a separate initialization condition.

Units:ACTIVE INITIAL(input units,input units) --> same units

Example

Capacity = Integ(capacity adjust,target capacity) ~~|

target capacity = Capacity * adjust from utilization ~~| 

This would simulate properly, except that the initial conditions cannot be computed correctly:  the initial conditions of Capacity require a value for target capacity, which in turn requires a value for Capacity.  Since Vensim does not support the implied simultaneous computation, you need to use the following equation for target capacity:

target capacity = ACTIVE INITIAL(Capacity * adjust from utilization,

 100) ~~|

This will cause Capacity to be initialized at 100;  then the first value of target capacity will be Capacity * adjust from utilization.  In general, this will not be 100; the initial expression is used only to compute the initial conditions of State variables.  

 

Sample model: ACTIVE INITIAL.mdl in FunctionExamples