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

Wp flex changed reinforcement 2 #391

Open
wants to merge 24 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
34c30b4
Add new reinforce measure in case of voltage issues
birgits Oct 26, 2023
b9d27d8
Add function to get standard line from config
birgits Oct 27, 2023
f82804b
Move splitting of feeder to separate function
birgits Oct 27, 2023
8bc8bea
Minor doc change
birgits Oct 27, 2023
67d2cb3
Add option to keep line_type and number of parallel lines when splitt…
birgits Oct 27, 2023
ebd8172
Change parameter name
birgits Oct 27, 2023
56dddb9
Fix adding parameter to function
birgits Oct 27, 2023
8924e2d
Add function to obtain transformer costs
birgits Oct 28, 2023
8f55efb
Add type_info to new transformers when grid is split
birgits Oct 28, 2023
6b6b75b
Use minimum of quantity added and parallel lines because sometimes li…
birgits Oct 28, 2023
1a2aed1
Bug fix not all transformer changes have station in name
birgits Oct 28, 2023
aba6897
Bug fix
birgits Oct 30, 2023
25c5df5
Bug fix add missing parameter
birgits Oct 30, 2023
3fed9d1
Merge branch 'features/home_storage_operation' into wp_flex_changed_r…
birgits Oct 30, 2023
c0837d5
Merge branch 'features/home_storage_operation' into wp_flex_changed_r…
birgits Oct 31, 2023
7ea7eb8
Bug fix convert to float64 so that round() does not fail
birgits Oct 31, 2023
097f965
Bug fix create directory for logging
birgits Nov 15, 2023
4dfc1d0
Bug fix create directories recursively
birgits Nov 15, 2023
2973cba
Enable getting electricity time series for status quo for households …
birgits Nov 18, 2023
f3eab58
Add todo
birgits Dec 6, 2023
762dce3
Merge branch 'dev' into wp_flex_changed_reinforcement_2
birgits Dec 20, 2023
5288c7d
Merge branch 'dev' into wp_flex_changed_reinforcement_2
birgits Jan 18, 2024
b5d976f
Merge branch 'dev' into wp_flex_changed_reinforcement_2
birgits Apr 24, 2024
19e01ce
Merge branch 'dev' into wp_flex_changed_reinforcement_2
birgits Apr 24, 2024
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
27 changes: 23 additions & 4 deletions edisgo/flex_opt/reinforce_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ def enhanced_reinforce_grid(
activate_cost_results_disturbing_mode: bool = False,
separate_lv_grids: bool = True,
separation_threshold: int | float = 2,
use_standard_line_type: bool = True,
**kwargs,
) -> EDisGo:
"""
Expand Down Expand Up @@ -877,7 +878,12 @@ def enhanced_reinforce_grid(
separation_threshold : int or float
Overloading threshold for LV grid separation. If the overloading is higher than
the threshold times the total nominal apparent power of the MV/LV transformer(s)
the grid is separated.
the grid is separated. Default: 2.
use_standard_line_type : bool
Only used when `separate_lv_grids` is set to True. If use_standard_line_type is
True, standard line type is used to connect bus, where feeder is split, to
the station. If False, the same line type and number of parallel lines as
the original line is used. Default: True.
kwargs : dict
Keyword arguments can be all parameters of function
:func:`edisgo.flex_opt.reinforce_grid.reinforce_grid`, except
Expand All @@ -891,6 +897,7 @@ def enhanced_reinforce_grid(

"""
kwargs.pop("skip_mv_reinforcement", False)
# ToDo kwargs timesteps_pfa is currently ignored, should that be changed?

num_lv_grids_standard_lines = 0
num_lv_grids_aggregated = 0
Expand All @@ -900,7 +907,11 @@ def enhanced_reinforce_grid(
"Separating lv grids. Set the parameter 'separate_lv_grids' to False if "
"this is not desired."
)
run_separate_lv_grids(edisgo_object, threshold=separation_threshold)
run_separate_lv_grids(
edisgo_object,
threshold=separation_threshold,
use_standard_line_type=use_standard_line_type,
)

logger.info("Run initial grid reinforcement for single LV grids.")
for lv_grid in list(edisgo_object.topology.mv_grid.lv_grids):
Expand Down Expand Up @@ -1077,7 +1088,11 @@ def enhanced_reinforce_grid(
return edisgo_object


def run_separate_lv_grids(edisgo_obj: EDisGo, threshold: int | float = 2) -> None:
def run_separate_lv_grids(
edisgo_obj: EDisGo,
threshold: int | float = 2,
use_standard_line_type: bool = True,
) -> None:
"""
Separate all highly overloaded LV grids within the MV grid.

Expand All @@ -1095,6 +1110,10 @@ def run_separate_lv_grids(edisgo_obj: EDisGo, threshold: int | float = 2) -> Non
Overloading threshold. If the overloading is higher than the threshold times
the total nominal apparent power of the MV/LV transformer(s), the grid is
separated.
use_standard_line_type : bool
If use_standard_line_type is True, standard line type is used to connect bus
where feeder is split to the station. If False, the same line type and number
of parallel lines as the original line is used. Default: True.

Returns
-------
Expand Down Expand Up @@ -1169,7 +1188,7 @@ def run_separate_lv_grids(edisgo_obj: EDisGo, threshold: int | float = 2) -> Non
if worst_case > threshold * transformers_s_nom:
logger.info(f"Trying to separate {lv_grid}...")
transformers_changes, lines_changes = separate_lv_grid(
edisgo_obj, lv_grid
edisgo_obj, lv_grid, use_standard_line_type
)
if len(lines_changes) > 0:
_add_lines_changes_to_equipment_changes(
Expand Down
Loading
Loading