Export primal SDP in canonical form

32 views
Skip to first unread message

sid

unread,
Jul 3, 2019, 10:21:36 AM7/3/19
to YALMIP
Hello,

I am trying to achieve the following:
1) use Yalmip to define a complex SDP problem with a range of sdpvar() objects and constraints between them
2) extract the primal of this problem in canonical form, i.e. in the form "min_X <C,X> s.t. <Ai,X> <= bi, X is PSD" (or an analogous formulation with block matrices Xj so that X = blkdiag(X1,...,XJ)). This is relevant since it is non-trivial to write down the primal canonical form
3) Run a method to find an X (an oracle that can only process SDPs in the above canonical form and does not obtain dual solutions)
4) Fill the solution of X in the original sdpvar() objects

So far, I looked into the export() function and to my understanding this makes use of primal/dual pairs, e.g. for step 4) the dual solution seems to be used. What would be the simplest way to achieve the above?

Any hints are much appreciated.

Thanks,
Sid

Johan Löfberg

unread,
Jul 3, 2019, 3:58:09 PM7/3/19
to YALMIP


X = sdpvar(3);
[F,h,detected_X] = dualize([X(1)==1, X>=0],trace(X));
[model,recoverymodel] = export(F,-h,sdpsettings('solver','sedumi'));

use numerical sedumi model, and then 

assign(X,mysolution)


sid

unread,
Jul 8, 2019, 3:52:13 AM7/8/19
to YALMIP
Thanks a lot for the quick reply! 

When using 
assign(X,mysolution)
to fill the solution in the sdpvar X, it is necessary that I have an understanding how the variables obtained by export (specified in model.K) relate to my primal sdpvar objects. Since this is not always straightforward, ideally I would be able to abstract this away, i.e. similar to
assign(recover(recoverymodel.used_variables),y);
When using dualize() & export() as you describe, is it possible to fill the data in the original sdpvar objects in my primal formulation without having to understand the exact structure of the variables obtained by export()?


Johan Löfberg

unread,
Jul 8, 2019, 4:56:24 AM7/8/19
to YALMIP
You will have to test and reverse engineer it, as I don't know. It is not intended to be used like this so there is no simple way I guess
Reply all
Reply to author
Forward
0 new messages