## 3 Adaptive Neural Fuzzy Model
### ANFM Structure  
In Figure 3, the structure of ANFM is a \"deformed\" RBF neural network, which is functionally equivalent to a T-S fuzzy model. The \"deformation\" mainly refers to the fact that the network has more than three layers, and the weights are a function of the input and not constants. Figure 2: Responding nonlinear ship model. Layer 1: The input layer, where each node represents an input linguistic variable respectively, and the total number of input variables is \(r\). In this paper, the output course angle \(\psi(k)\) generated by the ship, its previous step \(\psi(k-1)\) and rudder angle \(\delta(k)\) are used as sample data for the training of ANFM. Layer 2: The membership function layer, where each node represents a respective RBF membership function. In this paper, the Gaussian function is chosen as the membership function of ANFM. \[\mu_{ij}(x_{i})=exp[-\frac{\left(x_{i}-c_{ij}\right)^{2}}{\sigma_{j}^{2}}] \tag{6}\]  
where, \(\mu_{ij}\) is the jth membership function of \(x_{i}\), \(c_{ij}\) is the center of the jth Gaussian membership function of \(x_{i}\), \(\sigma_{j}\) is the width of the jth Gaussian membership function of \(x_{i}\), and \(u\) is the number of membership functions for each variable. Layer 3: the fuzzy rule layer, where each node represents a possible antecedent of a fuzzy rule, namely the IF part. Here, the T-norm product operator is used, which is multiplied by the Gaussian membership function of each input variable, and the width of the membership function of each variable corresponding to each rule is the same. \[\varphi_{j}=exp[-\frac{\sum_{i=1}^{r}\left(x_{i}-c_{ij}\right)^{2}}{\sigma_{j} ^{2}}] \tag{7}\]  
Which is  
\[\varphi_{j}=exp[-\frac{\left\|\mathbf{X}-\mathbf{C}_{j}\right\|^{2}}{\sigma_{j}^{2}}] \tag{8}\]  
where, \(\mathbf{X}=\left(x_{1},x_{2},\cdots,x_{r}\right)\in\Re^{r}\), \(\mathbf{C}_{j}=\left(c_{1j},c_{2j},\cdots,c_{rj}\right)\in\Re^{r}\) is the center of the jth RBF neural unit. In terms of neural networks, each node in the layer is an RBF neural unit node and the number of neural units is time-varying in the dynamic process. Therefore, in  
Figure 3: ANFM structure. ANFM, the number of RBF neural unit nodes is equal to the number of rules of the fuzzy system, and the two concepts are interchangeable. Layer 4: Normalization layer, where each node represents an \(N\) node respectively. Each \(N\) node is the output of its corresponding previous layer of rules as a proportion of the sum of the outputs of all rules. It is easy to know that the number of \(N\) nodes is equal to the number of fuzzy rules. The output of the jth node \(N_{j}\) is  
\[\phi_{j}=\frac{\phi_{j}}{\sum_{k=1}^{u}\phi_{k}} \tag{9}\]  
Layer 5: The output layer, where each node represents a respective output variable. This layer represents the latter part of the fuzzy rule, namely the THEN part. In this paper, only the single output mode is used as an example for derivation. The output of ANFM is a linear superposition of all the input signals of the previous layer according to the connection weights. \[y(X)=\sum_{k=1}^{u}\omega_{k}\phi_{k} \tag{10}\]  
where, \(y\) is the output variable and \(\omega_{k}\) is the connection weight of the \(k\)th \((k=1,2,\cdots,u)\) rule. In ANFM, the connection weights are not simply real constants, but a function of all input variables about the whole ANFM, expressed as a linear combination of each input variable according to a corresponding set of weight coefficients, with the following expression.