Suffix of variable reduced cost - ipopt

385 views
Skip to first unread message

Yisu Nie

unread,
Mar 23, 2015, 11:33:02 AM3/23/15
to pyomo...@googlegroups.com
I solved a simple NLP problem with Pyomo and ipopt, where I wanted to have the reduced costs/optimal Lagrangian multiplier values for variables to do some sensitivity analysis. I was able to get the multipliers for equations by using the suffix model.dual, but is there a similar procedure for the variables?

Thank you
 

Watson, Jean-Paul

unread,
Mar 23, 2015, 12:03:41 PM3/23/15
to pyomo...@googlegroups.com
The variable values are directly accessible via the Pyomo Var components that you defined for your model. You just need to wrap the call in a “value” function, e.g., “print value(instance.my_var)” or “print value(instance.my_var[j])” if you respectively have a scalar or indexed variable.

jpw

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gabriel Hackebeil

unread,
Mar 23, 2015, 4:34:34 PM3/23/15
to pyomo...@googlegroups.com
Also, I believe the suffix names for the reduced costs are “ipopt_zL_out” and “ipopt_zU_out” for lower and upper bounds, respectively.

If you want to use this information to warm start Ipopt, the dual suffix keeps the same name and the reduced cost names become “ipopt_zL_in” and “ipopt_zU_in”. If you have the Pyomo examples directory included with your installation, you can find a scripting example of this in examples/pyomo/suffixes/ipopt_warmstart.py.

Gabe
Reply all
Reply to author
Forward
0 new messages