J Domke
unread,Apr 3, 2013, 8:29:00 AM4/3/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to yal...@googlegroups.com
Hello,
Thanks for YALMIP-- it is extremely useful. I have a simple example where I'd like to extract the dual variables. but am struggling to do so. A simple toy version would be:
xlen = 20;
ylen = 5;
B = rand(ylen,xlen);
theta = randn(xlen,1);
phi = randn(ylen,1);
x = sdpvar(length(theta),1);
y = sdpvar(length(phi) ,1);
obj = theta'*x + phi'*y + x'*x + y'*y + 2*y'*y;
con = [B*x==y; x>=0; y>=0];
solvesdp(con,obj);
A = double(obj);
lambda = dual(con(1))
In which case YALMIP (I think) converts to a quadratic program, and all is groovy. However, if I make a general nonlinear program, for example as follows:
xlen = 20;
ylen = 5;
B = rand(ylen,xlen);
theta = randn(xlen,1);
phi = randn(ylen,1);
x = sdpvar(length(theta),1);
y = sdpvar(length(phi) ,1);
obj = theta'*x + phi'*y + x'*x + y'*y - 2*entropy(y);
con = [B*x==y; x>=0; y>=0];
solvesdp(con,obj);
A = double(obj);
lambda = dual(con(1))
YALMIP still solves the problem just fine (using fmincon), but the dual variables are all set to NaN. Is there anything I can do to get them? Thank you again!