## 3 System Modeling and Mathematical Formulation
It offers a holistic approach that melts the strengths of deterministic and data-driven modeling paradigms, resulting in a versatile and efficient predictive system. This original research contribution holds promise for advancing EV battery management systems, with potential applications in optimizing battery performance, prolonging battery lifespan, and bolstering overall EV reliability and sustainability. \begin{table}
\begin{tabular}{l l} \hline \hline
**Symbols** & **Descriptions** \\ \hline \(C_{i}\) & Initial capacity of the battery \\ \(V_{max}\) & Maximum voltage of the battery \\ \(V_{min}\) & Minimum voltage of the battery \\ \(I_{max}\) & Maximum discharge current \\ \(T_{max}\) & Maximum operating temperature of the battery \\ \(C_{d}\) & Depth of discharge during cycling \\ \(\mathbf{Q}\) & Process noise covariance matrix \\ \(\mathbf{R}\) & Measurement noise covariance matrix \\ \(n_{c}\) & Number of charge–discharge cycles \\ \(n_{tc}\) & Number of steps per cycle \\ \(T_{s}\) & Time step in days \\ \(\mathbf{X}\) & Initial state of the battery (voltage, current, temperature) \\ \(\mathbf{P}\) & Initial covariance matrix for EKF \\ \(\mathbf{f}\) & Dynamic model function to simulate battery dynamics \\ \(\mathbf{z}\) & Measurement model function to model battery measurements \\ EKF & Class implementing EKF \\ \(L_{t}\) & List to store time values \\ \(L_{SoH}\) & List to store SoH values \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Symbols and definitions in the EKF-SoH algorithm. ```
1:\(C_{i}\), \(V_{max}\), \(V_{min}\), \(I_{max}\), \(T_{max}\), \(C_{d}\), \(\mathbf{Q}\), \(\mathbf{R}\), \(n_{c}\), \(n_{tc}\), \(T_{s}\), \(\mathbf{X}\), \(\mathbf{P}\), \(\mathbf{z}\)
2:\(L_{t}\), \(L_{SolH}\)
3:Initialize parameters and classes of ekf
4:Initialize initial state, initial covariance, \(\mathbf{Q}\), and \(\mathbf{R}\)
5:Establish a measurement model with Equation (4)
6:EKF forecasts the evolution of battery characteristics over time with Equation (6)
7:\(F=\) Identity matrix (linear dynamic model)
8:\(Covariance=F\cdot Covariance\cdot F^{T}+\mathbf{Q}\)
9:Predict the battery's internal state at the next time step with Equations (8) and (9)
10:\(H=\) Identity matrix (linear measurement model)
11:\(K=Covariance\cdot H^{T}\cdot(H\cdot Covariance\cdot H^{T}+\mathbf{R})^{-1}\)
12:Computes the Kalman Gain with Equation (10)
13:\(Innovation=Measurement-measurement\_model(current\_state)\)
14:\(Current\_state=Current\_state+K\cdot Innovation\)
15:\(Covariance=(Identitymatrix-K\cdot H)\cdot Covariance\)
16:update the predicted state and covariance matrix with Equations (11) and (12)
17:forcycle from 1 to \(n_{c}\)do
18:forstep from 1 to \(n_{tc}\)do
19:\(t=(cycle-1)*n_{tc}+step\)
20:\(control\_input=T_{c}\)
21:\(voltage=initial\_state[0]*(initial\_capacity/100)*C_{d}\)
22:\(current=I_{max}*sin(t/100)\)
23:\(temperature=T_{max}*sin(t/50)\)
24:\(measurement=[voltage,current,temperature]\)
25:\(predicted\_state=ekf.predict(control\_input,dynamic\_model)\)
26:\(ekf.update(measurement,measurement\_model)\)
27:\(estimated\_capacity=ekf.state[0]/V_{max}*100\)
28:\(SoH=initial\_SoH\_function(t)\)
29: append \(t\) to \(L_{t}\)
30: append \(SoH\) to \(L_{SoH}\)
31:endfor
32:endfor
33:Output:\(L_{t},L_{SolH}\)
```  
**Algorithm 1** EKF-SoH: estimate the SoH of electric vehicle batteries using EKF