edisgo.flex_opt.check_tech_constraints ====================================== .. py:module:: edisgo.flex_opt.check_tech_constraints Functions --------- .. autoapisummary:: edisgo.flex_opt.check_tech_constraints.mv_line_max_relative_overload edisgo.flex_opt.check_tech_constraints.lv_line_max_relative_overload edisgo.flex_opt.check_tech_constraints.lines_allowed_load edisgo.flex_opt.check_tech_constraints.lines_relative_load edisgo.flex_opt.check_tech_constraints.hv_mv_station_max_overload edisgo.flex_opt.check_tech_constraints.mv_lv_station_max_overload edisgo.flex_opt.check_tech_constraints.stations_allowed_load edisgo.flex_opt.check_tech_constraints.stations_relative_load edisgo.flex_opt.check_tech_constraints.components_relative_load edisgo.flex_opt.check_tech_constraints.voltage_issues edisgo.flex_opt.check_tech_constraints.allowed_voltage_limits edisgo.flex_opt.check_tech_constraints.voltage_deviation_from_allowed_voltage_limits Module Contents --------------- .. py:function:: mv_line_max_relative_overload(edisgo_obj, n_minus_one=False) Returns time step and value of most severe overloading of lines in MV network. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param n_minus_one: Determines which allowed load factors to use (see :py:attr:`~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. :type n_minus_one: bool :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:`pandas.Timestamp`, and 'voltage_level' specifying the voltage level the line is in (either 'mv' or 'lv'). :rtype: :pandas:`pandas.DataFrame` .. rubric:: 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'. .. py:function:: lv_line_max_relative_overload(edisgo_obj, n_minus_one=False, lv_grid_id=None) Returns time step and value of most severe overloading of lines in LV networks. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param n_minus_one: Determines which allowed load factors to use (see :py:attr:`~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. :type n_minus_one: bool :param lv_grid_id: If None, checks overloading for all LV lines. Otherwise, only lines in given LV grid are checked. Default: None. :type lv_grid_id: str or int or 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:`pandas.Timestamp`, and 'voltage_level' specifying the voltage level the line is in (either 'mv' or 'lv'). :rtype: :pandas:`pandas.DataFrame` .. rubric:: 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'. .. py:function:: lines_allowed_load(edisgo_obj, lines=None, n_minus_one=False) 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'. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param lines: List of line names to get allowed loading for. Per default allowed loading is returned for all lines in the network. Default: None. :type lines: list(str) :param n_minus_one: 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. :type n_minus_one: bool :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:`pandas.Timestamp`. Columns are line names as in index of :attr:`~.network.topology.Topology.loads_df`. :rtype: :pandas:`pandas.DataFrame` .. py:function:: lines_relative_load(edisgo_obj, lines=None, n_minus_one=False) 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 :py:attr:`~lines_allowed_load` for more information). :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param lines: 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. :type lines: list(str) or None :param n_minus_one: Determines which allowed load factors to use. See :py:attr:`~lines_allowed_load` for more information. :type n_minus_one: bool :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:`pandas.Timestamp`. Columns are line names as in index of :attr:`~.network.topology.Topology.loads_df`. :rtype: :pandas:`pandas.DataFrame` .. py:function:: hv_mv_station_max_overload(edisgo_obj) Checks for over-loading of HV/MV station. :param edisgo_obj: :type edisgo_obj: :class:`~.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:`pandas.Timestamp`, and 'grid' containing the grid object as :class:`~.network.grids.MVGrid`. :rtype: :pandas:`pandas.DataFrame` .. rubric:: 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'. .. py:function:: mv_lv_station_max_overload(edisgo_obj, lv_grid_id=None) Checks for over-loading of MV/LV stations. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param lv_grid_id: If None, checks overloading for all MV/LV stations. Otherwise, only station in given LV grid is checked. Default: None. :type lv_grid_id: str or int or 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:`pandas.Timestamp`, and 'grid' containing the grid object as :class:`~.network.grids.LVGrid`. :rtype: :pandas:`pandas.DataFrame` .. rubric:: 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'. .. py:function:: stations_allowed_load(edisgo_obj, grids=None) 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'. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param grids: 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. :type grids: list(:class:`~.network.grids.Grid`) :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:`pandas.Timestamp`. Column names are the respective grid's name with the extension '_station'. :rtype: :pandas:`pandas.DataFrame` .. py:function:: stations_relative_load(edisgo_obj, grids=None) 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). :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param grids: 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. :type grids: list(:class:`~.network.grids.Grid`) :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:`pandas.Timestamp`. Column names are the respective grid's name with the extension '_station'. :rtype: :pandas:`pandas.DataFrame` .. py:function:: components_relative_load(edisgo_obj, n_minus_one=False) 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). :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param n_minus_one: Determines which allowed load factors to use. See :py:attr:`~lines_allowed_load` for more information. :type n_minus_one: bool :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:`pandas.Timestamp`. Columns are line names (as in index of :attr:`~.network.topology.Topology.loads_df`) and station names (respective grid's name with the extension '_station', see :attr:`~.network.grids.Grid.station_name`). :rtype: :pandas:`pandas.DataFrame` .. py:function:: voltage_issues(edisgo_obj, voltage_level, split_voltage_band=True, lv_grid_id=None) Gives buses with voltage issues and their maximum voltage deviation in p.u.. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param voltage_level: 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. :type voltage_level: None or str :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. Default: True. :type split_voltage_band: bool :param lv_grid_id: 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. :type lv_grid_id: str or int or 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:`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 :attr:`~.network.topology.Topology.buses_df`. :rtype: :pandas:`pandas.DataFrame` .. rubric:: 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'. .. py:function:: allowed_voltage_limits(edisgo_obj, buses=None, split_voltage_band=True) Calculates allowed upper and lower voltage limits. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param buses: 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. :type buses: list(str) :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. Default: True. :type split_voltage_band: bool :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:`pandas.Timestamp`. Columns are bus names as in index of :attr:`~.network.topology.Topology.buses_df`. :rtype: :pandas:`pandas.DataFrame` .. py:function:: voltage_deviation_from_allowed_voltage_limits(edisgo_obj, buses=None, split_voltage_band=True) 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. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param buses: 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. :type buses: list(str) or None :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. Default: True. :type split_voltage_band: bool :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:`pandas.Timestamp`. Columns are bus names as in index of :attr:`~.network.topology.Topology.buses_df`. :rtype: :pandas:`pandas.DataFrame`