:py:mod:`eelib.core.control.EMS.EMS_model` ========================================== .. py:module:: eelib.core.control.EMS.EMS_model .. autoapi-nested-parse:: The eElib EMS model was developed as an energy management system on the building level and is therefore connected to all of the building's components. The control gathers all of the component's power flows, calculates the energy balance at the building node and the component's flexibility, and then sends out power set values in each step. Hereby, available solar power is favored to grid consumption, as well as charging / discharging limits of the charging stations, and batteries are considered. Regarding charging stations, different charging strategies are implemented: Default / Maximum power charging, balanced charging, solar charging and night charging. | 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 ~~~~~~~ .. autoapisummary:: eelib.core.control.EMS.EMS_model.HEMS eelib.core.control.EMS.EMS_model.HEMS_default eelib.core.control.EMS.EMS_model.GCP_Aggregator_HEMS eelib.core.control.EMS.EMS_model.HEMS_forecast_base eelib.core.control.EMS.EMS_model.HEMS_forecast_default eelib.core.control.EMS.EMS_model.HEMS_forecast_opt .. py:class:: HEMS(ename: str, step_size: int, cs_strategy: str = 'max_p', bss_strategy: str = 'surplus') Bases: :py:obj:`abc.ABC` Models an home energy managament system on building level. .. py:attribute:: _VALID_PARAMETERS .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: add_controlled_entity(entities_dict: dict) Adds a controlled entity to the corresponding EMS's lists (controlled components and type-specific). :param entities_dict: Input list with all models of a type (e.g. charging_station) which will be connected to the controller. :type entities_dict: dict .. py:method:: _get_component_by_type(type: str) Gets all controlled components of passed type. :param type: Query to determine all controlled components of this type. :type type: str :returns: Returns all entities of queried type. :rtype: dict .. py:method:: step(time: int) :abstractmethod: Handles stepping of energy managament systems by checking power values. :param time: Current simulation time :type time: int .. py:method:: _calc_power_energy(time: int) Gathers current power flows, aggregates limits, and calculates energy balances. :param time: Current simulation time :type time: int .. py:method:: _set_pv_max() Calculate pv system setpoints for all devices by using the maximum power. .. py:method:: _set_cs_p() Calculate charging station setpoints using the chosen charging strategy. .. py:method:: _set_hp_p_th() Calculate heatpump thermal power setpoints by reducing needed power at this step. .. py:method:: _set_bss_p() Calculate battery storage system setpoints for all devices using the chosen strategy. .. py:method:: _reset_financial_values() Reset all financial values (at the beginning of a new timestep). .. py:method:: _handle_incoming_signals() Retrieve tariff settings for this timestep from an incoming tariff signal. .. py:method:: _calc_financial_output() Calculate financial values like cost, profit and revenue for this timestep. .. py:class:: HEMS_default(ename: str, step_size: int = 900, **kwargs) Bases: :py:obj:`HEMS` Default strategy for Energy Management System. Should be copied and adapted for the use of a specific EMS concept. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time: int) Calculates power set values for each connected component according to the strategy. :param time: Current simulation time :type time: int .. py:class:: GCP_Aggregator_HEMS(ename: str, step_size: int = 900, **kwargs) Bases: :py:obj:`HEMS` Aggregation of power flows for depiction of uncontrolled devices in a building. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time) Aggregation of power values. :param time: Current simulation time :type time: int .. py:class:: HEMS_forecast_base(ename: str, step_size: int, forecast_horizon_hours: int = 24, forecast_frequency_hours: int = 24, forecast_type: str = 'household_only', cs_strategy: str = 'max_p', bss_strategy: str = 'surplus') Bases: :py:obj:`HEMS` Baseclass for EMS strategies using forecasts (and optimizations). .. py:attribute:: forecast_types .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: _request_forecast() Set models with their attributes and time horizon for forecast request. .. py:method:: _set_schedule_values() Take schedules of the devices and convert them into set values. .. py:method:: _set_power_in_limits(power: float, p_min: float, p_max: float) -> float Set a power value with regard to a maximum and minimum value, if given. :param power: current power value to start with :type power: float :param p_min: minimum power limit :type p_min: float :param p_max: maximum power limit :type p_max: float :returns: power value within the limiting bounds :rtype: float .. py:method:: _set_schedule_values_pv() Take schedules of pv systems and convert them to set values by using the power limits. .. py:method:: _set_schedule_values_cs() Take schedules of charging stations and convert to set values by using the limits. .. py:method:: _set_schedule_values_hp() Take schedules of heatpumps and convert them to set values by using the power limits. .. py:method:: _set_schedule_values_bss() Take schedules of battery storage systems and convert to set values using the limits. .. py:method:: step(time: int) :abstractmethod: Gathers current energy flows and calculates energy balances. :param time: Current simulation time :type time: int .. py:class:: HEMS_forecast_default(ename: str, step_size: int = 900, **kwargs) Bases: :py:obj:`HEMS_forecast_base` Default forecast strategy for Energy Management System. Should be copied and adapted for the use of a specific EMS concept. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time: int) Calculates power set values for each connected component according to the strategy. :param time: Current simulation time :type time: int .. py:class:: HEMS_forecast_opt(ename: str, step_size: int = 900, **kwargs) Bases: :py:obj:`HEMS_forecast_base` Optimization-based forecast/schedule strategy for Energy Management System. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time: int) Calculates power set values for each connected component according to the strategy. :param time: Current simulation time :type time: int