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`

.
(u-1).k |

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,

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}; r; v]* to

sys = ss(MPCobj,'rv');

In the general case of nonzero offsets, *y*_{m} (as
well as * r*,

`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:

— Maximum length of previewed inputs, that is,*h*`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?