Problem with configuring minimum uptime of heat pump in oemof

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!

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

Now it is working.
Thank you very much!

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!

Could you mark this topic as solved?

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.

Hi,

I noticed that the thread is old. But I have a relevant question. I see that the minimum up and downtime parameters are to be included inside the NonConvex flow. In the example above it is dione for dispatch optimization and it seems fine. Now, in my usecase, I want to use the min and max runtime parameters with Investment flow. How could I achieve this?

I see that in v 0.5, there is a InvestNonConvex flow defined. I have not tested this yet. But is there any possibility to do so in older versions?

Regards,
@dhungelgd

Hi @dhungelgd, to combine NonConvex with Investment, you need to use at least version 0.5.

1 Like