Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure DC transmission projects appear in the correct year #187

Merged
merged 18 commits into from
Sep 18, 2024
Merged

Conversation

nworbmot
Copy link
Member

@nworbmot nworbmot commented Sep 11, 2024

This script forces DC transmission projects that are built after the current investment year to have p_nom_opt = 0. The planned capacity continues to be stored in p_nom.

The changes are a compromise with behaviour of PyPSA-Eur scripts:

  • prepare_network.py sets p_nom_min = p_nom for lvopt setting
  • add_brownfield.py sets p_nom_min = p_nom_opt from previous network

A less hacky fix that also addresses AC transmission projects would need to touch PyPSA-Eur more extensively.

The projects can be forced in between the cutin and cutout years defined in the config. Between these years, all planned projects are realised with p_nom_min = p_nom. After these years planned projects are not forced, but offered as an option p_nom_min = 0.

This script recreates the desired behaviour.

Capacities in 2020 network:

image

Capacities in 2025 network:

image

Capacities in 2030 network:

image

Capacities in 2035 network (assuming cutout of 2030):

image

Note that here projects planned after 2030 are offered (p_nom_max = 22 GW) but not forced (p_nom_min = 0 GW).

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

  • Workflow with target rule ariadne_all completes without errors
  • The logic of export_ariadne_variables has been adapted to the changes
  • One or several figures that validate the changes in the PR have been posted as a comment
  • A brief description of the changes has been added to Changelog.md
  • The latest main has been merged into the PR
  • The config has a new prefix of the format YYYYMMDDdescriptive_title

nworbmot and others added 2 commits September 11, 2024 17:06
This script forces DC transmission projects that are built after the
current investment year to have p_nom_opt = 0. The planned capacity
continues to be stored in p_nom.

The changes are a compromise with behaviour of PyPSA-Eur scripts:

prepare_network.py sets p_nom_min = p_nom for opt setting
add_brownfield.py sets p_nom_min = p_nom_opt from previous
Copy link

github-actions bot commented Sep 12, 2024

Validator Report

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

⚠️ Config changes detected!

Results may differ due to these changes:

diff --git a/config/config.yaml b/config/config.yaml
index ea33f60..53d970a 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -4,7 +4,7 @@
 
 # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
 run:
-  prefix: 202406windcf
+  prefix: 240911-keepdc
   name:
   # - CurrentPolicies
   - KN2045_Bal_v4
@@ -184,7 +184,7 @@ lines:
 
 # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#enable
 enable:
-  retrieve: true # set to false once initial data is retrieved
+  retrieve: false # set to false once initial data is retrieved
   retrieve_cutout: false # set to false once initial data is retrieved
 clustering:
   # simplify_network:
@@ -612,3 +612,6 @@ must_run_biogas:
   enable: false
   p_min_pu: 0.6
   regions: ['DE']
+
+transmission_projects:
+  new_link_capacity: keep #keep or zero

Ariadne Variables

Comparison
NRMSE Pearson
Investment|Energy Supply|Heat|Biomass|w/o CCS 4330127.019 0.000
Investment|Energy Supply|Electricity|Biomass|w/o CCS 4330127.019 0.000
Capacity Additions|Electricity|Biomass|w/o CCS 1328.489 0.911
Capacity Additions|Heat|Biomass|w/o CCS 1327.183 0.911
Final Energy|Gases|Efuel 2.036 -0.259

NRMSE: Normalized (min-max) Root Mean Square Error
Pearson: Pearson correlation coefficient
Threshold: NRMSE > 2
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

General

Plots comparison
Main branch Feature branch
Image not found in results Image not found in results
Image not found in results Image not found in results
Image not found in results Image not found in results
Image not found in results Image not found in results
Image not found in results Image not found in results
Image not found in results Image not found in results
Files comparison
Status NRMSE MAE (norm)
csvs/nodal_capacities.csv ⚠️ NaN mismatch
csvs/nodal_costs.csv ⚠️ NaN mismatch
csvs/nodal_cfs.csv ⚠️ NaN mismatch
csvs/curtailment.csv ✅ Almost equal 0.000 0.09
csvs/cfs.csv ✅ Almost equal 0.069 0.01
csvs/costs.csv ✅ Almost equal 0.001 0.01
csvs/cumulative_cost.csv ✅ Almost equal 0.001 0.11
csvs/price_statistics.csv ✅ Almost equal 0.012 0.28
csvs/market_values.csv ✅ Almost equal 0.064 0.04
csvs/capacities.csv ✅ Almost equal 0.000 0.00
csvs/metrics.csv ✅ Almost equal 0.001 0.14
csvs/nodal_supply_energy.csv ✅ Almost equal 0.001 0.00
csvs/prices.csv ✅ Almost equal 0.027 0.01
csvs/supply_energy.csv ✅ Almost equal 0.001 0.02
csvs/supply.csv ✅ Almost equal 0.003 0.01
csvs/energy.csv ✅ Almost equal 0.001 0.02
csvs/weighted_prices.csv ✅ Equal

NRMSE: Normalized (min-max) Root Mean Square Error
MAE (norm): Mean Absolute Error on normalized Data (min-max
Status Threshold: MAE (norm) > 0.05 and NRMSE > 2

Comparing nep (944f288) with main (e5f56de).
Branch is 2 commits ahead and 0 commits behind.
Last updated on 2024-09-12 17:03:21 CEST.

nworbmot and others added 3 commits September 13, 2024 17:55
E.g. only force in projects planned to go into service between 2020
and 2030. Allow later lines to be built, but don't force them.
@lindnemi
Copy link
Collaborator

lindnemi commented Sep 17, 2024

  • make sure this works for upgraded links as well
  • consider capacity expansion in the exporter
  • consider investment with NEP costs in exporter
  • (minor priority) do it for AC projects
  • add a build year for the projects in transmission_projects/manual

@lindnemi
Copy link
Collaborator

lindnemi commented Sep 17, 2024

updated old TYNDP projects in PyPSA/pypsa-eur#1305

@lindnemi
Copy link
Collaborator

ignoring AC lines and upgraded DC links for now (upgraded DC are just a few)

@lindnemi lindnemi merged commit 3b9d8fa into main Sep 18, 2024
2 of 3 checks passed
toniseibold pushed a commit that referenced this pull request Sep 23, 2024
* make sure DC transmission projects appear in the correct year

This script forces DC transmission projects that are built after the
current investment year to have p_nom_opt = 0. The planned capacity
continues to be stored in p_nom.

The changes are a compromise with behaviour of PyPSA-Eur scripts:

prepare_network.py sets p_nom_min = p_nom for opt setting
add_brownfield.py sets p_nom_min = p_nom_opt from previous

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* only force onshore NEP projects between cutin and cutout years

E.g. only force in projects planned to go into service between 2020
and 2030. Allow later lines to be built, but don't force them.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* hack the correct capacities in the post networks before exporting data. still requires fixing for 2040

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* set p_nom_min in postprocessing of transmission projects

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix Syntax warning

* correctly account for international links and  inverter costs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* consider international h2 and AC transmission

* read discretization values from config

* read threshold from config as well

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rename prefix

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Michael Lindner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants