An Improved Recursive Least Squares Algorithm for Refined Modeling of Energy Storage Battery

We present a refined modeling approach for energy storage battery based on a novel improved recursive least squares (RLS) algorithm. The proposed algorithm consists of two mutually constrained RLS estimators, enabling accurate parameter identification under complex operating conditions typical of modern power systems, such as peak shaving and frequency regulation. We design specific pulse current profiles for charging and discharging of the energy storage battery, and apply the improved RLS algorithm to identify the parameters of a third-order equivalent circuit model. Simulations conducted in MATLAB/Simulink demonstrate that the maximum voltage error under the FUDS (Federal Urban Driving Schedule) test is below 2.68%, while under the DST (Dynamic Stress Test) it remains below 3.04%. These results confirm the accuracy and effectiveness of the proposed model, providing a reliable method for building dynamic models of energy storage battery under complex grid conditions.

Keywords: least squares method; Simulink; new power system; equivalent circuit model; energy storage battery




1. Introduction

The performance of an equivalent circuit model for energy storage battery heavily depends on the quality of the parameter identification method. The recursive least squares (RLS) algorithm, as a recursive form of the least squares method, offers simplicity in computation and good dynamic response of the established battery model. It allows online updating of model parameters, making it widely used in battery model parameter identification. Several studies have employed RLS for modeling with enhanced accuracy. For example, a variable-capacitance capacitor model based on RLS improved precision in certain applications. Another work integrated a constraint factor into RLS for parameter identification of a second-order RC equivalent model, achieving better accuracy under various operating conditions. However, these models often fail to adapt effectively to the complex peak-shaving and frequency-regulation scenarios encountered in new power systems. To accurately reflect the dynamic characteristics of energy storage battery under such demanding conditions, we extend the conventional second-order equivalent circuit model to a third-order structure. Furthermore, we propose an improved RLS algorithm consisting of two mutually constrained RLS modules for parameter identification. Experimental validation demonstrates the feasibility and effectiveness of the proposed approach.

2. Lithium-Ion Battery Model for Energy Storage Battery

2.1 Third-Order Equivalent Circuit Model

Lithium-ion batteries play a critical role in various energy systems. The third-order equivalent circuit model for energy storage battery consists of a controlled voltage source representing the open-circuit voltage \(U_{OC}\), three RC parallel networks, and an ohmic resistance \(R_0\). The structure is defined by the following equations:

In the S-domain, the terminal voltage equation is:

$$
U_{OC}(s) = R_0 I(s) + U_1(s) + U_2(s) + U_3(s) + U(s)
$$

For each RC network under zero-state response, the voltage in the S-domain is given by:

$$
U_i(s) = \frac{R_i}{\tau_i s + 1} I(s), \quad i=1,2,3
$$

where \(\tau_i = R_i C_i\) is the time constant of the \(i\)-th RC network. Under zero-input response, the time-domain voltage of an RC network decays as:

$$
U_i(t) = U_{i0} e^{-t/\tau_i}
$$

Here, \(U_{i0}\) is the initial voltage across the RC network.

2.2 Relationship Between Open-Circuit Voltage and State of Charge

We selected a lithium-ion battery with a usable capacity of 3200 mAh (Panasonic NCR18650B) and performed tests using a NEWARE BT4000 tester at a 1 C rate. The open-circuit voltage (OCV) parameters obtained during discharge are listed in the following table.

Table 1: Open-Circuit Voltage (OCV) Discharge Parameters
SOC (%) Charging Voltage (V) Discharging Voltage (V)
100 4.201 4.184
90 4.046 4.035
80 3.911 3.896
70 3.834 3.815
60 3.793 3.714
50 3.672 3.618
40 3.602 3.540
30 3.516 3.466
20 3.394 3.384
10 3.297 3.251

To accurately describe the functional relationship between OCV and SOC, we fit the experimental data and obtain the following polynomial (order 7):

$$
U_{OC}(S) = -67.431 S^7 + 236.074 S^6 – 323.335 S^5 + 218.610 S^4 – 74.523 S^3 + 10.866 S^2 + 0.7983 S + 3.138
$$

This expression is used in the model to relate the open-circuit voltage of the energy storage battery to its state of charge.

3. Parameter Identification Method for Energy Storage Battery Model

3.1 Test Cycle Design

We designed the test profile to simulate the droop characteristics of conventional frequency regulation sources when the energy storage battery participates in primary frequency regulation. For primary frequency regulation, more than 71% of the power output lasts less than 2 minutes, and 99.4% of the output is below 0.1 p.u. (where p.u. is the rated power). For secondary frequency regulation, more than 95.52% of the output lasts less than 5 minutes, and 92.4% of the output is below 0.7 p.u. The test cycle consists of multiple phases: constant current discharge (0.3 C for 1200 s), a rest period (3400 s), fast charging/discharging pulses for primary frequency regulation (pulses every 2.5 s), and slow charging/discharging pulses for secondary frequency regulation (pulses every 10 s).

3.2 Improved Parameter Identification Algorithm

We analyze the parameter identification process using one representative cycle of the test data. The identified segments AB and FG correspond to slow and fast current variations, respectively. Considering the combined effect of all three RC networks under different conditions, we propose an improved RLS algorithm with the following step-by-step procedure.

First, after the battery has rested for a time \(t \ge 3\tau_2\) following a current step, we select two points (D and F) where the voltages from the first and second RC networks have fully decayed to zero. Then, based on Kirchhoff’s voltage law:

$$
U(k) = U_k – U_3 e^{-t/\tau_3}
$$

Using the measured voltages at points D and F, the time constant \(\tau_3\) is obtained as:

$$
\tau_3 = \frac{t_F – t_D}{\ln(U_D – U_k) – \ln(U_F – U_k)}
$$

During the constant-current discharge segment (CG), the RC networks reach steady state, leading to:

$$
U_k = U(k) – I (R_0 + R_1 + R_2 + R_3)
$$

At the end of the rest period, the RC networks return to steady state with zero capacitor voltage, so:

$$
U(k) = U_k
$$

Therefore, the voltage difference between point D (end of constant current) and point G (end of rest) is caused by energy dissipation in the RC networks:

$$
U_L – U_C = I (R_0 + R_1 + R_2 + R_3)
$$

Applying backward difference transformation to the S-domain equations with \(s = (1 – z^{-1})/T\), we derive discrete forms for the two RLS sub-algorithms.

First RLS sub-algorithm (for slow varying phase):

$$
U_{120}(k) = U_k – U_3(k) – U(k)
$$
$$
U_{120}(k) = U_{120}(k-1) a(k) + I(k) b(k) – I(k-1) c(k)
$$
$$
U_3(k+1) = U_3(k) \frac{\tau_3}{T + \tau_3} + I(k) \frac{T R_3(k)}{T + \tau_3}
$$

where

$$
a = \frac{\tau_2}{T + \tau_2},\quad b = \frac{T (R_0 + R_1 + R_2) + (R_0 + R_1)\tau_2}{T + \tau_2},\quad c = \frac{(R_0 + R_1)\tau_2}{T + \tau_2}
$$

Second RLS sub-algorithm (for fast varying phase):

$$
U_{10}(k) = U_k – U_2(k) – U_3(k) – U(k)
$$
$$
U_{10}(k) = U_{10}(k-1) d(k) + I(k) f(k) – I(k-1) g(k)
$$
$$
U_2(k+1) = U_2(k) \frac{\tau_2}{T + \tau_2} + I(k) \frac{T R_2(k)}{T + \tau_2}
$$

where

$$
d = \frac{\tau_1}{T + \tau_1},\quad f = \frac{T (R_0 + R_1) + R_0 \tau_1}{T + \tau_1},\quad g = \frac{R_0 \tau_1}{T + \tau_1}
$$

The third resistance \(R_3\) is identified from the total resistance sum:

$$
U_G – U_C = I (R_0 + R_1 + R_2 + R_3)
$$

The complete algorithm proceeds as follows:

  1. Initialize parameters.
  2. Identify \(a(k), b(k), c(k)\) using Eq. (first sub-algorithm).
  3. Identify \(d(k), f(k), g(k)\) using Eq. (second sub-algorithm).
  4. Solve simultaneously for \(\tau_1(k), \tau_2(k), R_0(k), R_1(k), R_2(k)\).
  5. Obtain \(R_3(k)\) from the sum equation.
  6. Compute the errors \(e_1(k)\) and \(e_2(k)\) for the two RLS sub-algorithms.
  7. Update \(U_2(k+1)\) and \(U_3(k+1)\) using the state-update equations.
  8. Adjust the coefficients \(a,b,c\) based on \(e_1(k)\) and \(d,f,g\) based on \(e_2(k)\). When the errors satisfy the tolerance, stop updating the corresponding coefficients. Repeat steps 4 to 8 until both errors meet the required precision.

4. Model Validation

4.1 Identified Parameters

Using the improved RLS algorithm, we obtained the parameters of the third-order equivalent circuit model for the energy storage battery at different SOC levels. The results are summarized in the following table.

Table 2: Identified Parameters of the Energy Storage Battery Model
SOC (%) \(R_0\) (Ω) \(\tau_1\) (s) \(C_1\) (F) \(R_2\) (Ω) \(\tau_2\) (s) \(R_3\) (Ω) \(\tau_3\) (s)
100 0.0839 0.0870 0.0456 0.0048 0.6240 0.0313 49.3261
90 0.1039 0.1080 0.0458 0.0050 0.5913 0.1135 54.8481
80 0.0897 0.1010 0.0460 0.0122 0.2604 0.1104 77.4731
70 0.0868 0.1007 0.0483 0.0139 0.2238 0.1135 82.4747
60 0.0811 0.0943 0.0458 0.0132 0.2248 0.1115 77.4731
50 0.0649 0.0793 0.0452 0.0144 0.2228 0.1115 82.4747
40 0.0715 0.0831 0.0520 0.0116 0.2289 0.1104 97.4786
30 0.0808 0.0932 0.0457 0.0125 0.2263 0.0865 60.3330
20 0.0992 0.1019 0.0363 0.0028 1.0890 0.0896 104.8443
10 0.1038 0.1145 0.0367 0.0038 0.3051 0.1042 101.4598
0 0.0873 0.0960 0.0459 0.0087 0.4532 0.1208 109.9083

4.2 Error Verification

To validate the accuracy and effectiveness of the proposed modeling approach, we compared two models: Model 1, which uses the improved RLS algorithm to build the third-order equivalent circuit model for the energy storage battery; and Model 2, which is based on the conventional RLS algorithm with a second-order equivalent circuit. The models were tested under the FUDS and DST cycles. The FUDS test results are shown in the following analysis.

Under the FUDS condition, the terminal voltage of Model 1 closely follows the measured voltage. The maximum absolute voltage error is below 2.68%. Under the DST condition, the maximum error remains below 3.04%. These results demonstrate that the proposed improved RLS algorithm significantly enhances the model’s adaptability and accuracy under different dynamic conditions. The third-order structure captures slower and faster polarization dynamics more effectively than the second-order model, especially during rapid current changes typical of frequency regulation.

5. Conclusion

We first analyzed the third-order RC equivalent circuit model for an energy storage battery and established a precise mathematical relationship between open-circuit voltage and state of charge. Based on the actual operating conditions of energy storage battery in power grids, we designed a specific test profile with combined slow and fast pulse currents. Using the proposed improved RLS algorithm—which consists of two mutually constrained RLS estimators—we successfully identified all seven parameters (\(R_0, R_1, R_2, R_3, \tau_1, \tau_2, \tau_3\)) of the model. Finally, we built a third-order equivalent circuit model in MATLAB/Simulink and validated it under FUDS and DST cycles. The results show that the improved RLS algorithm yields a maximum voltage error of only 2.68% under FUDS and 3.04% under DST, confirming the high precision and robustness of the modeling method. This approach provides a solid foundation for further research on state of health monitoring and optimal control of energy storage battery in new power systems.

Scroll to Top