## 4 Mechanical Optimization for Fixing a Cubic FP Cavity
### Establishment and Comparison of Data Learning Models  
In order to establish the nonlinear relationship between the design variables and the performance indexes, the neural network (NN) was initially selected as the fitting model. The working mechanism of a single neuron can be described by  
\[h_{\theta}(x)=g(\sum_{i=1}^{n}\omega_{i}x_{i}+b), \tag{15}\]  
where \(x_{i}\) is the input of the neural network, \(b\) is the bias, \(\omega\) represents the corresponding weights, which are the parameters to be learned, and \(g(\cdot)\) is the activation function, with sigmoid and ReLU among the most commonly used [38]. A network of neurons organized hierarchically is called a neural network. To minimize the loss function, the gradient descent method was applied through forward propagation and backpropagation as well as through repeated iterations according to the chain rule. The samples in Table 2 were divided into 90% for training and 10% for testing. The layer size was determined as 40 and Bayesian regulation was adopted as the training algorithm. Figure 12 illustrates the training performance of the neural network model after 1000 epochs. Clearly, the neural network with a very small fitting error (10\({}^{-11}\)) exhibits excellent performance. To further compare the performance level of different fitting models, two surrogate models, i.e., the quadratic response surface model and the Kriging model, were selected and established for comparison [37]. The complete quadratic response surface model (RSF) with ten unknown parameters is defined by  
\[y_{RSF}(x)=a_{0}+\sum_{i=1}^{3}a_{i}x_{i}+\sum_{j=1}^{3}a_{j}x_{j}^{2}+\sum_{i= 1}^{3}\sum_{j=1,j\
eq i}^{3}a_{ij}x_{i}x_{j}=\left[1,x,x^{2},x_{1}x_{2},x_{1}x_ {3},x_{2}x_{3}\right]\cdot C, \tag{16}\]  
where \(y_{RSF}(x)\) is the quadratic response surface function, the regression coefficients \(a_{0}\), \(a_{i}\), \(a_{j}\), and \(a_{ij}\) are the constant term, the primary term, the quadratic term, the cross terms of  
Figure 12: Training results of the neural network. the complete quadratic response surface model, respectively, \(C\) is the coefficient matrix of the quadratic response surface function, and the response surface coefficients can be fitted using the least squares method. The Kriging response function \(y_{KRG}(x)\) is comprised of two parts, namely, a regression model and a Gaussian correlation model:  
\[y_{KRG}(x)=\beta f(x)+z(x) \tag{17}\]  
where \(f(x)\) is the global basis function, \(\beta\) is the regression coefficient, and \(z(x)\) is the Gaussian correlation function, for which the mathematical expectation and covariance are provided by  
\[ \begin{split}& E(z(x))=0\\ & Cov(z(x_{i}),z(x_{j}))=\sigma^{2}R(\theta,x_{i},x_{j})\\ & R(\theta,x_{i},x_{j})=\prod_{d=1}^{q}\exp(-\theta^{d}\Big{|}x_ {i}^{d}-x_{j}^{d}\Big{|}^{p^{d}}),\end{split}  \tag{18}\]  
where \(\sigma^{2}\) is the variance, \(\theta\) is the unknown parameter of association, and \(R(\theta,x_{i},x_{j})\) is the correlation function of points \(x_{i}\) and \(x_{j}\). For some point \(x\), the predictive value calculated by the Kriging model is  
\[\hat{\hat{y}}(x)=\hat{\beta}f(x)+r^{T}(x)R^{-1}(Y-\hat{\beta}F), \tag{19}\]  
where \(r^{T}(x)\) is the covariance matrix between the unknown and known point, \(Y\) is the target value matrix of the sample point, and \(F\) represents the basis function matrix of the known points. A test set of five points was used for model validation; the comparison results between the NN and surrogate models are shown in Figure 13. While the three models performed quite well overall, the prediction accuracy of all three models decreases for the volume, displacement under fixing force, and displacement under vibration test. This is likely because the volume variation along the design parameters is the most linear among the three indexes, followed by \(w_{F}\) and lastly \(w_{vib}\). As the variation of the index becomes more nonlinear, prediction using the models becomes increasingly challenging.