Note: This page has been translated by MathWorks. Click here to see

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

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

Set mixed input/output constraints for model predictive controller

`setconstraint(MPCobj,E,F,G)`

`setconstraint(MPCobj,E,F,G,V)`

`setconstraint(MPCobj,E,F,G,V,S)`

`setconstraint(MPCobj)`

`setconstraint(`

specifies mixed input/output constraints of the following form for the MPC controller,
`MPCobj`

,`E`

,`F`

,`G`

)`MPCobj`

:

*E**u*(*k* +
*j*|*k*) +
*F**y*(*k* +
*j*|*k*) ≤ *G* +
*ε*

*p*is the prediction horizon.*k*is the current time index.*E*,*F*, and*G*are constant matrices. Each row of*E*,*F*, and*G*represents a linear constraint to be imposed at each prediction horizon step.*u*is a column vector of manipulated variables.*y*is a column vector of all plant output variables.*ε*is a slack variable used for constraint softening (as in Standard Cost Function).

The outputs,

*y*, are being predicted using a model. If the model is imperfect, there is no guarantee that a constraint can be satisfied.Since the MPC controller does not optimize

*u*(*k*+*p*|*k*), the last constraint at time*k*+*p*assumes that*u*(*k*+*p*|*k*) =*u*(*k*+*p*–1|*k*).When simulating an MPC controller, you can update the

`E`

,`F`

,`G`

, and`S`

constraint arrays at run time. For more information, see Update Constraints at Run Time.