Model Predictive Control custom constraint definitions
[E,F,G,V,S]
= getconstraint(mpcobj)
[
returns the
custom constraints previously defined for the E
,F
,G
,V
,S
]
= getconstraint(mpcobj
)mpc
object, mpcobj
.
The constraints are in the general form
$$Eu(k+j)+Fy(k+j)+Sv(k+j)\le G+\epsilon V$$  (11) 
where:
j = 0,...,p.
p — MPC prediction horizon.
k — current time index.
u — column vector of manipulated variables.
y — column vector of all plant output variables.
v — column vector of measured disturbance variables.
ε — scalar slack variable used for constraint softening.
E, F, G, V and S — constant matrices.
getconstraint
calculates the last constraint
at time k+p
assuming
that u(k+pk)
= u(k+p1k)
.
This is because u(k+pk)
is
not optimized by the model predictive controller.

MPC controller, specified as an 

Constant used in custom constraints as defined in Equation 11.


Constant used in custom constraints as defined in Equation 11.


Constant used in custom constraints as defined in Equation 11.


Constant used in custom constraints as defined in Equation 11.
If


Constant used in custom constraints as defined in Equation 11.

Obtain the constraints associated with an MPC controller.
Create an mpc
object with
2 manipulated variables and 2 measured outputs.
p = rss(3,2,3); p.D = 0; p = setmpcsignals(p,'mv',[1 2],'md',3); c = mpc(p,0.1);
Assume that you have two soft constraints.
$$\begin{array}{l}{u}_{1}+{u}_{2}\le 5\\ {y}_{2}+v\le 10\end{array}$$
Set the constraints for the mpc
object.
E = [1 1; 0 0]; F = [0 0;0 1]; G = [5;10]; V = [1;1]; S = [0;1]; setconstraint(c,E,F,G,V,S);
Obtain the constraints for c
.
[E F G V S] = getconstraint(c) E = 1 1 0 0 F = 0 0 0 1 G = 5 10 V = 1 1 S = 0 1