Open pz-max opened 5 months ago
@GbotemiB discovered the bug and @davide-f found out about the potential reason
As a revision, in the mentioned code, it is ok to define it as s_nom, but it is better to specify s_nom_min in prepare_network. Actually, we have a section of code that should be doing that but it seems not to be working for some reason.
The code is in the set_transmission_limit function here: https://github.com/pypsa-meets-earth/pypsa-earth/blob/e4edb177fb5f1216f9d4ead8cf2e319a1c8a48ec/scripts/prepare_network.py#L188
Checklist
main
branch or the latest release. Please indicate.pypsa-earth
environment. Update viaconda env update -f envs/environment.yaml
.Describe the Bug
Lines are currently added as
s_nom
. If lines are oversized in a network and can reduce for the optimal cases_nom_opt
. 1) deconstructing lines makes no sense (yet) and 2) this can lead to negative objective values.https://github.com/pypsa-meets-earth/pypsa-earth/blob/e0117356d3600da4366d499b9dfbf9ebbbc61bff/scripts/base_network.py#L353-L359
We should probably add lines as
s_nom_min