## 4 Model-in-the-Loop Simulation Test and Analysis
### Variance Analysis of MIL Simulation Results  
Model-in-the-loop (MIL) testing plays a crucial role in research, providing the dual guarantee of early validation of the development process and risk reduction. MIL testing can verify the accuracy of SimulationX simulation models before hardware development is completed. Through early validation, potential issues can be identified and resolved, avoiding costly reworking in the later stages, significantly reducing development risks and shortening project cycles. The MIL test laid a solid foundation for subsequent hardware-in-the-loop (HIL) testing and final vehicle testing. Verifying the accuracy of the simulation model through MIL testing can improve the credibility of HIL simulation results, reduce the need for many actual vehicle tests, and thus save time and resources. Model-in-the-loop testing is influenced by environmental factors including signal transmission delays and noise interference originating from system components. As such, there are some errors in the results obtained. Therefore, the results with errors were statistically verified through orthogonal variance analysis. Different from range analysis, variance analysis requires arranging blank columns or conducting repeated tests [23]. Due to the interaction between factors, if a blank column is used, the model error will exaggerate the experimental error and mask the significance of the factor. The error caused by the interaction can be reduced by using the L\({}_{16}\)(24) orthogonal table for 16 MIL tests and two repeated tests. The results were averaged and analyzed using the MINITAB software. The optimal results of the MIL test were compared with the optimal results of simulation, as shown in Figure 21. The trend in the MIL test results is the same as that in the simulation results. The results from the MIL test were analyzed using variance analysis, and the findings are presented in the following table. As presented in Table 8, variance analysis was conducted on the test results. The * in the table represents the magnitude of significance, and the more *, the higher the significance. The analysis revealed that factor A exerts the most significant influence on the output shaft's velocity drop amplitude, factor D has a medium influence on the velocity drop amplitude of the output shaft, and factor B and factor C have no obvious influence on the velocity drop amplitude of the output shaft. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Origin** & **DF** & **Adj SS** & **Adj MS** & **F Value** & **\(p\) Value** & **Eminence** \\ \hline Factor A & 1 & 157.433 & 157.433 & 11.99 & 0.005 & *** \\ Factor B & 1 & 6.908 & 6.908 & 0.53 & 0.483 & \\ Factor C & 1 & 1.827 & 1.827 & 0.14 & 0.716 & \\ Factor D & 1 & 45.951 & 45.951 & 3.50 & 0.088 & * \\ Error e & 11 & 144.453 & 13.132 & & & \\ \hline \hline \end{tabular} DF stands for Degree of freedom. When \(p<0.01\), the significance is ***; when \(0.05\leq p<0.1\), the significance is *; when \(p\geq 0.1\), not Significantly.  
\end{table} 
Table 8: Analysis of velocity drop amplitude using variance method. Figure 21: Comparison of simulation and MIL results. Table 9 presents the variance analysis results for the test, revealing that factors A and D have the most pronounced influence on the output shaft's dynamic load coefficient. Conversely, factors B and C exhibit no discernable impact on this coefficient. Table 10 presents the variance analysis of the test results, demonstrating that factor C exerts the most substantial impact on output shaft impact strength. Factor D exhibits a moderate impact, while factors A and B show no significant influence on output shaft impact strength. As demonstrated in Table 11, variance analysis was conducted on the test results. The analysis revealed that factor A exerts the most significant influence on switching time, while factors D, C, and B show no discernible impact. A comparison and analysis of the simulation results and test results, as presented in Tables 8-11, are summarized in Table 12.