Inputs and Outputs to a Previous Value Element

The property dialog for a Previous Value element looks like this:

When defining a Previous Value element, your first step should be to specify the type of output for which you want to compute a previous value.  You do this by pressing the Type… button, which will display the following dialog:

By default, the output of a new Previous Value element is a scalar, dimensionless value. However, a Previous Value element can accept as an input (and hence output) one of four types of outputs (as specified in the Type field in this dialog): Values, Conditions, Discrete Change Signals and Discrete Event Signals.

If you select Value, Condition, or Discrete Change Signal, the Order can also be specified as a vector or a matrix.

The Display Units determine the dimensions of the input to and output from the Previous Value element, and are only applicable if the output is a Value or a Discrete Change Signal (otherwise the field is grayed out).

The Reference is the value for which you want to compute a previous value. 

   Note:  If the Reference is a Discrete Event Signal or a Discrete Change Signal, it can accept multiple discrete signals. This is indicated in the input field by separating the individual discrete signals by semi-colons (e.g., Change1; Change2; Change3).

If the Reference is a Value or a Condition, in order to compute the output of a Previous Value element, GoldSim must know what value to use at the beginning of the simulation.  This is specified within the Initial Value field.

   Note: The Initial Value must be a number or a link from a static variable (e.g., a constant Data element, a Stochastic, or an Expression that is a function of constant elements). 

Obviously, the Reference and the Initial Value inputs to the Previous Value element must have the same attributes (type, order and dimensions) as specified in the attributes dialogs (accessed via the Type… button).

   Note: If you specify the output type as a Discrete Event Signal, the Reference field will also accept Discrete Change Signals.  However, the information in the signal (Instruction and Value) will be lost when it is output by the Previous Value element.

If you place a Previous Value element inside a looping Container (and the Reference is a Value of a Condition), the element has an additional property (Reinitialize when looping starts) that controls how the Initial Value is treated between loops:

A Previous Value element has two outputs:

   The previous value of the Reference; and

   The rate of change of the Reference (i.e., the derivative).

The previous value is the primary output.

   Note: The rate of change output is only available if the Reference is a Value.

Related Topics…

Learn more about: