models.bess module¶
BESS (Battery Energy Storage System) model.
- class models.bess.BESS(name: str, capacity: float, max_charge_power: float, max_discharge_power: float, efficiency: float = 0.9, soc_min: float = 0.1, soc_max: float = 0.9, initial_soc: float = 0.5, control_strategy: BESSControlStrategy = BESSControlStrategy.DEFAULT, current_soc: float = 0.5, current_power: float = 0.0)[source]¶
Bases:
objectBattery energy storage system with SOC limits and round-trip efficiency.
- name¶
BESS identifier.
- Type:
str
- capacity¶
Total energy capacity (kWh).
- Type:
float
- max_charge_power¶
Maximum charge power (kW).
- Type:
float
- max_discharge_power¶
Maximum discharge power (kW).
- Type:
float
- efficiency¶
Round-trip efficiency in (0, 1]; default 0.90.
- Type:
float
- soc_min¶
Minimum SOC in [0, 1]; default 0.10.
- Type:
float
- soc_max¶
Maximum SOC in [0, 1]; default 0.90.
- Type:
float
- initial_soc¶
Initial SOC; default 0.50.
- Type:
float
- control_strategy¶
Control strategy enum.
- current_soc¶
Current SOC (updated by charge/discharge).
- Type:
float
- current_power¶
Current power (kW); positive = charging, negative = discharging.
- Type:
float
- capacity: float¶
- charge(power: float, timestep_seconds: float) float[source]¶
Charge for the given power and timestep; SOC is capped at soc_max.
- Parameters:
power – Requested charging power (kW), must be positive.
timestep_seconds – Timestep duration (s).
- Returns:
Actual power charged (kW); may be less than requested if SOC limit reached.
- control_strategy: BESSControlStrategy = 'default'¶
- current_power: float = 0.0¶
- current_soc: float = 0.5¶
- discharge(power: float, timestep_seconds: float) float[source]¶
Discharge for the given power and timestep; SOC is floored at soc_min.
- Parameters:
power – Requested discharge power (kW), must be positive.
timestep_seconds – Timestep duration (s).
- Returns:
Actual power discharged (kW); may be less than requested if SOC limit reached.
- efficiency: float = 0.9¶
- get_available_charge_capacity() float[source]¶
Capacity (kWh) available for charging (from current_soc to soc_max, accounting for efficiency).
- get_available_energy() float[source]¶
Energy (kWh) that can still be discharged (from current_soc down to soc_min, after efficiency).
- get_max_charge_power_available(timestep_seconds: float) float[source]¶
Maximum charge power (kW) in this timestep (min of max_charge_power and capacity-limited power).
- get_max_discharge_power_available(timestep_seconds: float) float[source]¶
Maximum discharge power (kW) in this timestep (min of max_discharge_power and energy-limited power).
- initial_soc: float = 0.5¶
- max_charge_power: float¶
- max_discharge_power: float¶
- name: str¶
- soc_max: float = 0.9¶
- soc_min: float = 0.1¶