Solutions ofconstraint sos

51 views
Skip to first unread message

Alpha Wagner

unread,
Aug 9, 2016, 10:03:27 AM8/9/16
to YALMIP
Is there a way to obtain the values of x and y in the example form the yamlip wiki (http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.SumOfSquares)

sdpvar x y lower
p
= (1+x*y)^2-x*y+(1-y)^2;
g
= [1-x;1+x;1-y;1+y]
[s1,c1] = polynomial([x y],2);
[s2,c2] = polynomial([x y],2);
[s3,c3] = polynomial([x y],2);
[s4,c4] = polynomial([x y],2);
F
= [sos(p-lower-[s1 s2 s3 s4]*g), sos(s1), sos(s2), sos(s3), sos(s4)];
solvesos
(F,-lower,[],[c1;c2;c3;c4;lower]);

Thanks

Johan Löfberg

unread,
Aug 9, 2016, 2:48:42 PM8/9/16
to YALMIP
No, solvesos does not try to extract solutions from tight relaxations.

However, solvemoment, which works in the dual space of solvesos, does so, and in this particular case the first relaxation is tight and a solution can be extracted
[~,extracted] = solvemoment(g>=0,p);

Having said that, the problem is trivial enough for a stadnard b&b LP-relaxation based solver to finish in no time
optimize(g>=0,p,sdpsettings('solver','bmibnb'));


Alpha Wagner

unread,
Aug 10, 2016, 6:10:56 AM8/10/16
to YALMIP
Thanks a lot.
What happens if the moment relaxation is not tight? 
Also in how far corresponds the a moment relaxation in the dual space to an sos relaxation in the primal space ?

Johan Löfberg

unread,
Aug 10, 2016, 6:17:54 AM8/10/16
to YALMIP
If it isn't tight, it cannot extract a solution, of course, as there is no solution achieving that super-optimal objective value.

The moment relaxation is the dual of the sos, basically.If you look at the semidefinite program that the sos leads to, and then look its dual, you have the model you would have derived if you took the moment route. Effectively, this means that as we can extract a solution from the primal moment matrix, we could extract a solution from the sos also, as sdp solvers compute primal-dual solution. YMIP doesn't do that though. More natural/easy to do it on the moment side.

Alpha Wagner

unread,
Aug 10, 2016, 6:36:53 AM8/10/16
to YALMIP
I see thanks.

Alpha Wagner

unread,
Aug 10, 2016, 10:38:44 AM8/10/16
to YALMIP
I am usually using mosek within matlab. Can I specify in solvemoment to use a different solver?

Thanks,
Andre

Johan Löfberg

unread,
Aug 10, 2016, 10:41:15 AM8/10/16
to YALMIP
of course

>> ops=sdpsettings;ops.moment

ans = 

          order: []
      blockdiag: 0
         solver: ''
         refine: 0
    extractrank: 0
        rceftol: -1

Alpha Wagner

unread,
Aug 10, 2016, 11:37:03 AM8/10/16
to YALMIP
Again thanks a lot.
By the way the ref's (Laserre:2001) in the moment tutorial ( http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.MomentRelaxations ) and  (Parrilo:2003) on the sos tutorial ( http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.SumOfSquares ) are not working. 
I get
Warning: fopen(http://users.isy.liu.se/johanl/yalmip/pub/): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /www/users/rt/johanl/yalmip/cookbook/bibtexref/bibtexref2.php on line 747 Can't open file
Cheers
Reply all
Reply to author
Forward
0 new messages