## Battery Representation in CSE

In each simulated timestep, the control strategy sends a charge/discharge request to the battery module. The control strategies themselves are described in the next section. For now, it will suffice to say that the input to the battery module is a charge request (in kW) that can be either positive or negative.

charge_request > 0 // charge

charge_request < 0 // discharge

charge_request = 0 // do nothing

The battery has maximum charge and discharge rates (kW) set based on the battery’s size. CBECC-Res defines both as the same fixed fraction (kW/kWh) of the battery’s user-defined maximum capacity (kWh).

max_charge_power = 0.42 * max_capacity

max_discharge_power = 0.42 * max_capacity

And both a charge and discharge efficiency (fraction), which are user-defined:

η_charge

η_discharge

At each timestep, there are also maximum charge and discharge limits (kW) defined by the state of charge on the battery. Charge and discharge power levels are measured at the battery’s edge: before efficiency losses in the case of charging and after efficiency losses in the case of discharging. The battery’s state-of-charge is metered between the two efficiency multipliers.

max_charge_available = (max_capacity - charge_level) /

η_charge * (timestep_minutes / 60)

max_discharge_available = charge_level * η_discharge *

(timestep_minutes / 60)

All together, that enables the module to determine the amount the battery should charge or discharge in the hour:

if charge_request > 0:

charge_power = min(charge_request, max_charge_rate,
max_charge_available)

else if charge_request < 0:

charge_power = max(charge_request, max_discharge_rate,

max_discharge_available)

else:

charge_power = 0

At the conclusion of that timestep, the battery’s charge level will have been updated:

if charge_power > 0: // charging

charge_level = charge_level + charge_power*η_charge

else if charge_power < 0 // discharging

charge_level = charge_level + charge_power/η_discharge

else:

charge_level = charge_level