## 4 Test Simulation and Result Analysis
### Simulation Experiment on Life Prediction of Lithium-Ion Battery  
Firstly, the ICSO-LSSVM model is trained. Then, the model is validated with the test samples. The ICSO-LSSVM model is tested by NMC1 and NMC2 battery capacity data. For NMC1 battery, the number of training samples and testing samples utilizes the first 500 and the last 260 samples respectively; for NMC2 battery, the number of training samples and testing samples utilizes the first 700 and the last 360 samples. The goal of the optimization process is to find the minimum value of f. The percentage of relative error (RE) is used as the evaluation index, and the percentage of the relative error of capacity prediction is as follows:  
\[RE=\frac{\dot{p}-p}{p}*100\% \tag{20}\]  
The predictive effects of three models were tested by using the data of NMC1 and NMC2 batteries, respectively. The first 500 sets of NMC1 battery capacity data are used as training samples; three models are trained by training samples. Then the 260 groups of data are predicted by PSO-LSSVM model, CSO-LSSVM model and ICSO-LSSVM model. The prediction curves are as follows. From Figure 7, it can be seen that the degradation trend of the three prediction curves is similar to that of the actual value curves. The prediction curves of the three models reach the failure threshold at 220, 215 and 212 times, respectively. The higher degree of fitting of the red prediction curve indicates that the ICSO-LSSVM model has a stronger ability to interpret NMC1 battery data. The prediction errors of the three models are calculated according to the prediction results of Figure 7, and the prediction results are evaluated according to the relative error RE. As shown in Figure 8, The maximum relative error of the PSO-LSSVM model exceeds 1%. The prediction error of the CSO-LSSVM and ICSO-LSSVM models is controlled within 1%. With the increase in the number of predicted samples, the prediction errors of the three models did not show significant fluctuations, indicating that the three models have high stability for NMC1 battery prediction. Figure 7: Discharge capacity prediction curve of NMC1 battery. Table 2 presents the RE of the PSO-LSSVM model, which fluctuates between \(\pm\)1.14%, and the average RE is 0.14%. The RE of the CSO-LSSVM model fluctuates between \(\pm\)0.86%, and the average RE of CSO-LSSVM model is 0.1559%. The RE of the ICSO-LSSVM model fluctuates between \(\pm\)0.82%, and the average RE of ICSO-LSSVM model is 0.11%. By comparison, The ICSO-LSSVM model controls the error to a small interval [\(-\)0.75% 0.82%]. The first 700 sets of NMC2 battery capacity data are used as training samples. Then the 360 groups of data are predicted by PSO-LSSVM, CSO-LSSVM and ICSO-LSSVM models. The NMC2 battery life prediction curves for each model are shown in Figure 9. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Model**} & **Maximum Reverse** & **Maximum Forward** & **Average RE/\%** \\  & **RE/\%** & **RE/\%** & **Average RE/\%** \\ \hline PSO-LSSVM & \(-\)0.81 & 1.13 & 0.14 \\ CSO-LSSVM & \(-\)0.73 & 0.86 & 0.15 \\ ICSO-LSSM & \(-\)0.75 & 0.82 & 0.11 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Model error analysis. Figure 8: Model error curves. Figure 9: Discharge capacity prediction curve of NMC2 battery. As shown in Figure 9, the black line reaches the failure threshold on the 299 th time. The pink line, blue line and red line present the prediction curves of PSO-LSSVM, CSO-LSSVM and model and ICSO-LSSVM models. The prediction curves reach the failure threshold on the 295 th, 317 th and 302 nd time. For the remaining life of the NMC2 battery, the prediction results of each model are as follows. The prediction error of the model before 200 samples is small, and the RE interval is controlled at \([-0.4\%\) 0.4%]. After 200 test samples, the prediction error of CSO-LSSVM and PSO-LSSVM increases, and the maximum RE of PSO-LSSVM is close to 0.8%.