Understanding Timestepping in GoldSim

In order to carry out a dynamic simulation, GoldSim steps through time in discrete intervals (referred to as timesteps). Calculations (referred to as updates of the model) are carried out at end of every timestep, with the values at the end of the current timestep computed as a function of the values at the end of the previous timestep. Although the term timestep actually refers to an interval of time, it is often used interchangeably with the term update (indicating a calculation at a point in time). 

In GoldSim, there are two kinds of updates/timesteps: scheduled updates (or timesteps) and unscheduled updates (or timesteps).

Scheduled Updates

Scheduled updates are specified directly prior to running the model.  That is, you tell GoldSim when you want these updates to occur.

There are four ways to specify scheduled updates:

   You define a Basic Step of a specified length;

   You define Reporting Periods (e.g., monthly, annual) which are used to accumulate or average results, and which force a scheduled timestep at the end of each period;

   You define Capture Times, which represent specific times during the simulation where “snapshots” of statistical values can be viewed. A scheduled timestep is created for each Capture Time.  By default, there is only a single Capture Time (the end of the simulation), but you can add as many as desired; and

   You define Period Timesteps for specific time intervals in which even smaller timesteps are desired.

The most common way to create scheduled updates will be by specifying some combination of Basic Steps and/or Reporting Periods:

   Basic Steps only.  In many cases, you will simply create a Basic Step (and this is the default).  This is the simplest way to create scheduled updates (but is not necessarily the most effective way, depending on your application).  You specify a Basic Step at which results are computed.  You can subsequently choose to save results at each Basic Step, or at only some Basic Steps (e.g., every other Step, or every tenth Step).

   Reporting Periods only.  In many cases, you will not use a Basic Step at all, but will simply define your scheduled updates using Reporting Periods.  Why would you do so? Whereas results saved at Basic Steps always represent instantaneous values, results saved at Reporting Periods can not only be displayed as instantaneous results, but can also report accumulated or averaged values over a specified period (e.g., monthly). Hence, if you needed average or accumulated flows over each step (e.g., over the last day or the last month), you can do so by defining your steps using Reporting Periods.

   Note: Most spreadsheet models implicitly compute accumulated values (e.g., flows) over a step (or the change from one step to the next).  Hence, if you want to compare or integrate GoldSim with a spreadsheet model, you should use Reporting Periods to define your steps.

   Reporting Periods and Basic Steps. In some cases, you may want to create Reporting Periods in order to report accumulated or averaged values over a specified period, but you may also need a shorter computational step in order to ensure accuracy.  For example, you may require a daily timestep to ensure accuracy, but only need to view monthly averages or accumulated values in terms of results. In this case, you would create a Basic Step as well as Reporting Periods.  You could choose to save results only for Reporting Periods, or could also save results for the Basic Steps.  When defining both Basic Steps and Reporting Periods, Reporting periods can be defined to coincide with Basic Steps (e.g., a 1 day Basic Step and a monthly reporting period), but they do not have to.  However, if a Basic Step is specified, Reporting periods must always be at least twice as large as the Basic Step.

In some cases, you may also want to create Capture Times, which are typically used to capture and view statistical results at specified points in your simulation. In particular, Capture Times allow you to save and view “Final Value” type results at specified times during a simulation (rather than just at the final time point). Final Value results are associated with multiple realizations (or items in an array), and allow you to display distributions, multi-variate results (e.g., scatter plots) and array plots.

When you define a Capture Time, a scheduled timestep is added at that time (if one does not already exist).

Finally, in rare cases, you may want to create smaller timesteps over a defined period of your simulation (e.g., if you know that early in your simulation, variables will change rapidly, and hence a small timestep is required).

   Note: You can also specify a shorter timestep for different parts (i.e., Containers) of your model.

When specifying scheduled timesteps, the appropriate timestep length is a function of how rapidly the system represented by your model is changing: the more rapidly it is changing, the shorter the timestep required to accurately model the system.

You can view all of the scheduled timesteps in your simulation by pressing the Show Scheduled Updates… button at the top of the Time tab.  The following dialog will be displayed:

Graphical user interface, table

Description automatically generated

This provides a summary of the scheduled timesteps you have defined (with the final column listing the type of each time point).

Unscheduled Updates

In some cases, events or other changes in the model may not fall exactly on a scheduled update. That is, some events or changes may actually occur between scheduled updates of the model. These trigger an “unscheduled update” of the model.  Unscheduled updates are timesteps that are dynamically inserted by GoldSim during the simulation in order to more accurately simulate the system. That is, they are not specified directly prior to running the model. GoldSim inserts them automatically (and, generally, without you needing to be aware of it).

“Unscheduled updates” can be generated in the following ways:

   When events are output by a Timed Event, Event Delay, Discrete Change Delay or Time Series element;

   By manually specifying a dynamic timestep (i.e., dynamically controlling the time between updates);

   When a Reservoir or Pool element reaches an upper or lower bound;

   When a Resource becomes exhausted;

   When any element is triggered by an At Stock Test, At Date, At Etime or At Duration triggering event; and

   By some specialized elements in GoldSim extension modules (Action and Function elements in the Reliability Module, Fund elements in the Financial Module, and Cell elements in the Contaminant Transport Module).

When any of these events occur, GoldSim automatically inserts an unscheduled update at the exact time that the event or change occurs.  For example, if you had specified a one day timestep, and a Timed Event occurs at 33.65 days (i.e., between the scheduled one-day updates), GoldSim would insert an unscheduled update at 33.65 days.

   Note: By default, GoldSim always inserts unscheduled updates.  However, although it is generally not recommended, you can override the default and instruct GoldSim not to insert the unscheduled updates. (This option is accessed via the Advanced… button in the Time tab of the Simulation Setting dialog).

A key and important difference between scheduled updates and unscheduled updates is that scheduled updates are included in time history plots and tables (unless you choose to exclude them).  Unscheduled updates, however, do not normally appear in time history plots and tables.  That is, although these timesteps may affect the results (e.g., by making them more accurate at the scheduled timesteps), unscheduled updates of the model are not saved and plotted.  Only the scheduled updates are actually saved and plotted.

   Note: In some cases, it may be of interest to see the values of selected outputs at unscheduled updates.  To facilitate this, GoldSim provides an option to do so (under a specified set of conditions) in the Advanced Time settings.

A simple example file illustrating unscheduled updates (UnscheduledTimeSteps.gsm) can be found in the Running subfolder of the the General Examples folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).

The GoldSim timestepping algorithm is discussed in detail in Appendix F of the GoldSim User’s Guide .

Related Topics…

Learn more about: