# Optimization of the Battery Pack Heat Dissipation Structure of a Battery-Type Loader
## 5 Combined Parameter Optimization
### Particle Swarm Algorithm Global Optimization Search  
The particle swarm algorithm is an optimization algorithm that simulates the migration process of a group of birds when foraging, which has the advantages of simplicity, fast convergence, and few setup parameters compared to optimization algorithms such as genetic algorithms and simulated annealing algorithms. As such, it was found to be very suitable for solving the structural parameter optimization problem considered in this study. In the particle swarm algorithm, each solution to the problem of finding the best parameter combination is imagined as a bird, called a \"particle\", and all particles search within a D-dimensional space [29], as shown in Figure 21.  
This group of random particles (random solutions) finds the optimal solution through iteration. In each iteration, the position and velocity of the particles are updated, where the velocity update formula is [29]:  
\[v_{id}^{k}=wv_{id}^{k-1}+c_{1}r_{1}\left(pbest_{id}-x_{id}^{k-1}\right)+c_{2}r_ {2}\left(gbest_{id}-x_{id}^{k-1}\right). \tag{5}\]  
The position update formula is:  
\[x_{id}^{k}=x_{id}^{k-1}+v_{id}^{k-1}\text{m}, \tag{6}\]  
where \(v_{id}^{k}\) is the \(d\)th component of the flight velocity vector of particle \(i\) in the \(k\)th iteration, \(x_{id}^{k}\) is the \(d\)th component of the position vector of particle \(i\) in the \(k\)th iteration, \(c_{1},c_{2}\) are acceleration constants to adjust the maximum learning step, \(r_{1},r_{2}\) are two random functions taking values in the range [0, 1] to increase the randomness of the search, and \(w\) is the inertia weight (non-negative), which regulates the search range within the solution space.  
The basic workflow of the particle swarm algorithm is as follows: first, to initialize the particle swarm and the external reserve set, particle positions are randomly generated in the given variable space, the particle velocity is initialized, the particle adaptation value is evaluated, and non-inferior solutions are saved to the external reserve set. Then, we  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{3}{*}{**No.**} & \multicolumn{3}{c}{**Max. Temperature**} & \multicolumn{3}{c}{**Average Temperature**} & \multicolumn{3}{c}{**Temperature Difference**} \\ \cline{2-10}  & **Simulation** & **RBF** & **Simulation** & **RBF** & **Simulation** & **RBF** & **Simulation** & **RBF** & **Predicted** & **Error (\%)** \\  & **Calculated** & **Predicted** & **Error (\%)** & **Calculated** & **Predicted** & **Error (\%)** & **Calculated** & **Predicted** & **Error (\%)** \\  & **Value (\({}^{\circ}\)C)** & **Value (\({}^{\circ}\)C)** & **Value (\({}^{\circ}\)C)** & **Value (\({}^{\circ}\)C)** & & **Value (\({}^{\circ}\)C)** & **Value (\({}^{\circ}\)C)** & \\ \hline
1 & 59.0 & 60.93 & 3.2 & 48.2 & 46.7 & 3.1 & 24.0 & 25.3 & 5.4 \\
2 & 59.6 & 88.10 & 2.5 & 48.0 & 47.1 & 1.8 & 25.5 & 25.8 & 1.2 \\
3 & 59.7 & 60.49 & 1.3 & 47.8 & 46.5 & 2.7 & 24.3 & 25.4 & 4.5 \\
4 & 59.4 & 60.31 & 1.5 & 47.7 & 48.8 & 2.3 & 24.8 & 23.9 & 3.6 \\
5 & 59.3 & 60.61 & 2.2 & 48.1 & 49.0 & 1.9 & 23.9 & 24.6 & 2.9 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Comparison and error analysis between predicted and calculated values.  
Figure 21: Schematic diagram of particle swarm optimization.  
enter the loop phase, in which the adaptation values of the particles in the reserve set are evaluated and the global guide is selected. After that, the velocity and position of particles are updated according to the guide, and the adaptation value of the particles is evaluated. Then, according to the evaluation result, the individual particle guide and the external reserve set are updated. Finally, we determine whether the target or the maximum number of cycles has been reached; if not, the above loop steps are repeated until the loop requirement is satisfied. The algorithm flowchart is briefly shown in Figure 22 below.