## 4 Simulation and Results Analysis
### Simulation of the Optimization Process  
The main discrimination index of the offline optimization process was the smell function: bestSmellbestIndex, and the IAE time was 0.2 s. Figure 9 is an optimization iteration diagram composed of the reciprocal of the control error IAE index in each control loop. Figure 9 represents the reciprocal of the control error IAE index of reactive power; Figure 9 represents the index of reactive power; Figure 9 represents the index of the \(d\)-axis component of the output control error; and Figure 9 represents the index of the \(q\)-axis component of the output control error. Table 1 shows the comparison of offline optimization key parameters between a population size of 100 and a population size of 200. The computation time of each fruit fly individual was 5.6 s in the offline optimization simulation process. Comparisons of the final optimized parameters suggested that the larger the population size, the larger the search space range and the smaller the number of iterations, but no significant difference was found between the final optimal values. Furthermore, the increase in the population scale meant the extension of optimization time. The total time for the  
Figure 9: The bestSmellbestIndex values of the offline FOA optimization simulation (the population is 100 and the iteration generation is 100). **(a)** The bestSmellbestIndex1 optimal values curves. **(b)** The bestSmellbestIndex2 optimal values curves. **(c)** The bestSmellbestIndex3 optimal values curves. **(d)** The bestSmellbestIndex4 optimal values curves. offline optimization calculation was 15.7 h when the fruit fly population was 100. When the fruit fly population was 200, the total simulation time increased to 31.4 h.  
Table 2 shows the comparisons of the parameters between different controllers after population optimization. It can be seen from the table that the parameters of different controllers differed a lot in population scale. Figure 10 shows the comparison unit step-response curves between the initial value and the optimal unit step-response of the optimization calculation process. It can be seen from the figure that the step-response results of the optimal controller parameters significantly outperformed those of the initial controller parameters. The unit step-response rising time of the \(d\)-axis component was 1.11434 \(\times\) 10\({}^{-6}\) s, and the average deviation rate of steady-state error was 0.298%, while the initial controller was 2.56119 \(\times\) 10\({}^{-5}\) s and 5.542%, respectively. Correspondingly, the unit step-response rising time and the average deviation rate of the steady-state error of the \(q\)-axis component was 8.21158 \(\times\) 10\({}^{-7}\) s and 0.271%, respectively, while the initial controller increased to 2.77256 \(\times\) 10\({}^{-5}\) s and 6.727%, respectively. It was noted that the responses of the optimized controllers became faster with a smaller steady-state error, and the control performance of these controllers was improved. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Optimum Variable**} & \multicolumn{2}{c}{**100-Population**} & \multicolumn{2}{c}{**200-Population**} \\ \cline{2-5}  & **Optimal Value** & **Iteration Number** & **Optimal Value** & **Iteration Number** \\ \hline bestSmellbestIndex1 & 0.007284 & 9 & 0.007321 & 16 \\ bestSmellbestIndex2 & 0.021197 & 7 & 0.021093 & 5 \\ bestSmellbestIndex3 & 0.037699 & 31 & 0.037472 & 16 \\ bestSmellbestIndex4 & 0.010301 & 7 & 0.010189 & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Detailed comparison results of optimal values.