getting the dual variables

20 views
Skip to first unread message

juan raposo

unread,
Jun 27, 2023, 2:33:56 PMJun 27
to Pyomo Forum
Hi,
I'm currently working on a mixed integer linear program in which I have binary and NonNegativeReal variables. Is it possible to obtain its dual variables? I am asking this because  when I try to get some specific dual variable associated to a constraint, I get an error message such as: 

 KeyError: "Component with id '1595808824672': Lower_W[HYDRO_RES,1]"

And when using instance.dual.display() I get the following message:

   dual : Direction=Suffix.IMPORT_EXPORT, Datatype=None Key : Value

Also the motive of this question is because I ve seen the following discussion at StackOverflow:


Could someone confirm if this is true? 

In case it is not, I am sharing my code of my GitHub repository:

  

David Woodruff

unread,
Jun 27, 2023, 5:26:32 PMJun 27
to pyomo...@googlegroups.com
The statement on the stack overflow page you cited (that you can't get duals for a problem with integer variables) is true enough for your purposes.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/a0454696-13c4-4376-85dd-f7879b53f295n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages