Working with Arrays

In many modeling efforts, you'll find yourself needing to replicate a model structure multiple times. For example, a demographic model might treat the aging of a population and be replicated for multiple ethnic groups in multiple areas. Conceptually, the model is very straightforward; visually, however, the structure takes up a lot of diagram space and can look confusing. Similarly, you might model a supply chain where a supplier ships out of a single inventory to multiple customers. Conceptually, the structure is very straightforward. Diagrammatically, it looks quite complex. In a marketing model, you might repeatedly use a simple structure to keep track of customer affinity for several different product lines. In an ecological model, you might repeatedly use a simple structure to represent the different serial stages associated with plant succession.

In each of these cases, copy and paste is the most straightforward way to represent the multiple parallel model structures involved. Unfortunately, the associated visual complexity of the resulting model diagram can become hard to manage, both for the model builder and the model user.

Arrays provide a simple but powerful mechanism for managing this visual complexity. By "encapsulating" parallel model structures, arrays can help you present the essence of a situation in a simple diagram. Behind the scenes, of course, arrays retain the richness of the disaggregated structure.

The following example shows how arrays can help you simplify a model diagram:

Using arrays in a model is straightforward. The process consists of the following three steps:

  1. Define one or more dimensions and elements for the array.

    Think of a dimension as a category. Each dimension contains a set of elements within that category. For example, if you create a dimension named "City", it might contain the elements "London", "Sarajevo", and "Tokyo." A dimension named "Mammal" might contain the elements "lion", "tiger", and "bear."

    You define dimensions in the Array Editor. For more information about creating dimensions and elements, see Working with Array Dimensions and Elements.

  2. Transform model variables into arrayed variables.

    After you've defined one or more dimensions, you can transform a non-arrayed variable into an arrayed variable. To do this, select the variable on the model diagram, and then select the Arrayed check box on the Array tab. For more information, see Creating Arrayed Variables.

    Tip: You don't need to worry about transforming flows into arrayed flows; whenever you transform a stock into an arrayed stock, any attached flows are automatically transformed into arrayed variables as well.

  3. Define the equation logic for arrayed variables.

    For each arrayed variable, you need to define the initial value/equation for each element within the array. You can choose to apply a single value/equation to all elements in an array, or you can provide unique values/equations for each element. For more information, see Creating Arrayed Variables.

Specialized Array Capabilities

There are a number of specialized way that you can work with arrays, many of which support mathematical array manipulation. In addition to the Array builtins, there is also Specialized Array Manipulation for manipulation and management of arrays.

Concept Link IconSee Also