Open
Description
from pyomo.environ import *
m = ConcreteModel()
m.x = Var()
m.c = Constraint(expr=m.x >= 1)
m.p = Param(mutable=True, initialize=5)
m.y = Var(bounds=(m.p, 3))
m.o = Objective(expr=m.x)
SolverFactory('gurobi').solve(m)
m.display()
This model is very much infeasible: 5 <= y <= 3
. Instead, we have:
Model unknown
Variables:
x : Size=1, Index=None
Key : Lower : Value : Upper : Fixed : Stale : Domain
None : None : 1.0 : None : False : False : Reals
y : Size=1, Index=None
Key : Lower : Value : Upper : Fixed : Stale : Domain
None : 5 : None : 3 : False : True : Reals
Objectives:
o : Size=1, Index=None, Active=True
Key : Active : Value
None : True : 1.0
Constraints:
c : Size=1
Key : Lower : Body : Upper
None : 1.0 : 1.0 : None