## 4 Case Studies
### Random Disturbances  
In order to further analyze the dynamic performance of the cost consensus algorithm for AGC power allocation with EV in practical applications, a random square wave load disturbance simulation is applied on the Hainan power grid while the wave period is 1000 s and the amplitude is no more than 150 MW (corresponding to 10% of the daily maximum load in Hainan province). Meanwhile, the simulation time is set to be 24 h. Besides, genetic algorithm (GA) [41; 42], particle swarm optimization (PSO) [43; 44], group search optimizer (GSO) [45], linear programming (LP) [46], and allocation algorithm based on the same adjustable capacity proportion are used for a fair and thorough performance comparison. In addition, the control period of AGC is nine seconds, while the total power command \(\Delta P_{\mathrm{EV}\sum}\) of EV centralized control center is obtained by offline static optimization based on GA, which aims to achieve a linear weighted minimization of the adjustment cost and a maximization of the climbing time of all AGC units in the whole control area. In order to further investigate the influence of the EV's participation in power system frequency regulation, coal-fired unit G3 and hydropower unit G6 are used to replace EV for further comparison, that is, the total power instruction \(\Delta P_{\mathrm{EV}\sum}\) of the EV centralized control center is all borne by coal-fired unit G3 or hydropower unit G6. Table 3 demonstrates the control performance standard (CPS) index and adjustment cost when EVs participate in frequency regulation of the Hainan power grid under different algorithms, in which \(\left|\Delta f\right|\), \(\left|\mathrm{ACE}\right|\) (automatic control error), CPS1, CPS2, and CPS are the average of the corresponding indicators within 24 h, while the cost is the total adjustment cost of all units in 24 h. From Table 3, one can readily find that the CPS index of the cost consensus algorithm is close to that of centralized algorithms such as GA, PSO, GSO, LP, and PROP, which further shows that the cost consensus algorithm is a feasible method for the decentralized control of AGC power allocation with EV in the power grid. In fact, the solved problem given in Equations (1)-(4) is linear, and its global optimum can be obtained by LP. In contrast, the proposed cost consensus algorithm is a distributed optimization method, for which it is difficult to obtain the global optimum, as it optimizes locally with the limited information. Although the heuristic algorithms (GA, PSO, and GSO) only search an approximate global optimum, they are still the good choice to be introduced for testing the performance of the proposed algorithm. In essence, the comparative algorithms, including GA, PSO, and GSO, are the meta-heuristic algorithm with various stochastic searching operations in nature. In order to reduce the optimization randomness and rapidly obtain a high-quality optimum, the local search weights of these algorithms are increased via setting their optimization parameters. Particularly, the crossover and mutation rates of GA are set to 0.9 and 0.05, respectively; the velocity weight of PSO is set to a dynamic value decreasing from 0.7  
Figure 6: Consensus convergence process of regulation cost; (**a**) Convergence process of virtual consensus variables; (**b**) Convergence process of actual consensus variables; (**c**) Convergence process of power generation in charging stations. to 0.3; and the percentage of rangers is set to 10% for GSO. In addition, because the cost consensus algorithm uses the local information interaction of the agents to cause the consensus variables to tend to be consentaneous, it strongly depends on the optimization model. Hence, compared with centralized algorithms such as GA, PSO, GSO, and LP, its total adjustment cost is slightly higher.