# Optimization of Ship Permanent Magnet Synchronous Motor ADRC Based on Improved QPSO
## 4 Parameter Tuning of ADRC Using the QPSO Algorithm
### Simulation Experiments  
In this section, to evaluate the performance of the QPSO algorithm, four benchmark functions, Ackley, Rastrigin, Rosenbrock, and Griewank, are used to run 200 iterations of testing on the PSO, QPSO, AGA, and DBO algorithms. A comparative analysis of the performance of these four algorithms is then conducted. Specifically, the AGA algorithm denotes the Adaptive Genetic Algorithm, and the DBO algorithm refers to the Dung Beetle Optimizer. Ackley function:  
\[f(x)=-a\cdot exp\left(-b\cdot\sqrt{\frac{1}{n}{\sum_{i=1}^{n}x_{i}^{2}}} \right)-exp\left(\frac{1}{n}{\sum_{i=1}^{n}cos(c\cdot x)}\right)+a+e, \tag{28}\]  
The Ackley function is a multimodal nonlinear function with numerous local minima and a single global minimum. It is widely used to test and compare optimization algorithms, particularly for global optimization problems. The test results are shown in Figure 7.  
Rastrigin function:  
\[f_{2}(x)=\sum_{i=1}^{n}\left[x_{i}^{2}-10 cos(2\pi x_{i})+10\right], \tag{29}\]  
The Rastrigin function features an irregular peak structure within the search space, making it easy for particles to become trapped in local optima during the algorithm's iterative optimization process. By offering a complex landscape with many local minima, it effectively evaluates the performance of optimization algorithms in solving complex problems. The test results are shown in Figure 8.  
Figure 7: Ackley Function. Rosenbrock function:  
\[f(x)=\sum_{i=1}^{n-1}\left[100\cdot\left(x_{i+1}-x_{i}^{2}\right)^{2}+\left(1-x_{ i}\right)^{2}\right], \tag{30}\]  
The Rosenbrock function is a well-known benchmark function characterized by a broad flat region and a narrow, curved valley. It is commonly used to assess whether optimization algorithms can efficiently locate local optima. The test results are shown in Figure 9.  
Griewank function:  
\[f(x)=1+\frac{1}{4000}\sum_{i=1}^{n}x_{i}^{2}-\prod_{i=1}^{n}cos\left(\frac{x_ {i}}{\sqrt{i}}\right), \tag{31}\]  
Figure 8: Rastrigin function. Figure 9: Rosenbrock function. The Griewank function is a multimodal optimization function that, as the dimensionality increases, exhibits periodic fluctuations in its landscape. It is commonly used to assess the performance of optimization algorithms, particularly for global optimization problems. The test results are shown in Figure 7.0  
A statistical comparison of the computation time, the number of iterations to convergence, and the converged fitness value for the four test functions using the PSO, improved QPSO, AGA, and DBO algorithms is provided. The results are shown in Table 2 below. From the data in the table, it is evident that QPSO demonstrates superior performance on all four standard test functions (Ackley, Rastrigin, Rosenbrock, and Griewank). In particular, QPSO typically converges faster to the optimal or near-optimal solutions compared to other optimization algorithms (such as PSO, AGA, and DBO), especially in terms of \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Test Function** & \begin{tabular}{c} **Optimization** \\ **Algorithm** \\ \end{tabular} & \begin{tabular}{c} **Computation** \\ **Time** \\ \end{tabular} & \
\begin{tabular}{c} **Number of** \\ **Iterations** \\ \end{tabular} &
\begin{tabular}{c} **Fitness Value** \\ \end{tabular} \\ \hline \multirow{4}{*}{Ackley} & PSO & 0.13749 & 183 & 3.3239 \\  & QPSO & 0.01723 & 72 & 0.3846 \\  & AGA & 0.03782 & 138 & 2.2217 \\  & DBO & 0.01837 & 200 & 1.0091 \\  & PSO & 0.01382 & 143 & 123.98 \\ \multirow{4}{*}{Rastrigin} & QPSO & 0.00204 & 182 & 20.178 \\  & AGA & 0.00711 & 178 & 21.258 \\  & DBO & 0.00488 & 197 & 51.336 \\ \multirow{4}{*}{Rosenbrock} & PSO & 0.03451 & 156 & 2734.8 \\  & QPSO & 0.01288 & 4 & 9.836 \\ \multirow{4}{*}{Rosenbrock} & AGA & 0.01476 & 120 & 109.46 \\  & DBO & 0.01396 & 183 & 132.47 \\ \multirow{4}{*}{Griewank} & PSO & 0.02498 & 190 & 0.567 \\  & QPSO & 0.00402 & 103 & 0.002 \\ \cline{1-1}  & AGA & 0.00675 & 181 & 0.0271 \\ \cline{1-1}  & DBO & 0.00377 & 198 & 0.0319 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Test results.