## 3 Prediction of 3D Ship Airwake Using a BP Neural Network  
### Training of the BP Neural Network  
A BP neural network is a type of multilayer feedforward neural network with strong nonlinear mapping capabilities. The typical structure of a BP neural network consists of an input layer, one (or more) hidden layer, and an output layer, as shown in Figure 9.  
In this structure,  
* \(X_{i}\) represents the \(i\)-th (\(i=1,2,\ldots,\) P) independent variable in the input vector (\(X_{1}\), \(X_{2}\), \(\ldots\), \(X_{P}\));
* \(\mathrm{H}_{j}\) denotes the output of the \(j\)-th (\(j=1,2,\ldots,\) L) neuron in the hidden layer;
* \(\hat{Y}_{k}\) represents the network output of the \(k\)-th (\(k=1,2,\ldots,\) M) neuron in the output layer;
* \(\mathrm{Y}_{k}\) is the desired output of the \(k\)-th neuron in the output layer (i.e., the \(k\)-th value in the dependent variable vector (\(\mathrm{Y}_{1}\), \(\mathrm{Y}_{2}\), \(\ldots\), \(\mathrm{Y}_{M}\)) from the sample dataset);
* \(\mathrm{w}_{\bar{y}}\) is the connection weight between the \(i\)-th input variable and the \(j\)-th neuron in the hidden layer;
* \(\mathrm{v}_{jk}\) is the connection weight between the \(j\)-th neuron in the hidden layer and the \(k\)-th neuron in the output layer;
* \(\mathrm{a}_{j}\) is the threshold of the \(j\)-th neuron in the hidden layer;
* \(\mathrm{b}_{k}\) is the threshold of the \(k\)-th neuron in the output layer.  
This study establishes BP prediction models for the 3D ship airwake (headwind, crosswind, and vertical wind) along the glide path. The independent variables are the inflow speed and direction measured at the bow direction, while the dependent variables are the wind speeds at various distances along the ideal glide path.  
Since there is no theoretical guidance for the selection of hidden layer numbers and their node numbers, we take the consistency between the BP predictions and the CFD sample results as the evaluation criterion. We have tried to select different numbers of layers or nodes and determined the optimal number of nodes in the hidden layers that yields the best prediction accuracy. This specific BP neural network, as shown in Figure 10, is configured with two nodes in the input layer (\(X_{1}\) and \(X_{2}\) represent the inflow speed and angle values from the bow direction), two hidden layers with 10 and 12 nodes, and 170 nodes in the output layer (\(\hat{\mathrm{Y}}_{1}\), \(\hat{\mathrm{Y}}_{2}\), \(\cdots\), \(\hat{\mathrm{Y}}_{170}\) represent wind speed values at 3 m intervals along the ideal glide path up to 500 m behind the touchdown point). The activation function for the hidden layer neurons is \(f_{j}(x)=\frac{1}{1+e^{-x}}\) and \(f_{k}(x)=x\) for the output layer neurons. The learning rate \(\eta\) is set to 0.005, with a computational precision \(\varepsilon_{0}\leq 1\times 10^{-15}\) and a maximum number of learning iterations \(N_{0}\leq 7000\).  
Figure 9: Typical topology of a three-layer BP neural network.  
The training sample data are derived from the steady RANS computations. These simulations provide a series of 3D wind speed values along the ideal glide path under various inflow conditions (the number of speed values is consistent with the 170 output nodes of the BP neural network). A total of 120 training samples, as summarized in Table 1, are selected from different inflow conditions. These samples are used to train and optimize the BP prediction models for headwind, crosswind, and vertical wind along the ideal glide path.