({{, (RefLink[ControllableModelQ, paclet:ref/ControllableModelQ])[sys] 
yields (RefLink[True, paclet:ref/True]) if the state-space model sys is controllable, and (RefLink[False, paclet:ref/False]) otherwise.}, {, (RefLink[ControllableModelQ, paclet:ref/ControllableModelQ])[{sys,sub}]
yields (RefLink[True, paclet:ref/True]) if the subsystem sub is controllable.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ControllableModelQ, paclet:ref/ControllableModelQ]) is also known as a reachable model.

A state-space model is said to be controllable if for any initial state (Subscript[x, i]) and any final state (Subscript[x, f]) there exists some control input that drives the state from (Subscript[x, i]) to (Subscript[x, f]) in finite time.

The system sys can be a standard or descriptor (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]) or (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]).

The following subsystems sub can be specified: »

The "Fast" and "Slow" subsystems primarily apply to descriptor state-space models as described in (RefLink[KroneckerModelDecomposition, paclet:ref/KroneckerModelDecomposition]).

The eigenmodes (Subscript[λ, i]) are described in (RefLink[JordanModelDecomposition, paclet:ref/JordanModelDecomposition]).

(RefLink[ControllableModelQ, paclet:ref/ControllableModelQ]) accepts a (RefLink[Method, paclet:ref/Method]) option with the following settings:

OpenersPrimaryExamplesSection(Spacer1)Examples  (29)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

A controllable system:

ControllableModelQ[(StateSpaceModelFull[(Subscript[a, 1]), 0, (Subscript[b, 1]), 0, (Subscript[a, 2]), (Subscript[b, 2]), 1, 0, 0, , , ])]

An uncontrollable system, since there is no way to affect the second state:

ControllableModelQ[(StateSpaceModelFull[(Subscript[a, 1]), 0, (Subscript[b, 1]), 0, (Subscript[a, 2]), 0, 1, 0, 0, , , ])]

OpenersExampleSection1(Spacer1)Scope  (6)

Test the controllability of a system with approximate coefficients:

ControllableModelQ[(StateSpaceModelFull[-5.`, -2.`, 1.`, 6.`, 2.`, -1.`, 1.`, 1.`, 0.`, , , ])]

Exact coefficients:

ControllableModelQ[(StateSpaceModelFull[-5, -2, 1, 6, 2, -1, 1, 1, 0, , , ])]

Symbolic coefficients:

ControllableModelQ[(StateSpaceModelFull[0, -p z, z, 1, -p-z, 1, 0, 1, 0, , , ])]

Multiple-input system:

ControllableModelQ[(StateSpaceModelFull[-1, 0, 1, 0, 0, -3, 0, 1, 1, -2, 0, 2, , , ])]

Discrete-time system:

ControllableModelQ[(StateSpaceModelFull[0, 1, 0, -0.4`, -1, 1, 0.68`, 1.7`, 0, 0.1`, , ])]

A descriptor system:

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

ControllableModelQ[ssm]

Controllability is equivalent to controllability of both slow and fast modes (C-controllability):

{ControllableModelQ[{ssm,"Slow"}],ControllableModelQ[{ssm,"Fast"}]}

Test controllability of individual eigenmodes:

ssm=(StateSpaceModelFull[-28, 40, 50, -8, 2, -6, -4, 1, -15, 24, 27, -5, 1, -4, 0, 0, , , ]);

The system is uncontrollable because of eigenmode -2:

modes=Eigenvalues[First[Normal[ssm]]]

Table[{λ,ControllableModelQ[{ssm,λ}]},{λ,modes}]

This can be seen in the Jordan form, where there is no way to affect the third state:

JordanModelDecomposition[ssm]//Last

Test controllability of an (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]):

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

If an operating point (Subscript[x, 0]) is given, controllability from (Subscript[x, 0]) is tested:

ControllableModelQ[(AffineStateSpaceModelFull[(Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 1]), 1, {(Subscript[x, 1]),0}, {(Subscript[x, 2]),0}, \[Null], \[Null], \[Null], AutomaticAutomatic, ])]

The system is controllable from a generic point:

ControllableModelQ[(AffineStateSpaceModelFull[(Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 1]), 1, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], \[Null], AutomaticAutomatic, ])]

OpenersExampleSection2(Spacer1)Options  (7)

OpenersExampleSubsection0(Spacer1)Method  (7)

By default, the controllability matrix is used for exact and symbolic systems:

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

ControllableModelQ[ssm,Method->"Matrix"]

The system is controllable if the (RefLink[ControllabilityMatrix, paclet:ref/ControllabilityMatrix]) has full rank:

cm=ControllabilityMatrix[ssm];

MatrixRank[cm]

The controllability Gramian is used for stable numeric systems:

ssm=(StateSpaceModelFull[0, 1.`, 0, 0, 0, 0, 1.`, 0, -1.`, -3.`, -5.`, 1.`, 1.`, 0, 0, 0, , , ]);

ControllableModelQ[ssm,Method->"Gramian"]

The system is controllable if the (RefLink[ControllabilityGramian, paclet:ref/ControllabilityGramian]) has full rank:

cg=ControllabilityGramian[ssm];

MatrixRank[cg]

For the controllability Gramian, this is equivalent to it being positive definite:

PositiveDefiniteMatrixQ[cg]

The PBH rank test is used for all other numeric systems:

ssm=(StateSpaceModelFull[-0.8`, 0.2`, 0.5`, -0.2`, 0, 0.01`, 1, 0, 0, , , ]);

ControllableModelQ[ssm,Method->"PBH"]

The system is controllable because (λ I-a,b) has full rank for all λ:

{a,b}=Normal[ssm][[{1,2}]];

MatrixRank/@Table[ArrayFlatten[{{λ IdentityMatrix[2]-a,b}}],{λ,Eigenvalues[a]}]

The controllability distribution is used for input-linear systems:

ControllableModelQ[(AffineStateSpaceModelFull[0, (Subscript[x, 1]), 1+(Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], \[Null], AutomaticAutomatic, ]),Method->"Distribution"]

For linear systems, the tests based on the controllability matrix and distribution are equivalent:

Table[ControllableModelQ[(AffineStateSpaceModelFull[(Subscript[x, 1])+(Subscript[x, 2]), -(Subscript[x, 1]), 1, 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]),Method->m],{m,{"Matrix","Distribution"}}]

Controllability of the linearized system implies controllability of the input-linear system:

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

lsys=StateSpaceModel[asys];

{ControllableModelQ[asys],ControllableModelQ[lsys]}

The matrix test for input linear system uses the "Matrix" method for the linearized system:

ControllableModelQ[asys,Method->"Matrix"]

Using no control input, the system follows the drift vector field x'(t)==a(x(t)):

asys=(AffineStateSpaceModelFull[-14 (Subscript[x, 3]), 0, -19 (Subscript[x, 3]), (Subscript[x, 1])+2 (Subscript[x, 2])+4 (Subscript[x, 3]), 2 (Subscript[x, 2]), 3 (Subscript[x, 3]), (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], \[Null], \[Null], AutomaticAutomatic, ]);

A system is weakly controllable if the drift vector field can also be used to move state:

ControllableModelQ[asys,Method->{"Distribution","DriftVectorField"->True}]

Without including the drift vector field, the system is not controllable:

ControllableModelQ[asys]

OpenersExampleSection3(Spacer1)Applications  (5)

The position and velocities of all three masses can be controlled by the force on (Subscript[m, 3]):

ControllableModelQ[(StateSpaceModelFull[0, 1, 0, 0, 0, 0, 0, -(((Subscript[k, 1])+(Subscript[k, 2]))/(Subscript[m, 1])), 0, ((Subscript[k, 2])/(Subscript[m, 1])), 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, ((Subscript[k, 2])/(Subscript[m, 2])), 0, -(((Subscript[k, 2])+(Subscript[k, 3]))/(Subscript[m, 2])), 0, ((Subscript[k, 3])/(Subscript[m, 2])), 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, ((Subscript[k, 3])/(Subscript[m, 3])), 0, -((Subscript[k, 3])/(Subscript[m, 3])), 0, (1/(Subscript[m, 3])), 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, , , ])]

An electric circuit with the capacitor voltage and inductor current as states:

ssm=(StateSpaceModelFull[-(1/(𝒞 (Subscript[R, 1]))), 0, (1/(𝒞 (Subscript[R, 1]))), 0, -((Subscript[R, 2])/L), (1/L), , , ]);

In general, the system is controllable:

ControllableModelQ[ssm]

However if L==(Subscript[R, 1])(Subscript[R, 2])𝒞, it is not controllable:

ControllableModelQ[ssm/.L->(Subscript[R, 1]) (Subscript[R, 2])𝒞]

A unicycle with drive and steering as input:

asys=(AffineStateSpaceModelFull[0, 0, 0, Cos[θ], 0, Sin[θ], 0, 0, 1, x, y, θ, \[Null], \[Null], \[Null], \[Null], AutomaticAutomatic, ]);

The system is controllable, but the linearized system is not:

{ControllableModelQ[asys],ControllableModelQ[StateSpaceModel@asys]}

The parking problem:

veh=(AffineStateSpaceModelFull[0, 0, 0, 0, Cos[θ+ϕ], 0, Sin[θ+ϕ], 0, Sin[θ], 0, 0, 1, x, y, ϕ, θ, \[Null], \[Null], \[Null], \[Null], \[Null], AutomaticAutomatic, ]);

The system is controllable, but the linearized system is not:

{ControllableModelQ[veh],ControllableModelQ[StateSpaceModel@veh]}

A rotating rigid satellite modeled using Euler's equations of motion:

sat[j1_,j2_,j3_]:=(AffineStateSpaceModelFull[(((j2-j3) (Subscript[ω, 2]) (Subscript[ω, 3]))/j1), (((-j1+j3) (Subscript[ω, 1]) (Subscript[ω, 3]))/j2), (((j1-j2) (Subscript[ω, 1]) (Subscript[ω, 2]))/j3), (1/j1), 0, 0, 0, (1/j2), 0, 0, 0, (1/j3), (Subscript[ω, 1]), (Subscript[ω, 2]), (Subscript[ω, 3]), \[Null], \[Null], \[Null], \[Null], {(Subscript[τ, 1]),(Subscript[τ, 2]),(Subscript[τ, 3])}Automatic, ])

Its controllability for various values of the principal moments and actuator combinations:

controllableQ[j1_,j2_,j3_]:=Table[{i,ControllableModelQ[SystemsModelExtract[sat[j1,j2,j3],i]]},{i,Subsets[Range[3],{1,3}]}]

A grid to show the results:

grid[res_,color_]:=Grid[res,Background->{None,{{color,White}}},Frame->True]

If (Subscript[J, 1])≠(Subscript[J, 2])≠(Subscript[J, 3]), the system is controllable with any two actuators:

grid[controllableQ[(Subscript[J, 1]),(Subscript[J, 2]),(Subscript[J, 3])],LightOrange]

If (Subscript[J, 1])==(Subscript[J, 2]), the system is not controllable with actuators 1 and 2 or any one actuator:

grid[controllableQ[(Subscript[J, 1]),(Subscript[J, 1]),(Subscript[J, 3])],LightRed]

If (Subscript[J, 1])==(Subscript[J, 2])==(Subscript[J, 3]), the system is controllable only with all 3 actuators:

grid[controllableQ[(Subscript[J, 1]),(Subscript[J, 1]),(Subscript[J, 1])],LightMagenta]

OpenersExampleSection4(Spacer1)Properties & Relations  (7)

A diagonal system is controllable, assuming (Subscript[λ, 1])≠(Subscript[λ, 2]) and (Subscript[b, i])≠0:

ControllableModelQ[(StateSpaceModelFull[(Subscript[λ, 1]), 0, (Subscript[b, 1]), 0, (Subscript[λ, 2]), (Subscript[b, 2]), , , ])]

With (Subscript[b, 1])==0, there is no way to control the first state:

ControllableModelQ[(StateSpaceModelFull[(Subscript[λ, 1]), 0, 0, 0, (Subscript[λ, 2]), (Subscript[b, 2]), , , ])]

With (Subscript[b, 1])==0, the first state cannot be controlled directly, but indirectly from the second state:

ControllableModelQ[(StateSpaceModelFull[(Subscript[λ, 1]), 1, 0, 0, (Subscript[λ, 1]), (Subscript[b, 2]), , , ])]

With (Subscript[b, 2])==0, the second state cannot be controlled directly or indirectly from the first state:

ControllableModelQ[(StateSpaceModelFull[(Subscript[λ, 1]), 1, (Subscript[b, 1]), 0, (Subscript[λ, 1]), 0, , , ])]

Use (RefLink[JordanModelDecomposition, paclet:ref/JordanModelDecomposition]) to compute the canonical state-space representation above:

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

JordanModelDecomposition[ssm]//Last

Compute the controllability of each mode using the "PBH" test:

Table[{λ,ControllableModelQ[{ssm,λ}]},{λ,{3}}]

For descriptor systems, (RefLink[KroneckerModelDecomposition, paclet:ref/KroneckerModelDecomposition]) is the generalization of the diagonal form:

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

kssm=Last[KroneckerModelDecomposition[ssm]]

Determine the controllability of the slow subsystem from its structure:

SystemsModelExtract[kssm,All,All,{1,2}]

Compute it using the original system:

ControllableModelQ[{ssm,"Slow"}]

Determine the controllability of the fast subsystem:

SystemsModelExtract[kssm,All,All,{3}]

Compute it using the original system:

ControllableModelQ[{ssm,"Fast"}]

If the descriptor matrix of a (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]) has full rank, there is no fast subsystem:

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

Hence the complete controllability of the system can be evaluated from the slow subsystem:

{ControllableModelQ[ssm],ControllableModelQ[{ssm,All}],ControllableModelQ[{ssm,"Slow"}]}

Controllability is invariant under a nonsingular (RefLink[StateSpaceTransform, paclet:ref/StateSpaceTransform]):

ssm=(StateSpaceModelFull[(Subscript[λ, 1]), 1, (Subscript[b, 1]), 0, (Subscript[λ, 1]), 0, , , ]);

p=Array[(Subscript[t, ##])&,{2,2}];

ControllableModelQ/@{ssm,StateSpaceTransform[ssm,p]}

Controllability is invariant under state feedback:

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

ControllableModelQ[ssm]

Compute the state feedback using (RefLink[StateFeedbackGains, paclet:ref/StateFeedbackGains]):

κ=StateFeedbackGains[ssm,{-4,-5}]

The closed-loop system is also controllable:

SystemsModelStateFeedbackConnect[ssm,κ];

ControllableModelQ[%]

Controllability does not mean it is output controllable ((RefLink[OutputControllableModelQ, paclet:ref/OutputControllableModelQ])):

ssm=(StateSpaceModelFull[-1.75`, 0.5`, 0, 0.375`, -1.25`, 4, 0.125`, 0.25`, 0, 0.25`, 0.5`, 0, , , ]);

{ControllableModelQ[ssm],OutputControllableModelQ[ssm]}

Output controllability does not imply controllability:

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

{ControllableModelQ[ssm],OutputControllableModelQ[ssm]}

OpenersExampleSection5(Spacer1)Possible Issues  (2)

The Gramian method is not reliable for systems that are not asymptotically stable:

ssm=(StateSpaceModelFull[-(5/2), -1, -(1/4), 0, (3/4), (1/2), -(3/8), (1/2), -6, -8, 0, 6, (1/4), (3/2), -(1/8), 0, , , ]);

Table[ControllableModelQ[ssm,Method->m],{m,{"Gramian","Matrix","PBH"}}]

The eigenvalue in the right half of the complex plane leads to instability for continuous-time systems:

Eigenvalues@First@Normal@ssm

For affine systems with nonzero drift, the distribution tests only for accessibility:

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

ControllableModelQ[asys]

A random initial condition and random input signal generator:

ic=RandomReal[{-2,2},2];u[t_]:=Interpolation[Transpose[{Range[0,1,0.1],RandomReal[{-1,1},11]}],t]

Simulate the system 10 times with random inputs:

Table[StateResponse[{asys,ic},u[t],{t,0,1}],{10}];

The system cannot be moved to the left of the initial point:

ParametricPlot[%,{t,0,1},PlotRange->All,AspectRatio->1/GoldenRatio]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[OutputControllableModelQ, paclet:ref/OutputControllableModelQ])  ▪  (RefLink[ControllabilityMatrix, paclet:ref/ControllabilityMatrix])  ▪  (RefLink[ControllabilityGramian, paclet:ref/ControllabilityGramian])  ▪  (RefLink[JordanModelDecomposition, paclet:ref/JordanModelDecomposition])  ▪  (RefLink[KroneckerModelDecomposition, paclet:ref/KroneckerModelDecomposition])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Analysis of State-Space Models, paclet:guide/AnalysisOfStateSpaceModels])}, {▪(RefLinkPlain[Nonlinear Control Systems, paclet:guide/NonlinearControlSystems])}})}})