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.
SystemsModelStateFeedbackConnect[sys,con,{s1,…},{{in1,ftype1},…}]
connects state si of sys to the i
input of con and the j
output of con to input inj of sys with feedback type ftypej
SystemsModelStateFeedbackConnect
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.
SystemsModelStateFeedbackConnect[sys,con,{s1,…},{{in1,ftype1},…}]
connects state si of sys to the i
input of con and the j
output of con to input inj of sys with feedback type ftypej
Details
- The systems model sys can be a StateSpaceModel, AffineStateSpaceModel, or NonlinearStateSpaceModel.
- The controller con can be a gain matrix, a vector, StateSpaceModel, TransferFunctionModel, AffineStateSpaceModel, or NonlinearStateSpaceModel.
- StateFeedbackGains, LQRegulatorGains, DiscreteLQRegulatorGains, AsymptoticOutputTracker, and FullInformationOutputRegulator return state-feedback controllers as matrices or vectors.
Examples
open all close allBasic Examples (3)
Determine the closed-loop model of a state-feedback system:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{Subscript[a, 1], Subscript[a, 2]},
{Subscript[a, 3], Subscript[a, 4]}},
{{Subscript[b, 1]}, {Subscript[b, 2]}},
{{Subscript[c, 1], Subscript[c, 2]}}, {{0}}}, SamplingPeriod -> None,
SystemsModelLabels -> None], {{Subscript[k, 1], Subscript[k, 2]}}]Compute the feedback gains to place the poles at z1 and z2 for a discrete-time system:
ssm = StateSpaceModel[{{{1, T}, {0, 1}}, {{T^2/2}, {T}}, {{1, 0}},
{{0}}}, SamplingPeriod -> T, SystemsModelLabels -> None];
k = StateFeedbackGains[ssm, {Subscript[z, 1], Subscript[z, 2]}]Determine the closed-loop model:
SystemsModelStateFeedbackConnect[ssm, k]Eigenvalues[Normal[%][[1]]]Determine the closed-loop model with a set of optimal state feedback gains:
Subscript[ssm, d] = StateSpaceModel[{{{0.4725, 0.2376, 0.0589, 0.1971}, {0.1451, 0.5669, 0.2311, 0.0439},
{0.0932, 0.119, 0.5752, 0.2319}, {0.2628, 0.0757, 0.1406, 0.4465}},
{{0.5711}, {-0.3999}, {0.6899}, {0.8156}}, {{0.11, 0, 0, 0.05}, {0, 0, 0.03, 1.1}}, {{0}, {0}}},
SamplingPeriod -> 0.01, SystemsModelLabels -> None];
q = DiagonalMatrix[{0.5, 0.8, 2, 4}];r = {{1}};
k = LQRegulatorGains[Subscript[ssm, d], {q, r}];
SystemsModelStateFeedbackConnect[Subscript[ssm, d], k]Scope (15)
Basic Uses (10)
The closed-loop model of a system with state feedback:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{a}}, {{b}}, {{c}}, {{d}}},
SamplingPeriod -> None, SystemsModelLabels -> None], {{k}}]SystemsModelStateFeedbackConnect[StateSpaceModel[{{{a}}, {{b}}, {{c}}, {{d}}},
SamplingPeriod -> None, SystemsModelLabels -> None], {{k}}, "Positive"]The state feedback gains specified as a transfer-function model:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{8, 6}, {-4, -2}}, {{-4}, {3}}, {{2, 3}}, {{0}}}, SamplingPeriod -> None,
SystemsModelLabels -> None], TransferFunctionModel[{{{-95/2, -60}}, 1}, ]]The gains specified as a state-space model:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{8, 6}, {-4, -2}}, {{-4}, {3}}, {{2, 3}}, {{0}}}, SamplingPeriod -> None,
SystemsModelLabels -> None], StateSpaceModel[{{}, {}, {}, {{-95/2, -60}}}, SamplingPeriod -> None, SystemsModelLabels -> None]]A affine state-space model with feedback specified in a vector:
SystemsModelStateFeedbackConnect[AffineStateSpaceModel[{{a[Subscript[x, 1]]},
{{b[Subscript[x, 1]]}}, {c[Subscript[x, 1]]},
{{0}}}, {Subscript[x, 1]}, {Subscript[, 1]}, {Automatic}, Automatic,
SamplingPeriod -> None], {k[Subscript[x, 1]]}]A nonlinear state-space model with feedback specified in a vector:
SystemsModelStateFeedbackConnect[NonlinearStateSpaceModel[{{f[x, u]},
{h[x, u]}}, {x}, {u},
{Automatic}, Automatic, SamplingPeriod -> None], {k[x, u]}]SystemsModelStateFeedbackConnect[StateSpaceModel[{{{27.5, 24.6}, {-30, -26.5}}, {{-1}, {1}}, {{-5, -4}}, {{0}}},
SamplingPeriod -> None, SystemsModelLabels -> None], {{4.59, -6.42}}, "Positive"]Only feedback to the first input:
ssm = StateSpaceModel[{{{0, -1, -2}, {-2, -1, 0}, {2, 2, 3}}, {{0, -2}, {0, 1}, {1, 1}}, {{1, 2, 1}},
{{0, 0}}}, SamplingPeriod -> None, SystemsModelLabels -> None];SystemsModelStateFeedbackConnect[ssm, (-(67/2) (127/4) 18), {1, 2, 3}, {1}]Only feedback to the second input:
ssm = StateSpaceModel[{{{0, -1, -2}, {-2, -1, 0}, {2, 2, 3}}, {{0, -2}, {0, 1}, {1, 1}}, {{1, 2, 1}},
{{0, 0}}}, SamplingPeriod -> None, SystemsModelLabels -> None];SystemsModelStateFeedbackConnect[ssm, (364 (467/2) (1025/2)), {1, 2, 3}, {2}]Connect the second state to the first input through a feedback system:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{Subscript[a, 11], Subscript[a, 12]},
{Subscript[a, 21], Subscript[a, 22]}},
{{Subscript[b, 11], Subscript[b, 12]},
{Subscript[b, 21], Subscript[b, 22]}},
{{Subscript[c, 11], Subscript[c, 12]},
{Subscript[c, 21], Subscript[c, 22]}}, {{0, 0}, {0, 0}}},
SamplingPeriod -> None, SystemsModelLabels -> None], StateSpaceModel[{{{Subscript[α, 11], Subscript[α, 12]},
{Subscript[α, 21], Subscript[α, 22]}},
{{Subscript[β, 11], Subscript[β, 12]},
{Subscript[β, 21], Subscript[β, 22]}},
{{Subscript[γ, 11], Subscript[γ, 12]}}, {{0, 0}}},
SamplingPeriod -> None, SystemsModelLabels -> None], {2}, {1}]The closed-loop model of a multiple-input system:
ssm = StateSpaceModel[{{{0, -1, -2}, {-2, -1, 0}, {2, 2, 3}}, {{0, -2}, {0, 1}, {1, 1}}, {{1, 2, 1}},
{{0, 0}}}, SamplingPeriod -> None, SystemsModelLabels -> None];
k = StateFeedbackGains[ssm, {-4. + 2 I, -4. - 2 I, -8.}]SystemsModelStateFeedbackConnect[ssm, k]System Types (5)
Connect two StateSpaceModel systems:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{a}}, {{b}}, {{c}}, {{d}}},
SamplingPeriod -> None, SystemsModelLabels -> None], StateSpaceModel[{{{α}}, {{β}}, {{γ}},
{{ρ}}}, SamplingPeriod -> None, SystemsModelLabels -> None]]SystemsModelStateFeedbackConnect[StateSpaceModel[{{{a + SystemsModelDelay[Subscript[τ, 1]]}},
{{b}}, {{c}}, {{d}}}, SamplingPeriod -> None,
SystemsModelLabels -> None], StateSpaceModel[{{{α + SystemsModelDelay[Subscript[τ, 2]]}},
{{β}}, {{γ}}, {{ρ}}}, SamplingPeriod -> None,
SystemsModelLabels -> None]]Using descriptor state-space models:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{a}}, {{b}}, {{c}}, {{d}},
{{e}}}, SamplingPeriod -> None, SystemsModelLabels -> None], StateSpaceModel[{{{α}}, {{β}}, {{γ}},
{{ρ}}, {{η}}}, SamplingPeriod -> None, SystemsModelLabels -> None]]Input linear AffineStateSpaceModel systems:
SystemsModelStateFeedbackConnect[AffineStateSpaceModel[{{a[Subscript[x, 1]]},
{{b[Subscript[x, 1]]}}, {c[Subscript[x, 1]]},
{{0}}}, {Subscript[x, 1]}, {Subscript[, 1]}, {Automatic}, Automatic,
SamplingPeriod -> None], AffineStateSpaceModel[{{α[Subscript[x, 2]]},
{{β[Subscript[x, 2]]}},
{γ[Subscript[x, 2]]}, {{0}}}, {Subscript[x, 2]},
{Subscript[, 1]}, {Automatic}, Automatic, SamplingPeriod -> None]]General nonlinear NonlinearStateSpaceModel systems:
SystemsModelStateFeedbackConnect[NonlinearStateSpaceModel[{{Subscript[f, 1][Subscript[x, 1],
Subscript[u, 1]]}, {Subscript[h, 1][Subscript[x, 1],
Subscript[u, 1]]}}, {Subscript[x, 1]},
{Subscript[u, 1]}, {Automatic}, Automatic, SamplingPeriod -> None], NonlinearStateSpaceModel[{{Subscript[f, 2][Subscript[x, 2],
Subscript[u, 2]]}, {Subscript[x, 2]}},
{Subscript[x, 2]}, {Subscript[u, 2]}, {Automatic}, Automatic,
SamplingPeriod -> None]]Connecting a standard linear system and an input linear system will give an affine model:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{a}}, {{b}}, {{c}}, {{d}}},
SamplingPeriod -> None, SystemsModelLabels -> None], AffineStateSpaceModel[{{α[x]}, {{β[x]}},
{γ[x]}, {{0}}}, {x}, {Subscript[, 1]}, {Automatic},
Automatic, SamplingPeriod -> None]]Connecting standard linear or affine system with a nonlinear system gives a nonlinear model:
SystemsModelStateFeedbackConnect[StateSpaceModel[{{{a}}, {{b}}, {{c}}, {{d}}},
SamplingPeriod -> None, SystemsModelLabels -> None], NonlinearStateSpaceModel[{{f[x, u]},
{h[x, u]}}, {x}, {u},
{Automatic}, Automatic, SamplingPeriod -> None]]SystemsModelStateFeedbackConnect[AffineStateSpaceModel[{{a[x]}, {{b[x]}},
{c[x]}, {{d[x]}}}, {x},
{Subscript[, 1]}, {Automatic}, Automatic, SamplingPeriod -> None], NonlinearStateSpaceModel[{{f[x, u]},
{h[x, u]}}, {x}, {u},
{Automatic}, Automatic, SamplingPeriod -> None]]Applications (3)
The linearized inverted pendulum model is unstable:
pendulum = StateSpaceModel[{{{0, 1, 0, 0}, {(g*(m + M))/
(l*M), 0, 0, 0}, {0, 0, 0, 1},
{(-g)*(m/M), 0, 0, 0}},
{{0}, {-l^(-1)/M}, {0}, {M^(-1)}},
{{1, 0, 0, 0}, {0, 0, 1, 0}}, {{0}, {0}}}, SamplingPeriod -> None, SystemsModelLabels -> None] /. {g -> 9.8, m -> 1, M -> 10, l -> 5};A plot of its unstable response:
StateResponse[{pendulum, {.01, 0, 0, 0}}, 0, {t, 0, 5}];
Plot[%, {t, 0, 5}]Compute a set of state feedback gains:
k = StateFeedbackGains[pendulum, {-0.2, -0.5, -5, -8.67}]csys = SystemsModelStateFeedbackConnect[pendulum, k]The closed-loop response is stable:
StateResponse[{csys, {.01, 0, 0, 0}}, 0, {t, 0, 15}];
Plot[%, {t, 0, 15}, PlotLayout -> "Column", PlotRange -> All]Calculate a gain matrix to optimize a quadratic cost function of the input and the states:
ssm = StateSpaceModel[{{{0, 1, 0}, {0, 0, 1}, {0, -2, -3}}, {{0}, {0}, {1}},
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, {{0}, {0}, {0}}}, SamplingPeriod -> None,
SystemsModelLabels -> None];
k = LQRegulatorGains[ssm, {(| | | |
| --- | - | - |
| 100 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |), (0.01)}]SystemsModelStateFeedbackConnect[ssm, k]Calculate a gain matrix to optimize a quadratic cost function of the input and the outputs:
ssm = StateSpaceModel[{{{0, 0, 1, 0}, {0, 0, 0, 1}, {-0.12, 0, -0.8, 0}, {0, -0.12, 0, -0.8}},
{{0, 0}, {0, 0}, {1, 0}, {0, 1}}, {{-0.54, 0.6, -2.7, 1}}, {{3, 0}}}, SamplingPeriod -> 0.5,
SystemsModelLabels -> None];
k = LQOutputRegulatorGains[ssm, {{{0.05}}, DiagonalMatrix[{2, 2}]}];SystemsModelStateFeedbackConnect[ssm, k]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]}]SystemsModelStateFeedbackConnect and SystemsModelFeedbackConnect are equivalent:
{SystemsModelStateFeedbackConnect[ssm, {{Subscript[k, 1], Subscript[k, 2]}}], SystemsModelFeedbackConnect[ssm, TransferFunctionModel[{{Subscript[k, 1], Subscript[k, 2]}}]]}Subtract@@(Normal /@ %)Related Guides
Text
Wolfram Research (2010), SystemsModelStateFeedbackConnect, Wolfram Language function, https://reference.wolfram.com/language/ref/SystemsModelStateFeedbackConnect.html (updated 2014).
CMS
Wolfram Language. 2010. "SystemsModelStateFeedbackConnect." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/SystemsModelStateFeedbackConnect.html.
APA
Wolfram Language. (2010). SystemsModelStateFeedbackConnect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SystemsModelStateFeedbackConnect.html
BibTeX
@misc{reference.wolfram_2026_systemsmodelstatefeedbackconnect, author="Wolfram Research", title="{SystemsModelStateFeedbackConnect}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/SystemsModelStateFeedbackConnect.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_systemsmodelstatefeedbackconnect, organization={Wolfram Research}, title={SystemsModelStateFeedbackConnect}, year={2014}, url={https://reference.wolfram.com/language/ref/SystemsModelStateFeedbackConnect.html}, note=[Accessed: 13-June-2026]}