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 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. When you do so, a Looping tab is added to the Container dialog:
Looping Containers are represented in the graphics pane as follows:
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).
Note: Looping
Containers are useful when the looping calculation necessarily involves multiple
elements (e.g., Reservoirs). For a calculation requiring simpler
looping requirements (defining an array, or iterating to a solution for a simple equation), a Script element
would often provide a more transparent and easier solution.
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.
Learn more about:
Controlling the Number of Loops in a Looping Container
Understanding How Elements Inside a Looping Container are Updated