# A Hybrid Adaptive Particle Swarm Optimization Algorithm for Enhanced Performance
## 5 Engineering Application
### Pressure Vessel Design  
In the pressure vessel design problem, the main objective is to minimize the total cost of making the pressure vessel, such as materials and welding, while ensuring the normal operation of the vessel. The head of the pressure vessel is hemispherical, and the two ends of the vessel are covered. The problem mainly involves four key optimization variables: the thickness of the container \(T_{s}\), the thickness of the container head \(T_{h}\), the internal radius of the container \(R\), and the length of the cylindrical section \(L\) without considering the head. A schematic diagram of the pressure vessel is shown in Figure 8.  
Figure 7: Convergence curves of the seven testing algorithms for dimensions of 800.  
The mathematical model of the pressure vessel design is as follows:  
* Design variable: \(x=[x_{1},x_{2},x_{3},x_{4}]=[T_{s},T_{h},R,L]\);
* Objective function: \(f(x)=0.6624x_{1}x_{3}x_{4}+1.7781x_{2}x_{3}^{2}+3.1661x_{1}^{2}+19.84x_{1}^{2}x _{3}\);
* Constraint condition: \(g_{1}(x)=-x_{1}+0.0193x_{3}\leq 0\), \(g_{2}(x)=-x_{2}+0.00954\leq 0\), \(g_{3}(x)=-\pi x_{3}^{2}x_{4}-\frac{4}{3}\pi x_{3}^{3}+1296000\leq 0\), \(g_{4}(x)=x_{4}-240\leq 0\).
* Variable range: \(0\leq x_{1}\leq 99\), \(0\leq x_{2}\leq 99\), \(10\leq x_{3}\leq 99\), \(10\leq x_{4}\leq 99\).  
The fitness function consists of the objective function \(f(x)\) and the penalty function \(gp\), which can be expressed as \(fit(x)=f(x)+gp\). It is an important basis for evaluating the feasibility of the problem solution. When a solution does not satisfy the constraints, we will design a penalty \(gp=factor\times\sum_{i=1}^{i=4}(\max(x,g_{i}(x)))^{2}\) and add it into the fitness value. By increasing this penalty number, the model can be forced to always search for the optimal solution in the feasible region during the process of iterative calculation. In this way, the constraints in the problem can be transformed into penalty terms in the fitness function, so as to ensure that the problem design not only satisfies all the constraints but also minimizes the cost. The objective function is responsible for evaluating and calculating the cost of the problem.  
To solve the optimal solution of this constrained optimization problem, we compare the improved adaptive particle swarm optimization algorithm (APSO) with the algorithms GWO, WOA, SSA, and BOA. To ensure the reliability of the experimental results, the same test function was used to evaluate all the algorithms. In order to eliminate the performance fluctuation of the algorithm, each algorithm was run 30 times independently, and the average value of the optimal solution of each algorithm was taken as the performance evaluation index. Table 7 shows the detailed comparative experimental results.  
According to the optimal cost results in Table 7, in the pressure vessel design optimization problem, the improved APSO algorithm obtains the best solution for each design variable, which significantly reduces the total material cost. The actual cost was reduced from 7167 to 6352, resulting in savings of approximately 815. The experimental results show that the algorithm APSO is feasible and effective in such practical engineering applications. In addition, the algorithm APSO shows superior performance in optimizing the design parameters of pressure vessels compared with similar algorithms.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Algorithm** & \(T_{s}\) & \(T_{h}\) & \(R\) & \(L\) & **Optimal Value** \\ \hline APSO & 0.85557 & 0.4256 & 44.24708 & 163.38307 & **6352.40957** \\ GWO & 1.2161 & 0.6034 & 62.79492 & 20.94734 & 7166.85064 \\ WOA & 1.22113 & 0.6099 & 62.70057 & 22.12873 & 7277.40309 \\ SSA & 1.06355 & 0.52691 & 54.97014 & 63.29055 & 6594.33153 \\ BOA & 2.88847 & 4.38213 & 60.86174 & 35.62021 & 43,775.09400 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Optimal solution of each algorithm in pressure vessel design.  
Figure 8: Structure diagram of pressure vessel.