Skip to content

Commit

Permalink
Improve equivalent transformation calculations in base.nc (#978)
Browse files Browse the repository at this point in the history
* Keep an original voltage value before rebase

* Adjust the transmission capacity to account for the voltage rebase

* Adjust p_nom calculations for DC lines

* Add a release note
  • Loading branch information
ekatef authored Mar 4, 2024
1 parent f2a5cba commit 283668a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ E.g. if a new rule becomes available describe how to use it `snakemake -j1 run_t

**Minor Changes and bug-fixing**

* Minor bug-fixing for GADM_ID format naming. `PR #980 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/980>`__

* Keep data on the original voltage value when rebasing voltages to the standard values and adjust the transmission capacity accordingly. `PR #898 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/978>`__

* Minor bug-fixing for GADM_ID format naming. `PR #980 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/980>`__

PyPSA-Earth 0.3.0
=================
Expand Down
11 changes: 10 additions & 1 deletion scripts/base_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ def _rebase_voltage_to_config(base_network_config, voltages_config, component):
config : dictionary (by snakemake)
component : dataframe
"""
component["v_nom_original"] = component["v_nom"]

v_min = (
base_network_config["min_voltage_rebase_voltage"] / 1000
) # min. filtered value in dataset
Expand Down Expand Up @@ -494,9 +496,16 @@ def base_network(
lines_dc = lines[lines.tag_frequency.astype(float) == 0].copy()

lines_ac = _set_electrical_parameters_lines(lines_config, voltages_config, lines_ac)
lines_ac.num_parallel = lines_ac.num_parallel * (
lines_ac.v_nom_original / lines_ac.v_nom
)

lines_dc = _set_electrical_parameters_dc_lines(
lines_config, voltages_config, lines_dc
)
lines_dc.num_parallel = lines_dc.num_parallel * (
lines_dc.v_nom_original / lines_dc.v_nom
)

transformers = _set_electrical_parameters_transformers(
transformers_config, transformers
Expand All @@ -518,7 +527,7 @@ def base_network(
lines_dc = _set_electrical_parameters_links(links_config, lines_dc)
# parse line information into p_nom required for converters
lines_dc["p_nom"] = lines_dc.apply(
lambda x: x["v_nom"] * n.line_types.i_nom[x["type"]],
lambda x: x["v_nom_original"] * n.line_types.i_nom[x["type"]],
axis=1,
result_type="reduce",
)
Expand Down

0 comments on commit 283668a

Please sign in to comment.