Matrix Arithmetic
iThink and STELLA support a variety of matrix operations. In this post, I will explain the following common operations and how to perform them:
- Addition and Subtraction
- Transposition
- Extracting the Diagonal of a Square Matrix
- Multiplying and Dividing by a Scalar
- Multiplying a Square Matrix by a Vector
- Multiplying a Non-Square Matrix by a Vector
- Multiplying Two Matrices
In the examples provided, I use five different arrays of varying dimensions. They are all defined using the subscript name Dim3, which is size 3.
a: 3×3
b: 3×3
c: 3×3
d: 3×1 [one-dimensional]
e: 3×1 [one-dimensional]
I also use two arrays based on Dim3, as well as the subscript name Dim2, which is size 2.
s: 2×3
t: 3×2
A module is a container for lower-level model structure. It is designed to support a process of top-down model design and development.
A module input is a variable that can become the ghost of another variable at a different level of the module hierarchy. It becomes the ghost when you assign it to that other variable. After it is assigned, it is referred to both as a cross-level ghost and an assigned module input. All of this is managed transparently if you use the ghost tool.
When a variable is designated as a module output, you are telling the software that this variable can be ghosted on a different level of the module hierarchy. While any variable can be a module output, it is important to carefully manage which variables you intend to be shared across modules.