Battery Model¶
This page documents the high‑fidelity electro‑thermal battery model in PhlyGreen.
Overview¶
PhlyGreen’s Battery module provides a dynamic, temperature‑aware, physics‑based representation of a lithium‑ion battery pack suitable for hybrid‑electric aircraft preliminary design.
It simulates:
- A representative cell, based on a modified Shepherd equation
- Its thermal behaviour using a lumped‑parameter model
- A complete battery pack, built via series (
S) and parallel (P) configuration - Full operational constraint handling (voltage, SOC, current, temperature)
- A sizing loop integrated into the aircraft’s WTO iteration
The model is based on empirical cell parameters (selected in Cell_Models) and is configurable via user‑provided battery settings.
Battery State Variables¶
At every timestep, the battery tracks three continuous state variables:
- Cell current:
i - Spent charge (Ah):
$$ i_t(t+\Delta t) = i_t(t) + \frac{i\,\Delta t}{3600} $$
- Temperature: \( T \)
The State of Charge (SOC) is defined as:
where \( Q \) is the cell capacity.
A BatteryError is raised if SOC leaves the allowable range:
Pack Architecture¶
A battery pack is constructed as:
Scells in series → increases voltagePcells in parallel → increases current capability
Thus:
Pack-level capacity and energy:
Cell Electrical Model¶
Modified Shepherd Equation (Temperature‑Aware)¶
The cell voltage is computed using a temperature‑corrected modified Shepherd model:
Where:
- \( E_0(T) \) — open‑circuit voltage (with thermal correction)
- \( K(T) \) — polarization constant
- \( A(T), B(T) \) — exponential zone parameters
- \( R(T) \) — internal resistance (Arrhenius‑corrected)
Solving for Current from a Required Power¶
Given a required pack power \( P_{\text{pack}} \), the battery solves:
This becomes a quadratic equation:
Where:
- \( a = -(R + K_r) \) with \( K_r = K Q/(Q-i_t) \)
- \( b = E_0 + A e^{-Bi_t} - i_t K_r \)
- \( c = -P_{\text{cell}} \)
The physically meaningful root is selected:
If the discriminant is negative:
Thermal Model¶
Lumped‑Parameter Single‑Node Cell Temperature¶
The cell temperature evolves according to:
Where:
- \( C_{\text{th}} \) — thermal capacitance
- \( R_{\text{th}} \) — total thermal resistance
Heat Generation¶
Convection Cooling Model¶
with airflow proportional to losses:
Battery Sizing Loop¶
Inside the aircraft’s WTO root‑finding solver:
- Guess
WTO - Guess
P_number - Run full mission simulation
- During each timestep, battery state is updated
- If any violation occurs:
- SOC too low
- Voltage too low
- Current > max
- Temperature out of range
→ ABatteryErroris thrown
- Increase
P_numberand retry - Once feasible, compute pack weight
- Continue WTO iteration
This ensures size is based on actual in‑mission behaviour, not just averaged metrics.
Inputs¶
Battery configuration comes from CellInput:
"Class"—"I"(simple) or"II"(electro‑thermal)"Model"— reference intoCell_Models"SpecificEnergy"override"SpecificPower"override"Pack Voltage""Minimum SOC""Initial temperature""Max operative temperature"
Cell models include:
- Mass, size, geometry
- OCV constants
- Polarization coefficients
- Exponential coefficients
- Arrhenius constants
- Thermal properties
Outputs¶
Available throughout the simulation:
Vout— pack voltagecell_Vout— cell voltageI_packandi_cell— total and per‑cell currentSOCTQ_loss— thermal losses- Pack mass, volume, energy
- Maximum deliverable power
Error Handling¶
The battery throws structured exceptions:
"SOC_OUTSIDE_LIMITS""VOLTAGE_OUTSIDE_LIMITS""CURR_OUTSIDE_LIMITS""NEG_BATT_TEMP""BATT_UNDERPOWERED""TEMP_OUTSIDE_LIMITS"
These allow the sizing algorithm to automatically increase P.
Usage Example¶
battery = Battery(aircraft)
battery.SetInput()
battery.Configure(parallel_cells=48)
I = battery.Power_2_current(P=150e3)
dTdt, Qloss = battery.heatLoss(Ta=288, rho=1.225)
battery.it += I * dt / 3600
battery.T += dTdt * dt
Limitations¶
- Single‑node temperature model (no spatial gradients).
- No ageing/SEI model.
- Cooling system mass is not sized.
- Discharge‑only model (no charging).
References¶
-
Shepherd, C. M. Design of Primary and Secondary Cells: II. An Equation Describing Battery Discharge.
Journal of The Electrochemical Society, 112(7):657, 1965. -
Tremblay, O., & Dessaint, L.-A. A Generic Battery Model for the Dynamic Simulation of Hybrid Electric Vehicles.
Proceedings of the 2007 IEEE Vehicle Power and Propulsion Conference, pp. 284–289. -
Saw, L., Somasundaram, K., Ye, Y., & Tay, A. Electro-thermal analysis of Lithium Iron Phosphate battery for electric vehicles.
Journal of Power Sources, 249:231–238, 2014.