Quadratic Constraints not working

39 views
Skip to first unread message

Marc PR

unread,
Jun 5, 2019, 11:15:42 PM6/5/19
to YALMIP
Hello,

I have been working with MPC for a while, using only linear constraints, and everything has been working fine. However, now I want to add some quadratic constraints to the problem and, even though the solver is able to find a solution, the constraints are not fulfilled.
The quadratic constraints represent distances between two points and look like this:


I've seen in some other posts that Prof. Löfberg advices to change some of the variables to make it easier, I've done it, but the problem persists.
In this case the equality constraint is not fulfilled, z12 is always 0.0325 even though x_h is always changing.

I would appreciate some help to be able to solve this.
Thank you very much!

Best regards,
Marc

Johan Löfberg

unread,
Jun 6, 2019, 2:23:27 AM6/6/19
to YALMIP
The models you show are nonconvex and very hard. Gurobi is not applicable

Not sure about the reformulation you are trying to do. Makes no difference. The typical reformulation you do is that you replace dense quadratic terms (Ax+b)'*(Ax+b) with z'*z where z is a new decision variable, , and the equality constraint z == Ax + b. That way, the quadratic is sparse (only z_i^2 terms, no z_iz_j)

Marc PR

unread,
Jun 7, 2019, 12:38:34 AM6/7/19
to YALMIP
Thank you very much for your response!

Should I try another solver then? I tried to use bmibnb but it's not working... all states go to NaN.

Thank you!

Johan Löfberg

unread,
Jun 7, 2019, 2:54:29 AM6/7/19
to YALMIP
you would have to post reproducible code for any clear answer. We don't know what happened when you used bmibnb (infeasible, unbounded, crash, iteration limit...)

bmibnb would be one of very few (global) options. As I said, you have a typically intractable problem
Reply all
Reply to author
Forward
0 new messages