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.
Baca Juga
- How To Import Word2vec Into Tensorflow Seq2seq Model?
- Pyqt5 Cannot Update Progress Bar From Thread And Received The Error "cannot Create Children For A Parent That Is In A Different Thread"
- Overflowerror: (34, 'numerical Result Out Of Range') While Solving And Optimizing A System Of Ode's Using Pyomo?
Post a Comment for "Performance Of Creating Pyomo Constraints"