Solver time seems to be to high for a small energy model using oemof (solph) with CBC solver

I do agree that 40min seems to be too long for such a small system.

Normally the solver time increases significantly if the problem is infeasible. Therefore you should make sure that the problem is still solvable after you added additional demand objects. By the way, different units (or prefixes) are a typical source of error.

An easy way to make your problem solvable is to add unlimited excess and shortage objects to every bus (balance). Make sure that the shortage source is more expensive for the solver than all other objects, otherwise it might be used instead of your power plants.

For oemof.solph it looks like this (e.g. bus_1):

from oemof import solph

# shortage bus_1
solph.Source(label='shortage_1',
             outputs={bus_1: solph.Flow(variable_costs=50000)})

# excess bus_1
solph.Sink(label='excess_1', inputs={bus_1: solph.Flow()})

If you add these objects to every bus your problem will be solvable. Afterwards you can check the results. If the sum of these sinks and sources is greater than zero the problem would be infeasible without them. Now you can analyse your results to find the problem.

1 Like