how to solve a submodel by assigning upper variables to some value

43 views
Skip to first unread message

施云辉

unread,
Apr 13, 2018, 9:16:37 AM4/13/18
to Pyomo Forum
Hi, I'm working with a bi-level problem, and I want to solve the bi-level problem with benders-decomposition method. And one step of my method is to solve a submodel by assigning the variables of the upper model to some value. For example, I have a ConcreteModel M, with varible M.x, and a SubModel M.sub, with variable M.sub.y  and some constraints and an objective. I want to assign M.x to 0, and solve the M.sub. Is there any way to do this ?

Michael Bynum

unread,
Apr 13, 2018, 1:54:37 PM4/13/18
to Pyomo Forum
I believe the following should work:

M.x.fix(0)
opt = SolverFactory('pick_a_solver')
results = opt.solve(m.sub)

Michael

施云辉

unread,
Apr 13, 2018, 10:34:26 PM4/13/18
to Pyomo Forum
Thanks a lot, it works. And it's cool, I think the 'fix' method should be documented.

在 2018年4月14日星期六 UTC+8上午1:54:37,Michael Bynum写道:

David Woodruff

unread,
Apr 13, 2018, 10:39:06 PM4/13/18
to pyomo...@googlegroups.com

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages