Soften hard constraints in MPC formulated as a QP-problem
6 次查看(过去 30 天)
显示 更早的评论
I have problems introducing a slack variable to soften some constraints I have on the states. I use QUADPROG to solve the problem which is written in the form
min 0.5x'Hx
S.t Aeq*x = beq
lb <= x <=ub
The vector x contains 3 states z1, z2 and z3 as well as the the calculated control input u. For instance, for prediction horizon 1 the vector will have 4 rows, for prediction horizon 2 it will grow to 8 etc. Now I have constraints on the input varible which I put in the vectors lb and ub. Everything works fine until I introduce constraints on the states. These are hard inequality constraints. As expected the problem becomes infeasible so I would need to relax them. Therein lies the issue, I do not know how to modify the setup in order to incorporate a slack variable.
I understand that the state vector has to be expanded by adding an extra variable s => 0 preferably in the end. Consequently I have to increase the size of H by 1, so the last diagonal element will be the weight on the slack varible which of course should be heavily penalized. Now if I would like to soften the constraint on the first state z1 I need to modify the first entry in ub and lb by adding the slack variable s.
So far I have only modified H as mentioned above but I do not know how to continue with the vectors ub and lb, which I assume also have to be modified in some way.
Thank you in advance for any advice!
0 个评论
回答(2 个)
Anton Semechko
2018-6-12
You could try using 'fmincon' instead of 'quadprog', which would allow you to incorporate non-linear constraints on your state variables in terms of barrier functions.
0 个评论
Ahmed Hatem
2018-6-12
2 个评论
Anton Semechko
2018-6-12
You make a good point. Using 'fmincon' was a bad suggestion on my part. There is pretty good tutorial on YouTube explaining how to convert the inequality constraints into equality constraints with slack variables. I am not sure if that will help, as it is a something that may already be done internally when calling 'quadprog'.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!