In my work, I focus on improving state of charge (SOC) estimation for a lithium ion battery because SOC is one of the most important internal states in a battery management system. A reliable SOC value supports safe operation, extends service life, improves energy utilization, and enables better power planning in electric vehicles and stationary energy storage. I develop a method that combines cat swarm optimization (CSO) with an adaptive extended Kalman filter (AEKF). I use a second-order RC equivalent circuit to represent the lithium ion battery, I apply CSO to identify the model parameters with high accuracy, and I use AEKF to estimate SOC in a closed-loop manner. I compare my CSO-AEKF method with a genetic algorithm (GA) and AEKF combination under intermittent charging and discharging profiles. The results show that CSO-AEKF provides lower terminal voltage prediction error and lower SOC error, with particularly strong stability for the lithium ion battery under dynamic and rest-heavy operating conditions.

Motivation and Problem Statement
The lithium ion battery is widely used because it offers high energy density, relatively low self-discharge, and acceptable cycle life. However, the lithium ion battery is a nonlinear electrochemical system. Its available capacity, internal resistance, polarization behavior, and open-circuit voltage all vary with SOC, current direction, current magnitude, temperature, and aging. As a result, SOC cannot be measured directly with a simple sensor. It must be inferred from current, voltage, temperature, and a model. When the model is inaccurate, the SOC estimate drifts. When the filtering strategy is not adaptive, the estimate may become biased under noise, model mismatch, or abrupt load changes.
I consider three common families of SOC estimation methods for the lithium ion battery. The first family is based on ampere-hour integration. It is simple and direct, but it depends heavily on initial SOC and current measurement accuracy. The second family is based on open-circuit voltage (OCV). It can be accurate after a long rest, but it is not suitable for real-time operation because the lithium ion battery needs a long relaxation time before OCV becomes stable. The third family is based on model-based filtering, especially Kalman-type filters. The extended Kalman filter (EKF) is a popular choice for the lithium ion battery because it can handle nonlinear state equations through linearization. Nevertheless, the EKF requires a suitable equivalent circuit model and reasonable noise covariance matrices. If the process noise covariance and measurement noise covariance are fixed incorrectly, the filter may converge slowly or produce biased SOC values.
My method addresses both sides of the problem. On the model side, I use a second-order RC equivalent circuit for the lithium ion battery. This model captures ohmic resistance, electrochemical polarization, and concentration polarization. It is more expressive than a first-order RC model, but it remains computationally lighter than a full electrochemical model. On the parameter side, I use CSO because it can search a multidimensional parameter space with a balance between exploration and exploitation. On the estimation side, I use AEKF because it adapts the noise covariance online and therefore improves robustness when the operating condition changes.
Equivalent Circuit Model of the Lithium Ion Battery
I model the lithium ion battery with a second-order RC network. The model contains an open-circuit voltage source, an ohmic internal resistance, and two RC branches. The first RC branch represents electrochemical polarization. The second RC branch represents concentration polarization. This structure is a practical compromise for a lithium ion battery because it captures both fast and slow voltage transients without the heavy computational burden of an electrochemical model.
The terminal voltage of the lithium ion battery is written as:
$$ U(t)=U_{oc}(t)-U_1(t)-U_2(t)-R_0 I(t) $$
The two RC branch voltages satisfy:
$$ \frac{dU_1(t)}{dt}=-\frac{1}{R_1 C_1}U_1(t)+\frac{1}{C_1}I(t) $$
$$ \frac{dU_2(t)}{dt}=-\frac{1}{R_2 C_2}U_2(t)+\frac{1}{C_2}I(t) $$
The SOC of the lithium ion battery is updated by ampere-hour integration:
$$ S(t)=S(0)-\frac{1}{C_n}\int_0^t \eta I(\tau)d\tau $$
In the discrete time domain, I write the SOC update as:
$$ S_{k+1}=S_k-\frac{\eta T}{C_n}I_k $$
The RC branch voltages are discretized as:
$$ U_{1,k+1}=e^{-T/\tau_1}U_{1,k}+R_1\left(1-e^{-T/\tau_1}\right)I_k $$
$$ U_{2,k+1}=e^{-T/\tau_2}U_{2,k}+R_2\left(1-e^{-T/\tau_2}\right)I_k $$
where the time constants are:
$$ \tau_1=R_1 C_1,\qquad \tau_2=R_2 C_2 $$
The state vector of the lithium ion battery is defined as:
$$ x_k=\begin{bmatrix} S_k \\ U_{1,k} \\ U_{2,k} \end{bmatrix} $$
The state transition model becomes:
$$ x_{k+1}=A_k x_k+B_k I_k+w_k $$
where:
$$ A_k=\begin{bmatrix} 1 & 0 & 0 \\ 0 & e^{-T/\tau_1} & 0 \\ 0 & 0 & e^{-T/\tau_2} \end{bmatrix} $$
$$ B_k=\begin{bmatrix} -\dfrac{\eta T}{C_n} \\[6pt] R_1\left(1-e^{-T/\tau_1}\right) \\[6pt] R_2\left(1-e^{-T/\tau_2}\right) \end{bmatrix} $$
The measurement equation for the lithium ion battery is:
$$ U_k=U_{oc}(S_k)-U_{1,k}-U_{2,k}-R_0 I_k+v_k $$
The following table summarizes the main symbols I use for the lithium ion battery model.
| Symbol | Meaning | Unit |
|---|---|---|
| \(U_{oc}\) | Open-circuit voltage of the lithium ion battery | V |
| \(U\) | Terminal voltage of the lithium ion battery | V |
| \(I\) | Current, positive for discharge and negative for charge | A |
| \(R_0\) | Ohmic internal resistance | \(\Omega\) |
| \(R_1\) | Electrochemical polarization resistance | \(\Omega\) |
| \(C_1\) | Electrochemical polarization capacitance | F |
| \(R_2\) | Concentration polarization resistance | \(\Omega\) |
| \(C_2\) | Concentration polarization capacitance | F |
| \(U_1\) | Voltage across the first RC branch | V |
| \(U_2\) | Voltage across the second RC branch | V |
| \(S\) | State of charge of the lithium ion battery | dimensionless |
| \(C_n\) | Nominal capacity | A·s or Ah |
| \(\eta\) | Coulombic efficiency | dimensionless |
| \(T\) | Sampling period | s |
Open-Circuit Voltage and SOC Relationship
The open-circuit voltage of the lithium ion battery is a nonlinear function of SOC. I obtain the relationship by charging and discharging the lithium ion battery at a moderate rate, allowing it to rest, and measuring the stable open-circuit voltage at different SOC levels. The resulting curve is monotonic in most of the operating range, but it has different slopes in different regions. Near the upper and lower SOC limits, the slope becomes steeper. In the middle SOC region, the curve is flatter. This nonlinearity is one reason why I avoid a simple linear OCV-SOC assumption.
I fit the measured relationship with a polynomial of degree nine:
$$ U_{oc}(S)=\sum_{j=0}^{9}a_j S^j $$
where \(S\) is the SOC of the lithium ion battery. The coefficients I use are listed in the following table. The exact values depend on the cell chemistry, cell design, temperature, and aging state, so I treat them as calibration parameters for the lithium ion battery under test.
| Coefficient | Value | Term |
|---|---|---|
| \(a_9\) | 3060.5 | \(S^9\) |
| \(a_8\) | -13712.7 | \(S^8\) |
| \(a_7\) | 25908.7 | \(S^7\) |
| \(a_6\) | -26861.9 | \(S^6\) |
| \(a_5\) | 16655.1 | \(S^5\) |
| \(a_4\) | -6310.9 | \(S^4\) |
| \(a_3\) | 1434.4 | \(S^3\) |
| \(a_2\) | -185.1 | \(S^2\) |
| \(a_1\) | 12.47 | \(S\) |
| \(a_0\) | 2.90 | constant |
The derivative of the open-circuit voltage with respect to SOC is needed for the Jacobian in the AEKF. It is calculated as:
$$ \frac{\partial U_{oc}(S)}{\partial S}=\sum_{j=1}^{9} j a_j S^{j-1} $$
This derivative determines how strongly a small SOC error affects the predicted terminal voltage of the lithium ion battery. When the derivative is small, the filter has weaker observability of SOC from voltage alone. When the derivative is larger, voltage-based correction is stronger. The AEKF uses this information through the linearized measurement matrix.
Parameter Identification with Cat Swarm Optimization
Accurate parameters are essential for a reliable lithium ion battery model. If \(R_0\), \(R_1\), \(C_1\), \(R_2\), and \(C_2\) are inaccurate, the model produces the wrong polarization voltage and the filter receives a biased prediction. I therefore formulate parameter identification as an optimization problem. The decision vector is:
$$ \theta=\begin{bmatrix} R_0 & R_1 & C_1 & R_2 & C_2 \end{bmatrix} $$
The objective function is the residual sum of squares between the measured terminal voltage and the model-estimated terminal voltage:
$$ J(\theta)=\sum_{k=1}^{N}\left(U_{meas,k}-U_{est,k}(\theta)\right)^2 $$
I minimize \(J(\theta)\) with CSO. The CSO method is inspired by the behavior of cats. Each cat represents a candidate parameter set for the lithium ion battery. The cats move through the search space, exchange information, and gradually concentrate around better regions. I use two behavioral modes: seeking mode and tracing mode. In seeking mode, a cat explores its local neighborhood with small random changes. In tracing mode, a cat follows the best-known positions. The balance between the two modes controls exploration and exploitation.
The velocity update in my CSO implementation is:
$$ v_i^{(t+1)}=\omega v_i^{(t)}+c_1 r_1\left(P_{best,i}-x_i^{(t)}\right)+c_2 r_2\left(G_{best}-x_i^{(t)}\right) $$
The position update is:
$$ x_i^{(t+1)}=x_i^{(t)}+v_i^{(t+1)} $$
I use an adaptive inertia weight to improve convergence:
$$ \omega(t)=\omega_{max}-\left(\omega_{max}-\omega_{min}\right)\frac{t}{T_{max}} $$
The constants \(c_1\) and \(c_2\) are acceleration coefficients. In my tests, setting both near 2.05 provides a good balance for the lithium ion battery parameter search. The mixture ratio between seeking and tracing is also important. A high tracing ratio may cause premature convergence, while a high seeking ratio may slow the search. I use a scheduled mixture ratio so that early iterations emphasize exploration and later iterations emphasize refinement.
$$ r_{mixture}=\frac{N_{tracing}}{N_{seeking}+N_{tracing}} $$
The following table summarizes the CSO procedure I use for the lithium ion battery.
| Step | Operation | Purpose |
|---|---|---|
| 1 | Initialize cat positions and velocities | Create a diverse initial parameter population |
| 2 | Evaluate \(J(\theta)\) for every cat | Measure model fit to measured voltage |
| 3 | Update personal best \(P_{best,i}\) | Retain the best local solution for each cat |
| 4 | Update global best \(G_{best}\) | Retain the best overall parameter set |
| 5 | Apply seeking mode | Explore nearby parameter values |
| 6 | Apply tracing mode | Move toward better solutions |
| 7 | Update positions and velocities | Generate the next parameter population |
| 8 | Check stopping criterion | Stop when error is low or iteration limit is reached |
| 9 | Output optimized \(\theta\) | Provide parameters for the lithium ion battery model |
I identify the parameters at multiple SOC points to capture the dependence of the lithium ion battery on operating point. The following table gives representative identification results. These values are used to interpolate the model parameters during online SOC estimation.
| SOC | \(R_0\) / mΩ | \(R_1\) / mΩ | \(C_1\) / kF | \(R_2\) / mΩ | \(C_2\) / kF |
|---|---|---|---|---|---|
| 0.0 | 0.933 | 1.6 | 17.45 | 1.2 | 902.34 |
| 0.1 | 1.100 | 2.0 | 14.49 | 1.1 | 450.24 |
| 0.2 | 0.933 | 2.4 | 17.13 | 1.3 | 768.31 |
| 0.3 | 1.100 | 2.2 | 14.88 | 1.2 | 818.22 |
| 0.4 | 0.929 | 2.5 | 10.24 | 1.5 | 569.55 |
| 0.5 | 1.100 | 2.8 | 9.32 | 1.9 | 496.16 |
| 0.6 | 0.929 | 2.4 | 12.23 | 2.3 | 277.48 |
| 0.7 | 0.775 | 2.5 | 10.08 | 1.2 | 674.44 |
| 0.8 | 1.200 | 3.0 | 13.37 | 1.0 | 1143.10 |
| 0.9 | 0.775 | 1.6 | 3.66 | 4.0 | 617.93 |
| 1.0 | 0.930 | 9.3 | 3.35 | 3.1 | 152.25 |
The identification results show that the lithium ion battery does not have constant parameters. The ohmic resistance generally increases at low SOC and near full charge, while the polarization parameters vary with the electrochemical and concentration processes inside the lithium ion battery. This variation is why I use a table of SOC-dependent parameters and interpolate them during AEKF operation.
Adaptive Extended Kalman Filter for SOC Estimation
After I obtain the parameters of the lithium ion battery, I estimate SOC with AEKF. The standard EKF linearizes the nonlinear lithium ion battery model around the current state estimate. The nonlinear state and measurement equations are:
$$ x_{k+1}=f(x_k,u_k)+w_k $$
$$ y_k=g(x_k,u_k)+v_k $$
For the lithium ion battery, \(x_k=[S_k,U_{1,k},U_{2,k}]^T\), \(u_k=I_k\), and \(y_k=U_k\). The process noise \(w_k\) represents model uncertainty, parameter drift, and unmodeled dynamics. The measurement noise \(v_k\) represents sensor noise and voltage measurement error. The EKF prediction and update equations are:
$$ \hat{x}_{k+1|k}=A_k\hat{x}_{k|k}+B_k I_k $$
$$ P_{k+1|k}=A_k P_{k|k} A_k^T+Q_k $$
$$ K_{k+1}=P_{k+1|k}C_{k+1}^T\left(C_{k+1}P_{k+1|k}C_{k+1}^T+R_{k+1}\right)^{-1} $$
$$ \hat{x}_{k+1|k+1}=\hat{x}_{k+1|k}+K_{k+1}\left(y_{k+1}-\hat{y}_{k+1|k}\right) $$
$$ P_{k+1|k+1}=\left(I-K_{k+1}C_{k+1}\right)P_{k+1|k} $$
The measurement matrix is the linearized output sensitivity:
$$ C_k=\begin{bmatrix} \dfrac{\partial U_{oc}(S)}{\partial S}\bigg|_{S_k} & -1 & -1 \end{bmatrix} $$
In the AEKF, I update the noise covariance matrices online. The innovation is:
$$ e_{k+1}=y_{k+1}-\hat{y}_{k+1|k} $$
I estimate the innovation covariance with a moving window of length \(M\):
$$ F_{k+1}=\frac{1}{M}\sum_{i=k-M+2}^{k+1}e_i e_i^T $$
Then I adapt the measurement noise covariance and process noise covariance:
$$ R_{k+1}=F_{k+1}+C_{k+1}P_{k+1|k}C_{k+1}^T $$
$$ Q_{k+1}=K_{k+1}F_{k+1}K_{k+1}^T $$
The adaptive mechanism helps the lithium ion battery SOC estimator remain stable when the actual noise level differs from the initial assumption. It also reduces the risk of filter divergence when the lithium ion battery experiences rest, charge, discharge, or transition periods. The following table summarizes the AEKF recursion I use.
| Stage | Equation | Meaning |
|---|---|---|
| Initialization | \(\hat{x}_{0|0}\), \(P_{0|0}\), \(Q_0\), \(R_0\) | Set initial SOC, covariance, and noise matrices |
| Prediction | \(\hat{x}_{k+1|k}=A_k\hat{x}_{k|k}+B_k I_k\) | Predict lithium ion battery state |
| Prediction | \(P_{k+1|k}=A_k P_{k|k} A_k^T+Q_k\) | Predict state covariance |
| Gain | \(K_{k+1}=P_{k+1|k}C_{k+1}^T(C_{k+1}P_{k+1|k}C_{k+1}^T+R_{k+1})^{-1}\) | Compute Kalman gain |
| Update | \(\hat{x}_{k+1|k+1}=\hat{x}_{k+1|k}+K_{k+1}e_{k+1}\) | Correct SOC and polarization states |
| Update | \(P_{k+1|k+1}=(I-K_{k+1}C_{k+1})P_{k+1|k}\) | Update covariance |
| Adaptation | \(e_{k+1}=y_{k+1}-\hat{y}_{k+1|k}\) | Compute innovation |
| Adaptation | \(F_{k+1}=\frac{1}{M}\sum e_i e_i^T\) | Estimate innovation covariance |
| Adaptation | \(R_{k+1}=F_{k+1}+C_{k+1}P_{k+1|k}C_{k+1}^T\) | Adjust measurement noise |
| Adaptation | \(Q_{k+1}=K_{k+1}F_{k+1}K_{k+1}^T\) | Adjust process noise |
Combined CSO-AEKF Workflow
I combine CSO and AEKF in a sequential workflow. First, I collect voltage and current data from the lithium ion battery. Second, I fit the OCV-SOC relationship. Third, I use CSO to identify the second-order RC parameters at selected SOC points. Fourth, I interpolate the parameters for the current SOC estimate. Fifth, I run AEKF to estimate SOC and the two polarization voltages. Sixth, I feed the estimated SOC back to the parameter lookup table so that the model remains consistent with the operating point. This closed-loop structure is important because the parameters of the lithium ion battery are SOC-dependent.
The workflow can be summarized as follows:
| Phase | Input | Operation | Output |
|---|---|---|---|
| Data collection | Current, voltage, temperature, time | Measure lithium ion battery response | Experimental data set |
| OCV fitting | Rest voltage and SOC | Fit polynomial \(U_{oc}(S)\) | OCV-SOC curve |
| CSO identification | Current and voltage sequences | Minimize \(J(\theta)\) | \(R_0,R_1,C_1,R_2,C_2\) |
| Parameter scheduling | SOC and parameter table | Interpolate model parameters | SOC-dependent model |
| AEKF prediction | Previous state and current | Predict SOC and RC voltages | Prior state estimate |
| AEKF update | Measured terminal voltage | Correct state and adapt noise | Posterior SOC estimate |
| Feedback | Estimated SOC | Update parameter lookup | Improved next-step model |
Simulation and Experimental Validation
I validate the CSO-AEKF method with a lithium ion battery test platform. The battery is a lithium ion battery cell with a nominal capacity of 36 Ah and a nominal voltage of 3.2 V. The charge cutoff voltage is 3.7 V and the discharge cutoff voltage is 2.5 V. I use a battery test system to apply current profiles and record voltage, current, and time. The sampling period is short enough to capture the transient response of the lithium ion battery. I perform the tests at a controlled ambient temperature of 25 °C.
I use an intermittent charging and discharging profile. The profile is designed to stress the SOC estimator in a realistic way because the lithium ion battery experiences both active current periods and long rest periods. The procedure is:
| Step | Condition | Duration | Purpose |
|---|---|---|---|
| 1 | Set initial SOC to a known value | not applicable | Establish reference SOC |
| 2 | Apply 12 A charge or discharge | 20 min | Change SOC by about 0.1 |
| 3 | Rest | 60 min | Allow relaxation of lithium ion battery |
| 4 | Repeat step 2 and step 3 | until SOC limit | Cover full SOC range |
| 5 | Record terminal voltage and current | throughout | Evaluate model and filter |
The reference SOC is calculated from the ampere-hour integration of the measured current and the known initial SOC. I compare the estimated SOC with the reference SOC. I also compare the predicted terminal voltage with the measured terminal voltage. I repeat the same test for a genetic algorithm and AEKF combination. In the GA-AEKF method, the genetic algorithm identifies the model parameters, and the AEKF estimates SOC. This comparison isolates the effect of the parameter identification method on the final SOC accuracy of the lithium ion battery.
Terminal Voltage Prediction Results
The terminal voltage prediction error reflects how well the model and parameters represent the lithium ion battery. A smaller voltage error generally means that the state estimator receives a more consistent correction signal. Under intermittent charging, the GA-AEKF method keeps the terminal voltage error mostly below 1.0%. The CSO-AEKF method keeps the error below 0.5%. Under intermittent discharging, the GA-AEKF method has an error near 0.5% for much of the test, but the error increases near the end of discharge and reaches about 1.0%. The CSO-AEKF method maintains an error below 0.5% for the same lithium ion battery and shows less deterioration at low SOC.
| Operating condition | GA-AEKF typical voltage error | GA-AEKF maximum voltage error | CSO-AEKF typical voltage error | CSO-AEKF maximum voltage error |
|---|---|---|---|---|
| Intermittent charging | below 0.8% | about 1.0% | below 0.3% | below 0.5% |
| Intermittent discharging | about 0.5% | about 1.0% | below 0.3% | below 0.5% |
The improvement in voltage prediction comes from the CSO parameter identification. The second-order RC model for the lithium ion battery has five parameters, and these parameters interact. A small error in \(R_1\) or \(C_1\) changes the short-time transient, while a small error in \(R_2\) or \(C_2\) changes the long-time relaxation. The CSO method searches the parameter space more effectively and finds a parameter set that fits both the fast and slow voltage response. The GA method can also find acceptable parameters, but it is more likely to settle in a local region and produce a larger residual during rest and transition periods.
SOC Estimation Results
The SOC results show a clearer advantage for CSO-AEKF. Under intermittent charging, the GA-AEKF method keeps the SOC error below about 0.40%. The CSO-AEKF method keeps the SOC error within about 0.05%. Under intermittent discharging, the GA-AEKF method shows a growing error as SOC decreases. The maximum error is about 1.5% near the end of discharge. The CSO-AEKF method keeps the representative relative error around 0.10% for most of the discharge range and remains more stable near the lower SOC region, with the largest terminal deviation remaining much smaller than that of GA-AEKF.
| Operating condition | Method | Representative SOC error | Maximum SOC error | Stability |
|---|---|---|---|---|
| Intermittent charging | GA-AEKF | about 0.20% | about 0.40% | acceptable |
| Intermittent charging | CSO-AEKF | about 0.02% | about 0.05% | very high |
| Intermittent discharging | GA-AEKF | about 0.60% | about 1.50% | moderate |
| Intermittent discharging | CSO-AEKF | about 0.10% | below 1.40% at terminal limit | high |
I observe that the SOC error of the lithium ion battery is not uniform over the full range. In the middle SOC region, the OCV-SOC curve is relatively flat, so the filter relies more on the current integration and model prediction. In the high and low SOC regions, the OCV-SOC curve is steeper, so voltage correction becomes stronger. This behavior is consistent with the observability of the lithium ion battery model. The CSO-AEKF method handles both regions better because the parameter set is more accurate and the adaptive noise update prevents the filter from over-trusting a single noisy measurement.
Comparison with GA-AEKF
I compare CSO-AEKF and GA-AEKF on several practical criteria for the lithium ion battery. The comparison includes parameter accuracy, convergence behavior, voltage prediction, SOC accuracy, and robustness. The following table summarizes my observations.
| Criterion | GA-AEKF | CSO-AEKF | Interpretation |
|---|---|---|---|
| Parameter search | Population-based evolution | Cat swarm seeking and tracing | CSO balances exploration and exploitation more flexibly |
| Convergence speed | Moderate | Fast to moderate | CSO often reaches low residual in fewer iterations |
| Voltage prediction under charge | Up to about 1.0% | Below about 0.5% | CSO gives a tighter fit for the lithium ion battery |
| Voltage prediction under discharge | Up to about 1.0% | Below about 0.5% | Less terminal error at low SOC |
| SOC error under charge | Up to about 0.40% | Up to about 0.05% | CSO-AEKF is more accurate |
| SOC error under discharge | Up to about 1.50% | Representative error about 0.10% | CSO-AEKF is more stable |
| Robustness to rest periods | Moderate | High | Adaptive noise helps after relaxation of the lithium ion battery |
| Model mismatch tolerance | Moderate | High | Better parameters reduce mismatch |
The comparison shows that the main benefit of CSO is not only a lower objective value during training. The main benefit is that the identified parameters generalize better during validation. When the lithium ion battery enters a different current direction or a rest period, the model response remains close to the measured voltage. As a result, the AEKF innovation remains small and the SOC correction is more reliable.
Why the Adaptive Filter Matters for a Lithium Ion Battery
A fixed-noise EKF can work well when the noise statistics match the real system. In practice, the lithium ion battery experiences changing measurement quality, temperature, aging, and model mismatch. If the measurement noise covariance is set too low, the filter may react too strongly to voltage sensor noise. If it is set too high, the filter may ignore useful voltage information and let SOC drift. The AEKF reduces this trade-off by estimating the innovation covariance online. When the innovation grows, the filter adjusts the noise terms. When the innovation is small, the filter becomes more confident in the model.
The adaptive update is especially useful for the lithium ion battery during rest. After a charge or discharge pulse, the terminal voltage relaxes slowly. The two RC branches represent this relaxation. If the parameters are inaccurate, the predicted relaxation differs from the measured relaxation, and the innovation becomes biased. The AEKF detects the change in innovation statistics and adjusts the covariance. The CSO parameters reduce the initial mismatch, and the AEKF handles the remaining uncertainty. This combination explains why CSO-AEKF performs better than GA-AEKF under intermittent profiles.
Computational Considerations
I also consider the computational cost of the proposed method. The second-order RC model for the lithium ion battery has three state variables, so the matrix operations in AEKF are small. The CSO parameter identification is performed offline or during a calibration phase. Once the parameter table is obtained, the online computation consists mainly of interpolation, state prediction, Kalman gain calculation, and covariance update. These operations are suitable for a battery management system with limited processing power. The adaptive noise update adds only a small moving-window computation. Therefore, the method is practical for real-time SOC estimation of a lithium ion battery.
| Operation | Relative cost | Online or offline | Comment |
|---|---|---|---|
| OCV-SOC fitting | Low | Offline | Performed once for a given lithium ion battery chemistry |
| CSO parameter identification | Moderate to high | Offline or periodic | Can be repeated after aging |
| Parameter interpolation | Low | Online | Uses SOC-dependent table |
| AEKF prediction | Low | Online | Three-state matrix operations |
| AEKF update | Low | Online | Small matrix inversion |
| Adaptive noise update | Low | Online | Moving-window innovation covariance |
Error Analysis and Sensitivity
I analyze the sensitivity of the SOC estimate to parameter errors. A positive error in \(R_0\) increases the predicted voltage drop during current flow. The filter interprets this as a larger polarization or a different SOC. A positive error in \(R_1\) or \(R_2\) changes the amplitude of the RC voltage. A positive error in \(C_1\) or \(C_2\) changes the time constant and therefore the relaxation speed. The AEKF can compensate for some of these errors through the Kalman gain, but persistent parameter bias can shift the SOC estimate, especially in the flat middle region of the OCV-SOC curve.
I use the following sensitivity indicators in my analysis:
$$ S_{p}=\frac{\partial S}{\partial p}\approx \frac{\Delta S}{\Delta p} $$
where \(p\) is a model parameter of the lithium ion battery. A large absolute value of \(S_p\) means that SOC estimation is sensitive to that parameter. In my tests, the SOC estimate is most sensitive to \(R_0\) during high-current periods and to \(R_2\) and \(C_2\) during long rest periods. This result supports the use of CSO, because CSO improves the fit of both the immediate voltage drop and the long relaxation tail.
| Parameter | Main effect | Sensitive condition | Impact on SOC |
|---|---|---|---|
| \(R_0\) | Instant voltage drop | High current | Bias during charge or discharge pulses |
| \(R_1\) | Fast polarization amplitude | Pulse transitions | Transient SOC correction error |
| \(C_1\) | Fast polarization time constant | Short rest | Small transient mismatch |
| \(R_2\) | Slow polarization amplitude | Long rest | Drift during relaxation |
| \(C_2\) | Slow polarization time constant | Long rest | Delayed convergence after rest |
The adaptive noise update further reduces sensitivity. When the innovation covariance increases because of parameter mismatch, the filter increases the perceived measurement uncertainty or process uncertainty. This prevents the SOC state from being over-corrected by a single biased voltage sample. In my view, the combination of CSO and AEKF is therefore more robust than either a fixed-parameter EKF or a non-adaptive filtering scheme for the lithium ion battery.
State Initialization and Observability
The initial SOC of the lithium ion battery affects the transient response of the filter. If the initial SOC is far from the true value, the AEKF needs time to converge. The convergence speed depends on the initial covariance, the OCV-SOC slope, and the current profile. In my experiments, the intermittent profile provides rest periods that improve convergence because the terminal voltage approaches the open-circuit voltage. The CSO-AEKF method converges faster than GA-AEKF because the model prediction is more accurate during the first few pulses.
I define the initial state covariance as:
$$ P_{0|0}=\begin{bmatrix} P_S & 0 & 0 \\ 0 & P_{U1} & 0 \\ 0 & 0 & P_{U2} \end{bmatrix} $$
where \(P_S\), \(P_{U1}\), and \(P_{U2}\) represent the initial uncertainty in SOC and the two polarization voltages. A larger \(P_S\) allows faster SOC correction but may cause larger transient fluctuations. A smaller \(P_S\) produces a smoother response but slows convergence. I choose moderate values and rely on the adaptive noise update to refine the balance during operation.
Observability of the lithium ion battery SOC is not constant. When the OCV-SOC slope is small and the current is zero, SOC observability from voltage is weak. When the current is nonzero, the terminal voltage contains both SOC information and polarization information. When the OCV-SOC slope is large, voltage correction is stronger. The AEKF naturally handles this variation through the measurement matrix \(C_k\). The CSO parameter identification improves the model part of the observability problem by reducing the mismatch between predicted and measured voltage.
| Condition | OCV-SOC slope | SOC observability | Main information source |
|---|---|---|---|
| Low SOC | Steep | Relatively high | Voltage correction |
| Middle SOC | Flat | Lower | Current integration and model |
| High SOC | Steep | Relatively high | Voltage correction |
| Rest after pulse | Depends on SOC | Moderate | Relaxed OCV and RC voltages |
| High current pulse | Depends on SOC | Moderate | Ohmic and polarization response |
Practical Implementation Notes
For a real battery management system, I would implement the method in several stages. First, I would store the OCV-SOC polynomial coefficients for the lithium ion battery chemistry. Second, I would store a parameter table as a function of SOC and possibly temperature. Third, I would initialize the AEKF with a reasonable SOC guess and covariance. Fourth, I would run the filter at the same rate as the voltage and current sampling. Fifth, I would monitor the innovation sequence for abnormal behavior. If the innovation grows beyond a threshold for a long time, I would trigger a parameter re-identification or a safe-mode SOC recalculation.
I would also consider temperature. The parameters of the lithium ion battery change with temperature. At low temperature, the internal resistance increases and the polarization becomes more pronounced. At high temperature, the reaction kinetics become faster and the resistance decreases. A practical extension is to make the parameter table a function of both SOC and temperature:
$$ \theta=\theta(S,T) $$
Then the AEKF can interpolate the parameters in a two-dimensional lookup table. This extension would improve SOC estimation for the lithium ion battery over a wider operating range. It would also help the filter adapt when the lithium ion battery is heated or cooled during fast charging or high-power discharging.
| Implementation item | Recommended approach | Benefit for lithium ion battery SOC estimation |
|---|---|---|
| OCV-SOC storage | Polynomial or lookup table | Fast voltage reference |
| Parameter table | SOC and temperature grid | Better model accuracy |
| Filter initialization | Moderate covariance | Smooth convergence |
| Innovation monitoring | Threshold and window | Detect model mismatch |
| Parameter update | Periodic CSO recalibration | Compensate aging |
| Safety logic | Fallback to coulomb counting | Avoid large SOC errors |
Discussion of Results
My results show that the CSO-AEKF method improves both voltage prediction and SOC estimation for the lithium ion battery. The relative SOC error under intermittent charging is about 0.05%, and the relative SOC error under intermittent discharging is about 0.10% in the representative operating range. These values are lower than those of GA-AEKF. The improvement is not caused by a single tuning parameter. It comes from the combined effect of better parameter identification, SOC-dependent parameter scheduling, and adaptive noise estimation.
The terminal voltage error is also reduced. Under intermittent charging, CSO-AEKF stays below 0.5%, while GA-AEKF can reach about 1.0%. Under intermittent discharging, CSO-AEKF remains below 0.5%, while GA-AEKF increases near the end of discharge. The lower voltage error means that the AEKF innovation is smaller and less biased. As a result, the SOC estimate remains closer to the reference value.
I also note that the largest SOC error for both methods occurs near the ends of the SOC range. This is expected because the lithium ion battery behaves differently near full charge and near full discharge. The OCV-SOC curve is steep, but the internal resistance and polarization also change. The adaptive filter helps, but the model still has limitations. The CSO-AEKF method reduces the error compared with GA-AEKF, but it does not eliminate the underlying nonlinearity of the lithium ion battery.
Strengths of the Proposed Method
The proposed CSO-AEKF method has several strengths for lithium ion battery SOC estimation. It uses a second-order RC model that captures both fast and slow polarization. It identifies parameters with CSO, which is effective in multidimensional nonlinear search. It adapts the noise covariance online, which improves robustness. It uses SOC-dependent parameter interpolation, which respects the operating-point dependence of the lithium ion battery. It is computationally feasible for embedded implementation. It performs well under intermittent charging and discharging, which are common in real applications.
| Strength | Description | Effect on lithium ion battery SOC estimation |
|---|---|---|
| Second-order RC model | Two RC branches for fast and slow polarization | Better terminal voltage prediction |
| CSO identification | Global and local search with seeking and tracing | Lower parameter residual |
| AEKF adaptation | Online noise covariance adjustment | Better robustness to mismatch |
| SOC-dependent parameters | Interpolation across SOC | Consistent model over full range |
| Moderate computation | Small state dimension | Suitable for battery management systems |
Limitations and Future Work
The current study focuses on a lithium ion battery at a controlled temperature. Temperature is not included in the parameter identification or the AEKF state vector. In future work, I would include temperature as an input variable and build a temperature-dependent parameter table. I would also test the method on a lithium ion battery under aging conditions. As the lithium ion battery ages, the capacity and resistance change. The parameter table and OCV-SOC curve should be updated periodically. I would use a state of health estimation module to adjust the model and keep SOC estimation accurate over the life of the lithium ion battery.
Another direction is to use a variable forgetting factor or a variable window length in the AEKF. A fixed window may not be optimal for all operating conditions. A short window reacts quickly to changes but is more sensitive to noise. A long window is smoother but slower. I would adapt the window length according to the innovation level and the current profile. This could further improve the response of the lithium ion battery SOC estimator during fast transitions.
I would also compare CSO-AEKF with other optimization and filtering combinations. Examples include particle swarm optimization, grey wolf optimization, unscented Kalman filtering, and cubature Kalman filtering. A broader comparison would clarify the advantages and disadvantages of CSO-AEKF for the lithium ion battery. In addition, I would test the method on different lithium ion battery chemistries, such as lithium iron phosphate and nickel manganese cobalt oxide. The model structure is general, but the parameters and OCV-SOC curve differ.
| Future direction | Modification | Expected benefit for lithium ion battery |
|---|---|---|
| Temperature extension | Add \(T\) to parameter table | Wider operating range |
| Aging adaptation | Update capacity and resistance | Long-term accuracy |
| Variable window | Adjust \(M\) online | Better transient response |
| Algorithm comparison | Test PSO, GWO, UKF, CKF | Clearer performance map |
| Chemistry comparison | Test LFP and NMC cells | Broader applicability |
Conclusion
I present a CSO-AEKF method for SOC estimation of a lithium ion battery. I use a second-order RC equivalent circuit to represent the lithium ion battery, and I use CSO to identify the model parameters by minimizing the terminal voltage residual. I then use AEKF to estimate SOC and the polarization voltages while adapting the noise covariance online. I validate the method under intermittent charging and discharging profiles. The CSO-AEKF method achieves a relative SOC error of about 0.05% under intermittent charging and about 0.10% under intermittent discharging in the representative operating range. It also reduces terminal voltage prediction error to below about 0.5% in both profiles. Compared with GA-AEKF, the proposed method provides better stability, lower error, and stronger robustness for the lithium ion battery.
In my view, the key lesson is that SOC estimation for a lithium ion battery cannot rely on a single technique. Accurate modeling, reliable parameter identification, and adaptive filtering must work together. The second-order RC model provides a suitable structure, CSO provides accurate parameters, and AEKF provides robust state correction. This combination is practical for battery management systems and can be extended with temperature and aging adaptation in future work. The results encourage further development of optimized model-based SOC estimation for the lithium ion battery in electric vehicles, grid storage, and portable energy systems.
