PyPSA / pypsa-ariadne

High resolution, sector-coupled model of the German Energy System
https://ariadneprojekt.de/en/model-documentation-pypsa/
MIT License
15 stars 7 forks source link

Restricting powerflow from and to Germany #231

Closed toniseibold closed 1 month ago

toniseibold commented 1 month ago

Issue

Germany has a net restriction for the import of electricity, however we observed timesteps with a unrealistic high import power flow.

Possible Solutions

Restrict Power Inflow by a fixed value

In the config["solving"]["constraints"]["limits_power_max"] values for Germany for the import/export flow are specified. The maximum power import/export is set to 15 GW and increases beginning from 2030 linear until 2045 to 30 GW.

Annotations The constraint is set for each timestep, since adding it as one leads to errors while exporting the postnetwork. This is due to the time dependent nature of the constraint that would need a unique name for each constraint anyway.

The constraint is not added to n.global_constraints due to that reason because it would overload the n.global_constraints with 8760 / time_resolution constraints. Since the shadow prices of those import/export constraints are not important at the moment, this is tolerated.

Set Interconnectors to s_max_pu=0.5

In modify_prenetwork the value of s_max_pu is set to 0.5.

Set Interconnectors to s_max_pu=0.3

In modify_prenetwork the value of s_max_pu is set to 0.3.

Numerical Issues

For the boundary condition there were numerical issues that led to a suboptimal solution in 2020. By dividing the values by a factor of 10, the large bounds and therefore the numerical issue was resolved.

In an optimization with a very restrictive s_max_pu=0.3 for interconnectors, there are also numerical instabilities in 2020 which led to a suboptimal solution.

Conclusion

The electricity generation 2020 is only varying mildly across the three strategies.

Leaning towards the boundary condition setting a maximum power of import. This would prevent unreasonable high imports/exports in a single timestep which can be seen in the system since Germany's neighbouring countries are only represented by one node disregarding the bottlenecks in those electricity systems. Furthermore, it prevents Germany from exporting emission intensive gas fired power plants and just importing the electricity without keeping track of the emissions. This is reflected in the higher emissions in the electricity and heat energy supply. In the comments this becomes apparent especially in 2045 in a January Dunkelflauten-situation. Germany cannot import ~ 100GWh and therefore needs to rely on hydrogen CHPs and OCGTs. Downturn: dampens the installed capacity of interconnectors since the power is limited.

Before asking for a review for this PR make sure to complete the following checklist:

github-actions[bot] commented 1 month ago

Validator Report

I am the Validator. Download all artifacts here. I'll be back and edit this comment for each new commit.

Ariadne Variables

Comparison
NRMSE Pearson
Capacity|Methanol 0.666 -0.678
Secondary Energy|Methanol 0.618 -0.659
Investment|Energy Supply|Methanol 0.577 -0.200
Capacity|Electricity|Storage Converter 0.442 0.154
Trade|Secondary Energy|Methanol|Gross Import|Volume 0.430 0.065
Trade|Secondary Energy|Methanol|Volume 0.429 0.063
Secondary Energy|Electricity|Hydro 0.412 -0.289
Capacity Additions|Methanol 0.408 -0.140
Price|Secondary Energy|Gases|Hydrogen 0.405 0.000
Capacity|Electricity|Gas|OC 0.204 0.926
Investment|Energy Supply|Electricity|Solar|PV|Open Field 0.124 0.971
Trade|Secondary Energy|Electricity|Volume 0.123 0.946
Capacity Additions|Electricity|Solar|PV|Open Field 0.112 0.968
NRMSE: Normalized (combined-min-max) Root Mean Square Error Pearson: Pearson correlation coefficient Threshold: NRMSE > 0.1 Only variables reaching the threshold are shown. Find the equivalent plot for all of them below.
Plots
Main branch Feature branch
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available

General

Plots comparison
Main branch Feature branch
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Files comparison
Status NRMSE MAE (norm)
csvs/metrics.csv :warning:Changed 0.000 0.07
csvs/curtailment.csv :warning:Changed 0.000 0.14
csvs/price_statistics.csv :warning:Changed 0.003 0.12
csvs/cumulative_cost.csv :warning:Changed 0.000 0.12
csvs/nodal_cfs.csv :white_check_mark: Almost equal 0.007 0.00
csvs/supply.csv :white_check_mark: Almost equal 0.001 0.01
csvs/prices.csv :white_check_mark: Almost equal 0.015 0.00
csvs/nodal_supply_energy.csv :white_check_mark: Almost equal 0.000 0.01
csvs/capacities.csv :white_check_mark: Almost equal 0.000 0.01
csvs/nodal_costs.csv :white_check_mark: Almost equal 0.000 0.00
csvs/market_values.csv :white_check_mark: Almost equal 0.012 0.04
csvs/nodal_capacities.csv :white_check_mark: Almost equal 0.000 0.00
csvs/cfs.csv :white_check_mark: Almost equal 0.031 0.00
csvs/costs.csv :white_check_mark: Almost equal 0.000 0.01
csvs/supply_energy.csv :white_check_mark: Almost equal 0.000 0.01
csvs/energy.csv :white_check_mark: Almost equal 0.000 0.01
csvs/weighted_prices.csv :white_check_mark: Equal
NRMSE: Normalized (combined-min-max) Root Mean Square Error MAE (norm): Mean Absolute Error on normalized data (min-max) Status Threshold: MAE (norm) > 0.05 and NRMSE > 0.3

Model Metrics

Benchmarks Image not available Image not available Image not available

Comparing restrict_power_flow (9a95f54) with main (0abf8b6). Branch is 10 commits ahead and 1 commits behind. Last updated on 2024-10-14 20:06:16 CEST.

toniseibold commented 1 month ago

Import/Export of electricity for January 2020

s_max_pu=0.3

elec-Jan-DE-2020

s_max_pu=0.5

elec-Jan-DE-2020

15 GW

elec-Jan-DE-2020

toniseibold commented 1 month ago

Import/Export of electricity for January 2045

s_max_pu=0.3

elec-Jan-DE-2045

s_max_pu=0.5

elec-Jan-DE-2045

15 GW

elec-Jan-DE-2045

toniseibold commented 1 month ago

Import/Export of electricity for May 2045

s_max_pu=0.3

elec-May-DE-2045

s_max_pu=0.5

elec-May-DE-2045

15 GW

elec-May-DE-2045

toniseibold commented 1 month ago

Emissions

s_max_pu=0.3

Emissions-CO2-Energy-Supply-Electricity-and-Heat

s_max_pu=0.5

Emissions-CO2-Energy-Supply-Electricity-and-Heat

15 - 30 GW

Emissions-CO2-Energy-Supply-Electricity-and-Heat