How to get dual varialbles using optimizer command ?

132 views
Skip to first unread message

kai wang

unread,
Dec 30, 2014, 10:16:12 AM12/30/14
to yal...@googlegroups.com
Thank Johan Löfberg for his great work because optimizer command do save lots of time when solving similar problems. 

But dual variables are needed in many problems. Is there any way to get dual varialbles using optimizer command ? I have already tried the dual command but it returns NaN only.

Thanks a lot if there any help.

Johan Löfberg

unread,
Dec 30, 2014, 10:30:29 AM12/30/14
to yal...@googlegroups.com
The fourth output from optimizer contains all dual variables. You will have troubles using them though as you have to figure out which constraints they correspond to, if you have a complex model. There is no way to use the dual command when you use optimizer

kai wang

unread,
Dec 30, 2014, 9:55:51 PM12/30/14
to yal...@googlegroups.com
Hi, Johan

Thanks a lot! 

I have also found the solution in your answers to the relative posts, such as extract value function, each objective's contribution and predicted states and extract dual variable by using command "optimizer". Great Q/A forum !

By saying "figure out which constraints they correspond to", do you mean the sequence of values in dual variable vector may not be consistent with that of constriants. Because it appears to be so from my test results.

I also wondering the third output of command optimizer for there is no clear explaination, either in matlab help or yalmip wiki.

By the way, is the optimizer command still beta version in the latest release ? Will a formal version come in future release ?

Kai


Johan Löfberg

unread,
Jan 2, 2015, 9:08:33 AM1/2/15
to yal...@googlegroups.com
Well, beta is a way of saying I am not sure about the design yet and you have to be aware of bugs. YALMIIP as a whole is still in beta...
Reply all
Reply to author
Forward
0 new messages