({{, (RefLink[SystemsModelStateFeedbackConnect, paclet:ref/SystemsModelStateFeedbackConnect])[sys,con] 
connects the states of the systems model sys to the controller con and the outputs of con to the inputs of sys in feedback.}, {, (RefLink[SystemsModelStateFeedbackConnect, paclet:ref/SystemsModelStateFeedbackConnect])[sys,con,{(Subscript[s, 1]),…},{{(Subscript[in, 1]),(Subscript[ftype, 1])},…}] 
connects state (Subscript[s, i]) of sys to the i(^th) input of con and the j(^th) output of con to input (Subscript[in, j]) of sys with feedback type (Subscript[ftype, j])}})

OpenersNotesSection(Spacer1)Details

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

The controller con can be a gain matrix, a vector, (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]), (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]), (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]), or (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]).

(RefLink[StateFeedbackGains, paclet:ref/StateFeedbackGains]), (RefLink[LQRegulatorGains, paclet:ref/LQRegulatorGains]), (RefLink[DiscreteLQRegulatorGains, paclet:ref/DiscreteLQRegulatorGains]), (RefLink[AsymptoticOutputTracker, paclet:ref/AsymptoticOutputTracker]), and (RefLink[FullInformationOutputRegulator, paclet:ref/FullInformationOutputRegulator]) return state-feedback controllers as matrices or vectors.

OpenersPrimaryExamplesSection(Spacer1)Examples  (22)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Determine the closed-loop model of a state-feedback system:

SystemsModelStateFeedbackConnect[(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, , , ]),{{(Subscript[k, 1]),(Subscript[k, 2])}}]

Compute the feedback gains to place the poles at (Subscript[z, 1]) and (Subscript[z, 2]) for a discrete-time system:

ssm=(StateSpaceModelFull[1, T, ((T^2)/2), 0, 1, T, 1, 0, 0, T, , ]);
k=StateFeedbackGains[ssm,{(Subscript[z, 1]),(Subscript[z, 2])}]

Determine the closed-loop model:

SystemsModelStateFeedbackConnect[ssm,k]

Verify the pole locations:

Eigenvalues[Normal[%][[1]]]

Determine the closed-loop model with a set of optimal state feedback gains:

(Subscript[ssm, d])=(StateSpaceModelFull[0.4725`, 0.2376`, 0.0589`, 0.1971`, 0.5711`, 0.1451`, 0.5669`, 0.2311`, 0.0439`, -0.3999`, 0.0932`, 0.119`, 0.5752`, 0.2319`, 0.6899`, 0.2628`, 0.0757`, 0.1406`, 0.4465`, 0.8156`, 0.11`, 0, 0, 0.05`, 0, 0, 0, 0.03`, 1.1`, 0, 0.01`, , ]);
q=DiagonalMatrix[{0.5,0.8,2,4}];r={{1}};
k=LQRegulatorGains[(Subscript[ssm, d]),{q,r}];
SystemsModelStateFeedbackConnect[(Subscript[ssm, d]),k]

OpenersExampleSection1(Spacer1)Scope  (15)

OpenersExampleSubsection0(Spacer1)Basic Uses  (10)

The closed-loop model of a system with state feedback:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[a, b, c, d, , , ]),{{k}}]

With positive state feedback:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[a, b, c, d, , , ]),{{k}},"Positive"]

The state feedback gains specified as a transfer-function model:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[8, 6, -4, -4, -2, 3, 2, 3, 0, , , ]),(TransferFunctionModelFull[-(95/2), -60, , , ])]

The gains specified as a state-space model:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[8, 6, -4, -4, -2, 3, 2, 3, 0, , , ]),(StateSpaceModelFull[-(95/2), -60, , , ])]

A affine state-space model with feedback specified in a vector:

SystemsModelStateFeedbackConnect[(AffineStateSpaceModelFull[a[(Subscript[x, 1])], b[(Subscript[x, 1])], c[(Subscript[x, 1])], 0, (Subscript[x, 1]), \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]),{k[(Subscript[x, 1])]}]

A nonlinear state-space model with feedback specified in a vector:

SystemsModelStateFeedbackConnect[(NonlinearStateSpaceModelFull[f[x,u], h[x,u], x, \[Null], \[Null], {u}Automatic, ]),{k[x,u]}]

Positive state feedback:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[27.5`, 24.6`, -1, -30, -26.5`, 1, -5, -4, 0, , , ]),{{4.59,-6.42}},"Positive"]

Only feedback to the first input:

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

SystemsModelStateFeedbackConnect[ssm,(({{-(67/2), (127/4), 18}})),{1,2,3},{1}]

Only feedback to the second input:

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

SystemsModelStateFeedbackConnect[ssm,(({{364, (467/2), (1025/2)}})),{1,2,3},{2}]

Connect the second state to the first input through a feedback system:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[(Subscript[a, 11]), (Subscript[a, 12]), (Subscript[b, 11]), (Subscript[b, 12]), (Subscript[a, 21]), (Subscript[a, 22]), (Subscript[b, 21]), (Subscript[b, 22]), (Subscript[c, 11]), (Subscript[c, 12]), 0, 0, (Subscript[c, 21]), (Subscript[c, 22]), 0, 0, , , ]),(StateSpaceModelFull[(Subscript[α, 11]), (Subscript[α, 12]), (Subscript[β, 11]), (Subscript[β, 12]), (Subscript[α, 21]), (Subscript[α, 22]), (Subscript[β, 21]), (Subscript[β, 22]), (Subscript[γ, 11]), (Subscript[γ, 12]), 0, 0, , , ]),{2},{1}]

The closed-loop model of a multiple-input system:

ssm=(StateSpaceModelFull[0, -1, -2, 0, -2, -2, -1, 0, 0, 1, 2, 2, 3, 1, 1, 1, 2, 1, 0, 0, , , ]);
k=StateFeedbackGains[ssm,{-4.+2 I,-4.-2 I,-8.}]

SystemsModelStateFeedbackConnect[ssm,k]

OpenersExampleSubsection1(Spacer1)System Types  (5)

Connect two (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]) systems:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[a, b, c, d, , , ]),(StateSpaceModelFull[α, β, γ, ρ, , , ])]

With delays:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[a+(SystemsModelDelay[(Subscript[τ, 1])]), b, c, d, , , ]),(StateSpaceModelFull[α+(SystemsModelDelay[(Subscript[τ, 2])]), β, γ, ρ, , , ])]

Using descriptor state-space models:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[e, a, b, c, d, , , ]),(StateSpaceModelFull[η, α, β, γ, ρ, , , ])]

Input linear (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]) systems:

SystemsModelStateFeedbackConnect[(AffineStateSpaceModelFull[a[(Subscript[x, 1])], b[(Subscript[x, 1])], c[(Subscript[x, 1])], 0, (Subscript[x, 1]), \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]),(AffineStateSpaceModelFull[α[(Subscript[x, 2])], β[(Subscript[x, 2])], γ[(Subscript[x, 2])], 0, (Subscript[x, 2]), \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ])]

General nonlinear (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]) systems:

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

Connecting a standard linear system and an input linear system will give an affine model:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[a, b, c, d, , , ]),(AffineStateSpaceModelFull[α[x], β[x], γ[x], 0, x, \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ])]

Connecting standard linear or affine system with a nonlinear system gives a nonlinear model:

SystemsModelStateFeedbackConnect[(StateSpaceModelFull[a, b, c, d, , , ]),(NonlinearStateSpaceModelFull[f[x,u], h[x,u], x, \[Null], \[Null], {u}Automatic, ])]

SystemsModelStateFeedbackConnect[(AffineStateSpaceModelFull[a[x], b[x], c[x], d[x], x, \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]),(NonlinearStateSpaceModelFull[f[x,u], h[x,u], x, \[Null], \[Null], {u}Automatic, ])]

OpenersExampleSection3(Spacer1)Applications  (3)

The linearized inverted pendulum model is unstable:

pendulum=(StateSpaceModelFull[0, 1, 0, 0, 0, ((g (m+M))/(l M)), 0, 0, 0, -(1/(l M)), 0, 0, 0, 1, 0, -((g m)/M), 0, 0, 0, (1/M), 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, , , ])/.{g->9.8, m->1, M->10,l->5};
StateResponse[{pendulum,{.01,0,0,0}}, 0,{t,0,5}];
Plot[%,{t,0,5}]

Calculate a gain matrix to place the closed-loop poles in the left half-plane:

k=StateFeedbackGains[pendulum,{-0.2,-0.5,-5,-8.67}]

Find the closed-loop system:

closedloop=SystemsModelStateFeedbackConnect[pendulum,k]

The closed-loop response is stable:

StateResponse[{closedloop,{.01,0,0,0}}, 0,{t,0,5}];
Plot[%,{t,0,5}]

Calculate a gain matrix to optimize a quadratic cost function of the input and the states:

ssm=(StateSpaceModelFull[0, 1, 0, 0, 0, 0, 1, 0, 0, -2, -3, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, , , ]);
k=LQRegulatorGains[ssm,{(({{100, 0, 0}, {0, 1, 0}, {0, 0, 1}})),(({{0.01`}}))}]

Find the closed-loop system:

SystemsModelStateFeedbackConnect[ssm,k]

Calculate a gain matrix to optimize a quadratic cost function of the input and the outputs:

ssm=(StateSpaceModelFull[0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, -0.12`, 0, -0.8`, 0, 1, 0, 0, -0.12`, 0, -0.8`, 0, 1, -0.54`, 0.6`, -2.7`, 1, 3, 0, 0.5`, , ]);
k=LQOutputRegulatorGains[ssm,{{{0.05}},DiagonalMatrix[{2,2}]}];

Find the closed-loop system:

SystemsModelStateFeedbackConnect[ssm,k]

OpenersExampleSection4(Spacer1)Properties & Relations  (1)

A model where the output matrix is identity and the direct transmission matrix is zero:

ssm=StateSpaceModel[{RandomReal[5,{2,2}],RandomReal[5,{2,1}],IdentityMatrix[2]}]

(RefLink[SystemsModelStateFeedbackConnect, paclet:ref/SystemsModelStateFeedbackConnect]) and (RefLink[SystemsModelFeedbackConnect, paclet:ref/SystemsModelFeedbackConnect]) are equivalent:

{SystemsModelStateFeedbackConnect[ssm,{{(Subscript[k, 1]),(Subscript[k, 2])}}],SystemsModelFeedbackConnect[ssm,TransferFunctionModel[{{(Subscript[k, 1]),(Subscript[k, 2])}}]]}

Subtract@@(Normal/@ %)

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[SystemsModelFeedbackConnect, paclet:ref/SystemsModelFeedbackConnect])  ▪  (RefLink[StateFeedbackGains, paclet:ref/StateFeedbackGains])  ▪  (RefLink[LQRegulatorGains, paclet:ref/LQRegulatorGains])}})}})

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