edisgo.flex_opt.reinforce_grid

Module Contents

Functions

reinforce_grid(→ edisgo.network.results.Results)

Evaluates network reinforcement needs and performs measures.

catch_convergence_reinforce_grid(...)

Reinforcement strategy to reinforce grids with non-converging time steps.

enhanced_reinforce_grid(→ edisgo.EDisGo)

Reinforcement strategy to reinforce grids voltage level by voltage level in case

run_separate_lv_grids(→ None)

Separate all highly overloaded LV grids within the MV grid.

edisgo.flex_opt.reinforce_grid.reinforce_grid(edisgo: edisgo.EDisGo, timesteps_pfa: str | pandas.DatetimeIndex | pandas.Timestamp | None = None, reduced_analysis: bool = False, max_while_iterations: int = 20, split_voltage_band: bool = True, mode: str | None = None, without_generator_import: bool = False, n_minus_one: bool = False, **kwargs) edisgo.network.results.Results[source]

Evaluates network reinforcement needs and performs measures.

This function is the parent function for all network reinforcements.

Parameters:
  • edisgo (EDisGo) – The eDisGo object grid reinforcement is conducted on.

  • timesteps_pfa (str or pandas.DatetimeIndex or pandas.Timestamp) – timesteps_pfa specifies for which time steps power flow analysis is conducted. See parameter timesteps_pfa in function reinforce for more information.

  • reduced_analysis (bool) – Specifies, whether to run reinforcement on a subset of time steps that are most critical. See parameter reduced_analysis in function reinforce for more information.

  • max_while_iterations (int) – Maximum number of times each while loop is conducted. Default: 20.

  • split_voltage_band (bool) – If True the allowed voltage band of +/-10 percent is allocated to the different voltage levels MV, MV/LV and LV according to config values set in section grid_expansion_allowed_voltage_deviations. If False, the same voltage limits are used for all voltage levels. Be aware that this does currently not work correctly. Default: True.

  • mode (str) – Determines network levels reinforcement is conducted for. See parameter mode in function reinforce for more information.

  • without_generator_import (bool) – If True, excludes lines that were added in the generator import to connect new generators from calculation of network expansion costs. Default: False.

  • n_minus_one (bool) – Determines whether n-1 security should be checked. Currently, n-1 security cannot be handled correctly, wherefore the case where this parameter is set to True will lead to an error being raised. Default: False.

  • lv_grid_id (str or int or None) – LV grid id to specify the grid to check, if mode is “lv”. See parameter lv_grid_id in function reinforce for more information.

  • scale_timeseries (float or None) – If a value is given, the timeseries used in the power flow analysis are scaled with this factor (values between 0 and 1 will scale down the time series and values above 1 will scale the timeseries up). Downscaling of time series can be used to gradually reinforce the grid. If None, timeseries are not scaled. Default: None.

  • skip_mv_reinforcement (bool) – If True, MV is not reinforced, even if mode is “mv”, “mvlv” or None. This is used in case worst-case grid reinforcement is conducted in order to reinforce MV/LV stations for LV worst-cases. Default: False.

  • num_steps_loading (int) – In case reduced_analysis is set to True, this parameter can be used to specify the number of most critical overloading events to consider. If None, percentage is used. Default: None.

  • num_steps_voltage (int) – In case reduced_analysis is set to True, this parameter can be used to specify the number of most critical voltage issues to select. If None, percentage is used. Default: None.

  • percentage (float) – In case reduced_analysis is set to True, this parameter can be used to specify the percentage of most critical time steps to select. The default is 1.0, in which case all most critical time steps are selected. Default: 1.0.

  • use_troubleshooting_mode (bool) – In case reduced_analysis is set to True, this parameter can be used to specify how to handle non-convergence issues in the power flow analysis. See parameter use_troubleshooting_mode in function reinforce for more information. Default: False.

  • run_initial_analyze (bool) – In case reduced_analysis is set to True, this parameter can be used to specify whether to run an initial analyze to determine most critical time steps or to use existing results. If set to False, use_troubleshooting_mode is ignored. Default: True.

  • weight_by_costs (bool) – In case reduced_analysis is set to True, this parameter can be used to specify whether to weight time steps by estimated grid expansion costs. See parameter weight_by_costs in get_most_critical_time_steps() for more information. Default: False.

Returns:

Returns the Results object holding network expansion costs, equipment changes, etc.

Return type:

Results

Notes

See Features in detail for more information on how network reinforcement is conducted.

edisgo.flex_opt.reinforce_grid.catch_convergence_reinforce_grid(edisgo: edisgo.EDisGo, **kwargs) edisgo.network.results.Results[source]

Reinforcement strategy to reinforce grids with non-converging time steps.

First, conducts a grid reinforcement with only converging time steps. Afterward, tries to run reinforcement with all time steps that did not converge in the beginning. At last, if there are still time steps that do not converge, the feed-in and load time series are iteratively scaled and the grid reinforced, starting with a low grid load and scaling-up the time series until the original values are reached.

Parameters:
Returns:

Returns the Results object holding network expansion costs, equipment changes, etc.

Return type:

Results

edisgo.flex_opt.reinforce_grid.enhanced_reinforce_grid(edisgo_object: edisgo.EDisGo, activate_cost_results_disturbing_mode: bool = False, separate_lv_grids: bool = True, separation_threshold: int | float = 2, **kwargs) edisgo.EDisGo[source]

Reinforcement strategy to reinforce grids voltage level by voltage level in case grid reinforcement method edisgo.flex_opt.reinforce_grid.catch_convergence_reinforce_grid() is not sufficient.

In a first step, if separate_lv_grids is set to True, LV grids with a large load, specified through parameter separation_threshold, are split, so that part of the load is served by a separate MV/LV station. See run_separate_lv_grids() for more information. In a second step, all LV grids are reinforced independently. Afterwards it is tried to run the grid reinforcement for all voltage levels at once. If this fails, reinforcement is first conducted for the MV level only, afterwards for the MV level including MV/LV stations and at last for each LV grid separately. For each LV grid is it checked, if all time steps converge in the power flow analysis. If this is not the case, the grid is split. Afterwards it is tried to be reinforced. If this fails and activate_cost_results_disturbing_mode parameter is set to True, further measures are taken. See parameter documentation for more information.

Parameters:
  • edisgo_object (EDisGo)

  • activate_cost_results_disturbing_mode (bool) – If True, LV grids where normal grid reinforcement does not solve all issues, two additional approaches are used to obtain a grid where power flow can be conducted without non-convergence. These two approaches are currently not included in the calculation of grid reinforcement costs, wherefore grid reinforcement costs will be underestimated. In the first approach, all lines in the LV grid are replaced by the standard line type. Should this not be sufficient to solve non-convergence issues, all components in the LV grid are aggregated to the MV/LV station. Default: False.

  • separate_lv_grids (bool) – If True, all highly overloaded LV grids are separated in a first step.

  • 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.

  • kwargs (dict) – Keyword arguments can be all parameters of function edisgo.flex_opt.reinforce_grid.reinforce_grid(), except catch_convergence_problems which will always be set to True, mode which is set to None, and skip_mv_reinforcement which will be ignored.

Returns:

The reinforced eDisGo object.

Return type:

EDisGo

edisgo.flex_opt.reinforce_grid.run_separate_lv_grids(edisgo_obj: edisgo.EDisGo, threshold: int | float = 2) None[source]

Separate all highly overloaded LV grids within the MV grid.

The loading is approximated by aggregation of all load and generator time series and comparison with the total nominal apparent power of the MV/LV transformer(s). This approach is chosen because this method aims at resolving highly overloaded grid situations in which cases the power flow often does not converge. This method ignores grid losses and voltage deviations. Original and new LV grids can be separated multiple times if the overloading is very high.

Parameters:
  • edisgo_obj (EDisGo)

  • threshold (int or float) – 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.

Returns:

The reinforced eDisGo object.

Return type:

EDisGo