## 4 Simulation and Application
### Simulation with an Artificial Signal  
For this simulation, we attempt to track the pushing distance with a Kalman filter, whose covariance \(Q\) and \(R\) are optimized by different optimization algorithms, e.g., a particle swarm optimization (PSO), genetic algorithm (GA), basic fruit fly algorithm (FOA), and 3D fruit fly algorithm (3D-FOA). Firstly, the parallel model for pushing distance tracking is constructed using MATLAB (Matlab 2016b, Torrance, CA, USA), as shown in following Figure 6. The input acceleration is a sinusoidal function: \(u_{k}=g\cdot\sin(\%)\), where \(g\) is a constant variable and given as \(g=9.81\). We simulate the process noise \(w\) and measurement noise \(v\) with random functions. Then, the simulated parameters go through the parallel plant model based on the state-space model described in Equations (12) and (13). The true output of the model is \(y\), the measurement with measurement noise is \(y_{n}\), and the estimation using the Kalman filter is \(y_{e}\). Secondly, create the fitness function, which utilizes the above parallel model to simulate the measurement and estimation. Then calculate the mean squared error using Equation (12). Finally, the simulation results can be obtained via the following configurations, which is listed in following Table 1:  
For comparison, four other optimization algorithms are also implemented and the comparison of the results are shown in Table 2.  
In this simulation, the parameters set for the FOA and 3D-FOA are the same. Some key parameters are given: maximum generations is 100, population size is 20, location range is [\(-1.0\), \(1.0\)], and food range is [\(-3.1\), \(3.1\)], etc. For the proposed IFOA, all of the parameters are the same as the FOA and 3D-FOA except the perturbation intensity \(\Delta w\). In this simulation, perturbation intensity is given as a fixed value 3.1. To complete the optimization using GA, the MATLAB genetic algorithm toolbox is used, and the function (GAOPTIMSET) is utilized to set all of the options about GA evolution. For the simulation using PSO, import parameters should also be set properly, and the details about the parameters are listed in Table 3. \begin{table}
\begin{tabular}{c c} \hline
**Index** & **Configuration** \\ \hline Processor & Intel Core i7, 2.5 GHz \\ RAM & 8 G \\ System & Win 10, x64 \\ Software & MATLAB \\ \hline \end{tabular}
\end{table} 
Table 1: Simulation configurations. \begin{table}
\begin{tabular}{c c c} \hline
**Algorithms** & **MSE** & **Time (s)** \\ \hline PSO & 0.39747 & 7.7298 \\ GA & 0.26777 & 13.002 \\ FOA & 0.022869 & 7.0885 \\
3D-FOA & 0.022089 & 7.3534 \\ Proposed IFOA & 0.020527 & 7.2502 \\ \hline \end{tabular}
\end{table} 
Table 2: Comparison of the estimation results produced by different algorithms. Figure 6: Parallel model for pushing distance tracking with varying optimization methods. The proposed FOA obtained the minimal mean squared error (MSE) (0.020527), while GA and PSO obtained larger errors, and their calculation time is rather larger than the other three algorithms based on FOA. Especially, the basic FOA is the fastest, but is subtly rough to find the global optimal compared to the proposed method and 3D-FOA. Compared to 3D-FOA, the proposed FOA performed better both in the estimation accuracy and the computational time, since the covariances are optimized offline. Despite the proposed FOA being more complex than the basic FOA, it is still the best choice after a comprehensive tradeoff. The estimation results of the pushing distance, as displayed in Figure 7, show that FOA, 3D-FOA, and the proposed FOA perform much better than PSO and GA, which is presented in the bottom-right due to the different magnitude of the estimated pushing distance. From the pushing distance estimation results, the difference between FOA, 3D-FOA, and the proposed FOA are not obvious.