# Parameter Identification of Lithium Battery Model Based on Chaotic Quantum Sparrow Search Algorithm
## 4 Improvements on the Sparrow Search Algorithm
### Simulation and Verification  
Six benchmark test functions including unimodal and multimodal functions are used to verify the effectiveness of CQSSA by comparing with PSO, GA, GWO, DOA and SSA. This study uses an Intel(r)Core(tm)i5 processor and MATLAB 2018a for algorithm verification on Windows 10. The selected test functions are shown in Table 1.  
F1 and F3 are unimodal functions which can reflect the convergence and exploration abilities of the algorithm. F2, F4, F5 and F6 are multimodal functions which have multiple \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Name** & **Function** & **Dim** & **Initial Range** & \(\mathbf{F_{min}}\) \\ \hline \multirow{2}{*}{
\begin{tabular}{c} Quaritic \\ Schwefle l2.26 \\ Rosenbrock \\ Griwank \\ \end{tabular} } & F1 = \(\sum\limits_{i=1}^{x_{i}}x_{i}^{2}+random(0,1)\) & 30 & [\(-1.28,1.28\)] & 0 \\  & F2 = \(\sum\limits_{i=1}^{x_{i}}-x_{i}\sin(\sqrt{|x_{i}|})\) & 30 & [\(-500,500\)] & \(-418.9829\times\text{dim}\) \\  & F3 = \(\sum\limits_{i=1}^{x_{i}-1}[100(x_{i+1}-x_{i}^{2})^{2}+(x_{i}-1)^{2}]\) & 30 & [\(-30,30\)] & 0 \\  & F4 = \(\frac{1}{200}\sum\limits_{i=1}^{x}x_{i}^{2}-\sum\limits_{i=1}^{x_{i}}\cos( \frac{x_{i}}{\sqrt{i}})+1\) & 30 & [\(-600,600\)] & 0 \\  & F5 = \(-20\exp(-0.2\sqrt{\frac{1}{\tilde{n}}\sum\limits_{i=1}^{x}x_{i}^{2}})-\exp \left(\frac{1}{\tilde{n}}\sum\limits_{i=1}^{x}\cos(2\pi x_{i})\right)\) & 30 & [\(-32,32\)] & 0 \\  & F6 = \(\frac{1}{20}\sin(\pi y_{1})+\sum\limits_{i=1}^{x_{i}-1}(y_{i}-1)^{2}[1+10\sin^ {2}(\pi y_{i}+1)]+(y_{n}-1)^{2}\) & & & \\  & F6 = \(\frac{1}{2}\sum\limits_{i=1}^{x_{i}}(x_{i},10,100,4)\) & 30 & [\(-50,50\)] & 0 \\  & \(u(x_{i},a,k,m)=\begin{cases}y_{i}=1+\frac{x_{i}+1}{x_{i}}&\\ k(x_{i}-a)^{\frac{1}{2}}&x_{i}>a\\ 0&-a<x_{i}<a\\ k(-x_{i}-a)^{\frac{1}{2}}&x_{i}<-a\end{cases}\) & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Test Function (Dim = 30). Figure 2: The algorithmic flow of the CQSSA algorithm. local extreme points which can reflect the local search and global search capabilities of the algorithm. To ensure the verification accuracy, six algorithms are implemented independently 30 times on each function. The population size is 100. For the PSO algorithm, the learning factors and the inertia coefficient are set as \(c_{1}=c_{2}=1.49618\) and \(w=0.7298\). For the GA algorithm, the genes are encoded in binary and the roulette method is used to select the genes that enter the next generation. The solution of each dimension is represented by 6 genes, the chromosome length is 6 \(\times\) Dim, and the mutation and crossover probabilities are set to 0.05 and 0.5, respectively. For GWO, the weight of the location distance of the wolf pack decreases linearly and \(r_{1}\) and \(r_{2}\) are random vectors within \([0,1]\). For DOA, \(\beta_{1}\) is a scaling factor that can change the trajectory of the dingoes and it is a random number uniformly distributed over \([-2,2]\); \(\beta_{2}\) is a random number uniformly generated in the interval \([-1,1]\). For SSA, the proportions of producers and guards are both 20%. For CQSSA, the maximum and minimum quantum contraction expansion coefficients are 1.0 and 0.5, respectively. The performance of the six different algorithms under each test function is shown in Table 2.  
For the unimodal function F1, PSO performs worst on this high-dimensional problem, whereas CQSSA has significantly better accuracy and stability than the other five algorithms. For function F2, GA has the best optimization result, followed by CQSSA, and they both significantly outperform the other algorithms. For function F3, CQSSA has the best optimization result. Furthermore, it can be clearly seen that the optimization result of CQSSA is significantly superior to the other algorithms for the multimodal functions F4-F6. It indicates that the proposed CQSSA algorithm performs better in convergence and stability probably due to the good capability of escaping from the local extreme.