Thanks a lot, Gabe, I've added that, and it got rid of that problem. However, now I get a similar one (although this one makes much more sense, as it actually refers to a constraint that I defined in pyomo).
The error is associated with using the Piecewise functionality in Pyomo. Here is the error that CPLEX gives me:
Below this message is how I'm using Piecewise in my model. I suspect the error comes from specifuing the wrong set of bounds in the variables compared to the extremes of the pw_pts in the Piecewise calls. That's just a suspicion, though, as this is my very first linearisation (and my first Pyomo program for that matter).
model.z1_Tttop_x_Ftank = Var(model.Time_Set, bounds=(-1e6,1e6))
model.z2_Tttop_x_Ftank = Var(model.Time_Set, bounds=(-1e6,1e6))
model.y1_Tttop_x_Ftank = Var(model.Time_Set, bounds=(-1e6*2,1e6*2))
model.y2_Tttop_x_Ftank = Var(model.Time_Set, bounds=(-1e6*2,1e6*2))
model.Tttop_x_Ftank = Var(model.Time_Set, bounds=(-1e6,1e6))
model.linearZ1_Tttop_x_Ftank = Piecewise(model.Time_Set, model.z1_Tttop_x_Ftank, model.y1_Tttop_x_Ftank, pw_pts=[-1e6*2, 0, 10, 50, 101, 1e6*2], pw_constr_type='EQ', f_rule=f2)
model.linearZ2_Tttop_x_Ftank = Piecewise(model.Time_Set, model.z2_Tttop_x_Ftank, model.y2_Tttop_x_Ftank, pw_pts=[-1e6*2, 0, 10, 50, 101, 1e6*2], pw_constr_type='EQ', f_rule=f2)
def linDef_y1_Tttop_x_Ftank(model, t):
return model.y1_Tttop_x_Ftank[t] == 0.5* (model.TankTopTemp[t] + model.TankFlow[t])
model.linDef_y1_Tttop_x_FtankConstraint = Constraint(model.Time_Set, rule=linDef_y1_Tttop_x_Ftank)
def linDef_y2_Tttop_x_Ftank(model, t):
return model.y2_Tttop_x_Ftank[t] == 0.5* (model.TankTopTemp[t] - model.TankFlow[t])
model.linDef_y2_Tttop_x_FtankConstraint = Constraint(model.Time_Set, rule=linDef_y2_Tttop_x_Ftank)
def linDec_Tttop_x_Ftank(model, t):
return model.Tttop_x_Ftank[t] == model.z1_Tttop_x_Ftank[t] - model.z2_Tttop_x_Ftank[t]
model.linDec_Tttop_x_FtankConstraint = Constraint(model.Time_Set, rule=linDec_Tttop_x_Ftank)