# Optimal Energy Management within a Microgrid: A Comparative Study
## 5 Results
### Microgrid Test
It is important to understand that the power supplied by the PV on a clear winter day is less than on a clear summer day. This reduction of power produces an increment in the imported power from the main grid and a gradual decrement in the power supplied by the WT, battery, and the PEV. Those increments and decrements in the power flow inside the microgrid are shown in Figure 12 through a comparison between the power generators on summer and winter days. Figure 12 shows the active (P) and reactive (Q) power flow exchanged between the main grid and the microgrid through the PCC for the whole time period T of interest (24 h). Also, the active power provided by the electric vehicles, battery, and photovoltaic system is shown in that figure. It is observed that the amount of active and reactive power exchanged with the main grid through the PCC changes along the time period T. This is due to the optimal energy dispatch driven by the proposed approach, which handles the energy storage systems under the variation of the system load demand and the power generated by the renewable generation systems. This optimal energy management also involves low total active power losses and an acceptable voltage profile. For example, for the microgrid operating on a summer day, Figure 13 shows the low total active power losses obtained along the time period T. This fact is expected in this approach because loss reduction involves a decrement in the  
Figure 11: Result of the power in generators for a clear winter day. Figure 10: SOC of battery and Park of EV (PEV) for a clear summer day. power imported from the main grid and, hence, in the total cost, which aids to minimize the fitness function. Also, the bus voltage profiles satisfy the specified operating limits (\(0.95\leq V\leq 1.05\)) for the whole time period \(T\), which is ensured in this approach because the bus voltage limits are explicitly considered in the proposed models (26)-(29). The total energy costs of the imported power from the main grid without DG and with DG during winter and summer days are shown in Figure 14 When the microgrid is working without DG, high cost occurs when there is peak load demand. Nevertheless, the main aim of this paper is the optimization when the microgrid works with DG, and we observe in Figure 13 that the aim is being met in full. However, differences exist between the energy cost when the microgrid operates on clear summer and winter days (energy cost is higher when it is a winter day). This is because the irradiation is lower on a winter day, generating less power compared to a sunny summer day, making the import of power more expensive from the main grid when it is a winter day. Figure 12: Comparison between power generation on summer and winter days. (**a**) Active and reactive powers exchanged with the main grid. ; (**b**) Active power provided by the battery; (**c**) Active power provided by the vehicle fleet; (**d**) Active power provided by the photovoltaic panel. Figure 13: Total active power losses and bus voltages for a summer day. (**a**) Active power losses; (**b**) Bus voltages.