## 5 Results and Discussion  
### Results  
To analyze the optimization effect of the BA, we drew the evaluation function, impulse loudness, and impulse emission rate diagrams, as shown in Figures 12-14. The evaluation function is \(f_{\min}\), representing the bat with the smallest current fitness level, and it was obtained using Equation (8). In this study, the bat's velocity is a vector. Therefore, we propose a new concept, i.e., the average velocity modulus length \(\overline{\|v\|}\). We first calculated the velocity modulus length of each bat, as shown in Equation (19), where \(D\) is the dimension of the vector. Then, the current average velocity modulus length of all the bats was calculated, as shown in Equation (20), where \(n\) is the number of bats. The relationship between the average velocity modulus length and number of iterations is shown in Figure 15.  
\[\|v\|=\sqrt{\sum_{i=1}^{D}{v_{i}}^{2}} \tag{19}\]  
\[\overline{\|v\|}=\frac{1}{n}\sum_{j=1}^{n}{\|v\|}_{j} \tag{20}\]  
By analyzing Figure 12, we found that the value of the evaluation function dropped significantly. When the number of iterations was 1650, the evaluation function tended to converge, indicating that the BA achieved the expected effect of optimization. In Figures 13 and 14, we can find that the impulse loudness \(A_{i}\) decreased during the iteration and reached the minimum at about 1100 iterations. The impulse emission rate \(r_{i}\) increased and reached the maximum at about 18 iterations. Figure 15 shows that the average velocity modulus length of bats increased during the iteration. Combined with Figure 12, it can be concluded that the smaller the evaluation function, the better the position of the bat, and the closer the bat is to the position of the prey, the greater the bat's velocity modulus. This is consistent with the fact that the closer the hunter is to the prey, the faster the hunter's reaction speed is in nature. Figure 16 shows the test error result of the actual remaining capacity of the battery. The estimated error of the actual remaining capacity estimated by BA-ELM is less than 0.02 Ah, and the maximum error is less than 1%.  
\begin{table}
\begin{tabular}{l} \hline \hline
**The Pseudo Code of BA-ELM** \\ \hline Step 1: Data acquisition and data processing. \\ Step 2: Generate the training set and the test set. \\ Step 3: Initialize the parameters of BA, including the population size \(n\), initial impulse loudness \(A_{0}\), initial impulse emission rate \(r_{0}\), maximum frequency \(Q_{\max}\), minimum frequency \(Q_{\min}\), the max number of iterations \(N\), and fitness evaluation function _Fitness_ (\(x\)). \\ Step 4: While (\(t\) \(<\) the max number of iterations) \\ Calculate the frequency \(Q_{i}\), location \(S_{i}\), speed \(V_{i}\), fitness value _Fitness\({}_{i}\)_ of each bat. \\ Step 5: If (\(rand>r_{i}\)) \\
1. Obtain an optimal solution _BestS_ in this iteration. \\
2. Calculate the local solutions around the optimal solution. \\ Step 6: End if \\ Produce new solutions by change randomly \\ Step 7: If (\(rand<A_{i}\) and \(Fitness\) (\(x_{i}\)) \(<\)\(Fitness\) (\(x_{s}\))). \\
1. Accept the new solutions. \\
2. Decrease the impulse loudness \(A_{i}\) and increase the impulse emission rate \(r_{i}\). \\ Step 8: End if \\ Sort all bats and obtain the optimal solution _BestS_ in this iteration. \\ Step 9: End while and accept the optimal output connection weight \(\beta\). \\ Step 10: Determine the input connection weight \(\omega\) and the bias \(b\). Obtain the network structure of BA-ELM \\ Step 11: Estimate the actual battery capacity using the BA-ELM model. \\ \hline \hline \end{tabular}
\end{table}
Table 5: The pseudo code of the proposed model.  
Figure 12: Evaluation function.  
Figure 13: Impulse loudness.  
Figure 14: Impulse emission rate.  
Figure 15: Average velocity modulus length.