## 4 Parameter Optimization  
The optimization is performed to find best combination of the deposition and the milling parameters in order to maximize the performances of HWMP in terms of surface quality, material utilization, and efficiency. The optimization problem can be expressed in the following form:  
Objective function:  
\[\text{min}\ R_{\text{a}}(W_{\text{FR}},T_{S},S_{\text{S}},T_{\text{FR}}),\ \text{min}\ 1/M_{\text{U}}(W_{\text{FR}},T_{\text{S}})\ \text{and}\ \text{min}\ T_{\text{C}}(T_{\text{S}},T_{\text{FR}}) \tag{11}\]  
within the ranges of these process parameters:  
\[3.4\ \text{m}/\text{min}\leq W_{\text{FR}}\leq 5.1\ \text{m}/\text{min}\]  
Figure 6: (**a**) The effects of single process parameter on surface roughness; (**b**) the effects of single process parameter on material utilization; and (**c**) the effects of single process parameter on construction time. \[0.35\;\mathrm{m/min}\leq T_{\mathrm{S}}\leq 0.6\;\mathrm{m/min}\]  
\[1000\;\mathrm{rpm}\leq S_{\mathrm{S}}\leq 8000\;\mathrm{rpm}\]  
\[1\;\mathrm{mm/s}\leq T_{\mathrm{FR}}\leq 5\;\mathrm{mm/s}\]  
and subjected to the constraint function:  
\[T_{\mathrm{W}}+1\leq 9.73-0.58T_{\mathrm{S}}+1.23W_{\mathrm{FR}}+0.21T_{\mathrm{S}} ^{2}(i.e.,B_{\mathrm{W}}) \tag{12}\]  
The constraint function (Equation (12)) means that the achieved bead width should be at least \(1\;\mathrm{mm}\) larger than the target width to ensure that the \"stair-stepping effect\" can be removed completely. GA is adopted to solve this optimization problem that is based on natural selection and biological evolution [29; 30]. GA has become popular in engineering optimization problems for its wide range of precise search and capability of solving complex non-linear problems. Due to the complexity of the multi-objective optimization problem, the weighted sum method (WSM) is applied first to convert the three objectives (i.e., \(\min R_{\mathrm{a}}\), \(\min 1/M_{\mathrm{U}}\), and \(\min T_{\mathrm{C}}\)) to a single objective (i.e., \(\min\) (\(w_{1}R_{\mathrm{a}}+w_{2}/M_{\mathrm{U}}+w_{3}T_{\mathrm{C}}\))) [31]. \(w_{1}\), \(w_{2}\), and \(w_{3}\) are the weight coefficients and \(w_{1}+w_{2}+w_{3}=1\). These parameters should be normalized before being converted as follows:  
\[R_{\mathrm{a}}^{*} = \frac{R_{\mathrm{a}}-R_{\mathrm{a},\min}}{R_{\mathrm{a},\max}-R_ {\mathrm{a},\min}} \tag{13}\] \[M_{\mathrm{U}}^{*} = \frac{M_{\mathrm{U}}-M_{\mathrm{U},\min}}{M_{\mathrm{U},\max}-M_ {\mathrm{U},\min}}\] (14) \[T_{\mathrm{C}}^{*} = \frac{T_{\mathrm{C}}-T_{\mathrm{C},\min}}{T_{\mathrm{C},\max}-T_ {\mathrm{C},\min}} \tag{15}\]  
Then the resultant objective function is obtained as follows:  
\[ \begin{array}{l}\min\bigl{(}w_{1}R_{\mathrm{a}}^{*}+w_{2}/M_{\mathrm{U}}^{* }+w_{3}T_{\mathrm{C}}^{*}\bigr{)}\\ =\min\bigl{(}w_{1}\frac{R_{\mathrm{a}}-R_{\mathrm{a},\min}}{R_{\mathrm{a},\max }-R_{\mathrm{a},\min}}+w_{2}/\frac{M_{\mathrm{U}}-M_{\mathrm{U},\min}}{M_{ \mathrm{U},\max}-M_{\mathrm{U},\min}}+w_{3}\frac{T_{\mathrm{C}}-T_{\mathrm{C },\min}}{T_{\mathrm{C},\max}-T_{\mathrm{C},\min}}\bigr{)}\end{array}  \tag{16}\]  
where \(w_{1}\) is set to 0.6, \(w_{2}\) is set to 0.2 and \(w_{3}\) is set to 0.2 in this study. By using the MATLAB optimization toolbox, the optimization solutions for different target widths are obtained as given in Table 4. The parameters such as \(L\), \(m_{\mathrm{plate}}/m_{\mathrm{stiffener}}\), etc., are the same as those in Equation (10). From Table 4, we can observe that for any target width, a high travel speed, and a high spindle speed are recommended because the surface roughness is a decreasing function of the two process parameters according to Figure 5(a). Higher travel speed also results in both higher material utilization and efficiency according to Figure 5(b),c. Though a low tool-feed rate is beneficial for achieving a low surface roughness according to Figure 5(a), it also increases the construction time according to Figure 5(c).