NAN solution found using gurobi solver

43 views
Skip to first unread message

XWK

unread,
Apr 13, 2020, 3:00:44 PM4/13/20
to YALMIP
Hi everyone,

I am trying to find the solution of a zonotope containment problem. In this field, I used to solve by using CVX toolbox, but in this case, the cost is concave. In the paper I read, they use YALMIP to formulate the problem and then solved by gurobi.

My test code is shown here.

G1 = [5 2 1;3 -1 2];

c1 = [0;0];

G2 = [1 0.2 0.5;-0.3 -0.1 0.3];

c2 = [0;0];


[n,n1] = size(G1);

[n,n2] = size(G2);

Gd = [G1 G2];

[n,nd] = size(Gd);


x = sdpvar(nd,1);

Phi = diag(x);

cdd = sdpvar(n,1);

Gamma = sdpvar(n1,nd+n2);

Beta = sdpvar(n2,1);

objective = norm(Phi);

constraints = [Phi >= 0, [Gd*Phi,G2] == G1*Gamma,c1-(cdd+c2) == G1*Beta, abs(Gamma)*ones(nd+n2,1)+abs(Beta) <= ones(n1,1)];

options = sdpsettings('solver','gurobi');

optimize(constraints,-objective,options);

 

Phi = value(Phi);

Gamma = value(Gamma);


The solution of matrix Phi is 


NaN     0     0     0     0     0

     0   NaN     0     0     0     0

     0     0   NaN     0     0     0

     0     0     0   NaN     0     0

     0     0     0     0   NaN     0

     0     0     0     0     0   NaN


Thanks so much for your help

Johan Löfberg

unread,
Apr 14, 2020, 1:00:37 AM4/14/20
to YALMIP
You are trying to maximize a matrix 2-norm. That is not MISOCP-rpresentable. You have to change the norm to something which is 1-norm or inf-norm representable (or use a squared frobenius norm to have a quadratic, and then use a global nonlinear mixed-integer solver, i.e. it does not get any worse in terms of hardness but bmibnb and baron would be applicable at least))

Also, Phi is symmetric hence Phi>=0 is a semidefinite constraint. That is silly to use though (as it is a much harder problem), when it really is a linear cone x>=0 you have

Mark L. Stone

unread,
Apr 14, 2020, 8:27:08 AM4/14/20
to YALMIP
If the norm is really intended to be the matrix (operator) two-norm, as written, then norm(Phi) = max(x), because Phi is diagonal. So the problem is, the non-convex, minimize(-max(x)) , subject to constraints.
Reply all
Reply to author
Forward
0 new messages