Inputs and Outputs to a Previous Value Element

The property dialog for a Previous Value element An element that outputs the value of its input from the previous model update. 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 An output consisting of a single value or condition., 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 A discrete signal that contains information regarding the response to an event., the Order can also be specified as a vector A one-dimensional array. or a matrix A two-dimensional array..

The Display Units The units (e.g., m, g, $/day) in which an output is displayed within GoldSim. determine the dimensions An output attribute for an element that defines the dimensionality (in terms of Length, Time and other fundamental dimensions) of the output. 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 A discrete signal indicating that something (e.g., an accident, an earthquake, a bank deposit) has occurred. 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 An input element intended to represent constant inputs in a model., 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 An element that acts like a "box" or a "folder" into which other elements can be placed. It can be used to create hierarchical models. (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 is the primary output For an element with multiple outputs, the output that has the same name as the element..

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