Problem with configuring minimum uptime of heat pump in oemof

oemof

#1

Hey,

I just stumbled over oemof and I really like it! At the moment am doing my first steps and have a little problem and couldn’t find a solution.

I am trying to set up a minimum / maximum runtime for a heat pump to avoid pulsing. But the optimizer seems to ignore it. The heat pump is still shut on and off just for one time step. The min and max parameter is working. Can you please check if I am doing something wrong?

Here is my code:

energysystem.add(solph.Transformer(label="heatPump", inputs={bel: solph.Flow()},
                           outputs={bheat: solph.Flow(nominal_value=2000,
                           startup_cost=30,
                           variable_costs=24.51,
                           nonconvex=solph.options.NonConvex(),
                           min=0.1,
                           max=1,
                           minimum_uptime=10,
                           minimum_downtime=10)}, 
                           conversion_factors={bheat: 3}))

I am using oemof 0.2.1 and the CBC solver

Thank you!


#2

Hi Gernot,

the min-uptime has to be defined within the nonconvex-object!

From the example repository:

pp1 = solph.Source(
    label='plant_min_down_constraints',
    outputs={
        bel: solph.Flow(
            nominal_value=10, min=0.5, max=1.0, variable_costs=10,
            nonconvex=solph.NonConvex(minimum_downtime=4, initial_status=0)
        )
    })

Cheers
Cord


#3

Now it is working.
Thank you very much!


#4

You are welcome.

Just be aware that the simultaneous usage of up- and downtimes might lead to conflicts (e.g. infeasible problems) in some situtations, especially in the “border regions” meaning the first and last time steps.

Good luck!


#5

Could you mark this topic as solved?


#6

Another way to soften pulsing is to define gradient costs. It is not as strict as a minimum time but may have similar effects. In contrast to minimum times the problem is still linear (faster) instead of mixed integer. You could try that alternatively.