Specifying Containers with Internal Clocks

In some situations, you may wish to use different timesteps in different portions of your model. This is useful, for example, if the processes represented in one portion of your model occur rapidly and hence require a short timestep to model accurately, while processes represented in the rest of your model occur much more slowly, such that a larger timestep can be used.

You can specify smaller timesteps for a Container by assigning the Container an “internal clock”.  Containers can be assigned internal clocks by selecting the Internal Clock feature in the Container dialog. When you assign an internal clock to a Container, an Internal Clock tab is added to the Container dialog:

Containers with internal clocks are represented in the graphics pane as follows:

   Note: When you specify a Container as having an Internal Clock, you cannot also define it as having Looping Capability (these two options are mutually exclusive).

Certain events (e.g, triggered by a Timed Event or a Reservoir hitting an upper bound) are automatically represented by GoldSim with greater accuracy by allowing them to fall between scheduled timesteps.

An important implication of an Internal Clock Container is that any unscheduled timesteps generated inside the Container only interrupt the clock pertaining to that Container (and hence cause the elements in the Container to update).  They do not cause elements outside the Container to be updated.

To understand this, consider the following simple example.  Suppose that your model had a 10 day timestep.  Within an Internal Clock Container, you added a Timed Event that occurred at 5 days.  This Timed Event triggered two elements: one inside the Container and one outside the Container.  In this model, the element inside the Container would be updated at 5 days.  However, the element outside the Container would not be updated until 10 days (the first scheduled timestep after the event occurred).  That is, the unscheduled update does not interrupt the clock outside the Container.  The element outside the Container is still impacted by the event, but not until it is updated (e.g., due to a scheduled update, or due to an unscheduled update triggered outside of the Container).

It is also important to understand that while unscheduled updates within an Internal Clock Container do not cause elements outside the Container to update, unscheduled updates outside the Container do cause elements inside the Container to update.  That is, unscheduled updates within the Container cannot “flow” outside the Container, but unscheduled updates outside the Container do “flow” in. 

While it is important to understand this behavior with regard to unscheduled timesteps automatically inserted by GoldSim, perhaps the most common use of an Internal Clock Container is to manually force a shorter timestep within the Container.

By default, the Maximum time between updates is set to 0 (and if you leave it unchanged or set it to a negative number, it will be ignored, as a non-positive length has no meaning). 

When GoldSim starts to carry out the calculations for a Container that has an internal clock (or after GoldSim completes a timestep within the Container), and it is at a time we will call Tcurr, it must decide when to insert the next timestep inside the Container. 

GoldSim uses the value in the Maximum time between updates field (referred to as DTmax below) to compute the next timestep inside the Container according to the following rules:

1.  If DTmax is greater than DTglob (the length of time until the next global timestep), the field is ignored and the next timestep is simply the regularly scheduled timestep (Tcurr + DTglob). (As a result, a Container with an internal clock can never have a timestep that is longer than the global timestep.)

2.  If DTmax is less than DTglob, GoldSim computes an internal timestep length (an unscheduled update), DTint, equal to DTglob/N, where N is the smallest integer such that  DTglob/N <= DTmax.  That is, GoldSim subdivides DTglob such that the internal step is as large as possible, but less than or equal to DTmax.

   Note: Because certain events (e.g, triggered by a Timed Event or a Reservoir 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 most cases, you will specify the Maximum time between updates as a constant in order to specify a shorter timestep for a portion of your model (e.g., assigning a Maximum time between updates of 1 day to a Container in which the global timestep is 10 days).  This variable can also be specified to vary dynamically in response to parameter values inside the Container.

   Note: By default, time history displays only include scheduled updates, and will not capture unscheduled updates. However, GoldSim provides an option to do so (under a specified set of conditions) in the Advanced Time settings. This provides a mechanism to display and view the exact times at which unscheduled updates are inserted within a Container with an Internal Clock.

   Warning: When you assign an internal clock to a Container, the Treat as SubSystem feature is also automatically selected (and cannot be deselected unless you first turn off Internal Clock).  That is, a Container with an internal clock, by definition, is treated as a SubSystem. Because a Container with an internal clock is treated as a SubSystem, this puts certain limitations on how these Containers can be used.

An example file which illustrates the use of Internal Clocks for Containers  (InternalClock.gsm) can be found in the Containers subfolder of the General Examples folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).

Related Topics…

Learn more about: