Elements That Can Manipulate Arrays

Many of the GoldSim elements can manipulate and produce vectors and matrices. For example, you can sum a number of matrices using the Sum element A simple function element that sums values., or compute the peak value of each item of a vector A one-dimensional array. using the Extrema element A function element that computes the maximum value (peak) or minimum value (valley) achieved by its input during a simulation..

In general, if the outputs for an element are an array A collection of variables that share common output attributes and can be manipulated in GoldSim elements or input expressions., its inputs must be arrays (defined by the same sets of array labels A collection of labels identifying the items of an array.), and GoldSim carries out the element's calculations in parallel for each item of the array.

Note: If an input field of an element requires a vector, and the vector only has a single item, GoldSim allows you to enter a scalar An output consisting of a single value or condition. as the input. Of course, if you then add items to the set of array labels (such that it consists of more than one item), the scalar input will no longer be valid.

In order for an element to output an array, you must specify that it is to be a vector or a matrix A two-dimensional array. when you define its output attributes Three properties of an element's output that determine the kinds of inputs to which it can be linked: type, order and dimensions. (by pressing the Type... button in the element's properties dialog). The dialog for specifying output attributes for an element looks like this:

The Order drop-list provides three choices: "Scalar" (the default), "Vector (1D-Array)", and "Matrix (2D-Array)":

If you wish to create a vector, select "Vector (1D-Array)". If you wish to create a matrix, select "Matrix (2D-Array)". If you select "Vector (1D-Array)", the Row Labels field becomes available. If you select "Matrix (2D-Array)", both the Row Labels and Column Labels fields become available.

These two fields contain lists of all of the sets of array labels defined in your model:

If you have defined the Order as a vector or a matrix (i.e., if the Row Labels or Column Labels fields are active), you must select a set of array labels (or GoldSim will display a warning message when you try to close the Output Attributes dialog):

Within the drop-list for the Row and Column labels is the choice to "Create new Array Labels...". If you click this option, the dialog for defining new array labels will be displayed. After leaving the Array Labels dialog, you will be returned to the dialog for defining output attributes.