Dynamically Controlling the Timestep

GoldSim allows you to decrease the timestep A discrete interval of time used in dynamic simulations. length according to a specified schedule during a simulation (e.g., start with a small timestep, and then telescope out to a larger timestep) by defining time periods which have different timestep lengths.

Although defining such time periods can be very useful, you must fully specify them prior to running the simulation. That is, you must know how you would like to alter your timesteps prior to running the model. In some cases, however, it may not be possible to do this. That is, in complex systems (particularly ones with uncertain parameters), variables may change at different rates in different realizations, in ways that you cannot predict prior to running the model.

To better simulate these kinds of systems, GoldSim provides an advanced feature that allows you to dynamically adjust the timestep during a simulation (i.e., insert unscheduled updates Timesteps that are inserted automatically by GoldSim during a simulation and are not directly specified by the user prior to running the model.) based on the values of specified parameters in your model. For example, you could instruct GoldSim to use a maximum timestep of 1 day if X was greater than Y, and 10 days if X was less than or equal to Y. Similarly, you could instruct GoldSim to use a short timestep for a period of 10 days after a particular event occurs, and then return to the default timestep.

This feature can be accessed in the Advanced Time Settings dialog (accessed from the Advanced... button on the Time tab of the Simulation Settings dialog). Within this dialog is a checkbox labeled Dynamically control time between updates:

By default, this checkbox is cleared. Checking it allows you to edit the Maximum time between updates field, which can be used to dynamically control the timestep (by inserting unscheduled updates).

Note: In order to access this checkbox, Allow unscheduled updates must also be checked (the default).

After GoldSim completes all the calculations for a timestep, it must decide when to insert the next timestep. Normally, the next timestep is specified by the Basic Step (or Reporting Periods Regular time points during a simulation (e.g., every month, every year) at which you can compute and view results associated with that period (e.g., monthly averages, annual cumulative values). or Period Timesteps, if defined).

GoldSim uses the value in the Maximum time between updates field (referred to as DTmax below) to override the normally scheduled timestep according to the following rules:

  1. If DTmax is greater than or equal to DTsched (the length of time until the next scheduled timestep), the field is ignored and the next timestep is simply the regularly scheduled timestep (Tcurr + DTsched), where Tcurr is the current time.
  2. If DTmax is less than or equal to (DTsched /2), the next timestep is Tcurr + DTmax.
  3. If DTmax is greater than (DTsched /2), but less than DTsched, the next timestep is Tcurr + (DTsched /2) - that is, DTsched is divided into two equal halves.

These rules can be best understood by considering several simple examples:

Example 1: Assume that the next scheduled timestep length is 10 days, and you have specified a Maximum time between updates (DTmax) of 4 days. GoldSim would compute timesteps at the following points in the first 10 days:

Example 2: Assume that the next scheduled timestep length is 10 days, and you have specified a Maximum time between updates (DTmax) of 6 days. GoldSim would compute timesteps at the following points in the first 10 days:

Example 3: Assume that the next scheduled timestep length is 10 days, and you have specified a Maximum time between updates of 1 day. GoldSim would compute timesteps at the following points in the first 10 days:

In all three of these examples, the actual timestep length is always less than or equal to the specified Maximum time between updates. Moreover, the scheduled timesteps Timesteps that are directly specified by the user prior to running the model. defined by the Basic Step, Reporting Periods or Period Timesteps are always observed.

Note: Because certain events (e.g., triggered by a Timed Event An element that generates discrete event signals based on a specified rate of occurrence. or a Reservoir A stock element that integrates and conserves flows of materials. hitting an upper bound) are automatically represented by GoldSim with greater accuracy by allowing them to fall between scheduled timesteps, any events that occur could result in a smaller timestep than that computed using the rules presented above. That is, after GoldSim computes the next timestep based on the rules presented above, it then checks to see if an event would fall within that interval. If an event does fall into that interval, the timestep could be shortened in order to represent the event.

In practice, you would not normally specify the Maximum time between updates as a constant (as you could accomplish the same thing by simply appropriately defining scheduled timesteps. Instead, you would specify it as a variable (i.e., a function). For example:

In addition to providing this dynamic timestepping algorithm on a global scale (i.e., for the entire model), GoldSim also enables you to apply a Maximum time between updates to specific Containers. As a result, you could apply a maximum timestep length only to a portion of your model (represented by a particular 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.).

Note: If the Maximum time between updates is less than or equal to zero, a warning message will be written to the Run Log Text that is stored with a GoldSim model once it has been run. It contains basic information regarding the simulation, and any warning or error messages that were generated., and it will be ignored (which is equivalent to clearing the Dynamically control time between updates checkbox).
Note: By default, time history displays only include scheduled timesteps, and will not capture unscheduled updates. However, GoldSim provides an option (under a specified set of conditions) in the Advanced Time settings that allows you to include both scheduled and unscheduled updates in a time history display. This provides a mechanism to display and view the exact times at which unscheduled updates are inserted.