# State of Charge Estimation for Lithium-Ion Power Battery Based on H-Infinity Filter Algorithm
## 3 SOC Estimation Based on the HIF Algorithm
### SOC Estimation Based on HIF Algorithm  
To judge the accuracy of the estimated object \(x_{k}\), the HIF algorithm defines a cost function \(J\):  
\[J=\frac{\sum\limits_{k=0}^{N-1}\left\|x_{k}-\hat{x}_{k}\right\|_{S_{k}}^{2}}{ \left\|x_{0}-\hat{x}_{0}\right\|_{p_{0}^{-1}}^{2}+\sum\limits_{k=0}^{N-1}\left( \left\|\omega_{k}\right\|_{Q_{k}^{-1}}^{2}+\left\|v_{k}\right\|_{R_{k}^{-1}}^{ 2}\right)} \tag{12}\]  
The matrices \(P_{0}\), \(Q_{k}\), \(R_{k}\), and \(S_{k}\) in the equation are all symmetric positive definite matrices, which are set by the designer for specific problems. Designers use these matrices to reflect the degree to which different types of noise affect the system. In general, we expect to perform similar processing on the weights of different types of noises to avoid the impact on the accuracy of estimation when a certain type of noise is ignored.  
It can be seen from Equation (11) that the cost function of HIF is a relative proportional value, and its numerator and denominator are related to the estimated value error and the overall noise of the system. The significance of establishing the cost function is to reflect the proportional relation between the estimation error and the noise interference. In order to meet the design requirements, the cost function has an upper bound, which satisfies the following condition:  
\[J<1/\theta\]  
To solve the above optimization process, the algorithm designer must find a suitable \(x_{k}\) method to minimize the denominator of the cost function \(J\). However, the reality is contrary to the designer's goal; it hopes to produce a specific special initialization state \(x_{0}\), noise \(\omega_{k}\), and \(v_{k}\), so as to maximize the cost function \(J\).  
Therefore, this problem becomes a maximum-minimum problem, that is, when \(\omega_{k}\), \(v_{k}\), and \(x_{0}\) make the cost function \(J\) maximum, the appropriate \(x_{k}\) should be selected to minimize the cost function \(J\). By re-integrating Equations (11) and (12) and combining it with the output Equation (9) of the state space, Equation (13) can be obtained:  
\[-\frac{1}{\theta}\|x_{0}-\hat{x}_{0}\|_{P_{0}^{-1}}^{2}+\sum_{k=0}^{N-1}\Bigl{[} \|x_{k}-\hat{x}_{k}\|_{S_{k}}^{2}-\frac{1}{\theta}(\|a_{k}\|_{Q_{k}^{-1}}^{2}+ \|y_{k}-C_{k}x_{k}-D_{k}u_{k}\|_{R_{k}^{-1}}^{2})\Bigr{]}<0 \tag{13}\]  
By solving the maximum-minimum problem of the cost function, a recursive relation satisfying Equation (12) can be obtained, as shown below:  
\[\left\{\begin{array}{l}K_{k}=A_{k}P_{k}(I-\theta S_{k}P_{k}+C_{k}^{T}R_{k}^{ -1}C_{k}P_{k})^{-1}C_{k}^{T}R_{k}^{-1}\\ \hat{x}_{k+1}=A_{k}\hat{x}_{k}+B_{k}u_{k}+K_{k}(y_{k}-C_{k}\hat{x}_{k}-D_{k}u_{ k})\\ P_{k+1}=A_{k}P_{k}(I-\theta S_{k}+C_{k}^{T}R_{k}^{-1}C_{k}P_{k})^{-1}A_{k}^{T}+Q_{k} \end{array}\right. \tag{14}\]  
Similar to the KF algorithm, in order to facilitate calculation and application of the SOC estimation method based on the HIF, the recursive relation (Equation (14)) is divided into two stages: prediction and update. The specific calculation process is shown in Table 5.