Hard constraint bounds for non linear constraints in MPC
1 view (last 30 days)
Show older comments
The Custom Constraint Fcn file in MPC toolbox enables us to give nonlinear constraints to the optimizer. The function is as follows:
function [C, Ceq, dCdy, dCdu, dCddu, dCdslack, dCeqdy, dCeqdu, dCeqddu, dCeqdslack] = mpcCustomConstraintFcn (y, yref, u, uref, du, v, slack)
However, these constraints are soft constrains by default. Any idea on how to make them hard constraints?
2 Comments
John D'Errico
on 1 Sep 2018
Typically most tools in MATLAB, or any language that works in floating point arithmetic, must allow a small amount of slop, a tolerance constraint, wherein the constraint may actually be exceeded by a small amount that is less than the tolerance. Much of the time, that excess is tiny, on the order of floating point trash.
A problem arises when your equations are ill-conditioned. Then the slop becomes magnified, and difficult to maintain the desired limits.
However, does your use of the word hard bounds mean that you wish to do more than that? Do you want to see strict inequalities, thus of the form C(X)>0, as opposed to C(X)>=0?
As I said above, floating point trash can get into all numerical computations done with floating point arithmetic. So asking for s strict inequality is quite difficult to do. Even asking for a solution that strictly obeys a nonlinear inequality of the form C(X)>=0, with no tolerance allowed for exceeding the bound is difficult.
Answers (0)
See Also
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!