## 6 Simulations  
In this paper, the simulation is conducted with the real ship data of COSCO 5446 TEU, a large container ship. As the ship uncertainty parameters \(K\), \(T\), \(\alpha\), \(\beta\) vary with the speed \(V\), the values of parameters \(K\), \(T\), \(\alpha\), \(\beta\) corresponding to different speeds between \(V=16.3\) knots and \(V=27.1\) knots(\(1\) knot \(=1.852\) km/h) can be derived from the ship state space model and the maneuverability of the ship [67], as shown in Table 1.  
To identify the inverse dynamics of the ship's course according to Figure 5, the simulation time is taken to be \(N_{k}=600\) s, and the ship's working condition is assumed to be a smooth acceleration state, namely the speed is kept at \(V=16.3\) knot during the initial 120 s of the simulation, and as the speed is constant, the modeling parameters at this time are taken to correspond to the constant values in Table 1. During the 121-480 s of the simulation, the ship gradually accelerates from \(V=16.3\) knot to \(V=27.1\) knot. The change in speed causes a change in the modelling parameters, and this section linearizes the trend according to the values of each parameter corresponding to the speed \(V=16.3\) knot and \(V=27.1\) knot in Table 1. And during the period 481-600 s of the simulation, the speed was \begin{table}
\begin{tabular}{c c c c c} \hline \hline \(V\) (Konts) & \(K\) & \(T\) & \(\alpha\) & \(\beta\) \\ \hline
27.1 & 0.2676 & 186.9556 & 10.4915 & 7.5343 \\
26.5 & 0.2617 & 191.1885 & 10.7291 & 8.0578 \\
24.5 & 0.2419 & 206.7958 & 11.6049 & 10.1966 \\
22.5 & 0.2222 & 225.1776 & 12.6366 & 13.1644 \\
19.8 & 0.1955 & 255.8837 & 14.3601 & 19.3172 \\
17.8 & 0.1758 & 284.6346 & 15.9748 & 26.5858 \\
16.3 & 0.1609 & 310.8280 & 17.4475 & 34.6171 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Uncertain model parameters under different ship speed \(V\). kept at \(V=27.1\) knot. The speed change curve is shown in Figure 8, and the uncertainty parameters \(K\), \(T\), \(\alpha\), \(\beta\) at different speeds are shown in Figure 9.  
After the uncertainty condition is set, the input rudder angle signal is generated in Figure 5. As the rudder angle variation range is generally between \([-35^{\circ},35^{\circ}]\), in order to ensure the training data contain as wide a range of inputs as possible, the control rudder angle is first taken to be a sin wave curve as follows,  
\[\delta(k)=35 sin(2\pi k/600) \tag{50}\]  
where \(k\in[0,600]\) is the training time, and let the simulation step \(h=1\)\(s\). The output \(\psi(k)\) generated by the ship, its previous step \(\psi(k-1)\) and \(\delta(k)\) are used as sample data for the training of ANFM. That is  
\[(X_{i},o_{i})=((\psi(k),\psi(k-1)),\delta(k)) \tag{51}\]  
Take the pre-set parameters for ANFM as follows: \(e_{max}=5\), \(e_{min}=0.1\), \(\beta=0.9764\), \(d_{max}=251.2381\), \(d_{min}=0.2\), \(\gamma=0.9809\), \(\sigma_{0}=106.1584\), \(k_{s}=2,k_{\omega}=1.05\), \(k_{err}=0.0001\)  
Figure 8: Changing curve of ship speed \(V\). Figure 9: Changing curve of uncertain parameters \(T\), \(\alpha\), \(\beta V\). The approximation between the input rudder angle and the output rudder angle of the ANFM is given in Figure 11. From Figure 11, the ANFM shows a strong approximation capability, with its output rudder angle almost always covering the ideal rudder angle. Figure 12 gives the changes in the structure of ANFM during the learning process. Rule numbers indicate the number of fuzzy rules in the third layer of ANFM or the number of RBF neural units in that layer. In Figure 12, the number of fuzzy rules gradually increases from 1 to 8, and then is pruned to 6 and saved until the end of the final learning, from which it can be argued that ANFM requires only six fuzzy rules, or only six RBF neural units to describe the inverse dynamics of \(\psi\rightarrow\delta\) when the learning is complete. This result largely reflects the simplicity of the ANFM structure.