Performance Of Creating Pyomo Constraints
I am setting up a biggish energy optimization problem with pyomo. The setup took unreasonably long as mentioned in other questions, however I managed to speed up most of the proble
Solution 1:
Well, it turns out the problem was with the slices.
defflows(model, et, t):
vars = [model.in_flow[obj, et, t] for obj in model.objects_index]
vars.extend([model.out_flow[obj, et, t] for obj in model.objects_index])
return pyo.quicksum(vars) == 0
This refomulation of the constraint rule speed up my model creation by about 60%. I found two other places where I did a similar reformulation. I am now down from 120s before the optimisation, to about 7s.
Post a Comment for "Performance Of Creating Pyomo Constraints"