## 4 Results
### Multiple Electric Vehicle Connection and Disconnection
#### 4.3.3 Generation Behavior  
Figure 13 shows the behavior of the active power in the three DGs when EVs are connected and disconnected. Figure 13a shows the active power, and Figure 13b presents the reactive power. In the simulation, the active power changes each period, corresponding to the connection and disconnection of EVs along the microgrid according to the events previously defined (Events 1-6). Regarding the active power presented in Figure 13a, the obtained result shows that each distributed generator is stabilized as quickly as possible to deliver adequate active power to the different loads. Thus, the following results are obtained:  
* During the first two periods of simulation (Event 1 and Event 2), the microgrid is subjected to the connection and disconnection of five EVs in Node 1 and followed by one EV connected to Node 2. During these two periods, DGs 1 and 3 are the ones that present the most changes in active power and after some seconds, they finish sharing similar values. * Then, in the third period (Event 3), 10 EVs are connected to Node 3 at the beginning of the period and disconnected at the end of the period. During this period, DG 2 responds more abruptly to the load change, because this generator is closer than the others to the variable load. * Later, in the fourth period (Event 4), three EVs are connected to Node 4. In this case, DGs 2 and 3 are the ones that respond most to this load change because they are closest to the load, while the control stabilizes the three generators at the same value of active output power. * In the fifth period (Event 5), two EVs are connected to Node 5. When analyzing the simulation, the DG that responds more to this change is the DG 3, because it is closest to the variations. However,  
Figure 10: Events considered for the second test related to multiple electric vehicle (EVs) connection. with the help of the control strategy, the output power is stabilized to the same value as the other two DGs. * Finally, in the sixth period (Event 6), two EVs are connected to Node 6. In this case, DG 3 undergoes the most abrupt change in power generation, because it is the closest generator to the load. Figure 11: Load variation with electric vehicles (EVs): (**a**) Active power and (**b**) reactive power. Figure 12: Voltage regulation with variable virtual impedance. Regarding the reactive power presented in Figure 13b, the obtained result shows that each distributed generator is stabilized as quickly as possible to deliver adequate reactive power to the different loads. The following results are obtained:  
* DG 1 undergoes the most abrupt change in reactive power during the first period (Event 1), because the connection of EVs is closest to this generator. * Next, during the second period (Event 2), the same generator undergoes the greatest change in reactive power; however, this time with a negative change because it delivers less reactive power because the load decreases 80% at Node 1 (disconnection of five EVs) and Node 2 increases only to one connected EV. * In the third period (Event 3), DG 3 increases the reactive power because of the load changes from one EV to 10 EVs. Then, the load increases 90%, and DG 2 delivers more reactive power because the EVs are connected to the same node as the generator. Thus, the proposed control strategy performs regulation according to the closest generator. * In the fourth period (Event 4), the power reduces in DGs 1 and 2 because of the load change from 10 EVs at Node 3 to only three EVs connected at Node 4. * In the fifth period (Event 5), the powers of DGs 1 and 2 are reduced because three EVs are disconnected from Node 4 and two EVs are connected to Node 5. If the connection of EVs occurs at a greater distance from these two DGs and much closer to DG 3, then the reactive power in DG 3 increases considerably. Figure 13: Behavior of (**a**) active power and (**b**) reactive power when EVs are connected and disconnected at different nodes in the microgrid.