Looping Containers

In some models, you may want to carry out an iterative calculation at each timestep.  This might be useful, for example, if you have a coupled system of nonlinear equations that must be solved every timestep by iterating. 

You can define a Container as a looping Container by selecting the Looping Capability feature in the Container dialog.

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

   Warning: When you specify a Container as a looping Container, the Treat as SubSystem feature is also automatically selected (and cannot be deselected unless you first turn off Looping Capability).  That is, a looping Container, by definition, is treated as a Subsystem. Because a looping Container is treated as a SubSystem, this puts certain limitations on how these Containers can be used.

When you specify a Container as a looping Container, a Looping tab is added to the Container dialog, and the fields in this tab are used to control how the Container carries out its loops:

Related Topics…

Learn more about: