# A Hybrid Adaptive Particle Swarm Optimization Algorithm for Enhanced Performance
## 5 Engineering Application
### Reducer Optimization  
The optimization problem of the speed reducer aims to minimize the weight of the reducer taking into account the bending stresses of the gears, the lateral deflection of the shafts, the surface pressure of the speed reducer, and the stresses on the shafts. As shown in Figure 10, the speed reducer consists of seven main constraint variables: the width of the speed reducer \(b\), the modulus of the teeth \(m\), the number of teeth of the pinion \(z\), the length of the first shaft between the bearings \(l_{1}\), the length of the second shaft between the bearings \(l_{2}\), the diameter of the first shaft \(d_{1}\), and the diameter of the second shaft \(d_{2}\). By \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithm** & \(\mathbf{X_{1}}\) & \(\mathbf{X_{2}}\) & \(\mathbf{X_{3}}\) & **Optimal Value** \\ \hline APSO & 0.05127 & 0.34634 & 12.0000 & **0.01275** \\ GWO & 0.05907 & 0.56125 & 5.01580 & 0.01374 \\ WOA & 0.06582 & 0.80024 & 2.74423 & 0.01645 \\ SSA & 0.05441 & 0.42537 & 8.19871 & 0.01284 \\ BOA & 0.05496 & 0.42082 & 9.32809 & 0.01440 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Optimal solution of the algorithm in the design of tension and compression springs. Figure 9: Schematic diagram of tension spring. solving the \(l_{1}\) constraints of the speed reducer, the values of the relevant variables and the weight of the speed reducer can be obtained. The mathematical model of the design is as follows:  
* Design variable: \(x=[x_{1},x_{2},x_{3},x_{4},x_{5},x_{6},x_{7}]=[b,m,z,l_{1},l_{2},d_{1},d_{2}]\);
* Objective function: \(f(x)=0.7894x_{2}^{2}x_{1}(14.9334x_{3}-43.0934+3.33333x_{3}^{2}+0.7854(x_{5}x_{ 7}^{2}+x_{4}x_{6}^{2})-1.508x_{1}(x_{7}^{2}+x_{6}^{2})+7.477(x_{7}^{3}+x_{6}^{3})\);
* Constraint condition: \(g_{1}(x)=-x_{1}x_{2}^{2}x_{3}+27\leq 0\), \(g_{2}(x)=-x_{1}x_{2}^{2}x_{3}+397.5\leq 0,g_{3}(x)=1-\frac{140.45x_{1}}{x_{2}^{2 }x_{3}}\leq 0\), \(g_{4}(x)=-x_{2}x_{2}^{4}x_{3}x_{5}^{-3}+1.93\leq 0\), \(g_{5}(x)=10x_{6}^{-3}\sqrt{16.91\times 10^{6}+(745x_{4}x_{2}^{-1}x_{3}^{-1})^{2}}- 1100\leq 0\), \(g_{6}(x)=10x_{7}^{-3}\sqrt{157.5\times 10^{6}+(745x_{4}x_{2}^{-1}x_{3}^{-1})^{2}}- 850\leq 0\), \(g_{7}(x)=x_{2}x_{3}-40\leq 0\), \(g_{8}(x)=-x_{1}x_{2}^{-1}+5\leq 0\), \(g_{9}(x)=x_{1}x_{2}^{-1}-12\leq 0\), \(g_{10}(x)=1.5x_{6}-x_{4}+1.9\leq 0\), \(g_{11}(x)=1.1x_{7}-x_{5}+1.9\leq 0\). * Variable range: \(2.6\leq x_{1}\leq 3.6\), \(0.7\leq x_{2}\leq 0.8\), \(17\leq x_{3}\leq 28\), \(7.3\leq x_{4}\), \(x_{5}\leq 8.3\), \(2.9\leq x_{6}\leq 3.9\), \(5\leq x_{7}\leq 5.5\). In the speed reducer design, in order to improve the values of the seven core parameters and thus optimize the weight of the reducer, the range of values of the optimization problem can be transformed into the boundaries of the particle swarm optimization, where the upper boundary is \(ub=[3.6,0.8,28,8.3,8.3,3.9,5.5]\) and the lower boundary is \(lb=[2.6,0.7,17,7.3,7.3,2.9,5]\). Since there may be cases where the solution of the problem does not satisfy the constraints, it is necessary to devise a large penalty term for the fitness function, to ensure that the particles satisfy all the conditions during optimization search. The fitness function and penalty function are \(fit=f(x)+g_{p}\) and \(g_{p}=factor\times\sum_{i=1}^{i=11}(\max{(0,g_{i}(x))})^{2}\), respectively. Figure 10: Schematic diagram of the reducer. In order to verify the efficiency of our algorithm, the improved algorithm is compared with other metaheuristic algorithms such as GWO, WOA, SSA and BOA. Each algorithm was run 30 times independently, and the average of the minimum values of the results of each run was taken as the optimal value. The experimental results are shown in Table 9.  
According to the data comparison results in Table 9, it can be seen that in the reducer optimization problem, the optimal solution obtained by the improved APSO algorithm is superior to other metaheuristic algorithms.