You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to YALMIP
Dear professor Löfberg,
I was trying to export Yalmip model to Cplex format. After exporting, I tried to run the model directly in Cplex, but I got a different solution. Please see the code below,
n = 5;
S = randn(n);S = S*S'/1000;
mu = rand(1,n)/100;
w = sdpvar(n,1);
F = [sum(w)==1, 1>=w>=0, w'*S*w<=sum(sum(S))/n^2];
Obj = -mu*w;
options = sdpsettings('solver','cplex');
optimize(F,Obj,options);
value(w)
% Export the model to Cplex, and rerun in Cplex
[model,~,~,~] = export(F,Obj,options);
cmodel = Cplex(model);
sol = cmodel.solve();
sol.x
Is this the correct way to export Yalmip model to Cplex? I am using Matlab 2018a, Cplex 12.8 and Yalmip '20180612'.
Thank you very much.
Best,
Lun Yang
Johan Löfberg
unread,
Oct 19, 2018, 1:50:05 AM10/19/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
and the variables of interest are x(1:length(w)) (YALMIP introduces extra variables to normalize the SOCP cones)
Lun Yang
unread,
Oct 19, 2018, 11:24:19 AM10/19/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to YALMIP
Thank you professor Löfberg.
In order to get the same results, is there a way to see which Cplex Matlab function Yalmip calls? The reason I am asking is, later when my model is getting complicated, cplexqcp might not be the correct solver function Yalmip calls?
Thank you again,
Best,
Lun Yang
Johan Löfberg
unread,
Oct 19, 2018, 11:40:12 AM10/19/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to YALMIP
which function is called depends on the model of course. You would have to study call_cplexibm_qcmiqp and call_cplexibm_miqp.m
Lun Yang
unread,
Oct 19, 2018, 11:41:20 AM10/19/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to YALMIP
thank you, exactly what I need.
Lun
Lun Yang
unread,
Oct 19, 2018, 12:01:27 PM10/19/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to YALMIP
I quick follow up question. Is there a way to get the solution pool from directly calling the following