## 1 Introduction
### Literature Review
An improved optimal sizing methodology of a typical residential microgrid integrating renewable energy sources and EVs has been proposed in [26] to lower greenhouse gases emissions and minimize the cost. An annealing mutation particle swarm optimization problem has been studied in [27] for microgrid optimal dispatchingto minimize the environmental protection cost and the operation and maintenance cost of a microgrid in a multi-objective economic dispatch model. A multi-agent particle swarm optimization problem has been addressed in [28] for a grid-connected PV, energy storage system and EV charging station to size the PV and the energy storage system and to set the charging/discharging pattern of the energy storage system. The EV charging station integrates PV, an energy storage system and a grid connection. A machine learning-based approach has been proposed in [29] for energy management in a microgrid, taking into account a reconfigurable structure based on remote switching of ties and sectionalizing. They have also proposed a new modified optimization problem based on dragonfly due to the complexity of the problem. An optimal configuration of PV-powered EV charging stations in [30] has been studied economically and technically under different solar irradiation profiles in Vietnam using the HOMER Grid program. An optimization model based on a genetic algorithm has been proposed in [31] to optimize the use and scheduling of energy sources for an intelligent hybrid energy system, including EVs and a micro-combined heat and power system. In [32], a bi-level robust optimization has been proposed to optimize the design of an EV charging station with distributed energy resources. The authors of [33] have proposed an optimization model for a battery-swapping station to minimize the charging cost of EVs by optimizing the charging schedule for swapped EV batteries. An optimal charging profile has been proposed in [34] for EVs to minimize battery degradation and extend their lifetime. A robust optimal power management system has been presented in [35] for a standalone hybrid AC/DC microgrid. The optimization problem, formulated as a MILP problem, is responsible for supervising the power flow in the hybrid microgrid, with the objective to satisfy the load demand while maximizing the usage of renewable sources (PV and wind), minimizing the usage of diesel generation, extending battery life, and limiting the utilization of the converter between the AC and DC microgrids. An energy management system for a grid-connected microgrid has been addressed in [36] based on a MILP problem to minimize the total energy cost over 24 h, taking into account load demand, grid tariffs, and renewable energy sources production. A long short-term memory network has been proposed in their paper to deal with the power prediction of the renewable energy sources and the load demand, where each hour, it predicts the profiles for the next 24 h. Then, real-time implementation is enabled by the receding horizon strategy, which is used to minimize the prediction error and gives commands for the first hour; then, each hour, the data are actualized. The proposed strategy in [36] proved its cost reduction in comparison with an offline optimization after conducting simulation tests. In [37], a novel modular modeling method has been described for an energy management system for urban multi-energy sources, including cooling, heating and renewable sources, that allow complex system topologies to be modeled. They have conducted various case studies with different climate conditions and electrical loads. They have also compared the results with a rule-based algorithm to compare the annual cost reductions. In [38], the authors have investigated the technical, economic, and environmental aspects of renewable energy sources in a microgrid. An equilibrium optimization problem was developed to minimize the operational cost of the microgrid, which includes PV, wind turbines, and a biomass generator.