Convert unconstrained MPC controller to state-space linear system
sys = ss(MPCobj)
sys = ss(MPCobj,signals)
sys = ss(MPCobj,signals,ref_preview,md_preview)
[sys,ut]
= ss(MPCobj)
The ss
command returns a linear controller
in the state-space form. The controller is equivalent to the traditional
(implicit) MPC controller MPCobj
when no constraints
are active. You can then use Control System Toolbox™ software for
sensitivity analysis and other diagnostic calculations.
returns
the linear discrete-time dynamic controller sys
= ss(MPCobj
)sys
x(k + 1) = Ax(k) + By_{m}(k)
u(k) = Cx(k) + Dy_{m}(k)
where y_{m} is the vector
of measured outputs of the plant, and u is the
vector of manipulated variables. The sampling time of controller sys
is MPCobj.Ts
.
Note Vector x includes the states of the observer (plant + disturbance + noise model states) and the previous manipulated variable u(k-1). |
returns
the linearized MPC controller in its full form and allows you to specify
the signals that you want to include as inputs for sys
= ss(MPCobj
,signals
)sys
.
The full form of the MPC controller has the following structure:
x(k + 1) = Ax(k) + By_{m}(k) + B_{r}r(k) + B_{v}v(k) + B_{ut}u_{target}(k) + B_{off}
u(k) = Cx(k) + Dy_{m}(k) + D_{r}r(k) + D_{v}v(k) + D_{ut}u_{target}(k) + D_{off}
Here, r is the vector of setpoints for both measured and unmeasured plant outputs, v is the vector of measured disturbances, u_{target} is the vector of preferred values for manipulated variables.
Specify signals
as a single-character or
multicharacter vector constructed using any of the following:
'r'
— Output references
'v'
— Measured disturbances
'o'
— Offset terms
't'
— Input targets
For example, to obtain a controller that maps [y_{m}; r; v] to u, use:
sys = ss(MPCobj,'rv');
In the general case of nonzero offsets, y_{m} (as
well as r, v, and u_{target})
must be interpreted as the difference between the vector and the corresponding
offset. Offsets can be nonzero is MPCobj.Model.Nominal.Y
or MPCobj.Model.Nominal.U
are
nonzero.
Vectors B_{off}, D_{off} are
constant terms. They are nonzero if and only if MPCobj.Model.Nominal.DX
is
nonzero (continuous-time prediction models), or MPCobj.Model.Nominal.Dx
-MPCobj.Model.Nominal.X
is
nonzero (discrete-time prediction models). In other words, when Nominal.X
represents
an equilibrium state, B_{off}, D_{off} are
zero.
Only the following fields of MPCobj
are used
when computing the state-space model: Model
, PredictionHorizon
, ControlHorizon
, Ts
, Weights
.
specifies
if the MPC controller has preview actions on the reference and measured
disturbance signals. If the flag sys
= ss(MPCobj
,signals
,ref_preview
,md_preview
)ref_preview='on'
,
then matrices B_{r} and D_{r} multiply
the whole reference sequence:
x(k + 1) = Ax(k) + By_{m}(k) + B_{r}[r(k);r(k + 1);...;r(k + p – 1)] +...
u(k) = Cx(k) + Dy_{m}(k) + D_{r}[r(k);r(k + 1);...;r(k + p– 1)] +...
Similarly if the flag md_preview='on'
, then
matrices B_{v} and D_{v} multiply
the whole measured disturbance sequence:
x(k + 1) = Ax(k) +...+ B_{v}[v(k);v(k + 1);...;v(k + p)] +...
u(k) = Cx(k) +...+ D_{v}[v(k);v(k + 1);...;v(k + p)] +...
[
additionally returns
the input target values for the full form of the controller. sys
,ut
]
= ss(MPCobj
)
ut
is returned as a vector of doubles, [utarget(k);
utarget(k+1); ... utarget(k+h)]
.
Here:
h — Maximum length of previewed
inputs, that is, h = max(length(MPCobj.ManipulatedVariables(:).Target))
utarget
— Difference between
the input target and corresponding input offsets, that is, MPCobj.ManipulatedVariables(:).Targets
- MPCobj.Model.Nominal.U