({{, (RefLink[SystemsModelOrder, paclet:ref/SystemsModelOrder])[sys]
gives the order of the state-space model sys.}})

OpenersNotesSection(Spacer1)Details

The system sys can be a standard or descriptor (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]), an (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]), or a (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]), all with no delays.

The order of a standard continuous-time systems model is the number of integrators in the model and for standard discrete-time systems, the number of integer delays in the model.

For a descriptor (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]), the order is taken to be the dimension of the slow subsystem.

OpenersPrimaryExamplesSection(Spacer1)Examples  (14)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

The order of a state-space model:

SystemsModelOrder[(StateSpaceModelFull[0, 1, 3, 3, 2, 5, 1, 5, 0, 3, 0, 3, 5, 2, 1, 0, , , ])]

The order of a descriptor state-space model:

SystemsModelOrder[ssm=(StateSpaceModelFull[1, 0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, , , ])]

It can be computed as the exponent of the polynomial (RefLink[Det, paclet:ref/Det])[s e-a]:

{a,e}=Normal[ssm][[{1,-1}]];
Exponent[Det[s e-a],s]

OpenersExampleSection1(Spacer1)Scope  (6)

A standard state-space model:

SystemsModelOrder[(StateSpaceModelFull[(Subscript[a, 1]), (Subscript[a, 2]), (Subscript[b, 1]), (Subscript[a, 3]), (Subscript[a, 4]), (Subscript[b, 2]), (Subscript[c, 1]), (Subscript[c, 2]), 0, , , ])]

A nonsingular descriptor state-space model:

SystemsModelOrder[(StateSpaceModelFull[(Subscript[e, 1]), 0, (Subscript[a, 1]), 0, (Subscript[b, 1]), 0, (Subscript[e, 2]), 0, (Subscript[a, 2]), (Subscript[b, 2]), (Subscript[c, 1]), (Subscript[c, 2]), 0, , , ])]

A singular descriptor state-space model:

SystemsModelOrder[(StateSpaceModelFull[(Subscript[e, 1]), 0, (Subscript[a, 1]), 0, (Subscript[b, 1]), 0, 0, 0, (Subscript[a, 2]), (Subscript[b, 2]), (Subscript[c, 1]), (Subscript[c, 2]), 0, , , ])]

A discrete-time system with integer time delay:

SystemsModelOrder[(StateSpaceModelFull[0, 1.`, 0.`, 0, 0, 0.`, 1.`, 0, -1, -5.`, 2, 1, -3 (SystemsModelDelay[10]), 1, 1, 0, T, , ])]

An affine state-space model:

SystemsModelOrder[(AffineStateSpaceModelFull[(Subscript[x, 1])-(Subscript[x, 2]), (Subscript[x, 1]) (Subscript[x, 2]), 0, 1, (Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], AutomaticAutomatic, ])]

A nonlinear state-space model:

SystemsModelOrder[(NonlinearStateSpaceModelFull[(u^2)+x+u x, x, x, \[Null], \[Null], {u}Automatic, ])]

OpenersExampleSection3(Spacer1)Applications  (2)

Use (RefLink[SystemsModelOrder, paclet:ref/SystemsModelOrder]) and (RefLink[ControllableDecomposition, paclet:ref/ControllableDecomposition]) to test for controllability:

ssm=(StateSpaceModelFull[-3, -1, -3, 1, 2, 0, 3, 0, 2, 2, 1, -1, 2, 1, 2, 0, , , ]);

SystemsModelOrder[ssm]===SystemsModelOrder[Last[ControllableDecomposition[ssm]]]

ControllableModelQ[ssm]

Test for observability:

ssm=(StateSpaceModelFull[-3, -1, -3, 1, 2, 0, 3, 0, 2, 2, 1, -1, 2, 1, 2, 0, , , ]);

SystemsModelOrder[ssm]===SystemsModelOrder[Last[ObservableDecomposition[ssm]]]

ObservableModelQ[ssm]

OpenersExampleSection4(Spacer1)Properties & Relations  (3)

The order of a singular state-space model depends on the descriptor matrix:

ssm=(StateSpaceModelFull[0, 1, 4, 0, 1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 1, 0, 0, -4, -1, 1, -2, (7/2), -4, 0, 0, , , ]);
SystemsModelOrder[ssm]

The order is equivalent to the exponent of the polynomial (RefLink[Det, paclet:ref/Det])[s e-a]:

{a,e}=Normal[ssm][[{1,-1}]];
Exponent[Det[s e-a],s]

It also equals the size of the slow system found with (RefLink[KroneckerModelDecomposition, paclet:ref/KroneckerModelDecomposition]):

kssm=Last@KroneckerModelDecomposition[ssm]

The slow system size is shown by the number of ones on the descriptor matrix diagonal:

e=Normal[kssm][[5]];
Total[Diagonal[e]]

The order of a discrete-time time-delay system is the total number of delays in the system:

SystemsModelOrder[(StateSpaceModelFull[(1/2), (SystemsModelDelay[6]), 2, 0, 1, , ])]

The order of a system with no zero dynamics is the total of the vector relative orders:

asys=(AffineStateSpaceModelFull[(Subscript[x, 1]) (Subscript[x, 2]), (Subscript[x, 2]), 1, 1, 0, 1, (Subscript[x, 1]), (Subscript[x, 2]), 0, 0, 0, 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], \[Null], AutomaticAutomatic, ]);

Use (RefLink[SystemsModelVectorRelativeOrders, paclet:ref/SystemsModelVectorRelativeOrders]) to get the relative orders:

SystemsModelOrder[asys]==Total[SystemsModelVectorRelativeOrders[asys]]

OpenersExampleSection5(Spacer1)Possible Issues  (1)

Discrete-time systems with fractional delays are not supported:

SystemsModelOrder[(StateSpaceModelFull[(1/4), (SystemsModelDelay[4.3`]), 1, 0, 2, , ])]

Approximate the delays:

SystemsModelOrder[SystemsModelDelayApproximate[(StateSpaceModelFull[(1/4), (SystemsModelDelay[4.3`]), 1, 0, 2, , ])]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[SystemsModelVectorRelativeOrders, paclet:ref/SystemsModelVectorRelativeOrders])  ▪  (RefLink[SystemsModelDimensions, paclet:ref/SystemsModelDimensions])  ▪  (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel])  ▪  (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel])  ▪  (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Basic Systems Modeling, paclet:guide/Modeling])}})}})