Hello,
after working with Gurobi and Mixed integer linear programming (MILP) in Matlab for a few month I have to use mixed integer quadratic programing now.
While working on a first, simple project I get the error: "Q matrix is not positive semi-definite (PSD)" .
The quadratic constraint causing this problem is a simple multiplication of two variables (P = U*I) .
My code to create the matrices looks like that:
for i = 1:n
model.quadcon(i).Qc = sparse(zeros(n*leng,n*leng));
model.quadcon(i).Qc(i, n+i) = 0.5;
model.quadcon(i).Qc((n+i, i) = 0.5;
model.quadcon(i).q = zeros(1,leng);
model.quadcon(i).q(2*n+i) = -1;
model.quadcon(i).rhs(1:n) = 0;
end
I'm looking for a solution to this problem for some time now, but even though it looks like an easy task, I can't come up with a solution to turn this matrix postive semi-definite.
Is there any way I can solve this problem?
Thanks,
Michael