Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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) = *A**x*(*k*)
+ *B**y _{m}*(

*u*(*k*)
= *C**x*(*k*) + *D**y _{m}*(

where *y _{m}* is the vector
of measured outputs of the plant, and

`sys`

is `MPCobj.Ts`

.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) = *A**x*(*k*)
+ *B**y _{m}*(

*u*(*k*)
= *C**x*(*k*) + *D**y _{m}*(

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 character vector or
string with any combination that contains one or more of the following
charcters:

`'r'`

— Output references

`'v'`

— Measured disturbances

`'o'`

— Offset terms

`'t'`

— Input targets

For example, to obtain a controller that maps [*y _{m}*;

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

*x*(*k* +
1) = *A**x*(*k*)
+ *B**y _{m}*(

*u*(*k*)
= *C**x*(*k*) + *D**y _{m}*(

Similarly if the flag `md_preview='on'`

, then
matrices *B _{v}* and

*x*(*k* +
1) = *A**x*(*k*)
+...+ *B _{v}*[

*u*(*k*)
= *C**x*(*k*) +...+ *D _{v}*[

`[`

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`

Was this topic helpful?