Subscripts are only available in Vensim Professional and DSS.
Subscripts allow a single variable to represent more than one thing. All variable types except Groups, Units, String Constants, Subscript Ranges, Subscript Elements, and Time Bases can have subscripts. Subscripts are enclosed in square brackets [ ] directly following the variable name. A variable can have up to eight subscripts separated by commas ,. You must use subscript values for a variable consistently throughout the model. If you do not, Vensim returns error messages.
NOTE Subscript Elements are also sometimes referred to as Subscript Constants.
Subscripts do not appear in sketches. Sketches represent structure, and subscripts are a convenient way of replicating structure. The sketch maintains a simpler and less cluttered view of a model by not distinguishing subscripted and unsubscripted variables. When there are multiple equations for a subscripted variable, the sketch represents the interaction implied by all of the equations (the union of interactions). You define and edit subscripts from the Subscript Control which, in turn, opens the Equation Editor. You can also change the definition of a subscript anytime the Equation Editor is open by choosing the name of the subscript to edit. Subscripts are applied to variables by editing their equations of using the Edit>Set Subscripts command.
To indicate the specific set of "values" which a subscript will take on, it is necessary to define a Subscript Range as a series of Subscript Elements.
country : MEXICO, USA, CANADA
|~||The list of countries represented in the model|
|births[country] = Population[country] *|
|~||people / year|
|~||Total live births in a specific country.|
When you use a Subscript Range in an equation it must appear on the left hand side. For example the equation:
deaths = Population[country]/average lifetime ~~|
would generate an error message. In this equation deaths takes on only one value, while Population[country] takes on three different values. There is no way to determine how to assign those values in the above equation.
It is not, however, true that every variable on the right hand side of an equation needs to have the same subscripts. For example the equation
deaths[country] = Population[country]/average lifetime ~~|
is completely valid. Here the equation says that deaths in a country depend on the population in that country, but that each country has the same death rate.
See Also: User Guide, Chapter 17