我试图在pyomo Concretemodel()中执行此操作,但我得到了以下错误:
model.Smax = Var( within=PositiveIntegers )
model.Z = Var(model.T, bounds=(0, model.Smax))
ValueError: Non-fixed input of type '<class 'pyomo.core.base.var.SimpleVar'>' supplied as variable
upper
bound - legal types are fixed expressions or variables.parameters
我如何更改代码使其具有该上限?或者我应该对Z[t]的最大值使用约束
谢谢
对于上界或下界,可以如下设置:
相关问题 更多 >
编程相关推荐