Hierarchical Dynamic-Loop Simulation of Battery Energy Storage Systems Across Electrical, Thermal, and Aging Timescales

Grid-scale battery energy storage is used for peak shaving, frequency regulation, renewable smoothing, and other services that require fast, bidirectional power control. In energy battery storage, the plant is not a single battery but a hierarchy of cells, modules, strings, and clusters, each with its own state of charge (SOC), temperature, internal resistance, and aging trajectory. The simulation problem is therefore multi-timescale: electrical transients evolve in milliseconds to seconds, thermal response in minutes to hours, aging over months to years, and battery management system (BMS) equalization over minutes. Resolving every cell in one monolithic differential-algebraic system can be accurate but computationally expensive; aggregating cells into a single equivalent loses the parameter dispersion that drives current imbalance and local degradation. A practical framework must retain cell-level states while reducing the network solution to a sequence of low-dimensional problems.

Containerized lithium-ion battery energy storage system
Grid-connected lithium-ion battery storage must be represented at cell, module, and plant levels.

The simulation problem: cell-level detail versus plant-level scale

Equivalent-circuit models are widely used for battery energy storage system (BESS) studies because they map terminal voltage and current onto a small set of state variables. A typical Thevenin branch contains an open-circuit voltage, a series resistance, and a parallel resistance–capacitance polarization branch. When thousands of cells are connected in series and parallel, the resulting model contains thousands of SOC, polarization-voltage, temperature, and aging states. Solving all of them as one coupled system causes the matrix dimension to grow rapidly with pack size; for large hybrid topologies, the cost of matrix inversion and the risk of convergence problems can dominate the simulation.

Cell-to-cell parameter dispersion adds a second difficulty. Manufacturing spread in capacity, resistance, polarization capacitance, and self-discharge means that parallel branches do not share current equally. The resulting SOC and temperature differences accelerate local aging, which in turn changes resistance and capacity, creating a feedback loop between electrical, thermal, and degradation behavior. A model that ignores this dispersion cannot reproduce branch imbalance currents or the long-term effect of BMS equalization. A model that resolves dispersion for every cell must also avoid a monolithic network solve.

The hierarchical dynamic-loop approach addresses both requirements. It keeps a cell-level electro-thermal-aging model, represents the pack as nested series–parallel loops, and solves the loop currents from the outside inward. The electrical network is not reduced to a single equivalent cell; instead, the network equations are decomposed into an outer set of parallel-branch loops and an inner set of cell-string loops. This preserves parameter differences while keeping each matrix small.

Cell-level electro-thermal-aging representation

Each cell is represented by a Thevenin equivalent circuit with open-circuit voltage U, series resistance R, polarization resistance RP, and polarization capacitance CP. The terminal voltage is

$$U_{\mathrm{ter}}=U+U_P-I_{\mathrm{bat}}R$$

where UP is the polarization voltage and Ibat is the cell current. The parameters are not constant: U, R, RP, and CP are functions of SOC, and the resistances also depend on temperature and aging. For example, the series resistance is updated as

$$R=f_R(SOC)\,g_R(1+R_{\mathrm{inc}})\exp\left[4065.4\left(\frac{1}{T}-\frac{1}{T_{\mathrm{sta}}}\right)\right]$$

where gR is a cell-specific inconsistency coefficient, Rinc is the aging-induced resistance increase, T is cell temperature, and Tsta is the standard reference temperature. The polarization resistance follows an analogous temperature-sensitive update, while capacity is reduced by the aging-induced loss Qlos. This structure allows the same cell model to be used across the pack while preserving unit-to-unit differences through the coefficients gQ, gR, gRP, and gCP.

Thermal behavior is represented with a lumped-parameter energy balance. The cell is assumed to have a uniform internal temperature, and heat generation is balanced against convective exchange with the environment:

$$C_{\mathrm{cap}}M\frac{dT}{dt}=I_{\mathrm{bat}}^2(R+R_P)-\varepsilon A(T-T_{\mathrm{env}})$$

Here M is cell mass, Ccap is specific heat capacity, ε is the convective heat-transfer coefficient, A is the exchange area, and Tenv is ambient temperature. The thermal state is slow relative to the electrical state, but it is not independent: resistance and aging rates depend on temperature, and heat generation depends on current and resistance.

Aging is described with a semi-empirical model of the Naumann type. Capacity loss and resistance increase are driven by temperature, SOC, charge–discharge rate, and depth of discharge:

$$\dot Q_{\mathrm{los}}=f_Q(T,SOC,\gamma_{\mathrm{rat}},D_{\mathrm{doc}}),\qquad \dot R_{\mathrm{inc}}=f_R(T,SOC,\gamma_{\mathrm{rat}},D_{\mathrm{doc}})$$

where γrat is the current-to-capacity rate and Ddoc is the cycle depth. The aging states are updated at each simulation step, so the electrical parameters drift as the pack operates. This is important for long-horizon studies: a pack that looks balanced at the beginning can develop branch current imbalance as cells age at different rates.

The BMS equalization model is built around a bidirectional flyback converter. For an inner pack with m1 series cells and n1 parallel branches, the average SOC is

$$S^{OC}_{\mathrm{ave}}=\frac{1}{m_1n_1}\sum_{i=1}^{m_1}\sum_{j=1}^{n_1}S^{OC}_{i,j}$$

and the deviation of cell (i, j) is

$$S^{OC,\mathrm{diff}}_{i,j}=S^{OC}_{i,j}-S^{OC}_{\mathrm{ave}}$$

A proportional–integral law converts the SOC deviation into a duty ratio:

$$D_{i,j}=K_{\mathrm{pro}}S^{OC,\mathrm{diff}}_{i,j}+K_{\mathrm{int}}\int S^{OC,\mathrm{diff}}_{i,j}\,dt$$

The sign of the deviation determines whether the converter transfers energy from the cell to the pack or from the pack to the cell:

$$I^{\mathrm{bal}}_{i,j}=-\operatorname{sgn}\left(S^{OC,\mathrm{diff}}_{i,j}\right)\frac{D_{i,j}P_{\mathrm{bal}}}{U^{\mathrm{ter}}_{i,j}}$$

where Pbal is the equalization power and Uter is the cell terminal voltage. In a simpler control study the duty ratio can be fixed, but the sign and magnitude of the balancing current still depend on the cell states.

Hierarchical loop-current solution

The pack is organized as a nested hybrid topology. An inner “string–parallel” unit contains m1 series cells and n1 parallel branches. Each inner unit becomes a cluster in the outer structure, which contains m2 series clusters and n2 parallel branches. For the j-th inner branch, the cell voltages and resistances are summed as

$$U^{in}_j=\sum_{i=1}^{m_1}\left(U_{i,j}+U^P_{i,j}\right),\qquad R^{in}_j=\sum_{i=1}^{m_1}R_{i,j}$$

For a parallel group of n1 such branches, the cluster equivalent voltage and resistance follow from current sharing:

$$U^{out}_{k,l}=\frac{\sum_{j=1}^{n_1}\sum_{i=1}^{m_1}\left(U_{i,j}+U^P_{i,j}\right)/R_{i,j}}{\sum_{j=1}^{n_1}\sum_{i=1}^{m_1}1/R_{i,j}}$$

$$R^{out}_{k,l}=\left(\sum_{j=1}^{n_1}\sum_{i=1}^{m_1}\frac{1}{R_{i,j}}\right)^{-1}$$

The outer branch then sums its series clusters:

$$U^{out,e}_l=\sum_{k=1}^{m_2}U^{out}_{k,l},\qquad R^{out,e}_l=\sum_{k=1}^{m_2}R^{out}_{k,l}$$

The network is solved from the outside inward. First, n2 outer loop-current equations are formed from the equivalent branch voltages and resistances. Their solution gives the current in each outer parallel branch. Each outer branch current then acts as a current source for the corresponding inner network, where n1 loop equations are solved for the individual cell currents. The SOC of each cell is updated by coulomb counting:

$$S^{OC}_{k,l,i,j}(t)=S^{OC}_{k,l,i,j}(t-h)+\frac{I^{\mathrm{bat}}_{l,j}h}{3600Q_{k,l,i,j}}$$

where h is the time step and Qk,l,i,j is the cell capacity. This hierarchical solve is the central computational step. The largest matrix in the electrical network has dimension n2 or n1, not the total number of cells. The method therefore retains every cell state but avoids assembling and inverting a single high-dimensional differential-algebraic system.

Time integration and step-size stability

The polarization voltage is a fast state relative to SOC and temperature, so its update needs a stable integrator. The RC branch obeys

$$\frac{dU_P}{dt}=\frac{I_{\mathrm{bat}}-U_P/R_P}{C_P}$$

A fourth-order Runge–Kutta update is used:

$$U_P(t+h)=U_P(t)+\frac{h}{6}\left(k_1+k_2+k_3+k_4\right)$$

where the intermediate slopes are evaluated from the current and polarization state at the start, midpoint, and end of the step. Within a step, the battery current is treated as varying linearly, which provides the midpoint current needed by the Runge–Kutta stages. The stability of the RC update can be checked from the characteristic value

$$\lambda=-\frac{1}{R_PC_P},\qquad Z=\lambda h=-0.03\in[-2.785,0]$$

for a 1 s step evaluated at SOC = 1. The negative value lies inside the stable interval, so the chosen step is acceptable for the polarization dynamics. The same step is used for the electrical, thermal, aging, and BMS states; the slower states simply change much less per step.

Validation against a full equivalent-circuit model

Validation was performed in MATLAB 2024b/Simulink on an Intel Core i7-12700 CPU with 16 GB of memory. The cell was a Lishen LR1865EH lithium iron phosphate cell with a capacity of 1.522 Ah. Because a full Simulink equivalent-circuit model becomes costly at large pack size, the accuracy comparison used a 2-series–2-parallel pack. Cell parameters were perturbed with inconsistency coefficients drawn from a normal distribution with mean 1 and standard deviation 0.02. The coefficients used in the four cells are listed in Table 1.

Table 1. Inconsistency coefficients for the 2S2P validation pack.
Cell position gQ gR gRP gCP
(1, 1) 1.030 0.995 0.971 1.007
(2, 1) 0.983 0.979 1.004 0.994
(1, 2) 1.016 0.994 0.984 0.982
(2, 2) 1.006 0.998 0.998 1.007

The simulation used a 1 s step and a total duration of 7,000 s. Terminal voltage, battery current, temperature, capacity loss, and branch imbalance current from the hierarchical model closely tracked the full equivalent-circuit model. The comparison was repeated with a variable-power Beijing bus driving cycle. Across both high-rate and low-rate segments, the two sets of curves largely overlapped, indicating that the loop decomposition did not sacrifice the electrical–thermal–aging coupling.

Table 2 summarizes the error against the full equivalent-circuit model. The maximum terminal-voltage error was 0.036 V, or about 1.0%; the maximum current error was 0.005 A, or 0.64%; the maximum temperature error was 0.004 °C, or 0.17%. Average errors were below 0.5% for all reported quantities. The capacity-loss error was 0.005 percentage points at maximum and 0.0004 percentage points on average.

Table 2. Simulation error of the hierarchical model against the full equivalent-circuit model.
Quantity Maximum absolute error Maximum relative error Average absolute error Average relative error
Terminal voltage Uter 0.036 V 1.0% 0.007 V 0.19%
Battery current Ibat 0.005 A 0.64% 0.0002 A 0.31%
Temperature T 0.004 °C 0.17% 0.002 °C 0.01%
Capacity loss Qlos 0.005 percentage points — 0.0004 percentage points 0.25%

BMS equalization and computational efficiency

The BMS equalization model was tested with six cells whose initial SOC values were 0.22, 0.29, 0.38, 0.45, 0.52, and 0.59. The equalization power was 48 W, the duty ratio was fixed at 0.4, and the converter efficiency was 0.8. Under these conditions, the hierarchical model and the full equivalent-circuit model produced consistent SOC trajectories. The result is a numerical check of the balancing model rather than a field validation, but it shows that the reduced network solve preserves the effect of the equalization current on individual cells.

The computational benefit becomes clear as pack size increases. Table 3 compares the two models for five pack configurations, all with a 1 s step and a 7,000 s simulation horizon.

Table 3. Simulation time for packs of increasing size (7,000 s simulated at h = 1 s).
Parallel branches × series cells Hierarchical model time (s) Full equivalent-circuit model time (s)
2 × 2 17.45 143.16
3 × 3 17.99 883.28
4 × 4 20.40 3,706.67
5 × 5 20.72 13,269.15
6 × 6 23.12 Not completed in the reported test

For the 2 × 2 pack, the hierarchical model completed in 17.45 s versus 143.16 s for the full equivalent-circuit model. At 5 × 5, the hierarchical model took 20.72 s while the full model required 13,269.15 s, about 3.69 h. At 6 × 6, the hierarchical model completed in 23.12 s; the full model did not complete the reported test. The hierarchical time grows only modestly from 4 to 36 cells because the loop matrices remain small and the dominant work shifts to cell-level state updates and parameter lookups.

Engineering implications and limits

For BESS engineering, the practical value of this framework is that it makes cell-level long-horizon studies tractable. Grid operators and storage designers often need to evaluate how equalization thresholds, thermal management, and dispatch profiles affect SOC spread, branch current imbalance, and aging. A monolithic equivalent-circuit model can answer those questions for small packs, but its cost rises quickly with pack size. The hierarchical dynamic-loop model keeps the cell-level detail that drives imbalance and degradation while reducing the electrical network to nested loop problems.

The model also provides a consistent environment for multi-timescale coupling. Electrical current affects heat generation; temperature affects resistance and aging; aging changes resistance and capacity; those changes feed back into current sharing and SOC evolution; and the BMS equalization loop acts on the resulting SOC differences. Treating these effects in one simulation avoids the inconsistency that arises when electrical, thermal, and aging studies use separately aggregated pack models.

The limits are equally important. The thermal model is a lumped-parameter representation and assumes a uniform cell temperature; it does not resolve internal temperature gradients or local hot spots. The aging model is semi-empirical, so extrapolation beyond its parameterized temperature, SOC, rate, and depth-of-discharge range requires caution. The accuracy validation used a 2-series–2-parallel pack, while the efficiency test extended to 6 × 6; larger field packs with complex cooling and wiring impedance would need further verification. The BMS test used a fixed duty ratio, and the model does not yet include grid-forming inverter control. Extending the framework to grid-forming operation and larger field configurations is a natural next step.

Conclusion

A hierarchical dynamic-loop framework can simulate battery energy storage systems across electrical, thermal, aging, and BMS timescales without collapsing the pack into a single equivalent cell. The cell model combines a Thevenin branch, a lumped thermal balance, a semi-empirical aging law, and a bidirectional equalization model. The network solution decomposes the pack into outer parallel-branch loops and inner cell-string loops, and a fourth-order Runge–Kutta update handles the polarization dynamics at a stable 1 s step. In the reported validation, terminal voltage, current, temperature, capacity loss, and branch imbalance current closely matched a full equivalent-circuit model, with maximum errors near 1% and average errors below 0.5%. The computational gain was substantial: a 5 × 5 pack simulated in 20.72 s versus about 3.69 h for the full model, and a 6 × 6 pack completed in 23.12 s. For energy battery storage, the significance is not a single faster simulation but a scalable way to keep cell-level inconsistency and multi-physics coupling visible in long-duration studies of equalization, thermal management, and aging.

Scroll to Top