# Evolutionary Algorithm to Optimize Process Parameters of AI/Steel Magnetic Pulse Welding
## 2 Materials and Methods
### Results and Discussion
#### 2.3.2 Optimization of Process Parameters
The initial population represents the possible solutions to the optimization problem, and each possible solution is referred to as an individual [23]. A possible solution was formed by the values of the peak current (kA), the gap between workpieces (mm), and the frequency (kHz). The search for the optimum was based on the maximization of the load and weld length, which define the objective function. Table 10 presents the GA parameters that yield the best results: a mutation rate of 0.008, a population size of 100, and a maximum number of generations of 100. Figures 10 and 11 depict the results achieved using the optimal process parameters obtained through GA. These parameters were determined in just 45 generations for the Al/Steel MPW joint. The maximum load and weld length, defining the objective function, were found to be 1.99929 kN and 0.78551 mm, respectively. (3)  
A systematic analysis was carried out to evaluate the effectiveness of the proposed algorithms. Both the ICA and GA algorithms were implemented in MATLAB and executed on an INTEL Core-i5 2500M laptop CPU. Table 11 presents a comparison of the optimization results obtained by ICA and GA. It is apparent that ICA slightly outperforms GA in terms of both accuracy and computational time. \begin{table}
\begin{tabular}{c c} \hline \hline
**GA Parameters** & **Al/Steel MPW** \\ \hline Population size & 100 \\ Number of generations allowed & 100 \\ Mutation rate & 100 \\ Crossover rate & 0.5 \\ Type of crossover & 0.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: GA parameters. Figure 9: The convergence of the weld length objective function is determined by the ICA. The optimized process parameters were 484 kA, 0.73 mm, and 21 kHz for peak current, gap between workpieces, and frequency for achieving maximum weld length. Verification of the selected optimal process parameters was performed. The experiment used the optimized process parameters from Table 11 for the joining conditions. After welding, joint qualities were tested according to the maximum values of load and weld length. Figure 12 \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Method**} & \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Peak Current** **(kA)**} & **Gap between Workpieces** & **Frequency** **(kHz)** & **Cost** & **CPU Time** **(s)** \\ \hline \multirow{4}{*}{ICA} & Maximum load & 484 & 0.77498 & 21 & 2.00012 & 2.9 \\  & (kN) & Weld length & 483.9 & 0.73533 & 21 & 0.78892 & 3 \\  & (mm) & 483.9 & 0.77485 & 20.9 & 1.99929 & 8 \\ \hline \multirow{4}{*}{GA} & Maximum load & 483.9 & 0.73529 & 20.9 & 0.78551 & 9.4 \\  & (mm) & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Comparison between ICA and GA results. Figure 10: The convergence of the maximum load objective function is determined by GA.  
Figure 11: The convergence of the weld length objective function is determined by GA.  
shows the results of the verification test. The joint at the Al tube was broken, indicating that the strength of the weld joints is greater than the strength of the weaker parent materials, as illustrated in Figure 12a. The maximum load was measured at 2.139 kN. The weld length was measured at 0.8 mm on the joint, as shown in Figure 12b.