eelib.core.control.grid.grid_ems_model

The eElib grid EMS model is some sort of an implementation for the grid operator, as it is the grid energy management system. The control unit gathers the power flow results of the grid and can send out different kind of control signals, like set values or prices.

Author: elenia@TUBS
Copyright 2024 elenia
This file is part of eELib, which is free software under the terms of the GNU GPL Version 3.

Module Contents

Classes

_SeasonConfig

Describes time-variable prices within one season.

_VariableTariffOption

Describes one scenario for time-variable prices.

GridEMS

Models a grid energy managament system.

class _SeasonConfig

Describes time-variable prices within one season. low_1/2 and high_1/2 represent windows of low and high prices and have to be configured like e.g., “1-6” for 1 AM to 6 AM and “11-13” for 11 Am to 1 PM. scaling is multiplied with the price_low, price_high floats of the corresponding VariableTariffOption within these low/high windows.

scaling: float
low_1: str | None = 'None'
high_1: str | None = 'None'
low_2: str | None = 'None'
high_2: str | None = 'None'
class _VariableTariffOption

Describes one scenario for time-variable prices. price_low and price_high are the prices in €/kWh within low/high price windows. With the seasonal configs, the time of these windows and a multiplier to these base prices can be configured. See SeasonConfig Not all seasons have to be configured. Otherwise describes all the time outside the configured seasons.

price_low: float
price_high: float
otherwise: _SeasonConfig
winter: _SeasonConfig | None = 'None'
spring: _SeasonConfig | None = 'None'
summer: _SeasonConfig | None = 'None'
autumn: _SeasonConfig | None = 'None'
class GridEMS(eid: str, grid_model_config: dict, strategy: str = 'par_14a_EnWG', use_14a_enwg: bool = True, grid_tariff_model: str = 'static', variable_tariff_config: str | None = None, energy_price_norm: float = 0.08, peak_price_dem: float = 0.0, peak_price_gen: float = 0.0, peak_price_horizon_days: int = 1, start_time: str | None = None, step_size: int = 900)

Bases: object

Models a grid energy managament system.

_CONGESTIONS_DICT
_VALID_PARAMETERS
variable_tariff_options: dict[str, _VariableTariffOption]
eid
strategy = "'par_14a_EnWG'"
grid_model_config
use_14a_enwg = 'True'
grid_tariff_model = "'static'"
energy_price_norm = '0.08'
peak_price_dem = '0.0'
peak_price_gen = '0.0'
peak_price_horizon_days = '1'
grid_status
powerflow_results
ptdf_mat = '[]'
vpif_mat = '[]'
p_ems
q_ems
_grid_info: eelib.data.dataclass.GridInformation
cur_grid_status: dict
past_grid_status: dict
_flag_loading_high_gen = 'False'
_flag_loading_high_dem = 'False'
_flag_voltage_high = 'False'
_flag_voltage_low = 'False'
_last_control_sig_emit = '-1'
control_signal
flex_signals
_congestions
_congested_elements
calc_grid = 'False'
trafo_tap_pos = '0'
step_size = '900'
steps_per_hour = '0'
steps_per_day = '0'
timestep = '0'
forecast_request
forecast
grid_tariff = 'None'
is_grid_tariff_signal_sent = 'False'
grid_tariff_price_step = 'None'
classmethod get_valid_parameters() dict

Returns dictionary containing valid parameter types and values.

Returns:

valid parameters for this model

Return type:

dict

step(timestep: int)

Gathers current grid status, handles it and calculates output values.

Parameters:

timestep (int) – Current simulation time

_create_grid_tariff_signal()

Create the grid tariff to send to retail electricity providers and households.

Raises:
  • NotImplementedError – In case grid tariff model is not implemented

  • ValueError – If ‘time-variable’ is set, but not all necessary config.

add_grid_information(info: eelib.data.dataclass.GridInformation)

Overwrites the current grid information with the new information, if it is different.

Parameters:

info (GridInformation) – current grid topology information.

is_grid_congested() bool

Checks, if the grid is congested. According to the VDE FNN recommendation, a component is considered congested if its current load is more than 80 % or the occurring voltage drop is more than 80 % of the permissible voltage drop.

Returns:

Returns True as soon as one grid component is congested.

Return type:

bool

get_readings(eid: str) dict[str, float] | None

Retrieves the current reading of an equipment. Watch out: Only dictionaries are evaluated!

Parameters:

eid (str) – The entity identifier of the equipment.

Returns:

Returns None, if the eid matches no known equipment. Otherwise

the dictionary with the readings is returned.

Return type:

dict[str, float] | None

handle_congestions() None

Manages a congestion in the grid. Supports different methods to tackle the existing congestions.

Raises:

ValueError – Optimization strategy not yet implemented.

Returns:

No return values.

Return type:

None

reset_flags_status()

Resets the congestion control flags.

send_control_signal_timestep(p_feedin_limit: float, p_consumption_limit: float, to_eid: str = '')

Sends a control signal.

Parameters:
  • p_feedin_limit (float) – The limit for the minimum active power. Is < 0 to limit the maximum feedin power.

  • p_consumption_limit (float) – The limit for the maximum active power. Is > 0 to limit the maximum consumption power.

  • to_eid (str) – The entity identifier of the HEMS, that should receive the control signal. In case of an empty string the control signal is send to all known HEMS. Defaults to “”.

_update_control_signals()

Checks if control signals should be removed because they are outdated.

min_hems_active_power(device_count: int, diversity_factor: float = 0.6, for_loads: bool = True) float

Computes the minimum active power for a household with a HEMS.

Parameters:
  • device_count (int) – The number of controllable devices (either generators or loads). Must be equal or greater than zero.

  • diversity_factor (float) – Factor for distribution of power limits, according to simultaneity - the value must be in the interval of 0.45 to 0.8. Defaults to 0.6

  • for_loads (bool, optional) – Determines the sign of the computed active power. A minimum active power greater than zero means demand, as the passive sign system is used. Defaults to True.

Raises:

ValueError – In case of a device_count less than zero or a diversity_factor outside of the interval from 0.45 to 0.8.

Returns:

The minimum active power for household, in W. Greater than zero for demand and

less than zero for supply.

Return type:

float