## 2 Aircraft Engine and Its Prediction Model
### A Prediction Model of an Aircraft Engine
#### 2.2.3 The Aircraft Engine Prediction Model Based on GWO-EBPNN  
In this paper, the nonlinear model of aircraft engine from the main fuel flow \(w_{f}\) to low-pressure spool speed \(n_{l}\) is considered, which can be described in the form of the following discrete difference equation:  
\[n_{l}(k)=f\Big{[}n_{l}(k-1),n_{l}(k-2),w_{f}(k),w_{f}(k-1)\Big{]}. \tag{13}\]  
The corresponding neural network model can be expressed in the following form:  
\[\hat{n}_{l}(k)=f_{NN}\Big{[}n_{l}(k-1),n_  
setting. In this paper, [PERSON]'s theorem is used to obtain 9 as the number of hidden layer nodes in the elastic BP neural network.  
The randomization of initial weights and thresholds is an important factor affecting the training accuracy of the elastic BP neural network algorithm, which easily leads to training results that fall into the local convergence region, making the prediction accuracy of the neural network too low to meet the modeling requirements.  
Therefore, in view of the deficiency of the traditional initial value selection, this paper introduces the GWO algorithm in the elastic BP neural network to optimize the initial value selection. The basic idea is to use the GWO algorithm to globally pre-optimize the initial value of the network and then use the optimal solution obtained by the algorithm as the initial weight and threshold of each node of the elastic BP neural network for subsequent training operations.  
According to the above elaboration, there are 4 nodes in the input layer, 9 nodes in the hidden layer, and 1 node in the output layer. Therefore, it is known that the whole network includes two threshold matrices, \(b^{1}=[b^{1}{}_{i}]_{9\times 1}\) and \(b^{2}=[b^{2}{}_{i}]_{1\times 1}\), and two weight matrices, \(w^{1}=[w^{1}{}_{i\times j}]_{4\times 9}\) and \(w^{2}=[w^{2}{}_{j\times 1}]_{9\times 1}\). Before using the GWO algorithm to optimize the initial weights and thresholds, each matrix is sorted to a certain extent and the elements in each matrix are combined into a vector. During optimization, the vector is set as the position vector of the individual population in the GWO algorithm, and the reciprocal of the criterion function of the elastic BP neural network (the mean square error between the expected output and the network output) is taken as the fitness function of the algorithm. After optimization iteration, the obtained optimal solution is applied to the elastic BP neural network initialization. On this basis, network training can be carried out.  
The corresponding network initial value optimization process is as follows:  
Step 1: Create an elastic BP neural network according to the selected samples and the network structure determined previously.  
Step 2: Set the initial value vector of the weights and thresholds of each layer of the elastic BP neural network as the individual position of the population, and use the designed fitness function to calculate the fitness value of each individual. After sorting, carry out global optimization according to the optimization procedure in Section 2.2.2. When the fitness value reaches the condition or the iteration number reaches the maximum value, complete the optimization and save the position of the optimal individual as the optimal initial weight and threshold of the network to be trained.  
Step 3: Input the optimal initial value obtained in Step 2 into the network, start training the elastic BP network, and when the optimal conditions and iteration times are met, complete training to obtain the neural network training parameter value.  
Step 4: Select sample data to test the trained elastic BP network and verify the network performance.  
One can see from Figure 2 clearly that GWO is used to improve the selection of initial parameters in the elastic BP neural network.  
The aircraft engine prediction model can now be obtained by the recursive prediction method based on GWO-EBPNN.  
The main recurrence process is as follows:  
At the \(k\) sampling instant, if the actual output value of the engine is known as \(n_{l}(k)\), the predicted output value \(\hat{n}_{l}(k)\) can be described by  
\[\hat{n}_{l}(k)=f_{NN}\Big{[}n_{l}(k-1),n_{l}(k-2),w_{f}(k),w_{f}(k-1)\Big{]}. \tag{15}\]  
The predicted output value \(\hat{n}_{l}(k+1)\) at the \(k+1\) sampling instant will be  
\[\hat{n}_{l}(k+1)=f_{NN}\Big{[}\hat{n}_{l}(k),n_{l}(k+1),w_{f}(k+1),w_{f}(k) \Big{]}. \tag{16}\]The predicted output value \(\hat{n}_{l}(k+i)\) at the \(k+i\) sampling instant will be  
\[\hat{n}_{l}(k+i)=f_{NN}\Big{[}\hat{n}_{l}(k+i-1),\hat{n}_{l}(k+i-2),w_{f}(k+i),w _{f}(k+i-1)\Big{]} \tag{17}\]  
where \(i=1,2,\ldots,P\), and \(P\) is the prediction horizon.