Why sometimes only NaN is returned when calling dual command ?

88 views
Skip to first unread message

kai wang

unread,
Mar 25, 2015, 3:28:28 AM3/25/15
to yal...@googlegroups.com
Hi sir,

       I try to solve a economic dispatch problem in power system. In the first, I used the quadratic generation cost functions to model the problem and got the solution and all the dual variables by calling command dual. 

       Then, to simiplify the problem, I piecewise linearized the quadratic functions to form a linearized model, and the solution was verified by the one from quadratic model. But when I called dual command, it only returned NaN. What could cause this happen?

       I use CPLEX 12.6.

Thank you so much.

Wang Kai


kai wang

unread,
Mar 25, 2015, 10:15:34 AM3/25/15
to yal...@googlegroups.com
Well, it is my mistake. When linearized the original model, I introduced a binary variable to reflect the logical relationship. After that, the model became MILP, and there is no such dual thing for MILP. I noticed that in an another relative post. Thanks a lot.

Johan Löfberg

unread,
Mar 27, 2015, 3:19:41 AM3/27/15
to yal...@googlegroups.com
If the QP is convex, a pwa approximation max(ai'*x + bi) without binaries is possible, and then the model is a standard LP for which duals exist.

If the QP is nonconvex, or you made a binary model by mistake, you have a MILP, for which no dual variables exist as no solvers can return such.
Reply all
Reply to author
Forward
0 new messages