Skip to content

odys.domain.entities.battery_storage

Battery storage (BESS). Represents grid-connected battery assets with charge/discharge capabilities, efficiency losses, and state-of-charge dynamics.

See BatteryStorage in the User Guide.

Battery storage asset implementation.

This module provides the BatteryStorage class for modeling grid-connected energy storage devices in energy system optimization problems.

BatteryStorage

Bases: Asset

Battery storage (BESS): a battery at a fixed, grid-connected site.

The asset is what you own and name. The battery describes the physics (capacity, power limits, efficiencies, state of charge).

Source code in src/odys/domain/entities/battery_storage.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class BatteryStorage(Asset):
    """Battery storage (BESS): a battery at a fixed, grid-connected site.

    The asset is what you own and name. The battery describes the
    physics (capacity, power limits, efficiencies, state of charge).
    """

    battery: Battery

    def max_supply(self, conditions: OperatingConditions) -> tuple[float, ...]:
        """Return the battery's maximum discharge power at each timestep, in MW."""
        return (self.battery.max_discharge_power,) * conditions.horizon.number_of_steps

    def max_energy_supply(self, conditions: OperatingConditions) -> float:
        """Return the energy the battery can discharge over the horizon, in MWh.

        A full battery is emptied at most once, at no more than its maximum discharge power.
        """
        return min(self.battery.capacity, super().max_energy_supply(conditions))

max_energy_supply(conditions)

Return the energy the battery can discharge over the horizon, in MWh.

A full battery is emptied at most once, at no more than its maximum discharge power.

Source code in src/odys/domain/entities/battery_storage.py
25
26
27
28
29
30
def max_energy_supply(self, conditions: OperatingConditions) -> float:
    """Return the energy the battery can discharge over the horizon, in MWh.

    A full battery is emptied at most once, at no more than its maximum discharge power.
    """
    return min(self.battery.capacity, super().max_energy_supply(conditions))

max_supply(conditions)

Return the battery's maximum discharge power at each timestep, in MW.

Source code in src/odys/domain/entities/battery_storage.py
21
22
23
def max_supply(self, conditions: OperatingConditions) -> tuple[float, ...]:
    """Return the battery's maximum discharge power at each timestep, in MW."""
    return (self.battery.max_discharge_power,) * conditions.horizon.number_of_steps