## 8 MATLAB Simulation and Experimental Data Analysis
### MATLAB Simulation  
Firstly, the MATLAB simulation results are presented to validate the proposed adaptive target tracking method based on EKF. The initial speed of MRS is \(u_{f,0}=0\) m/s, the initial heading of MRS is \(\psi_{f,0}=20^{\circ}\) in \(O_{1}\) coordinate frame. The initial position of MRS is \(\left(x_{f,0},y_{f,0}\right)=(400,300)\). The task of MRS is to move with \(u_{f}=0.3\) m/s and travels in a straight path with \(\psi_{f}=20^{\circ}\). The initial speed of AUV is \(u_{v,0}=0\) m/s, the initial heading of MRS is \(\psi_{v,0}=0^{\circ}\) in \(O_{1}\) coordinate frame. The initial position of AUV is \((x_{v,0},y_{v,0})=(300,200)\). The task of AUV is to home to the MRS with \(u_{v}=0.5\) m/s. The noise variance of the AUV heading is \(0.0053\). The noise variance of the forward speed of AUV is GMD, which contains two single Gaussian distributions. The parameters of GMD are the weights(\(w\)), mean(\(\mu\)) and variance(\(\Sigma\)), which are shown in Table 1:  
Initialize the parameters used in the adaptive target tracking algorithm based on EKF. The initial system state is defined as \(\mathbf{x}_{0}=\left[300\ 200\ 400\ 0.1\ 300\ 0.1\right]^{T}\). \(\mathbf{Q}\) is initilized as \(\mathbf{Q}1=\left[ \begin{matrix}1^{2}&0&0&0\\ 0&0.2617^{2}&0&0\\ 0&0&0.1^{2}&0\\ 0&0&0&0.035^{2}\end{matrix} \right]\) or \(\mathbf{Q}2=\left[ \begin{matrix}0.0660&0&0\\ 0&0.0053&0&0\\ 0&0&0.1^{2}&0\\ 0&0&0&0.035^{2}\end{matrix} \right]\). All parameters used in VB algorithm and BP neural network are initialized. The simulation results are shown in Figures 7 and 8. The loss function is applied to test the performance of the proposed algorithm with a variety of conditions, and it is defined as:  
\[L1 =\Delta x_{v}^{2}+\Delta y_{v}^{2} \tag{40}\] \[L2 =\Delta x_{f}^{2}+\Delta y_{f}^{2}\] (41) \[L=L1+L2 =\Delta x_{v}^{2}+\Delta y_{v}^{2}+\Delta x_{f}^{2}+\Delta y_{f}^ {2} \tag{42}\]  
where \(\Delta x_{v}\) and \(\Delta y_{v}\) are the horizontal and vertical direction of the positioning error components of AUV;\(\Delta x_{f}\) and \(\Delta y_{f}\) are the horizontal and vertical direction of the positioning error components of MRS; \(L1\) is the loss function of positioning performance of AUV; \(L2\) is the loss function of positioning performance of MRS; \(L\) is the total loss function. The losses of the proposed algorithm with a variety of conditions are shown in Table 2. \begin{table}
\begin{tabular}{c c c c} \hline  & **Weight** & **Mean** & **Variance** \\ \hline
1 & \(w_{1}=0.3\) & \(\mu_{1}=0\) & \(\Sigma_{1}=0.1^{2}\) \\
2 & \(w_{2}=0.7\) & \(\mu_{2}=0\) & \(\Sigma_{2}=0.3^{2}\) \\ \hline \end{tabular}
\end{table} 
Table 1: The parameters of GMD. In this simulation, the real positions of AUV and MRS are calculated using the complicated motion model. The deviation between the real position and estimated position is positioning error. (a) and (b) in Figure 7 are the horizontal and vertical direction of the positioning error components of AUV with different algorithm. (c) and (d) in Figure 7 are the horizontal and vertical direction of the positioning error components of MRS with different algorithm. In these figures, the blue line show the positioning error of the TT-EKF with the PNCM \(\mathbf{Q}_{2}\). It should be pointed out that the components of \(\mathbf{Q}_{2}\) (\(Q(1,1)\) and \(Q(2,2)\)) is the real noise statistics. The red lines show the positioning error of the TT-EKF with the PNCM \(\mathbf{Q}_{1}\). The PNCM \(\mathbf{Q}_{1}\) is totally inaccurate. The green lines show the positioning error of the TT-EKF with the PNCM is estimated by VB algorithm. The black lines show the positioning error of the TT-EKF with the PNCM is estimated by VB algorithm and the odometric error is compensated by BP neural network. The estimated heading and forward speed of AUV and MRS are shown in Figure 8 based on TT-EKF with the PNCM is estimated by VB algorithm and the prediction error is compensated by BP neural network.