Input and State Constraints in MPC problem solved by quadprog
Show older comments
I'm working on a model predictive control problem in which there are constraints both on the input of the system and on the state variables. Since solvers like quadprog or mpcActiveSetSolve deal with the problem J = x'Hx + F'x, allowing to specify constraints only for the x variable (A*x <= b or the equality ones), which is in my case the input of the system for all the steps of the horizon (u bar as in the Cost_Function_LA.png), I don't know how to specify to the solver the constraints I put on the variables of the state.
Answers (1)
Altaïr
on 4 Oct 2024
0 votes
Hi Angelo,
The following procedure can be used to convert the state constraints into input constraints.
Consider the discrete-time state-space system
with
states, where
is the state vector and
is the input vector. Let the state constraints be
. If N is the prediction horizon, the predicted states can be concatenated into a single matrix given by,
states, where 
Where:
is equal to the initial state
.- X and U are concatenated vectors,
and
. - Φ is constructed as:
. - Γ is constructed as:
.
On concatenating the state constraint relations at each time step and substituting
, one may obtain the following inequality:
, one may obtain the following inequality:Where,
The above equation can be rearranged to obtain an input constraint relation.

The above relation is in the general form of inequality constraints,
. The equivalent matrices for
and
can be identified to be,
. The equivalent matrices for
and
can be identified to be,

You can refer to the attached MATLAB script for further assistance. To learn more about MPC matrices you can refer the following documentation page.
I hope this resolves your query!
Categories
Find more on Controller Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
