Defining a Process > Defining Model Elements and Advanced Elements > Arrays

Arrays

 

Note: arrays are available only in the Professional edition of Process Simulator.

 

 

In Process Simulator, an array is a matrix of cells that contains integers, or real values, or expressions, depending on which type of array is selected. Each cell in an array works much like a variable, and a reference to a cell in an array can be used anywhere a variable can be used. A one-dimensional array may be thought of as a single column, or a single row, of cells, depending on how the array is defined. A two-dimensional array may be thought of as multiple rows, for which each row has multiple columns (similar to a spreadsheet).

 

The maximum number of dimensions for an array in Process Simulator Professional is 2, and one-dimensional arrays must be written in the form of a two-dimensional array. In the above image, Array1 was defined as an array with 1 row and 10 columns of integer values, Array2 was defined as an array with 7 rows and 3 columns of real values, and Array3 was defined as an array with 3 rows and 12 columns of expressions.

 

To reference a particular cell within an array, write the name of the array and write the numbers for the row and column of interest within square brackets. Note that the row number precedes the column number within the brackets. For example, the fourth column of Array1 should be expressed as Array1[1,4]. Note that even one-dimensional arrays must be written in the form of two-dimensional arrays. Similarly, the fourth row and second column of Array2 should be expressed as Array2[4,2].

 

Array cell values are assigned in exactly the same way that values are assigned to a variable. For example, assigning the value 18.37 to the cell at the second row and third column of Array2 would be expressed as the following statement: Array2[2,3]=18.37

 

Arrays are defined through the use of the Model Elements dialog, which is accessible from the Advanced Elements button in the Model Elements portion of the Process Simulator ribbon.


© 2015 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com