Storage does not charge everytime

battery
oemof

#1

Hello :),

I have some problems in my first test with oemof .

My enrgysystem has PV, demand, battery and a grid connection (sink and demand).

When the battery is not fully charged and there is more PV energy then load/demand, the battery should charge but sometimes oemof decide to use the grid connection instead of the battery.

program file:

Elektrischen Bus initialisieren

bel = solph.Bus(label=“electricity”)
energysystem.add(bel)

demands (electricity/heat)

energysystem.add(solph.Sink(label=‘last’, inputs={bel: solph.Flow(
nominal_value=1, actual_value=data[‘last’], fixed=True)}))

demands (electricity/heat)

energysystem.add(solph.Sink(label=‘Emob’, inputs={bel: solph.Flow(
nominal_value=1, actual_value=data[‘emob’], fixed=True)}))

Solareinspeisung

energysystem.add(solph.Source(label=‘pv’, outputs={bel: solph.Flow(
actual_value=data[‘pv’], nominal_value=1, fixed=True)}))

Netzüberschuss, Einspeisung

energysystem.add(solph.Sink(label=‘Netzeinspeisung’, inputs={bel: solph.Flow(
variable_costs=500)}))

Knappheitsquelle, Netzbezug

energysystem.add(solph.Source(label=‘Netzbezug’, outputs={bel: solph.Flow(
variable_costs=5)}))

Batteriespeicher

battery = solph.components.GenericStorage(label=‘Batterie’,
inputs={bel: solph.Flow(variable_costs=0)},
outputs={bel: solph.Flow(variable_costs=0)},
capacity_loss=0,
nominal_value=100,
nominal_capacity=1000,
nominal_input_capacity_ratio=1/2,
nominal_output_capacity_ratio=1/2,
inflow_conversion_factor=1,
outflow_conversion_factor=1)
energysystem.add(battery)

can someone help me?

Björn


#2

Hi Börn,

does this mean that the PV power is fed into to the grid? If yes, this could be the case if it is indifferent cost-wise which does not seem to the the case at a first glance.

Overall, some metrics would help to illustrate the problem. Could you provide all (maximum) capacities or just put your example on some file hosting service like Dropbox or github?

Best,
Cord


#3

@CKaldemeyer:
Yes the pv power comes into to grid.

here is the script and the datarow:

https://drive.google.com/open?id=1sRnLbB3PhwBv2_H6yocWqemv1S4YLD84

thanks for helping me :slight_smile:


#4

If you have more excess than needed some of the excess energy will be stored and some will be exported. But as it is a ‘perfect foresight’ approach this may happen in reverse order. A human would first load the storage and export the remaining excess if the storage is full but the solver knows exactly how much energy will be produced so the storage may be charged at the end of an excess period with the exact amount that is needed afterwards. There is nothing wrong with that you just have to keep it in mind if you interpret your results.

It is just a guess and if you need a more detailed answer you have to show me the part where the “wrong” behavior happens, because we do not have the time to prepare the results, sorry. You could present a plot (just some days around the occurrence) with the state of charge (relative) of the storage and the flows around the electricity bus.


#5

In other words: If the order of dispatch (charge/discharge) is indifferent concerning your objective (costs) it might appear unintuitive but is still a valid optimal result.

You might reduce the time horizon and check whether the unexpected/unwilled behaviour occurs less frequently. This should be the case if the formulation is right. A help into the LP file for a small time horizon might also provide more details.

Best,
Cord


#6

Here is the first picture of the problem (two follow in the next post):

@CKaldemeyer:
I reduced the time horizon. A time of the summer which has the problems which are shown on the pictures, but the problem is just the same

@uwe.krien:
Thanks for ur answer. I tried to solve the problem with increasing the maximum capacity of the storage. But it does not help.

Do u have any other ideas how i could fix it?


#7


#8


#9

To me, the modelling looks allright and the answer can only be that the dispatch is indifferent concerning the objective.

At least at a quick glance it looks plausible to me on my system:


#10

For me everything looks fine. You added the possibility to export energy into the grid and so energy is exported into grid in times when nothing else make sense. The energy can only be used to satisfy the demand and when the demand is satisfied the energy will be exported.

Why do you want the storage to be fully charged if the energy is not needed?


#11

Your PV seems to be so over-dimensioned that the feed-in is indifferent concerning the objective.


#12

Ups, we answered at the same time :slight_smile:


#13

Okay, now i understand the ‘perfect foresight’. The battery only charge as long as needed to have enough energy for the demand.

I will test storage invest to find the perfect capacity.

Thank You!


#14

I think the storage is just under-dimensioned in relation to the pv-production and thus can be loaded within a couple of time steps:

#Batteriespeicher
battery = solph.components.GenericStorage(label='Batterie',
                                          inputs={bel: solph.Flow(variable_costs=0)},
                                          outputs={bel: solph.Flow(variable_costs=0)},
                                          capacity_loss=0,
                                          initial_capacity=0,
                                          nominal_value=1000,
                                          nominal_capacity=1000,
                                          nominal_input_capacity_ratio=1/2,
                                          nominal_output_capacity_ratio=1/2,
                                          inflow_conversion_factor=1,
                                          outflow_conversion_factor=1)

Thus the time of charging/discharging becomes indifferent concerning the costs.

In theory if you set up the capacity to some real big value, the “unwilled” behaviour should vanish and approve that your model works right from a mathematical perspective.

Best,
Cord