# Research on Fault Diagnosis Algorithm of Ship Electric Propulsion Motor
## 3 The Proposed Method  
### Model Optimization of Variational Mode Decomposition  
The decomposition order of VMD is determined by the \(K\) value. A too-large \(K\) value will cause signal decomposition fault, while a too-small \(K\) value will lead to incomplete signal decomposition or signal frequency aliasing. The punishment factor \(\alpha\) is a key parameter for converting the confined variational problem into an unconfined problem, and it mainly affects the bandwidth of the IMF component obtained by VMD decomposition and the convergence rate of the algorithm. The punishment factor is inversely proportional to the bandwidth of the IMF component. This paper uses the GWO algorithm to optimize \(K\) and \(\alpha\). The GWO algorithm is advanced by observing the grey wolf population's preying strategy in nature. In the grey wolf group, the grey wolf is classified into four classes from high to low according to the fitness value, which are \(\alpha\) wolf, \(\beta\) wolf, \(\delta\) wolf, and \(\omega\) wolf. Among them, the \(\alpha\) wolf is the optimum result, the \(\beta\) wolf and \(\delta\) wolf are the second and third optimum results, and the \(\omega\) wolf is the candidate result. The use of the grey wolf pack predation mechanism to solve the target solution space involves three steps: tracking, encircling, and attacking prey, and they are mapped to the solution to the mathematical model problem, i.e., the fitness from good to bad corresponds to the \(\alpha\) wolf, \(\beta\) wolf, and  
Figure 4: The structure of the Bi-LSTM network. \(\delta\) wolf in the wolf population, and the other fitness individuals correspond to the \(\omega\) wolf. The specific algorithm applied to the mathematical model can be represented as:  
\[D=\left|C*X_{p}-X_{(t)}\right| \tag{29}\]  
\[X_{(t+1)}=X_{p}(t)-A*D \tag{30}\]  
where \(D\) indicates the relative location between the grey wolf and the target; \(t\) is the current number of iterations; \(C\) and \(A\) are coefficients, \(X_{p}\) is the location of the target, and \(X_{(t)}\) is the location of the current gray wolf. The values of coefficients \(C\) and \(A\) are determined by:  
\[C=2r_{1} \tag{31}\]  
\[A=2 ar_{2}-a \tag{32}\]  
\[a=2-2*\frac{t}{T_{max}} \tag{33}\]  
where \(r_{1}\) and \(r_{2}\) are random numbers, the value of \(a\) linearly reduces from 2 to 0 with the number of iterations \(t\), and \(T_{max}\) is the maximum number of iterations. After the gray wolf population completes the positioning and tracking of the prey location, it needs to complete the enclosure of the prey and map it to the mathematical model. The location of \(\omega\) can be updated by calculating the locations of \(\alpha\), \(\beta\), and \(\delta\). The update formula is represented as:  
\[ \begin{cases}D_{\alpha}=\left|C_{1}\cdot X_{\alpha}-X\right|\\ D_{\beta}=\left|C_{2}\cdot X_{\beta}-X\right|\\ D_{\delta}=\left|C_{3}\cdot X_{\delta}-X\right|\end{cases}  \tag{34}\]  
where \(D_{\alpha}\), \(D_{\beta}\), and \(D_{\delta}\) denote the distance between \(\alpha\), \(\beta\), and \(\delta\) and the current iterated grey wolf individual; \(X_{\alpha}\), \(X_{\beta}\), and \(X_{\delta}\) indicate the current location of \(\alpha\), \(\beta\), and \(\delta\), respectively; \(C_{1}\), \(C_{2}\), and \(C_{3}\) are the corresponding coefficients; \(X\) denotes the location of the gray wolf individual in the current iteration. When the prey stops moving, the wolf completes the hunt by attacking. The location of a grey wolf individual can be determined by:  
\[ \begin{cases}X_{1}=X_{\alpha}-A_{1}\cdot D_{\alpha}\\ X_{2}=X_{\beta}-A_{2}\cdot D_{\beta}\\ X_{3}=X_{\delta}-A_{3}\cdot D_{\delta}\end{cases}  \tag{35}\]  
\[X_{(t+1)}=\frac{X_{1}+X_{2}+X_{3}}{3} \tag{36}\]  
where \(X_{1}\), \(X_{2}\), and \(X_{3}\) indicate the step length and direction of \(\omega\) wolves forward to \(\alpha\), \(\beta\), and \(\delta\), respectively; \(X_{(t+1)}\) indicates the final location of \(\omega\) wolves after the iteration.