Using matrix conversion functions
To calculate indicators from matrices, matrices and scalars must be used in formulas. With the matrix conversion functions it is possible to calculate a single value, a vector, or a new matrix from a matrix or several matrices and optionally consider active OD pairs. For example, global indicators such as the average journey time or distance by car can be calculated. These indicators can also be output per origin or destination zone by using row or column totals from matrices. When calculating new matrices, the matrix conversion functions can be used, for example, to determine shares of the total volume per OD pair.
The following matrix conversion functions are provided:
- Matrix sum
- Matrix column sum
- Matrix row sum
- Matrix value
- Matrix diagonal sum
- Matrix maximum
- Matrix minimum
The values (except the single matrix value) can optionally be calculated for active OD pairs.
Examples:
Evaluation |
Format of the result |
Object |
Formula |
---|---|---|---|
Matrix value of the OD pair i, j |
Single value |
variable or network UDA |
MATRIXVAL(MATRIX([NO]=39);11;10) i, j are the indices of the matrix beginning with 1 i = 11 (corresponds to the 11th zone sorted by number) i = 10 (corresponds to the 10th zone sorted by number) |
Matrix row sum i of active OD pairs |
Single value |
Variable or network UDA |
MATRIXROWSUM(MATRIX([NO]=39);2;1)
|
Matrix row sums i (e.g. average journey distance from a zone) |
Vector |
Zone UDA |
MATRIXROWSUM(MATRIX([NO] = 10) * MATRIX([NO] = 14); [MATINDEX]) / MATRIXROWSUM(MATRIX([NO] = 14); [MATINDEX]) |
Share of demand per OD relation in % of total demand |
Matrix |
Matrix |
MATRIX([NO] = 1)*100/MATRIXSUM(MATRIX([NO] = 1)) active OD pairs = optional parameter (default = 0, i.e. no) |
Share of demand per OD relation in the demand for active OD pairs in % (e.g. excluding intrazonal demand) |
Matrix |
Matrix |
MATRIX([NO] = 1)*100/MATRIXSUM(MATRIX([NO] = 1);1) active OD pairs = 1 (yes) |
Matrix sum (e.g. average travel time for cars) |
Single value |
Variable or network UDA |
MATRIXSUM((MATRIX([NO]=9))*(MATRIX([NO]=39)))/MATRIXSUM(MATRIX([NO]=39)) Matrix 9 = indicator tCur Matrix 39 = car demand |