edisgo.flex_opt.reinforce_grid ============================== .. py:module:: edisgo.flex_opt.reinforce_grid Functions --------- .. autoapisummary:: edisgo.flex_opt.reinforce_grid.reinforce_grid edisgo.flex_opt.reinforce_grid.catch_convergence_reinforce_grid edisgo.flex_opt.reinforce_grid.enhanced_reinforce_grid edisgo.flex_opt.reinforce_grid.run_separate_lv_grids Module Contents --------------- .. py:function:: reinforce_grid(edisgo, timesteps_pfa = None, reduced_analysis = False, max_while_iterations = 20, split_voltage_band = True, mode = None, without_generator_import = False, n_minus_one = False, **kwargs) Evaluates network reinforcement needs and performs measures. This function is the parent function for all network reinforcements. :param edisgo: The eDisGo object grid reinforcement is conducted on. :type edisgo: :class:`~.EDisGo` :param timesteps_pfa: timesteps_pfa specifies for which time steps power flow analysis is conducted. See parameter `timesteps_pfa` in function :attr:`~.EDisGo.reinforce` for more information. :type timesteps_pfa: str or :pandas:`pandas.DatetimeIndex` or :pandas:`pandas.Timestamp` :param reduced_analysis: Specifies, whether to run reinforcement on a subset of time steps that are most critical. See parameter `reduced_analysis` in function :attr:`~.EDisGo.reinforce` for more information. :type reduced_analysis: bool :param max_while_iterations: Maximum number of times each while loop is conducted. Default: 20. :type max_while_iterations: int :param split_voltage_band: 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. :type split_voltage_band: bool :param mode: Determines network levels reinforcement is conducted for. See parameter `mode` in function :attr:`~.EDisGo.reinforce` for more information. :type mode: str :param without_generator_import: If True, excludes lines that were added in the generator import to connect new generators from calculation of network expansion costs. Default: False. :type without_generator_import: bool :param n_minus_one: 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. :type n_minus_one: bool :param lv_grid_id: LV grid id to specify the grid to check, if mode is "lv". See parameter `lv_grid_id` in function :attr:`~.EDisGo.reinforce` for more information. :type lv_grid_id: str or int or None :param scale_timeseries: 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. :type scale_timeseries: float or None :param skip_mv_reinforcement: 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. :type skip_mv_reinforcement: bool :param num_steps_loading: 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. :type num_steps_loading: int :param num_steps_voltage: 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. :type num_steps_voltage: int :param percentage: 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. :type percentage: float :param use_troubleshooting_mode: 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 :attr:`~.EDisGo.reinforce` for more information. Default: False. :type use_troubleshooting_mode: bool :param run_initial_analyze: 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. :type run_initial_analyze: bool :param weight_by_costs: 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 :func:`~.tools.temporal_complexity_reduction.get_most_critical_time_steps` for more information. Default: False. :type weight_by_costs: bool :returns: Returns the Results object holding network expansion costs, equipment changes, etc. :rtype: :class:`~.network.results.Results` .. rubric:: Notes See :ref:`features-in-detail` for more information on how network reinforcement is conducted. .. py:function:: catch_convergence_reinforce_grid(edisgo, **kwargs) 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. :param edisgo: :type edisgo: :class:`~.EDisGo` :param kwargs: See parameters of function :func:`edisgo.flex_opt.reinforce_grid.reinforce_grid`. :type kwargs: dict :returns: Returns the Results object holding network expansion costs, equipment changes, etc. :rtype: :class:`~.network.results.Results` .. py:function:: enhanced_reinforce_grid(edisgo_object, activate_cost_results_disturbing_mode = False, separate_lv_grids = True, separation_threshold = 2, **kwargs) Reinforcement strategy to reinforce grids voltage level by voltage level in case grid reinforcement method :func:`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 :func:`~.flex_opt.reinforce_grid.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. :param edisgo_object: :type edisgo_object: :class:`~.EDisGo` :param activate_cost_results_disturbing_mode: 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. :type activate_cost_results_disturbing_mode: bool :param separate_lv_grids: If True, all highly overloaded LV grids are separated in a first step. :type separate_lv_grids: bool :param separation_threshold: 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. :type separation_threshold: int or float :param kwargs: Keyword arguments can be all parameters of function :func:`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. :type kwargs: dict :returns: The reinforced eDisGo object. :rtype: :class:`~.EDisGo` .. py:function:: run_separate_lv_grids(edisgo_obj, threshold = 2) 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. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param threshold: 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. :type threshold: int or float :returns: The reinforced eDisGo object. :rtype: :class:`~.EDisGo`