quadratic constrained quadratic programming MATLAB

577 views
Skip to first unread message

Yan

unread,
Aug 6, 2013, 3:18:26 PM8/6/13
to gur...@googlegroups.com
Hello all,

I am trying to use Gurobi to solve my quadratic constrained quadratic programming problem. Code 'qptest2.m' is attached here. I am working on fedora19(64 bits), MATLAB 2012a, and Gurobi 5.5.

The objective function is quadratic with four variables, and one quadratic equality constraint. I ran the script with preloaded data 'test1.mat' (attached also), however it said
-----------------------------------
Error using gurobi
Gurobi error 10020: Q matrix is not positive semi-definite (PSD)
-----------------------------------
I check the Q matrix with svd to see the singular values, they all are positive, I have no idea why Gurobi think it's not PSD.

By the way, how to set the constraint to be quadratic only in the better way(using parameters), now I am setting A and b to be zero, and sense = '='.

Lastly, how to provide (do I need to provide) an initial guess (starting point) to the problem. If yes, how to do it.

Thanks a lot!

Yan
qptest2.m
test1.mat

Yan

unread,
Aug 6, 2013, 5:00:38 PM8/6/13
to gur...@googlegroups.com
I noticed that my equality quadratic constrain matrix Qc is not positively semi-define (a1*a2+a3*a4=0).

Jakob Sch.

unread,
Aug 7, 2013, 3:31:37 AM8/7/13
to gur...@googlegroups.com
Hi Yan,

gurobi can only handle convex quadratic contraints of the form
  • x'Qx + q'x <= b, where Q is Positive Semi-Definite (PSD)
  • x'x <= y^2, where x is a vector of variables, and y is a non-negative variable (a Second-Order Cone)
  • x'x <= y z, where x is a vector of variables, and y and z are non-negative variables (a rotated Second-Order Cone)
(see http://www.gurobi.com/documentation/5.5/reference-manual/node557). Equalityconstraint involving quadratic terms are not allowed (since they are not convex!).

Best regards,
Jakob

BC

unread,
Aug 7, 2013, 4:56:37 AM8/7/13
to gur...@googlegroups.com
Yan,

A quick comment that PSD requires all of your eigenvalues to be non-negative - the singular values are always non-negative by definition.

BC

Yan

unread,
Aug 7, 2013, 1:13:14 PM8/7/13
to gur...@googlegroups.com
To Jakob, unfortunately the quadratic constraint is not convex.

To BC, thank to the headup, I checked again the 'eig'.

Thanks a lot!!
Reply all
Reply to author
Forward
0 new messages