edisgo.flex_opt.battery_storage_operation ========================================= .. py:module:: edisgo.flex_opt.battery_storage_operation Functions --------- .. autoapisummary:: edisgo.flex_opt.battery_storage_operation.apply_reference_operation Module Contents --------------- .. py:function:: apply_reference_operation(edisgo_obj, storage_units_names=None, soe_init=0.0, freq=1) Applies reference storage operation to specified home storage units. In the reference storage operation, the home storage system is directly charged when PV feed-in is higher than electricity demand of the building until the storage is fully charged. The storage is directly discharged, in case electricity demand of the building is higher than the PV feed-in, until it is fully discharged. The battery model handles generation positive and demand negative. To determine the PV feed-in and electricity demand of the building that the home storage is located in (including demand from heat pumps and electric vehicles), this function matches the storage units to PV plants and building electricity demand using the building ID. In case there is no electricity load or no PV system, the storage operation is set to zero. The resulting storage units' active power time series are written to :attr:`~.network.timeseries.TimeSeries.loads_active_power`. Further, reactive power time series are set up using function :attr:`~.edisgo.EDisGo.set_time_series_reactive_power_control` with default values. The state of energy time series that are calculated within this function are not written anywhere, but are returned by this function. :param edisgo_obj: EDisGo object to obtain storage units and PV feed-in and electricity demand in same building from. :type edisgo_obj: :class:`~.EDisGo` :param storage_units_names: Names of storage units as in :attr:`~.network.topology.Topology.storage_units_df` to set time for. If None, time series are set for all storage units in :attr:`~.network.topology.Topology.storage_units_df`. :type storage_units_names: list(str) or None :param soe_init: Initial state of energy of storage device in MWh. Default: 0 MWh. :type soe_init: float :param freq: Frequency of provided time series. Set to one, in case of hourly time series or 0.5 in case of half-hourly time series. Default: 1. :type freq: float :returns: Dataframe with time index and state of energy in MWh of each storage in columns. Column names correspond to storage name as in :attr:`~.network.topology.Topology.storage_units_df`. :rtype: :pandas:`pandas.DataFrame` .. rubric:: Notes This function requires that the storage parameters `building_id`, `efficiency_store`, `efficiency_dispatch` and `max_hours` are set in :attr:`~.network.topology.Topology.storage_units_df` for all storage units specified in parameter `storage_units_names`.