Modelling powerlines with negative costs

Hi all,

I am attaching a modified code of the provided “dispatch.py” example, in order to show the problem I have encountered.

It concerns the use of negative costs. In particular, if I associate a negative cost (which are of interest for my work on energy communities and sharing of electricity) with the powerlines (Link component), it happens the following: between the nodes involved in the bidirectional exchange, an amount of energy equal to the nominal capacity (500) is exchanged every hour, even if this energy is not produced/purchased.

Any suggestion on a possible solution?

Thanks!
Valeria

dispatch.txt (7.3 KB)

To get some help you have to provide a minimal example. For example two buses, connected with your power line and a sink and a source connected to each bus. Just use a few time steps and artificial data and try to reproduce your problem from above. Furthermore, you should include the data in your example so that it is possible to fully reproduce it.

# solph v0.4.1
demand1 = [2, 4, 3, 5, 2, 8]
solph.Sink(label="demand_1", inputs={bus1: solph.Flow(fix=demand1)})
# and so on ...

This would help us to help you.