edisgo.tools.temporal_complexity_reduction

Module Contents

Functions

get_most_critical_time_intervals(edisgo_obj[, ...])

Get time intervals sorted by severity of overloadings as well as voltage issues.

get_most_critical_time_steps(→ pandas.DatetimeIndex)

Get the time steps with the most critical overloading and voltage issues.

edisgo.tools.temporal_complexity_reduction.get_most_critical_time_intervals(edisgo_obj, num_time_intervals=None, percentage=1.0, time_steps_per_time_interval=168, time_step_day_start=0, save_steps=False, path='', use_troubleshooting_mode=True, overloading_factor=0.95, voltage_deviation_factor=0.95, weight_by_costs=True)[source]

Get time intervals sorted by severity of overloadings as well as voltage issues.

The overloading and voltage issues can be weighted by the estimated expansion costs solving the issue would require. The length of the time intervals and hour of day at which the time intervals should begin can be set through the parameters time_steps_per_time_interval and time_step_day_start.

This function currently only works for an hourly resolution!

Parameters:
  • edisgo_obj (EDisGo) – The eDisGo API object

  • num_time_intervals (int) – The number of time intervals of most critical line loading and voltage issues to select. If None, percentage is used. Default: None.

  • percentage (float) – The percentage of most critical time intervals to select. The default is 1.0, in which case all most critical time steps are selected. Default: 1.0.

  • time_steps_per_time_interval (int) – Amount of continuous time steps in an interval that violation is determined for. Currently, these can only be multiples of 24. Default: 168.

  • time_step_day_start (int) – Time step of the day at which each interval should start. If you want it to start at midnight, this should be set to 0. Default: 0.

  • save_steps (bool) – If set to True, dataframe with time intervals is saved to csv file. The path can be specified through parameter path. Default: False.

  • path (str) – Directory the csv file is saved to. Per default, it takes the current working directory.

  • use_troubleshooting_mode (bool) – If set to True, non-convergence issues in power flow are tried to be handled by reducing load and feed-in in steps of 10% down to 20% of the original load and feed-in until the power flow converges. The most critical time intervals are then determined based on the power flow results with the reduced load and feed-in. If False, an error will be raised in case time steps do not converge. Default: True.

  • overloading_factor (float) – Factor at which an overloading of a component is considered to be close enough to the highest overloading of that component. This is used to determine the number of components that reach their highest overloading in each time interval. Per default, it is set to 0.95, which means that if the highest overloading of a component is 2, it will be considered maximally overloaded at an overloading of higher or equal to 2*0.95. Default: 0.95.

  • voltage_deviation_factor (float) – Factor at which a voltage deviation at a bus is considered to be close enough to the highest voltage deviation at that bus. This is used to determine the number of buses that reach their highest voltage deviation in each time interval. Per default, it is set to 0.95. This means that if the highest voltage deviation at a bus is 0.2, it will be included in the determination of number of buses that reach their maximum voltage deviation in a certain time interval at a voltage deviation of higher or equal to 0.2*0.95. Default: 0.95.

  • weight_by_costs (bool) –

    Defines whether overloading and voltage issues should be weighted by estimated grid expansion costs or not. This can be done in order to take into account that some grid issues are more relevant, as reinforcing a certain line or feeder will be more expensive than another one.

    In case of voltage issues: If True, the costs for each MV and LV feeder, as well as MV/LV station are determined using the costs for earth work and new lines over the full length of the feeder respectively for a new MV/LV station. In each time interval, the estimated costs are only taken into account, in case there is a voltage issue somewhere in the feeder. The costs don’t convey the actual costs but are an estimation, as the real number of parallel lines needed is not determined and the whole feeder length is used instead of the length over two-thirds of the feeder. If False, only the maximum voltage deviation in the feeder is used to determine the most relevant time intervals.

    In case of overloading issues: If True, the overloading of each line is multiplied by the respective grid expansion costs of that line including costs for earth work and one new line. The costs don’t convey the actual costs but are an estimation, as the discrete number of needed parallel lines is not considered. If False, only the relative overloading is used to determine the most relevant time intervals.

    Default: True.

Returns:

Contains time intervals in which grid expansion needs due to overloading and voltage issues are detected. The time intervals are determined independently for overloading and voltage issues and sorted descending by the expected cumulated grid expansion costs, so that the time intervals with the highest expected costs correspond to index 0. In case of overloading, the time steps in the respective time interval are given in column “time_steps_overloading” and the share of components for which the maximum overloading is reached during the time interval is given in column “percentage_max_overloaded_components”. For voltage issues, the time steps in the respective time interval are given in column “time_steps_voltage_issues” and the share of buses for which the maximum voltage deviation is reached during the time interval is given in column “percentage_buses_max_voltage_deviation”.

Return type:

pandas.DataFrame

edisgo.tools.temporal_complexity_reduction.get_most_critical_time_steps(edisgo_obj: edisgo.EDisGo, mode=None, timesteps=None, lv_grid_id=None, scale_timeseries=None, num_steps_loading=None, num_steps_voltage=None, percentage: float = 1.0, use_troubleshooting_mode=True, run_initial_analyze=True, weight_by_costs=True) pandas.DatetimeIndex[source]

Get the time steps with the most critical overloading and voltage issues.

Parameters:
  • edisgo_obj (EDisGo) – The eDisGo API object

  • mode (str or None) – Allows to toggle between power flow analysis for the whole network or just the MV or one LV grid. See parameter mode in function analyze for more information.

  • timesteps (pandas.DatetimeIndex or pandas.Timestamp) – Timesteps specifies from which time steps to select most critical ones. It defaults to None in which case all time steps in timeindex are used.

  • lv_grid_id (int or str) – ID (e.g. 1) or name (string representation, e.g. “LVGrid_1”) of LV grid to analyze in case mode is ‘lv’. Default: None.

  • scale_timeseries (float or None) – See parameter scale_timeseries in function analyze for more information.

  • num_steps_loading (int) – The number of most critical overloading events to select. If None, percentage is used. Default: None.

  • num_steps_voltage (int) – The number of most critical voltage issues to select. If None, percentage is used. Default: None.

  • percentage (float) – 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) – If set to True, non-convergence issues in power flow are tried to be handled by reducing load and feed-in in steps of 10% down to 20% of the original load and feed-in until the power flow converges. The most critical time steps are then determined based on the power flow results with the reduced load and feed-in. If False, an error will be raised in case time steps do not converge. Default: True.

  • run_initial_analyze (bool) – 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) –

    Defines whether overloading and voltage issues should be weighted by estimated grid expansion costs or not. This can be done in order to take into account that some grid issues are more relevant, as reinforcing a certain line or feeder will be more expensive than another one.

    In case of voltage issues: If True, the voltage issues at each bus are weighted by the estimated grid expansion costs for the MV or LV feeder the bus is in or in case of MV/LV stations by the costs for a new transformer. Feeder costs are determined using the costs for earth work and new lines over the full length of the feeder. The costs don’t convey the actual costs but are an estimation, as the real number of parallel lines needed is not determined and the whole feeder length is used instead of the length over two-thirds of the feeder. If False, the severity of each feeder’s voltage issue is set to be the same.

    In case of overloading issues: If True, the overloading of each line is multiplied by the respective grid expansion costs of that line including costs for earth work and one new line. The costs don’t convey the actual costs but are an estimation, as the discrete needed number of parallel lines is not considered. If False, only the relative overloading is used.

    Default: True.

Returns:

Time index with unique time steps where maximum overloading or maximum voltage deviation is reached for at least one component respectively bus.

Return type:

pandas.DatetimeIndex