({{, (RefLink[ControllableDecomposition, paclet:ref/ControllableDecomposition])[sys] 
yields the controllable subsystem of the state-space model sys.}, {, (RefLink[ControllableDecomposition, paclet:ref/ControllableDecomposition])[sys,{(Subscript[z, 1]),…}]
specifies the new state variables (Subscript[z, i]).}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ControllableDecomposition, paclet:ref/ControllableDecomposition]) gives {p,csys}, where p is the transformation and csys is the controllable subsystem.

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

The controllable subsystem is given by (RefLink[StateSpaceTransform, paclet:ref/StateSpaceTransform])[sys,p].

(RefLink[ControllableDecomposition, paclet:ref/ControllableDecomposition]) accepts a (RefLink[Method, paclet:ref/Method]) option. The following settings can be specified:

OpenersPrimaryExamplesSection(Spacer1)Examples  (14)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Find the controllable subsystem and its transformation:

ControllableDecomposition[(StateSpaceModelFull[(Subscript[a, 1]), 0, 0, 0, 0, (Subscript[a, 2]), 0, (Subscript[b, 1]), 0, 0, (Subscript[a, 3]), (Subscript[b, 2]), (Subscript[c, 1]), (Subscript[c, 2]), (Subscript[c, 3]), (Subscript[d, 11]), , , ])]

OpenersExampleSection1(Spacer1)Scope  (4)

The controllable subsystem of a controllable system is the complete system:

ControllableDecomposition[(StateSpaceModelFull[-1, -2, 1, 3, -4, -1, 1, 0, 0, , , ])]

The controllable subsystem of a partially controllable continuous-time system:

ControllableDecomposition[(StateSpaceModelFull[-3, 0, 0, 1, 0, -4, 0, -1, 0, 0, -7, 0, 1, 0, 0, 0, , , ])]

The controllable subsystem of a descriptor system:

ControllableDecomposition[(StateSpaceModelFull[(Subscript[e, 1]), 0, 0, (Subscript[a, 1]), 0, 0, 0, 0, 0, (Subscript[e, 2]), 0, 0, (Subscript[a, 2]), 0, (Subscript[b, 1]), 0, 0, 0, 0, 0, 0, (Subscript[a, 3]), 0, (Subscript[b, 2]), 0, (Subscript[c, 1]), 0, (Subscript[d, 11]), (Subscript[d, 12]), 0, 0, (Subscript[c, 3]), (Subscript[d, 21]), (Subscript[d, 22]), , , ])]

The controllable subsystem of an affine system:

asys=(AffineStateSpaceModelFull[(Subscript[x, 1]), (Subscript[x, 1]), (Subscript[x, 1]), 1, 1+(Subscript[x, 1]), 1, (Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0}}Automatic, ]);

ControllableDecomposition[asys]

Specify the new state variables:

ControllableDecomposition[asys,{(Subscript[z, 1]),(Subscript[z, 2]),(Subscript[z, 3])}]

OpenersExampleSection3(Spacer1)Applications  (7)

OpenersExampleSubsection0(Spacer1)Linear Systems  (4)

Construct the Kalman controllable decomposition:

ssm=(StateSpaceModelFull[(Subscript[a, 1]), 0, 0, 0, 0, 0, (Subscript[a, 2]), 0, (Subscript[b, 1]), 0, 0, 0, (Subscript[a, 3]), 0, (Subscript[b, 2]), (Subscript[c, 1]), 0, 0, (Subscript[d, 11]), (Subscript[d, 12]), 0, 0, (Subscript[c, 3]), (Subscript[d, 21]), (Subscript[d, 22]), , , ]);

(RefLink[ControllableDecomposition, paclet:ref/ControllableDecomposition]) picks out the controllable subsystem only:

{p,cssm}=ControllableDecomposition[ssm];

cssm

Kalman controllable decomposition puts the controllable subsystem first and keeps the rest:

po=NullSpace[p\[Transpose]]\[Transpose];
StateSpaceTransform[ssm,ArrayFlatten[{{p,po}}]]

Compute the dimension of the controllable subspace:

{p,cssm}=ControllableDecomposition[(StateSpaceModelFull[(Subscript[a, 1]), 0, 0, 0, 0, 0, (Subscript[a, 2]), 0, (Subscript[b, 1]), 0, 0, 0, (Subscript[a, 3]), 0, (Subscript[b, 2]), (Subscript[c, 1]), 0, 0, (Subscript[d, 11]), (Subscript[d, 12]), 0, 0, (Subscript[c, 3]), (Subscript[d, 21]), (Subscript[d, 22]), , , ])];

The controllable subspace is the range of p, i.e. the column dimension:

Dimensions[p]//Last

Find the controllable subspace for the system below and explain the possible state trajectories that can occur in the system:

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

The system is uncontrollable, so only a subspace is controllable:

ControllableModelQ[ssm]

The range of the transformation matrix p gives the controllable subspace:

{p,csys}=ControllableDecomposition[ssm];

cspace=ParametricPlot3D[p.{u,v},{u,-1.25,1.25},{v,-1,1},Mesh->None,PlotStyle->Opacity[0.3]]

Trajectories can be controlled in this subspace:

x0=Flatten[Table[p.{u,v},{u,-0.8,0.8,0.3},{v,-0.8,0.8,0.3}],1];
sr=Table[StateResponse[{ssm,x},Sin[2t],{t,0,10}],{x,x0}];

Show[ParametricPlot3D[Evaluate[sr],{t,0,10}],cspace]

But you cannot control the drift between parallel copies of the controllable subspace:

w=First@NullSpace[p\[Transpose]]; (* Orthogonal direction to cspace *)
x0=Flatten[Table[p.{u,v}-w,{u,-0.8,0.8,0.3},{v,-0.8,0.8,0.3}],1];
sr=Table[StateResponse[{ssm,x},Sin[2t],{t,0,10}],{x,x0}];

Show[ParametricPlot3D[Evaluate[sr],{t,0,10}],cspace]

Design a controller for a system that is not completely controllable, by building a controller for the controllable subsystem:

Since a force applied only on the first mass (Subscript[m, 1]), the second mass (Subscript[m, 2]) is not controllable:

pars={(Subscript[k, 1])->75,(Subscript[k, 2])->100,(Subscript[m, 1])->1,(Subscript[m, 2])->0.5};

ssm=(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, (1/(Subscript[m, 1])), 0, 0, 0, 1, 0, 0, 0, ((Subscript[k, 2])/(Subscript[m, 2])), 0, -((Subscript[k, 2])/(Subscript[m, 2])), 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -((Subscript[k, 2])/(Subscript[m, 2])), 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, , ,{{(Subscript[y, 2])[t],0},(Subscript[\[FormalX], 1]),{(Subscript[x, 1])[t],0},(Subscript[\[FormalX], 2]),{(Subscript[x, 2])[t],0},(Subscript[\[FormalX], 3])},{{F[t],0}},{(Subscript[x, 1])[t],(Subscript[x, 2])[t]},t, ])/.pars;

ControllableModelQ[ssm]

Design a controller using the controllable subsystem:

{p,csys}=ControllableDecomposition[ssm];

κc=StateFeedbackGains[csys,{-1,-2,-3+I,-3-I}]

Use the transformation to obtain the controller for the original system:

κ=κc.p\[Transpose]

The simulation shows controlled as well as oscillatory modes in the closed-loop system:

clsys=SystemsModelStateFeedbackConnect[ssm,κ];

Plot[Evaluate[StateResponse[{clsys,{0,0,0.1,0,0.1,0}},0,{t,0,7}]],{t,0,7}]

Compute the modes of the closed-loop system:

Eigenvalues[First[Normal[clsys]]]

The oscillatory modes are the uncontrollable ones:

Select[Eigenvalues[First[Normal[ssm]]],!ControllableModelQ[{ssm,#}]&]

OpenersExampleSubsection1(Spacer1)Affine Systems  (3)

Construct the triangular controllability decomposition:

assm=(AffineStateSpaceModelFull[1, 0, (Subscript[x, 2]), 1, (Subscript[x, 2]), (Subscript[x, 1]), (Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]);

(RefLink[ControllableDecomposition, paclet:ref/ControllableDecomposition]) picks out the controllable subsystem only:

{{p1,p2},csys}=ControllableDecomposition[assm];

csys

Triangular controllability decomposition puts the controllable subsystem first and keeps the rest:

StateSpaceTransform[assm,{p1,Flatten[p2]}]

Compute the dimension of the controllable subspace:

assm=(AffineStateSpaceModelFull[(Subscript[x, 1]), (Subscript[x, 1]), (Subscript[x, 1]), 1, 1+(Subscript[x, 1]), 1, (Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0}}Automatic, ]);

ControllableModelQ[assm]

The dimension can be obtained from the inverse transformation (Subscript[p, 2]):

{{(Subscript[p, 1]),(Subscript[p, 2])},cssm}=ControllableDecomposition[assm];

cssm

Length[First[(Subscript[p, 2])]]

The controllable decomposition gives the reachable subspace and subsystem. This can be used to visualize the motion of the system from one subspace to another:

asys=(AffineStateSpaceModelFull[1, 0, (Subscript[x, 2]), 1, (Subscript[x, 2]), (Subscript[x, 1]), (Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]);

The generic reachable subspace:

{{(Subscript[p, 1]),{(Subscript[p, 21]),(Subscript[p, 22])}},csys}=ControllableDecomposition[asys];

rspace[{x1_,x2_,x3_}]:=Last/@(Subscript[p, 22])/.{(Subscript[x, 1])->x1,(Subscript[x, 2])->x2,(Subscript[x, 3])->x3}

rspace[{(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])}]

A specific reachable subspace:

c=0.2;

rspace0=ContourPlot3D[Evaluate[rspace[{(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])}]==c],{(Subscript[x, 1]),1,5},{(Subscript[x, 2]),0,5.5},{(Subscript[x, 3]),-7,7},Mesh->None,ContourStyle->Opacity[0.3]]

Select several initial points on this surface:

(Subscript[x, 10])=Range[1.5,3,0.05];

Flatten[(Subscript[x, 2])/.Solve[Thread[Last/@(Subscript[p, 22])==c],(Subscript[x, 2])]/.(Subscript[x, 1])->(Subscript[x, 10])];

(Subscript[x, 0])=Thread[{(Subscript[x, 10]),%,RandomReal[{-1.5,6.5},Length@(Subscript[x, 10])]}];

Short[(Subscript[x, 0]),2]

All these initial points end up at exactly the same final surface because that motion is not controllable:

sr=Table[StateResponse[{asys,x},0,{t,0,1}],{x,(Subscript[x, 0])}];

(Subscript[x, f])=rspace/@sr/.t->1;

Differences[%]//Chop

A 3D plot shows the motion from the initial surface to the final one:

rspace1=ContourPlot3D[Evaluate[rspace[{(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])}]==(Subscript[x, f])[[1,1]]],{(Subscript[x, 1]),1,5},{(Subscript[x, 2]),0.5,5},{(Subscript[x, 3]),-10,10},Mesh->None,ContourStyle->Opacity[0.3]];

Show[rspace0,ParametricPlot3D[Evaluate[sr],{t,0,1}],rspace1,PlotRange->All]

OpenersExampleSection4(Spacer1)Properties & Relations  (2)

The transformation matrix p selects the controllable subsystem using (RefLink[StateSpaceTransform, paclet:ref/StateSpaceTransform]):

ssm=(StateSpaceModelFull[(Subscript[a, 1]), 0, 0, 0, 0, 0, (Subscript[a, 2]), 0, (Subscript[b, 1]), 0, 0, 0, (Subscript[a, 3]), 0, (Subscript[b, 2]), (Subscript[c, 1]), 0, 0, (Subscript[d, 11]), (Subscript[d, 12]), 0, 0, (Subscript[c, 3]), (Subscript[d, 21]), (Subscript[d, 22]), , , ]);

{p,csys}=ControllableDecomposition[ssm];
tsys=StateSpaceTransform[ssm,{p,p\[Transpose]}];

{csys,tsys}

For affine systems, the transformation rules select the controllable subsystem:

assm=(AffineStateSpaceModelFull[-(Subscript[x, 4]), 0, -(Subscript[x, 1]), (Subscript[x, 2]), 1, 0, 1+(Subscript[x, 2]), 0, (Subscript[x, 1]), (Subscript[x, 2]), 0, 0, (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), (Subscript[x, 4]), \[Null], \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]);

{p,csys}=ControllableDecomposition[assm];
tsys=StateSpaceTransform[assm,p];

{csys,tsys}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ObservableDecomposition, paclet:ref/ObservableDecomposition])  ▪  (RefLink[JordanModelDecomposition, paclet:ref/JordanModelDecomposition])  ▪  (RefLink[InternallyBalancedDecomposition, paclet:ref/InternallyBalancedDecomposition])  ▪  (RefLink[StateSpaceTransform, paclet:ref/StateSpaceTransform])}})}})

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