CO
2 emissions are the major issue of global warming. The transport sector shares 25% of the global energy consumption in the world and therefore contributes to these emissions [
1,
2]. Renewable energies can decrease greenhouse gases and, therefore, CO
2 emissions due to pollution from the electrical power plants running on fossil fuels. In this context, the energy transition promotes the growth of renewable energy sources; however, this transition can introduce new constraints for grid operators in terms of reliability and quality [
3]. Therefore, microgrids are able to balance local production and consumption of energy and bring benefits to end-user by reducing electricity costs, e.g., reduced transmission cost and distribution cost by lowest energy loss in transmission. Microgrids are based on renewable energy sources such as photovoltaics (PV) and wind, storage devices, and loads and could have a connection to the grid [
4]. Electric vehicles (EVs) have been a center of attention worldwide due to their merits: zero tailpipe emissions, noise-free operation, high efficiency of energy use and simple structure [
5,
6]. The EV market is constantly growing [
1,
7,
8]. However, the increase in EV charging, seen as loads connected to the grid, will have a significant impact on the grid and will impose additional difficulties for grid operators [
9,
10]. Therefore, managing EV charging will be a critical requirement.
1.1. Literature Review
Recent studies have aimed to design microgrids for EV charging. The authors of [
11] have proposed mixed-integer linear programming (MILP) for an EV charging station integrated into a DC microgrid to determine the optimal operation planning. They have focused on optimizing the daily operational costs based on forecasting PV production and EV operation. A hybrid optimization problem for energy storage management has been proposed in [
12] to minimize the EV charging cost in a PV-integrated EV charging station using time-of-use wholesale electricity pricing. The authors in [
13] have presented meta-heuristic methods, such as binary particle swarm optimization and binary grey wolf optimization. They have studied an optimal charging coordination strategy for a random arrival of plug-in EVs. A MILP optimization has been proposed in [
14] to minimize the microgrid operation cost by having an aggregated EV charging station for an islanded microgrid and in [
15] to minimize the energy generation cost and load shedding considering various constraints in a microgrid that integrates battery EV charging stations. A heuristic operation problem has been proposed in [
2] for a commercial building microgrid that integrates EVs and a PV system to study a strategy to acquire data in real-time rather than forecasting EV charging demand or PV production. A genetic algorithm optimization has been studied in [
16] for the multi-criteria optimization problem to minimize the charging costs of the EV, maximize the use of PV and the storage device and minimize the degradation of the storage device. A MILP optimization has been proposed in [
17] to solve the day-ahead optimization problem and to find the optimal scheduling and operation of a prosumer who owns renewable energy sources and a plugged-in EV. They have used a feed-forward artificial neural network for the weather prediction module in the energy management system. Linear programming and quadratic programming optimization problems have been addressed in [
18] to minimize the total operating costs for building a microgrid that integrates a heterogeneous fleet of EVs. A multi-objective scheduling optimization problem based on genetic algorithms has been presented in [
19] for microgrids including EVs to reduce grid loss and charging costs considering various constraints of the microgrid sources and EV charging characteristics. The authors in [
20] have presented an optimal model for an energy management strategy in a real microgrid, which integrates a PV system with storage devices, smart buildings and a plug-in EV. They have minimized the total costs of energy consumption by reducing the power supplied from the grid. A robust optimization has been described in [
21] and compared with stochastic optimization to minimize the economic and environmental costs of a microgrid, which integrates PV and EVs. They have proposed a mathematical model to study the uncertainty of EV charging behavior and PV power. A model predictive control has been depicted in [
22] using a smart charging strategy that takes into account the future EV charging demand. Their goal is to reduce the peak energy demand for an EV parking lot with PV sources. A multi-objective evolutionary particle swarm optimization problem has been presented in [
23] to minimize the costs and the overloading for high demands of grid energy for EV scheduling based on a day-ahead scenario.
A novel convex quadratic objective function has been proposed in [
24] to minimize the power loss of a microgrid in a two-stage optimization method with different penetration levels of plug-in hybrid EVs, studying the behavior of the plug-in hybrid EVs. The authors of [
25] have proposed a stochastic planning model as a convex programming problem to optimize the component sizes by minimizing the total cost of the EV charging station considering the uncertainties of PV production, EV charging demand, and different constraints. 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 dispatching to 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. The simulation results proved the benefits of using the proposed algorithm in reducing operational costs and emissions. An equilibrium optimization problem has been addressed in [
39] for optimum PV-storage system integration in a radial distribution network. Multi-objective functions have been addressed to minimize the cost of investment in PV and storage system installations, their cost of operation, the cost of energy not supplied, the power losses in the distribution lines, and the CO
2 emissions by the PV and the grid. The proposed method is compared with various techniques to prove its effectiveness. In [
40], the authors have proposed an equilibrium algorithm to optimally find the lithium-ion battery parameters, formulated as a nonlinear optimization problem. The proposed method was compared with various recent techniques to prove its accuracy; also, it has proved its closeness to the experimental measurement. An artificial hummingbird optimization technique has been presented in [
41] to find the unknown parameters of lithium-ion batteries used in EVs. The proposed method is compared with various recent techniques to prove its value and effectiveness. An experimental test was conducted, and the proposed technique had the highest degree of precision among the other techniques.