({{, (RefLink[SystemsModelExtract, paclet:ref/SystemsModelExtract])[sys,{(Subscript[in, 1]),…}] 
extracts the subsystem of the systems model sys associated with inputs at position (Subscript[in, i]).}, {, (RefLink[SystemsModelExtract, paclet:ref/SystemsModelExtract])[sys,{(Subscript[in, 1]),…},{(Subscript[out, 1]),…}] 
extracts the subsystem associated with inputs and outputs at positions (Subscript[in, i]) and (Subscript[out, i]), respectively.}, {, (RefLink[SystemsModelExtract, paclet:ref/SystemsModelExtract])[sys,{(Subscript[in, 1]),…},{(Subscript[out, 1]),…},{(Subscript[s, 1]),…}] 
extracts the subsystem of the state-space model sys associated with inputs, outputs, and states at (Subscript[in, i]), (Subscript[out, i]), and (Subscript[s, i]), respectively.}})

OpenersNotesSection(Spacer1)Details

The systems model sys can be a (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]), (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]), (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]), or (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]).

The specifications of the inputs, outputs, and states can also be (RefLink[All, paclet:ref/All]) or (RefLink[None, paclet:ref/None]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (15)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Extract the subsystem associated with the first input and third output:

SystemsModelExtract[(TransferFunctionModelFull[(1/(0.5` +s)), 0, 2, (s/(3+0.1` s+(s^2))), (2/(1+2 s+(s^2))), ((s^2)/(1+3 (s^2)+(s^3))), , , ]),{1},{3}]

Extract the subsystem associated with the first two states:

SystemsModelExtract[(StateSpaceModelFull[(Subscript[a, 1]), 0, 0, (Subscript[b, 1]), 0, 0, 0, (Subscript[a, 2]), 0, 0, (Subscript[b, 2]), 0, 0, 0, (Subscript[a, 3]), 0, 0, (Subscript[b, 3]), (Subscript[c, 1]), 0, 0, (Subscript[d, 1]), 0, 0, 0, (Subscript[c, 2]), 0, 0, (Subscript[d, 2]), 0, 0, 0, (Subscript[c, 3]), 0, 0, (Subscript[d, 3]), , , ]),All,All,{1,2}]

OpenersExampleSection1(Spacer1)Scope  (8)

Extract the subsystem associated with the first input of a three-input system:

SystemsModelExtract[(TransferFunctionModelFull[(s/(3+s)), ((4 s)/(2+s)), (3/(2+s)), (1/(3+s)), (1/s), (1/s), , (Subscript[u, 1]), (Subscript[u, 2]), (Subscript[u, 3]), (Subscript[y, 1]), (Subscript[y, 2]), , ]),{1}]

The subsystem associated with the second output:

SystemsModelExtract[(TransferFunctionModelFull[(s/(3+s)), ((4 s)/(2+s)), (3/(2+s)), (1/(3+s)), (1/s), (1/s), , (Subscript[u, 1]), (Subscript[u, 2]), (Subscript[u, 3]), (Subscript[y, 1]), (Subscript[y, 2]), , ]),All,{2}]

Extract the subsystem corresponding to the first and second inputs, and the third and fourth outputs:

SystemsModelExtract[(StateSpaceModelFull[-1, 0, 0, 0, 1, 0, 0, 0, -3, 0, 0, 1, -1, 0, 0, 0, -4, 0, 0, 0, 1, 0, 0, 0, -8, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, , , ]),{1,2},{3,4}]

Extract the subsystem associated with the second and third states of a state-space model:

SystemsModelExtract[(StateSpaceModelFull[-1, 0, 0, 0, 1, 0, 0, 0, -3, 0, 0, 1, -1, 0, 0, 0, -4, 0, 0, 0, 1, 0, 0, 0, -8, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, , , ]),All,All,{2,3}]

The subsystem associated with the third and fourth states:

SystemsModelExtract[(StateSpaceModelFull[1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 1, 0, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, , , ]),All,All,{3,4}]

Extract the last two states of a descriptor (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]):

SystemsModelExtract[(StateSpaceModelFull[(Subscript[e, 11]), (Subscript[e, 12]), (Subscript[e, 13]), (Subscript[a, 11]), (Subscript[a, 12]), (Subscript[a, 13]), (Subscript[b, 1]), (Subscript[e, 21]), (Subscript[e, 22]), (Subscript[e, 23]), (Subscript[a, 21]), (Subscript[a, 22]), (Subscript[a, 23]), (Subscript[b, 2]), (Subscript[e, 31]), (Subscript[e, 32]), (Subscript[e, 33]), (Subscript[a, 31]), (Subscript[a, 32]), (Subscript[a, 33]), (Subscript[b, 3]), (Subscript[c, 1]), (Subscript[c, 2]), (Subscript[c, 3]), d, , , ]),All,All,{-2,-1}]

Extract the first and second states of an (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]):

SystemsModelExtract[(AffineStateSpaceModelFull[(Subscript[a, 1])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[a, 2])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[a, 3])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[b, 1])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[b, 2])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[b, 3])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], c[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], d[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], {(Subscript[x, 1]),(Subscript[x, 10])}, {(Subscript[x, 2]),(Subscript[x, 20])}, {(Subscript[x, 3]),(Subscript[x, 30])}, \[Null], \[Null], AutomaticAutomatic, ]),All,All,{1,2}]

By default the operating points are assumed to be zero:

SystemsModelExtract[(AffineStateSpaceModelFull[(Subscript[a, 1])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[a, 2])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[a, 3])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[b, 1])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[b, 2])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[b, 3])[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], c[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], d[(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])], (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], AutomaticAutomatic, ]),All,All,{1,2}]

Extract the first input of a (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]):

SystemsModelExtract[(NonlinearStateSpaceModelFull[f[x,(Subscript[u, 1]),(Subscript[u, 2])], g[x,(Subscript[u, 1]),(Subscript[u, 2])], x, \[Null], \[Null], {(Subscript[u, 1]),(Subscript[u, 2])}Automatic, ]),1]

A system with a nonzero operating point:

SystemsModelExtract[(NonlinearStateSpaceModelFull[f[x,(Subscript[u, 1]),(Subscript[u, 2])], g[x,(Subscript[u, 1]),(Subscript[u, 2])], {x,(Subscript[x, 0])}, \[Null], \[Null], {{(Subscript[u, 1]),(Subscript[u, 10])},{(Subscript[u, 2]),(Subscript[u, 20])}}Automatic, ]),1]

OpenersExampleSection3(Spacer1)Applications  (4)

Rearrange the inputs of a system:

SystemsModelExtract[(StateSpaceModelFull[(Subscript[a, 1]), 0, 0, (Subscript[b, 1]), 0, 0, 0, (Subscript[a, 2]), 0, 0, (Subscript[b, 2]), 0, 0, 0, (Subscript[a, 3]), 0, 0, (Subscript[b, 3]), (Subscript[c, 1]), 0, 0, (Subscript[d, 1]), 0, 0, 0, (Subscript[c, 2]), 0, 0, (Subscript[d, 2]), 0, 0, 0, (Subscript[c, 3]), 0, 0, (Subscript[d, 3]), , , ]),{1,3,2}]

Rearrange outputs:

SystemsModelExtract[(StateSpaceModelFull[(Subscript[a, 1]), 0, 0, (Subscript[b, 1]), 0, 0, 0, (Subscript[a, 2]), 0, 0, (Subscript[b, 2]), 0, 0, 0, (Subscript[a, 3]), 0, 0, (Subscript[b, 3]), (Subscript[c, 1]), 0, 0, (Subscript[d, 1]), 0, 0, 0, (Subscript[c, 2]), 0, 0, (Subscript[d, 2]), 0, 0, 0, (Subscript[c, 3]), 0, 0, (Subscript[d, 3]), , , ]),All,{2,3,1}]

Rearrange states:

SystemsModelExtract[(StateSpaceModelFull[(Subscript[a, 1]), 0, 0, (Subscript[b, 1]), 0, 0, 0, (Subscript[a, 2]), 0, 0, (Subscript[b, 2]), 0, 0, 0, (Subscript[a, 3]), 0, 0, (Subscript[b, 3]), (Subscript[c, 1]), 0, 0, (Subscript[d, 1]), 0, 0, 0, (Subscript[c, 2]), 0, 0, (Subscript[d, 2]), 0, 0, 0, (Subscript[c, 3]), 0, 0, (Subscript[d, 3]), , , ]),All,All,{2,1,3}]

Use (RefLink[SystemsModelExtract, paclet:ref/SystemsModelExtract]) to obtain the responses of individual subsystems of a MIMO system:

tfm=(TransferFunctionModelFull[(1/(1+s)), (s/(2+s)), (1/(2+s)), (s/(3+0.1` s+(s^2))), (1/(1+2 s+(s^2))), (1/(9+(s^2))), , , ]);

subSystems=Outer[SystemsModelExtract[tfm,#1,#2]&,Sequence@@(Range/@SystemsModelDimensions[tfm])]//Transpose;

The output response to a unit step input for each subsystem:

Map[Plot[OutputResponse[#,UnitStep[t],{t,10}]//Evaluate,{t,0,10},PlotRange->All]&,subSystems,{2}]//TableForm

The output response of all the subsystems:

Plot[OutputResponse[tfm,{UnitStep[t],UnitStep[t]},{t,10}]//Evaluate,{t,0,10},PlotRange->All]

The Nyquist plots for each subsystem:

Map[NyquistPlot,subSystems,{2}]//TableForm

Visualize the response of specific outputs to specific inputs for a MIMO system:

tfm=(TransferFunctionModelFull[((1+s)/(2+s)), ((-1-s)/((-1+s) (2+s))), ((-1+s)/(2+s)), ((1+s)/(2+s)), , , ]);

The response of the outputs to a unit step applied only to the first input:

Plot[OutputResponse[SystemsModelExtract[tfm,1],UnitStep[t],{t,10}]//Evaluate,{t,0,10}]

The response of the second output to excitations in both inputs:

Plot[OutputResponse[SystemsModelExtract[tfm,All,2],{Sin[t],Sin[3t]},{t,20}]//Evaluate,{t,0,20}]

In some cases it is possible to extract the controllable and observable subsystems by visual observation:

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

{ControllableModelQ[ssm],ObservableModelQ[ssm]}

Only the first three modes are controllable:

SystemsModelExtract[ssm,All,All,{1,2,3}]

(RefLink[ControllableDecomposition, paclet:ref/ControllableDecomposition]) gives the same result:

ControllableDecomposition[ssm]//Last

Only modes 2 and 3 are observable:

SystemsModelExtract[ssm,All,All,{2,3}]

(RefLink[ObservableDecomposition, paclet:ref/ObservableDecomposition]) gives the same result:

ObservableDecomposition[ssm]//Last

OpenersExampleSection4(Spacer1)Properties & Relations  (1)

The specifications in (RefLink[SystemsModelExtract, paclet:ref/SystemsModelExtract]) and (RefLink[SystemsModelDelete, paclet:ref/SystemsModelDelete]) are complementary:

ssm=StateSpaceModel[{Array[(Subscript[a, ##])&,{5,5}],Array[(Subscript[b, ##])&,{5,3}],Array[(Subscript[c, ##])&,{4,5}]}]

SystemsModelExtract[ssm,{1,2},{3,4},{2,5}]

SystemsModelDelete[ssm,Complement[Range[3],{1,2}],Complement[Range[4],{3,4}],Complement[Range[5],{2,5}]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[SystemsModelDelete, paclet:ref/SystemsModelDelete])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Control Systems, paclet:guide/ControlSystems])}, {▪(RefLinkPlain[Model Connections and Manipulations, paclet:guide/ModelConnections])}})}})