## 3 The Adaptive SOC Estimation of the Kalman Filter  
With the traditional Kalman filter method, it is generally assumed that the interference source is Gaussian white noise when estimating the SOC of the battery is estimated, but in the actual operation of the vehicle, the noise often does not have such good statistical characteristics. Based on this situation, the adaptive Kalman filter algorithm is employed to dynamically estimate the state variables in real time based on the measured data, and to continuously correct the statistical characteristics of the noise, so that the battery SOC can be better approached. According to Equations (3) and (4), an estimated model of the battery SOC can be obtained:  
\[\left\{ \begin{array}{c}x_{k+1}=f(x_{k},u_{k})+\Gamma w_{k}\\ y_{k}=g(x_{k},u_{k})+v_{k}\\ w_{k}\sim(q_{k},Q_{k})\\ v_{k}\sim(r_{k},R_{k})\end{array} \right. \tag{8}\]  
In Equation (8), \(x\) and \(y\) represent state variables and output variables, respectively; \(\Gamma\) is the interference matrix; \(w_{k}\) and \(v_{k}\) are the process noise and measurement noise, which are used to indicate the unknown interference of the battery during operation; \(q_{k}\), \(Q_{k}\) and \(r_{k}\), \(R_{k}\) are the corresponding mean and covariance [30]. The steps of estimating the SOC using the adaptive Kalman filter are shown below [35; 36; 37; 38]: \begin{table}
\begin{tabular}{c c c c} \hline
**SOC** & **R\({}_{0}\) (m\(\Omega\))** & **R\({}_{p}\) (m\(\Omega\))** & **C\({}_{p}\) (F)** \\ \hline
1 & 33.0 & 17.2 & 1987.0 \\
0.975 & 29.2 & 16.2 & 1902.7 \\
0.95 & 21.6 & 11.0 & 1790.7 \\
0.925 & 19.3 & 6.5 & 1881.7 \\
0.9 & 17.1 & 7.3 & 1626.0 \\
0.8 & 17.1 & 9.3 & 1706.9 \\
0.7 & 17.0 & 6.1 & 1702.2 \\
0.6 & 17.3 & 5.9 & 1692.4 \\
0.5 & 17.6 & 7.2 & 1650.3 \\
0.4 & 17.7 & 6.2 & 1274.6 \\
0.3 & 18.0 & 6.6 & 1354.8 \\
0.2 & 18.4 & 6.7 & 1224.6 \\
0.1 & 18.6 & 11.4 & 1135.3 \\ \hline \end{tabular}
\end{table} 
Table 1: Thevenin model identification parameters. 1. Initializing the system state gives an estimate of the initial state of the system \(x_{0}\) and its error covariance \(P_{0}\): \[\widehat{x_{0}}=E[x_{0}]\] (9) \[P_{0}=E[\left(x_{0}-\widehat{x_{0}}\right)\left(x_{0}-\widehat{x_{0}}\right)^{ T}]\] (10)
2. By iterating the state and the error covariance matrix of the previous moment, the state and error covariance matrix of the next moment can be obtained: \[\widehat{x_{k}}=A_{k}\widehat{x_{k-1}}+B_{k}u_{k-1}+\Gamma q_{k-1}\] (11) \[P_{k}=A_{k}P_{k-1}A_{k}^{T}+\Gamma Q_{k-1}\Gamma^{T}\] (12)
3. The Kalman gain matrix \(L_{k}\) is: \[L_{k}=P_{k}C_{k}^{T}\left(C_{k}P_{k}C_{k}^{T}+R_{k-1}\right)^{-1}\] (13)
4. The state error covariance will gradually increase as the uncertainty of the current state increases, resulting in a corresponding increase in the Kalman gain matrix, in order to greatly update the current system state. 5. The state and the state covariance matrix at time \(k\) will be updated with output error at time \(k\): \[\widehat{x_{k}}=\widehat{x_{k-1}}+L_{k}(y_{k}-C_{k}\widehat{x_{k-1}}-D_{k}u_ {k}-r_{k-1})\] (14) \[P_{k}=(I-L_{k}C_{k})P_{k-1}\] (15)
6. In Equation (15), \(I\) is a unit matrix. As the measured value increases, the stability of the state becomes better and better, so the reference value \(P_{k}\) of uncertainty will be continuously reduced. 7. The mean and the covariance of process noise and measurement noise will be updated: \[\left\{ \begin{array}{c}q_{k}=(1-d_{k-1})q_{k-1}+d_{k-1}G(\widehat{x_{k}}-A_ {k}\widehat{x_{k-1}}-B_{k}u_{k-1})\\ Q_{k}=(1-d_{k-1})Q_{k-1}+d_{k-1}G(L_{k}\overline{y_{k}}\overline{y_{k}}^{T}L_ {k}^{T}+P_{k}-A_{k}P_{k-1}A_{k}^{T})G^{T}\\ r_{k}=(1-d_{k-1})r_{k-1}+d_{k-1}(y_{k}-C_{k}\widehat{x_{k-1}}-D_{k}u_{k})\\ R_{k}=(1-d_{k-1})R_{k-1}+d_{k-1}(\overline{y_{k}}\overline{y_{k}}^{T}-C_{k}P _{k-1}C_{k}^{T})\end{array} \right.\] (16)  
In Equation (16), \(\widetilde{y_{k}}\) is the output error, \(\widetilde{y_{k}}=y_{k}-C_{k}x_{k-1}-D_{k}u_{k}-r_{k-1}\); \(G=(\Gamma^{T}\Gamma)\Gamma^{T}\); b (0 \(<\) b \(<\) 1) is the forgetting factor; here take b = 0.98.