I also asked this question at stackexchange, but probably it’s in better hands here.
I would like to start with a very simple model. It consists only of a source (SRC, fixed
), a sink (SNK, fixed
) and a storage (STO, half filled
). All three elements are connected to the same bus (BUS
).
I would expect if SRC>SNK
the STO
is charged and if SRC<SNK
the STO
is discharged.
In both cases, nothing happens to STO
and I get the following error message:
ERROR:root:Optimization failed with status ok and terminal condition infeasible
If SRC=SNK
no errors are shown.
My code looks like:
import oemof.solph as solph
from oemof.outputlib import processing
es = solph.EnergySystem()
BUS = solph.Bus(label='BUS')
SRC = solph.Source(label='SRC',
outputs={BUS: solph.Flow(actual_value=0.8,
nominal_value=100,
fixed=True)})
STO = solph.components.GenericStorage(label='STO',
nominal_capacity=100000,
initial_capacity=0.5,
inputs={BUS: solph.Flow()},
outputs={BUS: solph.Flow()})
SNK = solph.Sink(label='SNK',
inputs={BUS: solph.Flow(fixed=True,
actual_value=0.5,
nominal_value=100)})
es.add(BUS, SRC, STO, SNK)
om = solph.Model(es)
om.solve(solver='cbc', solve_kwargs={'tee': True})
print(processing.results(om))
What am I missing?