-
Notifications
You must be signed in to change notification settings - Fork 361
Description
Version Checks (indicate both or one)
-
I have confirmed this bug exists on the lastest release of PyPSA-Eur.
-
I have confirmed this bug exists on the current
masterbranch of PyPSA-Eur.
Issue Description
Hi everyone,
I have been experiencing trouble using pypsa.statistics.optimal_capacity with recent changes on the heat bus allocation for heat pumps. When calling optimal capacity for a specific carrier (e.g. low voltage), I get a positive capacity whereas I should get a negative one, as for any other (heat) link consuming "low voltage". Heat capacities are as well reversed (negative instead of positive). Energy balance are computed properly though
My guess, then, is that this comes from:
- Using p_max_pu = 0 / p_min_pu = -cop <0, but with a positive efficiency
- How optimal_capacity is implemented (using port_efficiency)
Maybe should we instead use a negative efficiency and p_min_pu = 0 / p_max_pu = cop, like for DAC ?
NB : This remark applies as well to heat vents, which use a efficiency = 1 but a p_max_pu = 0 / p_min_pu = -1.
Reproducible Example
>>> n = pypsa.Network(...) # optimized network
>>> n.statistics.optimal_capacity(bus_carrier="low voltage")
component carrier
Generator solar rooftop 27992.80489
Link BEV charger -296126.89025
V2G 133257.10061
electricity distribution grid -7974.74833
home battery charger -1.55432
home battery discharger 1.55432
rural air heat pump 3193.75522
rural ground heat pump 43602.10090
rural resistive heater -15485.35487
urban central air heat pump 15920.37297
urban central resistive heater -15618.98691
urban decentral air heat pump 124346.99806
urban decentral resistive heater -65188.19632
dtype: float64
>>> n.statistics.optimal_capacity(bus_carrier="rural heat")
component carrier
Generator rural heat vent 1.78074
rural solar thermal 0.55727
Link rural air heat pump -3193.75522
rural ground heat pump -43602.10090
rural water tanks charger -30.72206
rural biomass boiler 2962.42039
rural gas boiler 36835.83436
rural oil boiler 30667.91043
rural resistive heater 13936.81938
rural water tanks discharger 30.72206
dtype: float64Expected Behavior
>>> n.statistics.optimal_capacity(bus_carrier="low voltage")
component carrier
Generator solar rooftop 27992.80489
Link BEV charger -296126.89025
V2G 133257.10061
electricity distribution grid -7974.74833
home battery charger -1.55432
home battery discharger 1.55432
rural air heat pump - 3193.75522
rural ground heat pump - 43602.10090
rural resistive heater -15485.35487
urban central air heat pump - 15920.37297
urban central resistive heater -15618.98691
urban decentral air heat pump - 124346.99806
urban decentral resistive heater -65188.19632
dtype: float64
>>>n.statistics.optimal_capacity(bus_carrier="rural heat")
component carrier
Generator rural heat vent -1.78074
rural solar thermal 0.55727
Link rural air heat pump 3193.75522
rural ground heat pump 43602.10090
rural water tanks charger 30.72206
rural biomass boiler 2962.42039
rural gas boiler 36835.83436
rural oil boiler 30667.91043
rural resistive heater 13936.81938
rural water tanks discharger 30.72206
dtype: float64