How to specify time varying constraints(linear combination of input/output variables) using MPC Toolbox?

3 次查看(过去 30 天)
To clarify the issue: I am working on designing a linear MPC controller. Ideally, I would like to speficy constraints that vary over the prediction horizon.
I know this is possible for simple lower and upper bounds on inputs/outputs (see: https://de.mathworks.com/help/mpc/ug/time-varying-weights-and-constraints.html ), atleast within MPC Designer. I also know that constraints(linear combination of input/output variables) can vary inbetween the solution cycle/at run-time (See: https://de.mathworks.com/help/mpc/ug/run-time-constraint-updating.html ). However, as of today, I could not find any way to vary linear combinations of input/output variables for linear MPC over the prediction horizon.
Is there a way to achieve what I am looking for?
Thanks in advance.

回答(2 个)

Kothuri
Kothuri 2024-6-21
To vary the linear combinations of input/output variables over the prediction horizon, you can try NonLinearMPC Design which offers a greater flexibility in defining the constraints.
Below are the documentation links for more information on Non-Linear MPC Design
  1 个评论
Benedikt Schmidt
Benedikt Schmidt 2024-6-21
Hi Kothuri,
I know that it is possible with Nonlinear MPC, but Nonlinear MPC requires way more computational resources than linear MPC. Nevertheless, I found a workaround to avoid the issue of having to specify constraints that vary over the prediction horizon entirely.
But for anybody else having the same question as me: For linear MPC, there is no way to vary the matrices E, F, G, V and S over the prediction horizon (See: https://de.mathworks.com/help/mpc/ref/mpc.setconstraint.html ). To do that you need Nonlinear MPC, like Kothuri mentioned. What can however vary over the prediction horizon are the input/output/disturbance variables. So, if you have e.g. disturbance variables for which you know in advance what values they will take for future time steps, you can use Signal Previewing (See: https://de.mathworks.com/help/mpc/ug/improve-control-performance-with-look-ahead.html ). If you use previewing for a disturbance variable, the respective variable will vary over the prediction horizon. If you specified a constraint using setconstraint and the S matrix is not a zero matrix, than you get constraints, that vary over the prediction horizon (because of the previewing for that disturbance variable).
In short, you can not vary E, F, G, V or S matrices, but by using Signal Previewing, it's still possible to get constraints( i.e. linear combinations of input/output/disturbance variables) which vary over the prediction horizon.
That beeing said, the above idea (Signal Previewing + setconstraint) to create constraints that vary over the prediction horizon lead to numerical instability, which was caused by the Previewing (atleast I think so). Most of the solutions I got this way were infeasible. I resolved the issue by adding a new state to my state space model which represents the constraint that I want to enforce. For the new state I specified hard lower/upper bounds. So essentially I introduced a slack variable. This worked like a charm even which previewing enabled. Hope this gives people with the same issue some ideas on what to try.

请先登录,再进行评论。


Jordan Olson
Jordan Olson 2024-6-24
Hello Benedikt,
The simplest way to implement time-varying constraints for a nonlinear MPC is to use a multistage nonlinear MPC. This is essentially a special formulation of the standard nonlinear MPC where you can explicitly specify the cost and constraint functions separately for each stage from k to , p being the prediction horizon. For more information, please see the following:
  1 个评论
Benedikt Schmidt
Benedikt Schmidt 2024-6-24
Hi Jordan,
thanks for the answer. I should have specified in the initial question, that what I was looking for was specifically intended for linear MPC. My bad. Nevertheless, my original problem was resolved.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Refinement 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by