Using Sedumi in Yalmip

586 views
Skip to first unread message

Paul

unread,
Mar 26, 2014, 6:15:04 PM3/26/14
to yal...@googlegroups.com
New to yalmip and I am using the following code to test how yalmip works to solve sdp problem:

P = sdpvar(3,3);

cons = [P >= 0,P(2,2)==1];
options = sdpsettings('Solver','Sedumi');
obj = [P(1,1)+P(1,3)];

solvesdp(cons,obj,options);

PP = double(P)
PP(1,1)+PP(2,3)

and the results are 


PP =

    1.2900    0.0000   -2.2900
    0.0000    0.0000    0.0000
   -2.2900    0.0000    5.8700


ans =

    1.2900


I am just too curious about the results, in the constraints, I have P(2,2)==1, however, in the results, PP(2,2)=5.87, which is not 1, why does this happen?? Anyone can help?

Mark L. Stone

unread,
Mar 26, 2014, 9:54:16 PM3/26/14
to yal...@googlegroups.com
The problem as written is unbounded, i.e., the optimal objective value is minus infinity.  You would benefit from using 'verbose',2 in sdpsettings.  And actually, not that it "helps", but your PP(2,2) is 0.000000000362895, which is not 1, but neither is it 5.87 (which is your PP(3,3)).

Johan Löfberg

unread,
Mar 27, 2014, 2:47:47 AM3/27/14
to yal...@googlegroups.com
Exactly.

You should always look at the diagnostic information supplied by the solver, and the information returned by solvesdp

solvesdp(cons,obj,options)
SeDuMi 1.3 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
...
Primal infeasible, dual improving direction found.
iter seconds  
|Ax|    [Ay]_+     |x|       |y|
 
5      0.5   0.0e+00   4.5e-15   0.0e+00   6.4e+00

ans
=

    yalmiptime
: 1.240000000000006e-01
    solvertime
: 4.369999999999994e-01
          info
: 'Unbounded objective function (SeDuMi-1.3)'
       problem
: 2


This is to be expected. You can let P(1,3) go to -infinity and compensate that by letting P(3,3) go to infinity even faster

Paul

unread,
Mar 31, 2014, 1:19:32 PM3/31/14
to yal...@googlegroups.com
Thanks very much for the answer. YALMIP is really awesome, it is quite convenient to use. Thank you for developing this.
Best regards.
Reply all
Reply to author
Forward
0 new messages