## 4 Results and Discussion  
In this paper, a Matlab/Simulink simulation platform is used for simulation calculation and algorithm verification. The version of Matlab is R2017b. The CPU of the computer is Intel Core (TM) i5-8250U with 1.80 GHz frequency. The RAM of the computer is 8.00 GB and the operating system is Windows 10. Using the Monte Carlo sampling method [14], the random distribution model of SoC and AVDT of 50 electric vehicles was established. The rated capacity of each EV's power battery is 100 Ah, the battery end voltage is 300 V; The minimum spacing between different AVDT classes D1 = 30%. The minimum spacing between different AVDT classes D2 = 20 km; The clustering results of the 50 electric vehicles according to their SoC and AVDT classes are, as shown in Table 1 and Figure 5. \begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} \hline
**EVi** & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** & **9** & **10** \\ \hline
**SoC.ivalue (\%)** & 97 & 55 & 52 & 23 & 49 & 63 & 68 & 39 & 37 & 99 \\ \hline
**AVDTi.value (km)** & 32 & 19 & 9 & 21 & 24 & 6 & 30 & 11 & 19 & 29 \\ \hline
**SoC.iclass** & 2 & **3** & **3** & **1** & **3** & **3** & **3** & **3** & **1** & **2** \\ \hline
**AVDTi.class** & 1 & **3** & **2** & **3** & **3** & **2** & 1 & **2** & **3** & **1** \\ \hline
**EVi** & **11** & **12** & **13** & **14** & **15** & **16** & **17** & **18** & **19** & **20** \\ \hline
**SoC.ivalue (\%)** & 3 & 89 & 92 & 80 & 9 & 26 & 33 & 68 & 13 & 72 \\ \hline
**AVDTi.value (km)** & 12 & 14 & 31 & 13 & 42 & 50 & 37 & 17 & **29** & 5 \\ \hline
**SoC.iclass** & 1 & 2 & 2 & 2 & 1 & 1 & 1 & 3 & **1** & **3** \\ \hline
**AVDTi.class** & 3 & 3 & 1 & 3 & 1 & 1 & 1 & 3 & 1 & **2** \\ \hline
**EVi** & **21** & **22** & **23** & **24** & **25** & **26** & **27** & **28** & **29** & **30** \\ \hline
**SoC.ivalue (\%)** & 10 & 66 & 49 & 78 & 72 & 91 & 89 & 33 & 70 & 19 \\ \hline
**AVDTi.value (km)** & 46 & 44 & 41 & 13 & 30 & 1 & 21 & 15 & 8 & 9 \\ \hline
**SoC.class** & 3 & 3 & 3 & 3 & 2 & 2 & 1 & 3 & 1 & 3 \\ \hline
**AVDTi.class** & 1 & 1 & 1 & 3 & 1 & 1 & 1 & 2 & 3 \\ \hline
**AVDTi.value (km)** & 27 & 33 & 20 & 41 & 36 & 49 & 27 & 16 & 5 & 31 \\ \hline
**SoC.class** & 1 & 2 & 1 & 3 & 1 & 2 & 3 & 3 & 3 & 3 \\ \hline
**AVDTi.class** & 1 & 1 & 3 & 1 & 1 & 1 & 1 & 3 & 2 & 3 \\ \hline \end{tabular}
\end{table} 
Table 1: Random models of SoC and average vehicle daily travel (AVDT) of 50 EVs and their clustering results. Figure 5: (**a**) Clustering results of EVs based on the state of charge value of each EV; (**b**) Clustering results of EVs based on the average vehicle daily travel value of each EV. Reorganize the sub EV groups according to SoC and AVDT classes, the re-organized clustering results are shown in Table 2 and Figure 6:  
After completing the electric vehicle group classification, the optimization problems proposed by Equations (13) and (14) are solved, and the optimal \(\mathrm{S_{i}}\) values of the VSMs belonging to different electric vehicle groups are obtained. In order to simplify the solution process, the \"\(q\)-\(\Delta\omega\)/2\(\pi\)\" term in Equation (13) is rewritten as:  
\[\Delta P_{j}=\left\{ \begin{array}{cc}q\cdot\Delta\omega_{j}\frac{M_{j}\cdot \mathrm{SoC}_{j}}{2\pi\cdot\sum\limits_{j=1}^{N}M_{j}\otimes C_{j}}&\Delta \omega_{j}\leq 0\\ q\cdot\Delta\omega_{j}\frac{M_{j}\cdot(1-\mathrm{SoC}_{j})}{2\pi\cdot\sum \limits_{j=1}^{N}M_{j}(1-\mathrm{SoC}_{j})}&\Delta\omega_{j}>0\end{array} \right., \tag{19}\]  
where \(M_{j}\) is the EV numbers in cluster \(j\), and \(\mathrm{SoC}_{j}\) means the EV SoC corresponding to each type of cluster center. \(\Delta P_{j}\) should choose the upper part of Equation (19) since EVs with higher SoC have more margins for lowering charging power when \(\Delta\omega_{j}\) is negative, which means the grid frequency is lower than its rated value. Relatively, \(\Delta P_{j}\) should choose the lower part of Equation (19) since EVs with lower SoC have more margins for raising charging power when \(\Delta\omega_{j}\) is positive.