How can I get dual values for Conic/Quadratic constraints?
getdual() function works fine for LPs, however it doesn’t work for QP or SOCP.
Below is a sample code.
For conic constraints: Solvers like Gurobi and CPLEX don’t return duals for SOCPs, at least not in a way that we have hooked up through the interface. I would recommend using ECOS or Mosek instead if you care about duals on SOCPs.
For quadratic constraints: I think JuMP 0.18 just doesn’t have this hooked up. The usual workaround would be to call, e.g., Ipopt and formulate the quadratic constraints with @NLconstraint instead of @constraint.
Thanks for the suggestion!
It does return dual variable values with nonlinear solvers after replacing the constraint using norm.
But I don’t know why. Could you explain the difference between three expressions?
With the norm syntax, it is treated as a conic constraint with the second order cone and with the quadratic function is it treated as a LessThan expression with a quadratic function.
Duals are supporting for conic constraints but not for constraints with quadratic functions