Battery degradation

Submodules

Degradation base class

class fleetrl.utils.battery_degradation.batt_deg.BatteryDegradation[source]

Bases: object

calculate_degradation(soc_list, charging_power, time_conf, temp)[source]

This is the parent class for degradation methods. Any new implemented method must follow this style of inputs and outputs. Then, the method can be used in FleetRL by changing one line of code in the import.

The degradation methods in FleetRL are implemented such that degradation is calculated in real-time. In the step method of the environment class, the current SoH is calculated by SoH -= degradation

Parameters:
  • soc_list (list) – Historic values of SoC until now

  • charging_power (float) – Charging power in kW

  • time_conf (TimeConfig) – Time config instance, necessary for time step length

  • temp (float) – Temperature to use in battery degradation in °C

Return type:

float

Returns:

Degradation of battery (unit-less, reduction of SoH, which is max. 1)

Method comparison

class fleetrl.utils.battery_degradation.compare_methods.Comparison[source]

Bases: object

compare_methods(data, save=False)[source]
deg_rate_calendar(t, avg_soc, temp)[source]
deg_rate_cycle(dod, avg_soc, temp)[source]
emp_deg(data)[source]
l_with_sei(fd)[source]
static l_without_sei(self, l, fd)[source]
rainflow_sei(soc_log)[source]
stress_dod(dod)[source]
stress_soc(soc)[source]
stress_temp(temp)[source]
stress_time(t)[source]

Empirical degradation

class fleetrl.utils.battery_degradation.empirical_degradation.EmpiricalDegradation(init_soh, num_cars)[source]

Bases: BatteryDegradation

calculate_degradation(soc_log, charging_power, time_conf, temp)[source]

Similar to non-linear SEI, the most recent event is taken, and the linear-based degradation is calculated. No rainflow counting, thus degradation is computed for each time step.

  • find out the most recent entries in the soc list

  • get old and new soc

  • get average soc

  • compute cycle and calendar based on avg soc and charging power

Parameters:
  • soc_log (list) – Historical log of SOC

  • charging_power (float) – EVSE power in kW

  • time_conf (TimeConfig) – time config object

  • temp (float) – temperature

Return type:

array

Returns:

Degradation, float

Degradation logger

class fleetrl.utils.battery_degradation.log_data_deg.LogDataDeg(episode)[source]

Bases: object

Data Logger for degradation purposes. Deepcopy to avoid mutability

add_log_entry()[source]
log_soc(soc)[source]
log_soh(soh)[source]

Non-linear degradation (Rainflow SEI)

class fleetrl.utils.battery_degradation.rainflow_sei_degradation.RainflowSeiDegradation(init_soh, num_cars)[source]

Bases: BatteryDegradation

Non-linear battery degradation model, Xu et al. - Source: Modeling of Lithium-Ion Battery Degradation for Cell Life Assessment - https://ieeexplore.ieee.org/document/7488267

calculate_degradation(soc_log, charging_power, time_conf, temp)[source]

Calculates degradation. SOC from environment is converted to the necessary format for rainflow counting. Every time step, this function is called with a new soc_log entry. The rainflow library calculates the resulting cycle counts, which do not grow identically with soc_log entries. Rainflow results are used for the SOH calculations. If a new rainflow result entry appears, a calculation iteration is conducted. For calculation, the second most recent rainflow result is used.

Parameters:
  • soc_log (list) – SOC list for each time step t: t1:[soc_car1, soc_car2, …], t2:[soc_car1, soc_car2,…]

  • charging_power (float) – kW of the charger

  • time_conf (TimeConfig) – Time config instance from the environment

  • temp (float) – Temperature (default at 25°C)

Return type:

array

Returns:

Numpy array of degradation for each vehicle [deg_1, deg_2, …]

deg_rate_calendar(t, avg_soc, temp)[source]
deg_rate_cycle(dod, avg_soc, temp)[source]
l_with_sei(fd)[source]
static l_without_sei(l, fd)[source]
stress_dod(dod)[source]
stress_soc(soc)[source]
stress_temp(temp)[source]
stress_time(t)[source]