prepare_network: fix nmo security margin (#199)

* prepare_network: fix nmo security margin

* Update doc/release_notes.rst

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>

* Update scripts/prepare_network.py

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
This commit is contained in:
Martha Maria 2020-10-02 15:55:22 +02:00 committed by GitHub
parent 2e76b88ec8
commit 52683236cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -35,7 +35,10 @@ Upcoming Release
* Use `mamba` (https://github.com/mamba-org/mamba) for faster Travis CI builds (`#196 <https://github.com/PyPSA/pypsa-eur/pull/196>`_) * Use `mamba` (https://github.com/mamba-org/mamba) for faster Travis CI builds (`#196 <https://github.com/PyPSA/pypsa-eur/pull/196>`_)
* The mappings for clustered lines and buses produced by the ``simplify_network`` and ``cluster_network`` rules changed from Hierarchical Data Format (.h5) to Comma-Separated Values format (.csv) (`#198 <https://github.com/PyPSA/pypsa-eur/pull/198>`_) * The N-1 security margin for transmission lines is now fixed to a provided value in ``config.yaml``, removing an undocumented linear interpolation between 0.5 and 0.7 in the range between 37 and 200 nodes.
* The mappings for clustered lines and buses produced by the ``simplify_network`` and ``cluster_network`` rules changed from Hierarchical Data Format (.h5) to Comma-Separated Values format (.csv) (`#198 <https://github.com/PyPSA/pypsa-eur/pull/198>`_)
PyPSA-Eur 0.2.0 (8th June 2020) PyPSA-Eur 0.2.0 (8th June 2020)
================================== ==================================

View File

@ -93,10 +93,9 @@ def add_emission_prices(n, emission_prices=None, exclude_co2=False):
def set_line_s_max_pu(n): def set_line_s_max_pu(n):
# set n-1 security margin to 0.5 for 37 clusters and to 0.7 from 200 clusters s_max_pu = snakemake.config['lines']['s_max_pu']
n_clusters = len(n.buses)
s_max_pu = np.clip(0.5 + 0.2 * (n_clusters - 37) / (200 - 37), 0.5, 0.7)
n.lines['s_max_pu'] = s_max_pu n.lines['s_max_pu'] = s_max_pu
logger.info(f"N-1 security margin of lines set to {s_max_pu}")
def set_transmission_limit(n, ll_type, factor, Nyears=1): def set_transmission_limit(n, ll_type, factor, Nyears=1):