https://github.com/pypsa/condynet-2-wp-1
Code for topology-based approximations for N-1 contingency constraints
https://github.com/pypsa/condynet-2-wp-1
Last synced: 7 months ago
JSON representation
Code for topology-based approximations for N-1 contingency constraints
- Host: GitHub
- URL: https://github.com/pypsa/condynet-2-wp-1
- Owner: PyPSA
- License: gpl-3.0
- Created: 2021-03-18T20:31:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-18T09:23:13.000Z (over 4 years ago)
- Last Synced: 2025-01-17T03:44:39.839Z (about 1 year ago)
- Language: Jupyter Notebook
- Size: 254 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Workflow Overview
# Find buffer capacity factors
In this repository, we find buffer capacity factor based on our proposed approximate approach `c_a` (cf. rule `compute_approximate_c`),
robust approach for each subset `c_r` (cf. rule `compute_robust_c`) for each subset and whole of the network,
and line-specific approach `c_l` (cf. rule `compute_linespecific_c`) for the all transmission lines.
# Heuristic Security-Constrained LOPF
This repository is useful to test the operational costs of
a network with different buffer capacity (contingency) factors (cf. rule `solve_heuristic_contingency`) versus the
fully security-constrained case (cf. rule `solve_full_contingency`), as well as how
secure the heuristic systems for specific outages (cf. rule `check_outage_flow`).
## Workflow Structure

Documentation inside `scripts/*.py`.
## Configuration Options
The configuration is set in `config.yaml`.
- `network:` specifies the path to the already solved PyPSA-Eur network. Ideal would be a 50-node German network with investments optimized for 90% CO2 redunction, which has lots of flow, but also some conventional generators to set high marginal prices.
- `load_shedding:` adds load shedding generators to the network if not already existing to guarantee feasibility.
- `rolling_horizon:` runs full security-constraint LOPF in batches of snapshots rather than all at once.
- `group_size:` specifies the number of snapshots that form a batch.
- `s_max_pu:` specifies which heuristic contingency factors you want to sweep through.
- `solver:` includes the solver options and parameters.
## Executing on Cluster
Mount the LSDF, do `kubectl-login`, go to project directory and execute:
```
kubedo --inception -i pypsa-eur-gurobi -- snakemake -j 99 all
```
## Caveats
Make sure you do not have any lines with `num_parallel=0` and infinite reactance `x=np.inf`.
Make sure you do not have sub networks with a single bus.
## Analysis
You can get the operational costs of a network with different buffer capacity factor with `notebooks/operation_cost.py`.
You can check out the line loadings at the different outages with
```py
import pandas as pd
pd.read_csv("results/new/outage_line_loading_heur....csv", index_col=[0,1,2], parse_dates=True)
```
This file has multiple index levels: the first is the snapshot, the second the component type, the third the line index. The columns denote the outage of the line. The column `base` shows the flows under no outage conditions. You can compare this data to the line capacities in `n.lines.s_nom` to find any overloadings.
You can find total cases and snapshots where the transmission network is overloaded in at least one line for different buffer capacity factors with `notebooks/check_outages.py`.
## Plot
All results has been plotted with `notebooks/plot.ipynb`.