Understanding State Variables in GoldSim

Within a GoldSim model (actually, any dynamic model), there are fundamentally two types of outputs:

1.  Outputs whose current value only depends on the current value of their element’s inputs ((i.e., they have no “memory”). These outputs themselves fall into one of two sub-categories:

o Those that represent unchanging input data (or direct functions of input data) and are therefore static, in that they only need to be computed at the beginning of the simulation and do not need to be recalculated every timestep. Examples include the outputs of Data elements and Stochastics (which are not being resampled).

o Those whose inputs change with time, and therefore need to be recalculated every timestep. Examples include the outputs of Expressions and Selectors whose inputs vary with time.

2.  Outputs whose value is computed based on the historical value of the element’s inputs (as opposed to only being a function of the current value of the element’s inputs).  These outputs can be thought of as having “memory” of what has happened before. The primary output of a Reservoir or a Pool is a classic example.

This second type of output is referred to as a state variable in GoldSim. State variables are typically the key system variables that you are interested in predicting.  Together, the state variables define the predicted state of the system at any time in the future.  Examples of state variables include the volume of water in a pond, the amount of money in an account, the status (on/off/failed) of a piece of equipment, and the number of times a certain event has occurred.

All state variables have, by definition, an initial value (e.g., for Integrators, Reservoirs and Pools, the initial value is explicitly specified). This allows the outputs to be computed when there are no historical input values available (e.g., at the start of simulation).

All state variables have “memory”; that is, their value at time t is a function of their value at time t - ∆t.  Furthermore, state variables can change during a simulation in two different ways:

   Some state variables are intrinsically a function of time.  That is, every timestep, they may change because they are inherently defined with respect to time.  Integrators, Reservoirs and Pools are examples of this.  Since these elements fundamentally solve time integrals, whenever the simulation time changes, by definition they must be updated.

   Some state variables can be triggered by or respond to other elements in the model, and in turn, change their value.  A Status element is a good example of this.

Some state variables may change due to just one of these mechanisms, while others may potentially change due to both.  For example, Status elements can only change by the second mechanism; Reservoirs can change due to both.

Note that based on whether or not a particular state variable can change due to the second mechanism listed above, it falls into one of these two categories:  

1.  Its value at time t is completely determined by its value (and the inputs) at time t - ∆t.

2.  Its value at time t is determined by its value (and the inputs) at time t - ∆t, but can also be further modified by its inputs at time t.

Most state variables fall into the second category.

The most common state variables are the primary outputs of stocks (Integrators, Reservoirs and Pools).  A number of other elements, however, also have outputs which are state variables, and these are summarized in the table below.  

 

Element

Output

Integrator

 Current Value

Pool

 Current Value (Quantity)

 Is_Full

Reservoir

 Current Value

 Is_Full

Stochastic

 Current Value

 Probability Density

 Cumulative Probability

Script

 Result (primary output)

Extrema

 Current Value

Status

 Current Status

Decision

 Last Decision

Milestone

 Completion Status

 Date of Completion

 Elapsed Time of Completion

Timed Event Generator

 Cumulative Number Emitted

Triggered Event Generator

 Cumulative Number Emitted

Discrete Change

 Cumulative Number Emitted

Information Delay

 Current Value

Material Delay

 Current Value

 Amount in Transit

Event Delay

 Cumulative Number Emitted

 Number in Transit

 Number in Queue

 Mean Time for Emitted Events

 Current Service Time

Discrete Change Delay

 Cumulative Number Emitted

 Number in Transit

 Number in Queue

Conditional Container

 Activity Status

 Completion Status

Previous Value

 Previous value of input

Time Series

 Current Value

History Generator

 Current Value

Outputs listed in bold fall into category #1 above (i.e., they can never be impacted by inputs from the current timestep).

The icons for state variables are indicated in browsers (e.g., output ports) by showing a vertical line to the left of the output triangle:

Reservoir1 (the primary output) and Is_Full are state variables.

   Note: In addition to the elements listed above, a number of elements in GoldSim’s extension modules also have outputs that are state variables.

Related Topics…

Learn more about: