Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
078cfb5
first notebooks
JulianGeis Aug 19, 2025
77f67f0
finished methods in ipynb
JulianGeis Sep 26, 2025
4a8d0df
add flex metrics and plots to workflow
JulianGeis Sep 29, 2025
1beb80e
start industry dsm and different scenarios
JulianGeis Oct 7, 2025
547458b
pre-main-merge
JulianGeis Oct 7, 2025
f2ac433
Merge branch 'main' into feature-flex
JulianGeis Oct 7, 2025
8116ff2
pre-commit and scenarios
JulianGeis Oct 7, 2025
460fd49
implement industry demand side management
JulianGeis Oct 8, 2025
27fa619
fix minor bug in flex analysis
JulianGeis Oct 9, 2025
d84d816
implement temporal industry load
JulianGeis Oct 13, 2025
3c38ca6
add pdc plot, make ariadne workflow running, some changes for tempora…
JulianGeis Oct 13, 2025
668ce0f
add uc, restrict cross border flows, fix bug in scenarios, add plot f…
JulianGeis Oct 15, 2025
6464866
more scenarios
JulianGeis Oct 16, 2025
5eae41a
add function to restrict components buildout by fraction of MediumFle…
JulianGeis Oct 17, 2025
4d50d19
adaptions to run 2025 only
JulianGeis Oct 23, 2025
96d0c2d
add sensitivity scenarios
JulianGeis Oct 23, 2025
82144d7
plots improvements and fix in restrict_component_buildout
JulianGeis Oct 24, 2025
2178946
fix plot_ariadne_report
JulianGeis Oct 24, 2025
610f81e
change scenarios to inflexible electrolysis and rural/decentral PtH
JulianGeis Oct 29, 2025
cc2a833
add iron air battery
JulianGeis Oct 29, 2025
5317620
fix bug in iron-air costs
JulianGeis Oct 29, 2025
8acb5ac
implement inflexible PtH via p_min_pu and constraints
JulianGeis Oct 30, 2025
47d5a02
add plotting colors for iron air battery
JulianGeis Oct 30, 2025
5928f93
add H2 Electrolysis p_min_pu for all countries and add min_part_load …
JulianGeis Oct 31, 2025
e9adc59
remove monthly flex
JulianGeis Nov 3, 2025
36c0bd9
code cleaning and plots for per node flex aggregated
JulianGeis Nov 5, 2025
7b0a38f
more scenarios
JulianGeis Nov 6, 2025
3e7d78a
indendation error fix
JulianGeis Nov 6, 2025
8e4f268
update base capacities
JulianGeis Nov 6, 2025
7adeb36
update ipynb
JulianGeis Nov 6, 2025
f131cd2
remove 365H capacities; fix wrond df format in capacities
JulianGeis Nov 10, 2025
84f2d43
add capacities for 49cl 3H
JulianGeis Nov 10, 2025
cedfda1
fixes for comparison plot and add abbreviations
JulianGeis Nov 12, 2025
e1ee14b
update of Base capacities, plotting, jupyter notebooks
JulianGeis Nov 21, 2025
6e4b9c1
restrict component buildout for whole system
JulianGeis Nov 25, 2025
c1f71e3
increase memory for plotting
JulianGeis Nov 25, 2025
e028623
update scenarios
JulianGeis Dec 9, 2025
75e043b
add load shedding
JulianGeis Dec 9, 2025
99997be
scenarios updated for 49cl 1H and plotting scripts
JulianGeis Jan 16, 2026
096bac4
remove load shedding
JulianGeis Jan 16, 2026
f092883
add low flex testing scenarios
JulianGeis Jan 19, 2026
6c8cd02
fix plotting allocation
JulianGeis Jan 19, 2026
79afd0b
more low flex testing; improvement of restrict_component_buildout
JulianGeis Jan 20, 2026
45ac710
more low flex testing
JulianGeis Jan 21, 2026
e41d6a8
add synchronize_TES_extendability function to ensure TES constraints …
JulianGeis Jan 26, 2026
bd1ca41
synchronize TES charger, discharger and store; apply restrict compone…
JulianGeis Jan 26, 2026
6decb7d
scenarios for LowFlex 1H 49cl testing
JulianGeis Jan 27, 2026
d85f44c
set LowFlex50_pminpu0.9 as LowFlex scenario
JulianGeis Feb 2, 2026
96c6284
add plotting routines to workflow
JulianGeis Feb 9, 2026
754dee0
add plotting script for methods
JulianGeis Feb 9, 2026
840ba80
fix bug for restrict_component_buildout
JulianGeis Feb 9, 2026
698f6be
add more plots to workflow routine; disable h2_retrofit; disable all …
JulianGeis Feb 10, 2026
f7ff8b6
weaker lowflex scenarios
JulianGeis Feb 12, 2026
07407bb
plot and scenario updates
JulianGeis Feb 13, 2026
fb5c57d
scenario clean up
JulianGeis Feb 13, 2026
82d7832
add more LF scenarios
JulianGeis Feb 13, 2026
04ac7a1
add LowFlex50_pminpu0.5, LowFlex50_pminpu0.3 and make one node per co…
JulianGeis Feb 18, 2026
77b421c
include EV and decentral heat pump demand to residual load; update pl…
JulianGeis Mar 3, 2026
81822bb
set LowFlex75_pminpu_0.5 as default LowFlex scenario; adapt plotting …
JulianGeis Mar 3, 2026
655a150
handle case with V2G for calc_supply_demand function
JulianGeis Mar 3, 2026
78d45bc
properly seperate EV battery bus in case of V2G
JulianGeis Mar 3, 2026
ad7e69a
final config updates and really proper V2G separation
JulianGeis Mar 4, 2026
5543f17
remove old scenarios and old restric_component_buildout logic; import…
JulianGeis Mar 5, 2026
2ce61b7
fix intendation bug
JulianGeis Mar 9, 2026
a6ee1a8
other weather years
JulianGeis Mar 20, 2026
0786e9e
change to h2 retrofit force from 2035 to 2045
JulianGeis Mar 24, 2026
9c29220
add load shedding, update README, update ipynbs
JulianGeis Apr 2, 2026
432d0b0
backup file if temporal industrial load profiles download does not work
JulianGeis Apr 13, 2026
3ee383b
correct import limits functionality
JulianGeis Apr 13, 2026
2279d92
add load-shedding implementation
JulianGeis Apr 15, 2026
3c8861c
use capacities from run with load-shedding
JulianGeis Apr 24, 2026
5ad8ba7
low flex and capex sensitivities
JulianGeis Apr 24, 2026
fa932ec
add more conservative iron-air battery implementation
JulianGeis Apr 30, 2026
48eda14
set new duration_fix for iron-air battery (micha and my opinion)
JulianGeis May 4, 2026
202ae36
use Iegors P/E ratio duration fix ;update to 1500 and 1250$_2023/kW c…
JulianGeis May 8, 2026
8fbe84d
increase cost assumptions to be slightly higher than technology-data
JulianGeis May 8, 2026
2fc998a
remove DLR properly
JulianGeis Jun 16, 2026
b0ece77
ensure iron-air is not included in li-ion battery
JulianGeis Jun 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ d1gam3xoknrgr2.cloudfront.net/

*.geojson

*.ipynb
# *.ipynb

merger-todos.md

Expand Down
59 changes: 55 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# PyPSA-DE - Hochaufgelöstes, sektorengekoppeltes Modell des deutschen Energiesystems

PyPSA-DE ist ein sektorengekoppeltes Energiesystem-Modell auf Basis der Toolbox [PyPSA](https://github.com/PyPSA/pypsa) und des europäischen Modells [PyPSA-Eur](https://github.com/PyPSA/pypsa-eur). Der PyPSA-DE Workflow modelliert das deutsche Energiesystem mit deutschlandspezifischen Datensätzen (MaStR, Netzentwicklungsplan,...) im Verbund mit den direkten Stromnachbarn sowie Spanien und Italien. Der Ausbau und der Betrieb von Kraftwerken, des Strom- und Wasserstoffübertragunsnetzes und die Energieversorgung aller Sektoren werden dann in einem linearen Optimierungsproblem gelöst, mit hoher zeitlicher und räumlicher Auflösung. PyPSA-DE wurde im Rahmen des Kopernikus-Projekts [Ariadne](https://ariadneprojekt.de/) entwickelt in dem Szenarien für ein klimaneutrales Deutschland untersucht werden, und spielt eine zentrale Rolle im [Ariadne Szenarienreport](https://ariadneprojekt.de/publikation/report-szenarien-zur-klimaneutralitat-2045/), als Leitmodell für den [Sektor Energiewirtschaft und Infrastruktur](https://ariadneprojekt.de/publikation/report-szenarien-zur-klimaneutralitat-2045/#6-sektorale-perspektive-energiewirtschaft) und als eines von drei Gesamtsystemmodellen. Die Ergebnisse aus der Modellierung mit PyPSA-DE werden auch im [Ariadne-Webinar zu den Kernaussagen des Berichts](https://youtu.be/UL3KAH7e0zs) ([Folien](https://ariadneprojekt.de/media/2025/03/Ariadne_Szen2025_Webinar_Folien_Kernaussagen.pdf)) und im [Ariadne-Webinar zur Energiewirtschaft](https://youtu.be/FcmHBL1MKQA) ([Folien](https://ariadneprojekt.de/media/2025/03/Ariadne_Szen2025_Webinar_Folien_Energiewirtschaft.pdf)) vorgestellt. Die [gelösten Netzwerke](https://zenodo.org/records/15096970) sind auf zenodo verfügbar.

# PyPSA-DE - High resolution, sector-coupled model of the German Energy System

PyPSA-DE is a sector-coupled energy system model based on the toolbox [PyPSA](https://github.com/PyPSA/pypsa) and the European model [PyPSA-Eur](https://github.com/PyPSA/pypsa-eur). It solves a linear optimization problem to simulate the electricty and hydrogen transmission networks, as well as supply, demand and storage in all sectors of the energy system in Germany and its neighboring countries, as well as Italy and Spain, with high spatial and temporal resolution. PyPSA-DE was developed in the context of the Kopernikus-Projekt [Ariadne](https://ariadneprojekt.de/en/), which studies scenarios of a carbon-neutral German economcy, and plays a decisive role in the [Ariadne Szenarienreport](https://ariadneprojekt.de/publikation/report-szenarien-zur-klimaneutralitat-2045/), as reference model for the [energy and infrastructure sectors](https://ariadneprojekt.de/publikation/report-szenarien-zur-klimaneutralitat-2045/#6-sektorale-perspektive-energiewirtschaft). The results of modeling with PyPSA-DE are also presented in the [Ariadne-Webinar on the core messages of the report](https://youtu.be/UL3KAH7e0zs) ([slides](https://ariadneprojekt.de/media/2025/03/Ariadne_Szen2025_Webinar_Folien_Kernaussagen.pdf)) and in the [Ariadne-Webinar on the energy sector](https://youtu.be/FcmHBL1MKQA) ([slides](https://ariadneprojekt.de/media/2025/03/Ariadne_Szen2025_Webinar_Folien_Energiewirtschaft.pdf)). The [solved networks](https://zenodo.org/records/15096970) are available on zenodo.
Expand Down Expand Up @@ -50,6 +46,61 @@ This will run all analysis steps to reproduce results. If computational resource
* `logs` and `benchmarks`
* The `Snakefile` contains the PyPSA-DE specific snakemake workflow

## Flexibility Implementations

This repository contains extensions to PyPSA-DE for analysing flexibility needs and provision in a sector-coupled energy system. These are developed as part of a separate research branch and documented below.

### Environment

Use the existing PyPSA-DE environment — no separate environment is required for the flexibility analysis.

### Flexibility scenarios

The flexibility scenarios (e.g. LowFlex, LowBattery, Base, HighFlex) are defined in `config/scenarios.manual.yaml`. As with any PyPSA-DE scenario, the `build_scenarios` rule must be run before executing the flexibility workflow:

snakemake build_scenarios -f

Then run the flexibility analysis as described above.

### Flexibility-related model modifications

Several flexibility features are injected into the pre-network building stage via `scripts/pypsa-de/modify_prenetwork.py` (within the `# Start/End Flexibility implementations` block):

- **Industrial DSM**: adds demand-side management for industry if enabled and configured for the current planning year
- **Unit commitment**: optionally enforces unit commitment constraints for configurable carriers and regions, with `optimistic`, `conservative`, `average`, or `custom` parameter sets
- **Cross-border flow restrictions**: limits cross-border flows in specified planning years
- **Component buildout restrictions**: caps technology capacities relative to base capacities , configured via `restrict_component_buildout` in the config; base capacity CSVs are read from `flex-data/`
- **Forced PtH profiles**: optionally enforces minimum output profiles for decentralised rural power-to-heat units

### Flexibility workflow (Snakemake)

The flexibility-specific rules are defined at the end of the `Snakefile`. Run them with:
```bash
snakemake flex_all # runs all flexibility analyses and plots
snakemake flexibility_analysis # computes flexibility needs/contributions
snakemake flexibility_plots # generates standard flexibility plots
snakemake flexibility_plots_scenario_comparison # cross-scenario comparison
```

`flex_all` also triggers system plots and the Ariadne reporting outputs.

### Scripts

All flexibility scripts are in `scripts/pypsa-de/`:

| File | Purpose |
|---|---|
| `flexibility_analysis.py` | Core analysis: computes flexibility needs, causes, and contributions per node and month |
| `flexibility_plots.py` | Standard plots (needs, causes, contributions, monthly breakdowns) |
| `flexibility_plots_scenario_comparison.py` | Cross-scenario comparison plots |
| `system_plots.py` / `system_plots_scenario_comparison.py` | System-level plots |
| `flexibility_utils.py` | Shared utility functions used across the above scripts |

### Additional data and notebooks

* `flex-data/`: base capacity CSVs used to scale technology capacities in sensitivity scenarios (e.g. LowFlex, LowBattery)
* `flex_notebooks/`: Jupyter notebooks for exploratory flexibility analysis and figure generation outside the Snakemake workflow

## Differences to PyPSA-EUR

PyPSA-DE is a softfork of PyPSA-EUR. As such, large parts of the functionality are similar, and the [documentation](https://pypsa-eur.readthedocs.io/en/latest/) of PyPSA-Eur is a good starting point to get acquainted with the model. On top of that, PyPSA-DE adds several data sources and workflow steps that improve the representation of the German Energy System. Below is a non-conclusive list of the most important changes.
Expand Down
Loading
Loading