checkIndexDimensions

Method of mss.

Assert that the model’s index vectors cover the tensor exactly.

Source: src/model/@mss/checkIndexDimensions.m

Syntax

checkIndexDimensions(sys)
sys.checkIndexDimensions()

Description

checkIndexDimensions is the sanity check run at the end of every mss construction path. An mss describes its signals and equations by index vectors rather than by fixed blocks, so nothing else guarantees that those vectors and the tensor agree. The method asserts two identities:

|πšœπšπšŠπšπšŽπ™Έπš—πšπšŽπš‘|+|πš’πš—πš™πšžπšπ™Έπš—πšπšŽπš‘|⏟signal rows=nvar,|πšœπšπšŠπšπšŽπ™΄πššπšžπšŠπšπš’πš˜πš—π™Έπš—πšπšŽπš‘|+|πš˜πšžπšπš™πšžπšπ™΄πššπšžπšŠπšπš’πš˜πš—π™Έπš—πšπšŽπš‘|⏟equation rows=neq. \underbrace{|\texttt{stateIndex}| + |\texttt{inputIndex}|}_{\text{signal rows}} = n_\text{var}, \qquad \underbrace{|\texttt{stateEquationIndex}| + |\texttt{outputEquationIndex}|}_{\text{equation rows}} = n_\text{eq}.

Where nvarn_\text{var} and neqn_\text{eq} come from depends on the tensor:

Tensor nvarn_\text{var} neqn_\text{eq}
CPNTensor rows of structureMatrixTrue rows of parameterMatrixOne
TTTensor numel(cores) - 1 size(cores{1}, 2)

Any other tensor class raises "Unsupported tensor type.". A mismatch raises an assertion naming both counts; the usual causes are a hand-written index vector that does not match the matrices it indexes, or a state/output equation split that leaves parameter rows unaccounted for.

The method returns nothing β€” it either passes silently or errors.

Input arguments

Argument Description
sys The mss model to check.

Example

sys = rmss(3,1,1,4);          % random 3-state, 1-input, 1-output model
sys.checkIndexDimensions();   % passes silently

See also

mss Β· allSignalScalarIndices Β· allEquationScalarIndices Β· checkIndexDimensions


MyToolbox Documentation | Generated automatically by CI/CD pipeline