pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
18 stars 16 forks source link

Weird residential heat demand ? #303

Closed davide-f closed 1 month ago

davide-f commented 3 months ago

Checklist

Describe the Bug

When investigating why the Africa PR didn't reproduce the results of the Morocco ones, I found a problem in these lines:

https://github.com/pypsa-meets-earth/pypsa-earth-sec/blob/da0408dfd02ba0dd3e037dea95a65c986d09c88a/scripts/prepare_sector_network.py#L2154-L2164

heat_ind is in the form like: image

but the columns in the dataframe (the whole stuff among graphs) is indexed as follows: image

This mismatch between columns leads this line to reset the demand to 0.0. In the Africa PR, that was fixed hence adding the demand according to heat_ind, but that led to numerical troubles. Numerical troubles still appear also for morocco.

We need to agree on how to move forward. That unfortunately is not the only reason why the two PRs do not match for some reason.

By specifying p_set = 0.0 at the line mentioned above, the loads_t.p_set of the two networks (new vs old) match