edisgo.flex_opt.check_tech_constraints

Module Contents

Functions

mv_line_max_relative_overload(edisgo_obj[, n_minus_one])

Returns time step and value of most severe overloading of lines in MV network.

lv_line_max_relative_overload(edisgo_obj[, ...])

Returns time step and value of most severe overloading of lines in LV networks.

lines_allowed_load(edisgo_obj[, lines, n_minus_one])

Returns allowed loading of specified lines per time step in MVA.

lines_relative_load(edisgo_obj[, lines, n_minus_one])

Returns relative line load.

hv_mv_station_max_overload(edisgo_obj)

Checks for over-loading of HV/MV station.

mv_lv_station_max_overload(edisgo_obj[, lv_grid_id])

Checks for over-loading of MV/LV stations.

stations_allowed_load(edisgo_obj[, grids])

Returns allowed loading of specified grids stations to the overlying voltage level

stations_relative_load(edisgo_obj[, grids])

Returns relative loading of specified grids stations to the overlying voltage level

components_relative_load(edisgo_obj[, n_minus_one])

Returns relative loading of all lines and stations included in power flow analysis.

voltage_issues(edisgo_obj, voltage_level[, ...])

Gives buses with voltage issues and their maximum voltage deviation in p.u..

allowed_voltage_limits(edisgo_obj[, buses, ...])

Calculates allowed upper and lower voltage limits.

voltage_deviation_from_allowed_voltage_limits(edisgo_obj)

Function to detect under- and overvoltage at buses.

edisgo.flex_opt.check_tech_constraints.mv_line_max_relative_overload(edisgo_obj, n_minus_one=False)[source]

Returns time step and value of most severe overloading of lines in MV network.

Parameters:
  • edisgo_obj (EDisGo) –

  • n_minus_one (bool) – Determines which allowed load factors to use (see lines_allowed_load for more information). 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.

Returns:

Dataframe containing over-loaded MV lines, their maximum relative over-loading in p.u. (maximum calculated apparent power over allowed apparent power) and the corresponding time step. Index of the dataframe are the names of the over-loaded lines. Columns are ‘max_rel_overload’ containing the maximum relative over-loading as float, ‘time_index’ containing the corresponding time step the over-loading occurred in as pandas.Timestamp, and ‘voltage_level’ specifying the voltage level the line is in (either ‘mv’ or ‘lv’).

Return type:

pandas.DataFrame

Notes

Line over-load is determined based on allowed load factors for feed-in and load cases that are defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_load_factors’.

edisgo.flex_opt.check_tech_constraints.lv_line_max_relative_overload(edisgo_obj, n_minus_one=False, lv_grid_id=None)[source]

Returns time step and value of most severe overloading of lines in LV networks.

Parameters:
  • edisgo_obj (EDisGo) –

  • n_minus_one (bool) – Determines which allowed load factors to use (see lines_allowed_load for more information). 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.

  • lv_grid_id (str or int or None) – If None, checks overloading for all LV lines. Otherwise, only lines in given LV grid are checked. Default: None.

Returns:

Dataframe containing over-loaded LV lines, their maximum relative over-loading in p.u. (maximum calculated apparent power over allowed apparent power) and the corresponding time step. Index of the dataframe are the names of the over-loaded lines. Columns are ‘max_rel_overload’ containing the maximum relative over-loading as float, ‘time_index’ containing the corresponding time step the over-loading occurred in as pandas.Timestamp, and ‘voltage_level’ specifying the voltage level the line is in (either ‘mv’ or ‘lv’).

Return type:

pandas.DataFrame

Notes

Line over-load is determined based on allowed load factors for feed-in and load cases that are defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_load_factors’.

edisgo.flex_opt.check_tech_constraints.lines_allowed_load(edisgo_obj, lines=None, n_minus_one=False)[source]

Returns allowed loading of specified lines per time step in MVA.

Allowed loading is determined based on allowed load factors for feed-in and load cases that are defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_load_factors’.

Parameters:
  • edisgo_obj (EDisGo) –

  • lines (list(str)) – List of line names to get allowed loading for. Per default allowed loading is returned for all lines in the network. Default: None.

  • n_minus_one (bool) – Determines which allowed load factors to use. In case it is set to False, allowed load factors defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_load_factors’ are used. This is the default. In case it is set to True, allowed load factors defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_load_factors_n_minus_one’ are used. This case is currently not implemented.

Returns:

Dataframe containing the maximum allowed apparent power per line and time step in MVA. Index of the dataframe are all time steps power flow analysis was conducted for of type pandas.Timestamp. Columns are line names as in index of loads_df.

Return type:

pandas.DataFrame

edisgo.flex_opt.check_tech_constraints.lines_relative_load(edisgo_obj, lines=None, n_minus_one=False)[source]

Returns relative line load.

The relative line load is here defined as the apparent power over a line, obtained from power flow analysis, divided by the allowed load of a line, which is the nominal apparent power times a security factor (see lines_allowed_load for more information).

Parameters:
  • edisgo_obj (EDisGo) –

  • lines (list(str) or None) – List of line names to get relative loading for. Per default relative loading is returned for all lines included in the power flow analysis. Default: None.

  • n_minus_one (bool) – Determines which allowed load factors to use. See lines_allowed_load for more information.

Returns:

Dataframe containing the relative loading per line and time step in p.u.. Index of the dataframe are all time steps power flow analysis was conducted for of type pandas.Timestamp. Columns are line names as in index of loads_df.

Return type:

pandas.DataFrame

edisgo.flex_opt.check_tech_constraints.hv_mv_station_max_overload(edisgo_obj)[source]

Checks for over-loading of HV/MV station.

Parameters:

edisgo_obj (EDisGo) –

Returns:

In case there are no over-loading problems returns an empty dataframe. In case of over-loading problems the dataframe contains the name of the over-loaded station (grid’s name with the extension ‘_station’) in the index. Columns are ‘s_missing’ containing the missing apparent power at maximal over-loading in MVA as float, ‘time_index’ containing the corresponding time step the over-loading occurred in as pandas.Timestamp, and ‘grid’ containing the grid object as MVGrid.

Return type:

pandas.DataFrame

Notes

Over-load is determined based on allowed load factors for feed-in and load cases that are defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_load_factors’.

edisgo.flex_opt.check_tech_constraints.mv_lv_station_max_overload(edisgo_obj, lv_grid_id=None)[source]

Checks for over-loading of MV/LV stations.

Parameters:
  • edisgo_obj (EDisGo) –

  • lv_grid_id (str or int or None) – If None, checks overloading for all MV/LV stations. Otherwise, only station in given LV grid is checked. Default: None.

Returns:

In case there are no over-loading problems returns an empty dataframe. In case of over-loading problems the dataframe contains the name of the over-loaded station (grid’s name with the extension ‘_station’) in the index. Columns are ‘s_missing’ containing the missing apparent power at maximal over-loading in MVA as float, ‘time_index’ containing the corresponding time step the over-loading occurred in as pandas.Timestamp, and ‘grid’ containing the grid object as LVGrid.

Return type:

pandas.DataFrame

Notes

Over-load is determined based on allowed load factors for feed-in and load cases that are defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_load_factors’.

edisgo.flex_opt.check_tech_constraints.stations_allowed_load(edisgo_obj, grids=None)[source]

Returns allowed loading of specified grids stations to the overlying voltage level per time step in MVA.

Allowed loading considers allowed load factors in heavy load flow case (‘load case’) and reverse power flow case (‘feed-in case’) that are defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_load_factors’.

Parameters:
  • edisgo_obj (EDisGo) –

  • grids (list(Grid)) – List of MV and LV grids to get allowed station loading for. Per default allowed loading is returned for all stations in the network. Default: None.

Returns:

Dataframe containing the maximum allowed apparent power over the grid’s transformers to the overlying voltage level per time step in MVA. Index of the dataframe are all time steps power flow analysis was conducted for of type pandas.Timestamp. Column names are the respective grid’s name with the extension ‘_station’.

Return type:

pandas.DataFrame

edisgo.flex_opt.check_tech_constraints.stations_relative_load(edisgo_obj, grids=None)[source]

Returns relative loading of specified grids stations to the overlying voltage level per time step in p.u..

Stations relative loading is determined by dividing the stations loading (from power flow analysis) by the allowed loading (considering allowed load factors in heavy load flow case (‘load case’) and reverse power flow case (‘feed-in case’) from config files).

Parameters:
  • edisgo_obj (EDisGo) –

  • grids (list(Grid)) – List of MV and LV grids to get relative station loading for. Per default relative loading is returned for all stations in the network that were included in the power flow analysis. Default: None.

Returns:

Dataframe containing the relative loading of the grid’s transformers to the overlying voltage level per time step in p.u.. Index of the dataframe are all time steps power flow analysis was conducted for of type pandas.Timestamp. Column names are the respective grid’s name with the extension ‘_station’.

Return type:

pandas.DataFrame

edisgo.flex_opt.check_tech_constraints.components_relative_load(edisgo_obj, n_minus_one=False)[source]

Returns relative loading of all lines and stations included in power flow analysis.

The component’s relative loading is determined by dividing the stations loading (from power flow analysis) by the allowed loading (considering allowed load factors in heavy load flow case (‘load case’) and reverse power flow case (‘feed-in case’) from config files).

Parameters:
Returns:

Dataframe containing the relative loading of lines and stations power flow results are available for per time step in p.u.. Index of the dataframe are all time steps power flow analysis was conducted for of type pandas.Timestamp. Columns are line names (as in index of loads_df) and station names (respective grid’s name with the extension ‘_station’, see station_name).

Return type:

pandas.DataFrame

edisgo.flex_opt.check_tech_constraints.voltage_issues(edisgo_obj, voltage_level, split_voltage_band=True, lv_grid_id=None)[source]

Gives buses with voltage issues and their maximum voltage deviation in p.u..

Parameters:
  • edisgo_obj (EDisGo) –

  • voltage_level (None or str) – Specifies voltage level for which to determine voltage issues. Possible options are ‘mv’ to check voltage deviations at MV buses, ‘mv_lv’ to check voltage deviations at MV-LV stations, and ‘lv’ to check voltage deviations at LV buses. If None voltage deviations in all voltage levels are checked.

  • 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. Default: True.

  • lv_grid_id (str or int or None) – This parameter is only used in case voltage_level is “mv_lv” or “lv”. If None, checks voltage issues for all LV buses. Otherwise, only buses in given LV grid are checked. Default: None.

Returns:

Dataframe with maximum deviations from allowed lower or upper voltage limits in p.u. sorted descending from highest to lowest voltage deviation (it is not distinguished between over- or undervoltage). Columns of the dataframe are ‘abs_max_voltage_dev’ containing the maximum absolute voltage deviation as float, ‘time_index’ containing the corresponding time step the maximum voltage issue occured in as pandas.Timestamp, and ‘lv_grid_id’ giving the LV grid ID the bus is in as integer. Index of the dataframe are the names of all buses with voltage issues as in index of buses_df.

Return type:

pandas.DataFrame

Notes

Voltage issues are determined based on allowed voltage deviations defined in the config file ‘config_grid_expansion’ in section ‘grid_expansion_allowed_voltage_deviations’.

edisgo.flex_opt.check_tech_constraints.allowed_voltage_limits(edisgo_obj, buses=None, split_voltage_band=True)[source]

Calculates allowed upper and lower voltage limits.

Parameters:
  • edisgo_obj (EDisGo) –

  • buses (list(str)) – List of bus names to get allowed voltage limits for. Per default allowed voltage limits are returned for all buses in the network. Default: None.

  • 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. Default: True.

Returns:

Dataframe containing the maximum allowed apparent power per line and time step in MVA. Index of the dataframe are all time steps power flow analysis was conducted for of type pandas.Timestamp. Columns are bus names as in index of buses_df.

Return type:

pandas.DataFrame

edisgo.flex_opt.check_tech_constraints.voltage_deviation_from_allowed_voltage_limits(edisgo_obj, buses=None, split_voltage_band=True)[source]

Function to detect under- and overvoltage at buses.

The function returns both under- and overvoltage deviations in p.u. from the allowed lower and upper voltage limit, respectively, in separate dataframes. In case of both under- and overvoltage issues at one bus, only the highest voltage deviation is returned.

Parameters:
  • edisgo_obj (EDisGo) –

  • buses (list(str) or None) – List of buses to check voltage deviation for. Per default voltage deviation is returned for all buses included in the power flow analysis. Default: None.

  • 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. Default: True.

Returns:

Dataframe with deviations from allowed lower voltage level in p.u.. Positive values signify an overvoltage whereas negative values signify an undervoltage. Zero values signify that the voltage is within the allowed limits. Index of the dataframe are all time steps power flow analysis was conducted for of type pandas.Timestamp. Columns are bus names as in index of buses_df.

Return type:

pandas.DataFrame