Optimal Sizing and Energy Management of Microgrids with Vehicle-to-Grid Technology: A Critical Review and Future Trends

33-02-98-03-84-00


Introduction
Last decades have witnessed a significant increase in worldwide energy consumption as shown by Figure 1a, which leads to huge increase in atmospheric pollution as depicted by Figure 1b. Moreover, the increase of fossil fuel cost and the depletion of fossil resources have pushed researchers and engineers in industry to explore and propose a more sustainable energy resources alternatives. Consequently, renewable energy resources (RERs) have been developed to comply with these issues [1,2]. Thanks to their wide availability and non-polluting nature, renewable energies have become the ideal solution to overcome the economic and ecological problems and to ensure electrical energy supply to isolated areas and villages. The advancement and maturity in RERs technologies, such as wind turbines, photovoltaic panels (PV), marine current turbines, biomass, and many others, the advances in power electronics devices, and the development in control and monitoring technologies have made their exploitation more feasible and very profitable [3,4]. The integration of the RERs was done through conventional grids and was connected to the distribution and techniques with V2G in load frequency control and regional EMS are developed in the ubiquitous power grid concept [18,19]. This paper is a critical review and analysis of several works on MGs topologies and components, energy management systems, and electric vehicles integration and its bi-directional energy management. The focus is made on electric vehicles integration into MGs by considering the V2G strategy for energy management in charging stations. Table 1 gives a summary of major papers dealing with the issues of MGs sizing, energy management strategy and V2G concept. Relevant review papers deal with a single or multiple aspects of MGs, which may be generation sources, energy storage systems, sizing, power and energy management systems, or comparisons between AC, DC and hybrid MGs while considering the V2G technology. Few works have brought together all the aspects Table 1. Main papers about energy management systems of MG.

Ref.
Main Contributions [22] In this paper, the optimisation and control techniques are presented and criticized in detail. Optimization methods are classified into several classes to allow the understanding of the advantage and disadvantage of each of them, and their use cases. The main components of the MG and its modes of operation are also presented. [23] The authors presented a comparative study of different EMS in MGs, classified the optimisation objectives, system constraints, solution methods and simulation software used in grid-tied and autonomous MGs. [24] In this work an agricultural investment in the Algerian Sahara is carried out. A hybridization is initiated with local renewable solar energy resource, mainly PVs. This work is limited to the hydraulic pumped storage system, which is effective due to its geological aspects and the subject matter. The proposed management strategy considers temporal solar energy and combines it with pumping and online fuel consumption optimisation. [25] Various configurations and contracts available for the purchase/sale of energy from/to the grid are analysed and compared. The results show the potential to reduce energy costs, pollution and grid reliance. [26] The study presents various functionalities of V2G, such as active power regulation, reactive power support, load balancing, filtering of current harmonics, etc. At the same time, disadvantages are presented such as, battery degradation, communication costs between EVs and the grid, as well as the need for upgraded grid infrastructure. [27] The authors developed models to compute the grid supply capacity of three types of electric vehicles. Several advantages are presented, such as increased stability and reliability of the power grid, reduced costs of the power system, and storage of renewable energy to overcome the intermittency issue.
[ 28] This work shows that there could be a good combination between EVs and power grids, providing an additional storage system. Excess energy produced by RERs can be stored in EVs for driving and released again when consumption demand increases.
[ 28] This work shows that uncoordinated charging causes voltage problems. Authors address this problem by adding a voltage constraint in the optimization model that makes the power bidirectional. [29] In the context of smart control strategies in the Kansai region of Japan, through scenario analysis, the authors evaluate the influence of the implementation of PV, electric vehicles (EV) and heat pumps (HP) in future smart grids. The system also contributes to emission reduction. [30] A flywheel storage system is used in this work. The authors model the autonomous hybrid system between the DG, wind turbine and flywheel. Results show that this storage system can improve the dynamic performance of the hybrid grid in several situations, such as wind power uncertainty, slow response of the DG and load uncertainty. [31] A DC MG based on supercapacity for energy storage is achieved. A control technique is developed for controlling a bi-directional converter that connects the grid with the supercapacity providing the switch and play function. It is demonstrated that supercapacity can reduce the impact of oscillations due to transients in resources and load. [32] The authors designed a multi-layer control allowing a better integration of the DC MG. The objectives are to avoid unwanted injection, to reduce the MG power fluctuations, and to lower the peak load of the network by using a predictive interface system.

Microgrids Main Components
In this section, the main components of the MGs are presented, which are DERs, loads, sensors and control devices, and communication tools. Regarding DERs, the focus is made on RERs and the energy storage systems (ESS). The main components of the MG are shown by Figure 3. Table 2 shows examples of sustainable energy systems, energy storage systems and load type in some literature reviews.  The integration of RERs depends first and foremost on their maturity. Researchers and engineers obviously opt for mastered technologies. The most mature RERs are:

DER, ESS and Loads in Microgrids
• Solar energy, which includes three types: photovoltaic panels, solar heating, and concentrating solar power; • Wind energy, where two types can be distinguished, onshore and offshore wind turbines; • Marine energy, such as wave energy converters, tidal stream, tidal range [3].
Several articles have focused on the development of these mature renewable resources in terms of sizing, control, energy management and efficiency improvement [4,41,42]. Many other renewable resources can be cited such as hydro energy [43], geothermal energy and bioenergy for electricity and heat, and Biofuels [3]. Moreover, more immature technologies, which are very promising but still in the early stage of development, are investigated by researchers and engineers such as salinity gradient, deep ocean current, ocean thermal energy conversion, etc. [4].
The projects carried out on MGs mainly contain the most mastered RERs at present days. PV is the most mastered renewable energy production technology. Seven types of PVs can be distinguished today, which are photovoltaic solar panels composed of polycrystalline cells, monocrystalline cells, amorphous cells, multi-junction cells, silicon-free photovoltaic solar panels in thin film CIS (stands for the elements copper (C), indium (I) and selenium (S)), air panels and water panels. PVs are the most adopted RERs in MGs, [7,[44][45][46]. In several MG projects, PVs are used alone as renewable energy source to provide the required energy to satisfy the loads. In second place, wind turbines are extensively explored within MGs. Currently, wind turbines available on the market are divided into two large categories according to the architecture of their electric generator: those equipped with an asynchronous generator (approximately 75% of the market), and those equipped with a permanent magnet synchronous generator (approximately 25% of the market). In several MG projects, production is only based on wind turbines as the renewable resource [47]. Other studies combine the two technologies in order to broaden the range of production, decrease the energy storage systems capacity for investment saving, and sometimes because of the modest availability of the solar and wind resources in the region where the MG is designed. For instance, the research studies in [13,[36][37][38][39][40]48] have combined both wind turbines and solar panels to design an MG in order to satisfy the load while fulfilling several constraints. Other renewable energies are used in other research works. Indeed, in [49], the authors have investigated the integration of tidal turbine for islands power delivery. Moreover, in [35], an MG based on biomass and PVs is designed to power a vegetable greenhouse.

Evolution of ESSs Technologies
Given the importance of storage elements in almost all energy fields, especially in MGs, researchers have devoted several works to develop new technologies and enhance the performance of the existing ones. Several storage devices can be distinguished today, which are classified according to criteria of duration, capacity and applications. There are short-, medium-and long-duration storage devices, such as flywheels, batteries and hydrogen and air liquid energy storage, respectively. Large and small energy capacity storage, such as supercapacitors and batteries, respectively. Starting with batteries, they are currently covering a very large part of applications thanks to the availability of several types of batteries, such as Lithium-ion battery (LIB), Sodium-ion batteries (SIB), Redox flow battery (RFB) and so on [50]. They are characterised by their average storage time, and capacity which is not very large, but they can be combined to increase their autonomy. Several studies have been carried out in this field in order to improve lifespan, specific energy, power delivery capacity (specific power), environmental impact and recycling. Due to their high energy density and energy-to-weight ratio, Li-ion batteries are widely used in defence, automotive and aerospace applications [51]. The Ragone plot compares different storage systems according to power density and energy density as shown in Figure 4. Unlike batteries, electrochemical (EC) capacitors can operate at high charge and discharge rate over almost unlimited number of cycles and allow energy recovery in heavier systems [53]. Flywheel systems are under development and include those with steel flywheel rotors and resin/glass or resin/carbon fibre composite rotors [54]. Hydrogen energy storage is seen as a transition vector by researchers. The surplus energy generated by intermittent renewable energy sources is used for the electrolysis of water in order to produce hydrogen. The hydrogen is then stored as a liquid or compressed gas for later use. The hydrogen can be produced, stored and used to produce energy and water using fuel cell technology during peak-energy demand [55].

Evolution of Loads
Loads represent the second part of the MG after the DERs. Several aspects are dealt with by researchers in order to optimise their consumption, improve their protection systems, but above all to limit the self-discharging over time. In some harsh circumstances, energy consumption can rise abruptly at any time of the day, and the DERs, including the ESSs, may not be able to meet the energy demand. To solve this issue, load shedding can be operated in order to ensure the power delivery to critical loads. Indeed, the idea is to shift some non-critical loads (shiftable) outside the high energy consumption period in order to shave peak demand [56]. On the one hand, loads such as electric water heaters, refrigerators, electric vehicles, washing machines and public lighting can be shifted to maintain active power balance and MG stability. On the other hand, other loads are considered as critical. Indeed, they need to be powered regardless of energy production, such as hospitals, military bases, heating systems and university residences. In [32], the authors have performed a load shedding to ensure energy balance in an MG. Two operating modes have been investigated: in the first mode, the load is critical and must be satisfied at all times, whereas in the second mode, the load is controlled; if it exceeds a certain threshold it is divided into two parts according to some criteria. One part requiring to be powered, and the second one can be shifted later. Load shedding has shown its influence on the whole system, peak loads have decreased, DERs operate less intensively compared to the first study. In [57], authors proposed a model for optimising controllable load shedding for emergency MG control. The model takes into account the efficiency of load losses and the cost of load shedding. The aim is to minimise the load losses and voltage fluctuations of all buses.

Evolution of Communication Tools
In MGs, communication devices are of paramount importance. Indeed, all control and monitoring units and processors need an efficient data communication system. The aim is to ensure continuous, fast, reliable and accurate data transfer between sensors and controllers without any disruption or disconnection. Communication tools can be expensive, so it is essential to reduce installation costs while maintaining reliable operation [58].
The communication technologies used for data transmission between smart meters and utilities fall into two categories, wired and wireless [59]. In some cases, wired solutions are preferred because they do not have interference problems and their operation does not dependent on batteries, as wireless solutions often do. On the other hand, wireless communications have certain advantages over wired technologies, such as easy connection to difficult or inaccessible sites and low infrastructure costs [59].
The improvement of communication systems has enormously contributed to the development of MGs. In [59], authors show the evolution of smart sensors installed on DERs and smart meters installed in consumers homes. Some very practical communication technologies with and without wires are presented in [59], with their advantages and disadvantages, such as ZigBee, Wireless Mesh, Cellular Network Communication, Powerline Communication and Digital Subscriber Lines. Figure 5

Evolution of Electric Vehicles
The energy transition emphasizes a double challenge for energy suppliers. On the one hand, they must succeed in widely integrating intermittent renewable energy sources such as solar and wind power without being able to store their production on a large scale. On the other hand, it is necessary to ensure the stability of the grid and the ability to respond instantly to consumers demand including EVs fleet, which is expected to significantly increase in the upcoming years.
Batteries in EVs can help in the management of the energy of MGs since they can be considered as potential energy storage devices [60]. They can, therefore, participate in the energy management of MGs by storing energy in the case where renewable energy production exceeds energy demand (Grid-To-Vehicle, G2V) and supplying energy to the grid (Vehicle-To-Grid, V2G) during peak demand periods [61], as shown in Figure 6. In order to achieve this revolutionary concept, several parameters have to be studied such as batteries sizing and charging stations sitting and associated power electronics. The idea, therefore, is to consider the battery of an EV as an extension of the distribution grid, a distributed energy storage devices from which the electricity supplier can draw energy at any time.

Conventionnel charging stations
Electric vehicle

Smart house
New generation of charging stations V2G concept presents many advantages. For example, a householder can use the energy stored in the EV's battery to power different appliances during peak hours or time slots when electricity prices are high; and the EV battery can be charged later at night (during periods of low electricity prices or low electricity use), when the electricity provider offers the lowest prices. This is possible only in some countries where the price of electricity varies during the day (dynamic pricing) and may be considered in the implementation of MGs in the near future. In the same way, the flexibility of the V2G will allow batteries to be charged during renewable energy production time slots making the charging stations more environmentally friendly. Moreover, V2G makes the electricity from renewable resources available when the supply offered by solar or wind power is interrupted (during night for solar energy, for instance) [62].
At the network level, the distributed storage capacity made available through V2G is used by operators to respond more effectively to variations in demand. It helps, for example, to absorb peak demand without load shedding, or to compensate for micro-disturbances that can occur when production switches from one energy source to another [62]. In this model, operators pay their customers for the use of their batteries: V2G thus enables the end consumer to reduce their energy expenses. Finally, the vehicle-to-grid contributes to the creation of a smart distribution network: a smartgrid, in which the flows are constantly optimised thanks to measurements taken at each link in the chain. Combined with the technical capabilities of EVs, the smartgrid logic enables islands such as Porto Santo or Belle-Ile-en-Mer to make very concrete progress on the road to energy transition [62]. Some possible applications of the V2G concept ara as follows: • Voltage and frequency control: -Voltage stability is maintained when there is a balance between reactive power supply and demand. EVs act, instantly, to regulate signals that could be separately handled by each EV. A battery charger is used to integrate voltage regulation. The EV charger can manage the charging current in such a way to have the necessary phase angle to compensate for capacitive or inductive reactive power [63]. The charging stations can be managed such that at a low voltage, EV charging stops, and it resumes when the voltage level is high.

-
Frequency stability is maintained when there is a balance between active power supply and demand. In [63], frequency regulation techniques are presented using large cyclic generators, but they are expensive. The rapid charging and discharging of EV batteries can offer an alternative to frequency regulation [27]. Three types of control to maintain stable frequency exist, which are primary, secondary and tertiary control as described in [64].
• Load balancing and peak power (load management): The bi-directional operation of the V2G system can manage the electrical charge, such that in peak hours it discharges, and it charges when demand is low, i.e., during the night and off-peak hours. In [65], a smart charging algorithm is developed to allow peak load management and to shift the consumption curve. Shifting the load can be achieved through load coordination, reducing the impact of the EV fleet on the grid. The objective of the controlled battery charger is to shift the energy demand and level the peak load. In [66], authors suggest that shifting the load curve by peak power control is the cheapest solution for load management. • Support to renewable energy resources: V2G can be a backup source for renewable resources during their low output, providing alternative energy production [25]. Centralized power plants need to reduce their production by decreasing the number of distributed generation units to restore the balance. Conversely, EVs can store excess energy produced by RERs when they are in peak production, and then be discharged and fed into the grid when demand is higher [28]. In [67], the authors show that distribution networks with smartgrids and RERs are much cleaner than other systems and save industries USD 3.58 per vehicle per day.
The V2G system has many advantages, but with the increase of the number of EVs, it could have a direct impact on the dynamics of the power distribution network and system performance by overloading transformers, cables and power supplies. This reduces efficiency and requires additional generator starts, and creates voltage variations and harmonics [68,69]. The resilience of the network, its reliability, the balance between production and consumption, the transmission of electricity from supplier to consumers, all this can be maintained by the ancillary services that are necessary in an electricity system. These ancillary services can be provided by the good quality two-way V2G system, as well as better voltage regulation and frequency control and efficient load management and spinning reserves. Each electric vehicle can be used separately or as part of a cluster [26].
In addition to V2G concept, energy players can develop a storage technology using second-life batteries. When a battery no longer meets the requirements of automotive use, it can, before being recycled, be used in a "second life" for the large-scale storage of electricity. A less restrictive mission and less demanding in terms of energy and power density. Indeed, the battery is considered as much more than a mobility tool. Once its automotive life is over, the battery's residual value is enormous and can be used for other devices that are less stressful than automotive use, such as stationary storage [62].

Microgrids Classification
The previous section showed the main components of the MG-the DERs, including ESSs, EVs, loads, and communication tools. These elements are brought together to give a reliable MG that is able to ensure the production/consumption balance. The design of the MGs follows an architecture that depends on the aplication, and MGs can be classified according to three criteria into three main classes. The first criterion is the type of power which can be AC, DC or Hybrid. The second criterion is the operating mode, which can be isolated or connected. Finally, the last criterion is the type of control, which can be centralized or decentralized. Figure 7 shows the classification of MGs based upon these criteria.

Type of Power
As soon as electricity has to be transported between production sites and consumption sites, alternating current became the leading technology. Its strength lies in the possibility of using transformers to bring it to high voltages in order to make its transport easier and more profitable. Generators, both AC and DC, produce electricity at relatively low voltage levels, which is impractical for long-distance transmission, or else it results in huge and costly energy losses. For this purpose, the use of the step-up transformer has become necessary, involving the use of AC [70]. Alternating current also offers a high degree of interconnection flexibility to form a strong grid network, which makes electricity supply more reliable. In the early days of electricity, the issue of reliability of supply was a major concern. Then, as production came closer to consumption, the problem of massive transmission over long distances became less acute [71]. The main advantage of the alternative: the flexibility of connecting loads and production on the power path. This advantage is particularly important if the transport corridor passes through a densely populated area and if production facilities are located along the route. On the other hand, the alternative is costly: the system described above is very expensive since, in reality, it requires the construction of an all-electric infrastructure from start to end [70,72].
The major disadvantage of AC is the presence of reactive power. When a line is loaded below its nominal power, reactive power is produced; without the addition of compensation equipments, the voltage can rise disproportionately. Conversely, a line loaded above its nominal power consumes reactive power and causes the voltage to drop sharply. From a reliability point of view, it is necessary to build an AC transmission line in the form of interconnected sections, combining series and shunt compensation, in order to carry the maximum power at all times [71]. The fields of control and protection also have their own particular constraints. It must be possible to eliminate earth faults on one phase without opening the circuit breakers of all three phases. The difficulty lies in the high capacitive current, generated by the healthy phases, flowing through the fault. This can be overcome with tuned reactances that minimise the induced current [71].
Direct current present several advantages. Indeed, DC is easier to transport over long distances. The converter stations (rectifier-side and inverter-side) can very quickly regulate the voltage/current values and thus the power flow. The phase shift between the transmitting and receiving ends is insignificant if the only connection is direct current. In fact, the connected networks can even operate asynchronously since direct current has no phase angle and is independent of frequency. In addition of that, the emergence of new DC systems such as PV and other household appliances and the reduction in battery prices have paved the way for DC microgrids [70]. Another advantage of direct current lies in its low cost of transporting very high power over long distances, with minimal losses (5% for 2000 km). Not to mention that it requires fewer lines and a smaller footprint on the environment: the transfer of 12,000 MW can be satisfied by two DC lines at 800 kV, whereas the alternative would require eight lines [71].
Nevertheless, the combination of a massive power transmission over an economical high-voltage direct current link and, in parallel, a lower-voltage alternating current network could, in many cases, offer an optimal solution combining low cost and high flexibility, as well as the possibility of supplying the consumer throughout the entire journey. However, this does not come without some technical problems: disturbances in the DC transmission will often cause the AC link to break as the phase angles increase [71].

Type of Control
As mentioned before, the key component of the deployment of a MG is the use of an optimal and efficient energy management, which can be provided by a centralized or decentralized control system. In the centralized control system, the control is provided by a single control unit, which manages the entire MG. It receives internal information from the system (from sensors), and external information (climate data) and keeps tracking the energy market, especially the price evolutions, and generates a solution taking into account all these data at the same time. Therefore, the computed solution is feasible and optimal, and meets the system requirements, because it is generated according to all the system constraints [73]. However, collecting all the system data in a single control unit results in too many errors, too many variables and equations. The system constraints are accumulated and the large number of variables makes optimization very difficult, very slow, and the system becomes more complicated to solve. This type of control requires a strong computational approach and especially a fast solver to generate the solution in real time [74]. Another disadvantage of this type of control is that the optimization may fail due to a problem in one component of the system, resulting in a loss of management and the shutdown of the whole system.
The second possible control structure is decentralized control. It is developed to overcome the shortcomings of centralized control. The advantage of this control is that each unit takes care of its subsystem locally, therefore it will have fewer tasks to perform [75]. The local unit collects the measurements related to its subsystem and analyses the query it receives from the global unit. Initially, this unit generates a local solution taking into account only the constraints of its subsystem, which reduces the number of variables and thus the computation time. After calculating the local solutions, the central unit uses these results to find the optimal solution for the complete system, without taking into account all the constraints of the system, nor the measurements made at the level of the sensors of the subsystems. The computation time is short, and the approaches used are more simplified, and sometimes they are linear, and do not require strong software for computation [73].
Decentralized control, despite its advantages, has some drawbacks. It requires several local control units, more sensors, more communication tools, and other facilities, and thus a more expensive investment. Moreover, the solutions computed by the local units may be rejected by the central unit, as they are not feasible and do not satisfy all the constraints of the system [73]. In [76], the two aspects are combined for voltage control from power electronic converters. Several advantages are presented: adaptability to failures and the possibility of overcoming them (fault-tolerant approach), uncomplicated implementation, good power and energy management and thus good efficiency.

Type of Operation
A MG can operate in a connected mode (ON-grid) or in an islanded mode (OFF-grid) to increase the reliability of the power supply by disconnecting from the grid in case of a grid failure [77]. Rural electrification and small islands are some examples of islanded MGs. Their capacity is in the range of a few watts to 10 MW. Larger islands, industrial sites, military sites, hospitals, data centers, and existing distribution networks are some examples of island and connected MGs, their power ranges from 500 kW to 10 MW [78]. Large transmission and interconnection networks carry very large quantities of energy over long distances, they are voltage regulated to reduce current (losses), voltage levels are between 225 kV and 400 kV and can go up to 1000 kV. Then, there are the regional distribution networks, the voltage level varies between 63 kV, 90 kV and 225 kV. Finally, the distribution networks serve the final consumers at medium or low voltages. MGs, as their definition indicates, contain loads and they are designed in populated areas, so they have lower voltage levels than the large transmission and distribution networks, they are connected to the low voltage (sometimes medium voltage) distribution networks, where the voltage level varies from 400 V to 20 kV.
Connected MGs have a point of interconnection (called a point of common coupling ) with the main grid, allowing them to operate in both modes. MGs with this characteristic of operating in both modes must switch from one case to the other in a smooth and transparent manner [79]. This ability to switch modes makes the system more resilient, and valuable in the event of failures [80]. These aspects of switching from one mode to another are not present in MGs operating only in island mode, and therefore, less constrained in the EMS. An MG has an infrastructure that communicates information between the central control unit and its other measurement and control parts, but in general, an infrastructure is installed in parallel between all these parts and the main grid operator [6].
In a grid-connected mode, voltage and frequency are controlled by the main grid control unit, making the management of the MG simpler, as it becomes like a secondary component of the main grid, and therefore only satisfies the instructions of the main unit. The only parameters to be controlled are those of the DERs, the loads, and the ESSs [81]. In contrast to this mode, the island mode is more complex; in addition to the above parameters, the voltage and frequency must be controlled at all components of the islanded MG. Among the major disturbances encountered in MGs, the involuntary switch from connected mode to island mode, which is added to other known disturbances, such as the loss of one or more DERs and short circuits [6].

Electric Vehicles Integration into Microgrids
The majority of EVs are parked mostly all the time. To cope with the high penetration of intermittent RERs, the concept of V2G is considered as a promising solution. EVs have many advantages, but they also have disadvantages, among them their high energy consumption. Indeed, charging an EV is equivalent to the consumption of a house in Europe or the United States for a day. So, the attractiveness of EVs is only guaranteed if the penetration of RERs is high [82]. Indeed, if EV integration is not followed by high RER penetration, an energy shortage is created. Nevertheless, the power system has to overcome this load increase, and negative consequences are expected, such as ageing of power system DERs, degradation of ESSs, or even lack of energy at charging stations. EV charging stations can be categorized into two main classes as depicted by Figure 8 [83]. EV charging can be done in three ways: uncontrolled charging, dual rate charging, and smart charging, which is the cheapest but requires tracking and management [84]. Staggered charging times can help save the operation of the electrical system, and do so safely. The practice of load time staggering can save up to 5-35% of critical capital costs and reduce losses by up to 40% [82].

Network and EVs Constraints
The increase in the number of EVs in the grid has some impacts on generation and transmission, but especially on the distribution system because of the location of charging stations and EVs during the day. Loads and power losses are the most important parameters to control in a V2G system. For the loads it is necessary to reduce or eliminate fluctuations, and to improve the power quality in terms of voltage stability, three-phase unbalance, harmonics, etc. The planning of the network, its efficiency, reliability, benefits for the EV owner, and comfort, are addressed by the proposed model in [85,86]. Therefore, the works dedicated to V2G concepts is mainly focused on the optimisation of harmonic pollution and load fluctuations. Despite the significant attention from researchers, the V2G technology is still a new concept in smart MGs. The most studied aspects related to this concept are: To date, the economic feasibility as well as the overall structure have been addressed in several papers, however little work has been conducted on the implementation of the V2G concept. Willett in [27] has performed some work on the calculation of system capacity, and has also dealt with network stability problems in the case of very large integration of RERs. In [87], Dirk has investigated the impact of storage by EVs and shown that their capacity can be sufficient and may replace static ESSs. However, the location of EVs and charging stations remains a concern to be improved. Another technique is presented in [88], which uses EV storage to overcome peak loads. According to [89], the V2G implementation can be divided into four categories based on the different characteristics and methods of powering EVs: • Centralized implementation: the network controls all the system including the EVs. This category is applicable for systems with very large charging stations. • Stand-alone implementation: it does not allow for unified control. However, the features are flexible, convenient and not dependent on time or location. • Implementation in an MG: The EVs are integrated to perform V2G just in one area.
There is no exchange with the main network. It can ensure self-sufficiency in this area. • Battery replacement: reducing the number of storage batteries by integrating more EVs into the system. The interest is to minimize the initial investment and maintenance cost.
The issues to be addressed by the V2G concept, can be summarized as [90]: • The distribution of charging stations, and EVs. • The management of EV charging, which remains complicated due to the unpredicted use of EV by users. • The bidirectional charging, requiring a low-loss charger. • The impact of the V2G concept on batteries performance (battery degradation, reduced life cycle, etc.).
The literature indicates that the initial source of the two major problems associated with V2G, which are harmonic pollution and load fluctuations, is the bidirectional charger [90]. Indeed, conventional chargers operating in one direction only, has problems with harmonics. Therefore, the new chargers between the grid and the EVs must not only work in both directions, but they must also eliminate harmonics. The objective is to find the right topology to design chargers that can add value to the V2G concept, such as improved efficiency, economic optimisation, harmonic elimination, and reduced number of static ESSs, while remaining stable and resilient to external disturbances [90].
Regarding chargers, two levels of charging are mainly focused on: slow charging, which lasts a few hours, and is done at home or at work. Fast charging, which lasts a few minutes, and is done in public places [82]. The current networks are AC, so to supply the batteries of EVs which are DC, a transformer, rectifier and chopper must be added. This chain of converters increases the investment cost as well as the heating losses. The efficiency of the system may decrease especially for fast charging, which requires high current and voltage, the size and volume of these converters are not negligible.
The research activities for control in the V2G system are based on several objectives: optimisation of the operation to reduce cost, reduction of losses, minimisation of load variation, and good energy planning for the EVs. Solutions to these issues are separated into two categories: • Use smart approaches to manage the operation of all EVs. An algorithm is proposed in [91], which showed some drawbacks as it makes the problems more complicated and does not take into consideration the proprietary side of the EVs. • Use a decentralised model as in [17]: the principle is to put an intermediate system.
Each area containing a number of EVs is managed by a management system, so the main network will not handle the details of each EV.
The research carried out has not taken into consideration all the actors in the V2G system. The users of EVs are one of the most important actors in this concept, they must be willing to be part of this energy management program. Currently all the work requires that users accept the developed network management, while in reality this management may not satisfy all users. When energy is exchanged between the EV and the grid, whether in one direction or the other, each EV is seen separately from the other EVs. This is because this exchange is not done in the same way for all EVs. It changes from one EV to another. It depends on the real time and future status of the EV, which is mainly the battery charge level, its location with respect to the charging stations, and the distances the vehicle will travel, and in some countries it depends on the electricity price [90].
The uncoordinated loading of EVs is at the root of these problems [90]. As the network gets larger, the number of EVs increases, making the system more complex, due to the randomness of the EV as explained. Research that has attempted to address this problem includes pilot studies at the technical level, ranging from studying the influence of the randomness of vehicle charging to measuring the benefits of discharging energy from the vehicle to the grid [90]. Another key point that is a key lock for the development of the V2G concept lies in need for real time information, which facilitates the forecasting of consumption and pricing. For this purpose, the advanced metering infrastructure is indexed as a promising solution, because it allows to connect both the smart metering unit and the real-time communication medium [82].
Finally, there is not much systematic work to solve these problems, and even less for energy pricing in both directions. Solutions need to be found that encourage users to participate in this concept, offer more benefits, keep users' EVs in good condition (the vehicle's battery) and especially provide an interest in the energy price between charging and discharging (price incentives).

Power Quality Standards
The power quality that medium voltage and low voltage networks must provide to users is referred to in several standards [92]. Both the International Electrotechnical Commission (IEC) and the Institute of Electrical and Electronics Engineers (IEEE) define power quality standards such as the IEEE-519 and IEC 61000-4-30. Moreover, the European standard EN 50160 describes the phenomena that can degrade the power quality of the electrical network (UTE 2000). The power quality disturbances include the variation of frequency, amplitude of the supplied voltage, voltage dips, short and long interruptions, temporal and transient overvoltages between phases and earth, harmonic and inter-harmonic voltages, transmission of information signals on the network and unbalance of the supplied voltage. The standards for charging infrastructure are set out in Figure 9. These standards provide the requirements for charging infrastructure in terms of electromagnetic compatibility (EMC), energy storage, low-voltage safety, and communication between EVs and the power grid. Among the standards applicable to EVs, ISO TC22 Road vehicles regulates everything that concerns the EV as a means of transport (braking, power, energy consumption, frontal and lateral impacts, safety, etc.). The applicable standards on fuses and circuit breakers are EU2006/95EC, EU2004/108/EC, IEC TC64 and IEC TC 57. The storage cell standards that apply to batteries are EN 1175, EN 50272 and J2464, in addition to those related to their safe handling such as ISO 12405, ISO 6469, IEC 61982 and J1495.
Three standards are directly related to EV charging stations [93], which are: • IEC 61851, which regulates:

-
The non-isolated charging system for electric vehicles that defines the charging modes; - The types of outputs from the charging stations (both AC and DC) to the EV; -Safety requirements for EMC and for the connector socket.

Main Contributions Regarding V2G
The V2G concept requires three elements to be realised: The vehicle must be connected to the network for energy transfer, communication between the vehicle and the network to receive the command and the measuring devices for the command [95]. The V2G system can be used with hybrid EVs, fuel cell EVs or pure battery EVs [95]. In [96], an analysis of hybrid vehicles is made for different consumption cases: peak consumption, base consumption, spinning reserve and regulation services.
Several control works have been proposed for a safe and optimal operation of the V2G. Various authors around the world have studied the challenges posed by the V2G and the different management techniques. In [97], the impact of the bi-directional charging of the Li-ion cells of EVs was proposed to determine their performance. Paper [98,99] discussed battery technology and V2G technology policy. A methodology is developed to manage battery degradation and extend the life of the battery used in EVs. In 2015 Habib et al. conducted a study on the impact of EVs on the electricity grid by benchmarking the charging strategy of an EV in addition to V2G technology. They also stated that the charging strategy and aggressiveness of the vehicle could make V2G technology economically viable [26]. In [100], Birnie conducted a study examining parking in the United States and New Jersey and determined the driving needs that could be met by solar power only in summer using a simple approach. A similar study performed in [101]. Indeed, authors considered the possibility of providing parking in workplaces in the USA, Ohio, Columbus, Los Angeles, and CA. The system showed that it is efficient in terms of billing and carbon dioxide emissions.
Many studies have considered EV fleets at another urban or regional level. Among these studies is the project carried out in the Kansai region of Japan [29], which uses a smart charging method, combining one million EVs with one million heat pumps to reduce excess solar energy by about 3 TWh. The research work in [102] showed that batteries have almost no impact on the grid because they the capacity is small.
There are many socio-technical obstacles to the development of V2G due to its wide deployment [103]. In [27], Kempton and Tomic conducted a research to assess the economic aspects of V2G. They expressed the battery energy life as a function of several parameters, such as battery cycle life, battery capacity and density. In [104], Ekman examined the benefits of EV fleets for the high penetration of wind power in Denmark.

Microgrid Sizing
The type of power is the first criterion to be chosen before designing the MG. Indeed, an AC MG does not have the same operating conditions as a DC MG. Therefore, the two microgrids type do not have the same architecture or energy management strategies. Moreover, MG sizing involves other aspects that should be handled, which include conversion efficiency, transmission efficiency, control, calculation methods, the need for adequate loads and finally the protection systems [105]. A general structure of AC and DC microgrids with renewable resources are provided in Figure 10.
MGs contain AC and DC components at different voltage levels, which requires the addition of converters between each component and the rest of the system. In AC MGs, PVs, batteries, DC loads and all other DC components are connected to DC/AC converters, while other AC components, such as wind turbines, AC loads and the main grid (AC in general) are connected through AC/AC converters so that they are at the same voltage level and frequency as the overall system. In contrast, in DC MGs all components are connected to a fixed voltage DC bus. The DC components pass through choppers (DC/DC converters) to have the same voltage as the DC bus. The other AC components are connected to rectifiers to rectify their voltage to DC voltage.
The role of the converters is not only in the conversion of voltage, they are the point of action for the control of the whole system. The guidelines generated by the EMS are sent to the converters to achieve the optimal operating point. Power electronic devices keep the voltage constant to ensure the safety of the network, switch the DERs ON or OFF, and vary the current intensity at the output of the RERs according to the power reference required to achieve the generation/consumption balance.

Components Sizing, MG Siting and Operation Scheduling
Starting with the first point, which is the choice of DERs and the location of the MG. The designers of the MG must obviously choose a location that is suitable to be the one dedicated to energy production. It must be rich in renewable resources, and easy to access, and above all the power lines of the network must serve the customer areas [106]. Once the site is appropriately chosen, MG designers must select the best available DERs to meet the loads in a given area [106].
The energy production and storage equipment must be designed in such way that it is capable of supplying the load at any time and especially at any level. For this reason, the DERs must be sized according to peak demand and profitability criteria. Adding to the DERs sizing, the choice of fuel types adapted to the DGs, which is a critical issue with regard to the profitability and reliability of the system. A good initial investment may cost a little, but it will play a very important role afterwards, not only in satisfying the load, but also in earning more than one has invested. For this first point, several objectives need to be achieved: high cost-effectiveness, high profitability, low environmental impact and high reliability, but also low power losses [106].
Scheduling focuses on the planning of available resources, such as DGs, RERs and ESSs. The objective of scheduling is to minimise operational costs, environmental impact and maintenance cost while satisfying the load. Using different optimisation techniques for one or more objective functions, optimal operational conditions are dealt with for different micro-grid configurations in [106].
Optimal sizing is a very important factor for a reliable low power supply. Several algorithms exist for the computation of the size of power systems. Optimal sizing techniques are divided into three classes [107]: classical approaches, modern approaches and computational software. Currently, modern approaches are more suitable than classical approaches, due to their ability to solve and optimise complex models. In addition, these approaches are combined to formulate a hybrid algorithm to provide more promising proposals [108,109]. Calculation software such as HOGA, IHOGA and HOMER are the most widely used in the literature for MGs design. The simplest techniques are the deterministic approaches, citing: analytical, numerical, iterative, graphical construction methods.
Heuristic and metaheuristic algorithms are also used for sizing, for example: the firefly algorithm, particle swarm sizing, the grey wolf technique, the Cuckoo search approach and genetic algorithms [110][111][112][113][114][115]. The only drawback regarding these approaches is it does not allow intuitive selection of network components. They are used under some assumptions as discussed in [116,117]. The mentioned tools are used to perform comparative studies to investigate the sensitivity of the design results in [118].

AC Microgrids Sizing
For various advantages, the AC MG has gained attention over the DC MG in the emergence of smart grids. AC MGs allow the use of RERs like DC MGs, but also nonrenewable energies, such as diesel generator. The initial investment of an AC MG is more cost-effective in terms of the price of the devices, as they are available in large quantities and of good quality for all sizes of MGs, all over the world, from all companies. To connect to another conventional grid, AC MG is more recommended, as most grids are conventional and sometimes contain only fossil resources [119]. AC MG is reliable and has proven to be resilient in both populated cities and rural areas.
The presence of outages and disturbances does not have a great impact on a well-sized AC MG, as it can easily scale up production to overcome this problem. In islanded mode, the AC MG can operate with fewer grid-related constraints. Although AC systems are mature and controllable when installing overhead power lines, the management system remains complicated in an MG context, especially in terms of frequency control, and requires the designers to integrate sensors on all devices so that they are all synchronized [119]. In the design of MGs, the safety aspect is of great importance. In AC MGs sizing, the most effective protective devices are: (i) overcurrent relays, (ii) reclosers, (iii) disconnectors, (iv) miniature circuit breakers and (v) fuses. Currently, in low voltage distribution systems, the most commonly used protection schemes are: (i) fuse saving schemes, (ii) fuse blowing schemes, (iii) instantaneous reclosing and (iv) delayed reclosing [120].

DC Microgrids Sizing
The remarkable return of DC devices has favoured the design of DC MGs. However, instead of installing several converters, which will affect the accuracy of sizing, it will be better to design a DC MGs to reduce the number of converters, and therefore decrease losses. When sizing a DC MG, there will be fewer converters and therefore fewer loss calculations to take into account. On the other hand, DC/AC converters are added, but due to the high infiltration of DC equipment, the elimination of AC/DC converters is more important than the addition of DC/AC converters. For the same amount of power, a DC system requires smaller line cross-sections, as they carry a lower current than AC systems, due to the power factor. By minimising the current, the losses will also be reduced [121]. In a DC system, even if it does not need reactive energy, some of its components do. The AC equipment must therefore be properly sized to compensate for the reactive energy. Protective elements remain a problem in DC MGs, as they are immature and too costly. In [122], Bosch presented a new design of DC MGs with PVs as DERs to power DC loads. The aim is to design a reliable system with minimum converters. The results show that this new concept significantly increases the energy efficiency, which would be lower when using an AC MG for the same PVs and load.

Energy Management Systems
An Energy Management System (EMS) is a group of information technology tools used by power grid management units to control, monitor and optimise the performance and cost of power generation and the power grid while ensuring its continued operation [123]. Figure 11 depicts the main EMS architecture providing an insight on EMS inputs (weather forecasts and energy market), components (DERs, ESS, EVs, Loads, etc.), sensors, control, protection and monitoring devices.
The International Electrotechnical Commission, in IEC 61970, defines an EMS as "a computer system comprising a software platform providing basic support services and a set of applications providing the functionality necessary for the efficient operation of power generation and transmission facilities so as to ensure adequate security of energy supply at minimum cost" [22]. The problem of MG optimisation generally encompasses the following points: • Minimizing the operating costs of the micro-grid; • Maximising the output power of the generators at a given time;  Figure 12 describes all the aspects related to energy management systems in MGs. In general, an EMS problem leads to a constrained non-linear mixed-integer optimization problem, which can be relaxed to linear optimization problem. It can be solved using linear or non-linear methods, which can be implemented using available software such as Matlab, HOMER, etc. Several cost functions can be considered such as investment cost, operating and maintenance costs, losses cost, emissions cost, etc. The objective is to find the optimal values for decision variables that allow minimizing the cost function considering actual measured data (weather forecast, energy market, load demand, etc.) and fulfilling the constraints of the system. Specifically, the following subsections present a discussion on the objective functions of EMS, electrical network constraints, optimization methods, and software for optimization problem solving and MG optimal planning.  Figure 12. Energy management strategies of MG.

Microgrid Optimal Operation and Resilience
As discussed in [124], the objective of the EMS is to generate appropriate setpoints for all energy sources, storage and loads, so as to maintain an economically optimised energy mix to meet a certain load demand at a certain point in time. Since renewable energies always change according to climatic data (wind speed and direction, solar irradiation and ambient temperature, etc.), production forecasts and some fast online algorithms are used to define the availability of energy and, finally, to define the signals for optimised power distribution to loads.
As a result, energy management has to find an energy plan for one day or several days in advance. An intelligent energy management system is therefore required to enable short-term planning of energy allocation at minimum costs based on power generation and load demand. The EMS optimises the operation of the MG according to market prices, DGs offers, predicted generation, and expected loads. Based on these data, EMS sends signals to the controllers of DERs to be engaged, and if applicable, to determine the level of their production.
In order to increase the resilience of the MG, and to ensure a continuous and uninterruptible power supply, the MG must be able to meet the maximum demand of the load. Several aspects come into play, such as weather forecasts, the correct sizing of equipment and the appropriate optimisation methods. The management of RERs depends primarily on weather forecasts, which reduces the efficiency of RERs and can lead to an imbalance in the demand/consumption balance. Several studies are, therefore, interested in developing new methods for predicting weather data more accurately [125]. In [126], Obara and El-Sayed have developed an algorithm for optimal operation of a composite microarray using numerical weather information. This prediction is, then, used to minimise the fuel consumption of the system by developing a genetic algorithm (GA). As a result, energy production was not 100% accurate, but the fuel consumption was reduced. In [127], Ricalde et al. introduced some methods of weather forecasting as a function of the time interval of standby periods. Authors used Artificial Neural Networks (ANN) as a good approximation for non-linear and stochastic models. The multi layer ANN architecture is developed and formed with the Levenberg-Marqurardt backpropagation algorithm. The advantage is that these methods can predict with a considered accuracy the meteorological data, even with a lack of data.
A system that forecasts the load demand and availability of energy resources of micro grids is designed in [128] by Jaganmohan et al. It consists of three levels, the first being short (daily), medium (seasonal) and long term (annual). The system adapts an ANN function to forecast at the same time the demand and availability of energy resources in different situations and at the scale of the previously mentioned three levels. The contribution is remarkable, especially at the annual level, as the method gained experience by following the evolution of the daily and monthly loads.
The EMS must be able to ensure the proper operating of the MG while minimising a cost function. The cost function differs from project to project. It includes the cost of operating the MG, the cost of degrading the ESSs, the cost of degrading the DGs, the cost of CO 2 emissions, the cost of losses, the cost of the energy transaction, and the maintenance cost. The latter is refereed to in the literature as system resilience and self-healing capability. Resilience refers to the ability of a system to react to unexpected events by isolating the elements that cause a problem while allowing the rest of the system to recover and return to its normal operating regime. These self-healing operations result in fewer service interruptions to consumers and help service providers to manage the electricity distribution infrastructure in the best possible way [129].

ESSs Constraints
The deployment of ESSs in MGs is essential to ensure continuity of supply to the load, and to increase the efficiency of the system. Three criteria are related to ESSs as discussed in [130]: their location, their sizing and their optimal operation. Location and sizing are necessary to overcome peak loads. Moreover, with good operational management, ESSs facilitate the integration of DERs including RERs, and minimise MG expenses.
The required storage capacity of the ESS can be determined using the autonomy of each component in number of days (e.g., batteries), which means the maximum time a component can continuously provide energy without being recharged by the MG energy sources. Furthermore, the tolerated threshold of discharge level (depth of discharge) of each energy storage component is of paramount importance. System voltage is typically involved in ESS modeling for grid voltage regulation [131]. The calculation of the number of each ESS needed in the MG is based on the storage capacity of a single element, its efficiency, the efficiency of the converters connected to that element [131].
The cost of the ESSs is part of the initial investment of the MG, which confirms the importance of sizing all components. This cost is calculated as the sum of the single price and the annual maintenance cost [51]. The single price means the purchase price of the ESS in relation to its lifetime, as well as the cost of its installation. The purchase price of the ESSs and their installation is a variable value depending on the size of the ESS. The maintenance cost per year is also a variable cost proportional to the size of the ESS [51]. To size the ESS, the main objective function is to reduce the total cost function taking into consideration both the investment cost, te operating and maintenance costs, and the discount rate. Conversely, the objective function may be to maximise the total profit [51].

Software for EMS
Several software and programming languages are used for EMS implementation on MGs, including tools for simulating the operation of MG components, tools for sizing and siting, and other for solving optimization problems such as rule-based techniques or optimisation approaches.
An energy management simulation tool called WindSim is used in [132] and used for computational fluid dynamics for wind prediction and wind turbine power. It optimises the placement of wind turbines in onshore and offshore wind farms. In [133], authors have used a software package called PVsyst to simulate the efficiency of PVs and solar installation. PVsyst is designed to be used by engineers, researchers and architects for the design of MGs. PSCAD/EMTDC is used in [134] to simulate a suggested control strategy for MG. The advantage of PSCAD is that it simplifies construction, simulation and modelling, offering unlimited possibilities for electrical system simulation. It has a comprehensive library of system models, making it one of the preferred tools for researchers. The General Algebraic Modelling System (GAMS) is a modelling system with efficient optimizers to solve complex and large-scale mathematical programming and optimization problems [135]. In [136], a linear programming in GAMS is carried out by L. Majić et al. for economic studies of two MGs consisting of thermal and electrical loads and cogeneration units. Moreover, in [137] Chen et al. make an economic analysis, formulate an optimisation model and determine the optimal operating strategies for intelligent MG systems. The optimisation model is formulated as an integer programming model using GAMS and the resolution is done by the CPLEX optimiser. CPLEX is among the most efficient solvers of GAMS; CPLEX is useful for large-scale linear programming, integer programming and quadratic constraint problems. The outputs of GAMS and CPLEX provide optimal investment and operating solutions with cost reduction. Software called Versatile Energy Resource Allocation (VERA) is used in [138] by Khodaei to minimise the total cost of system planning. It also makes a prediction of demand coverage based on local weather conditions. MATLAB is widely used for MG simulations and optimal operation design. The HOMER software is widely used for MG modelling purposes. In [139], Nayar et al. presented an innovative hybrid wind-electric/vehicle/diesel system implemented on three remote islands in the Republic of Maldives. Authors used HOMER to undertake the planning of the renewable energy system and to analyse the different options. It took into account the cost of the per unit of the consumed electricity, the fuel saved and the initial capital requirements. This software simplifies the study of MGs, and has contributed greatly to the design of MGs, and is the most widely used software.

Optimization Methods for EMS Problems Solving
The term "optimisation" means a group of mathematical techniques oriented towards the selection of an optimal solution, while respecting the system criteria, among other available alternatives. Indeed, optimisation aims at calculating the best available values of a given objective function in a defined domain under a set of constraints, including a wide range of objective functions and domain types. Different disciplines are included in computational optimisation such as mathematics to formulate the model, operations research to model the system, computer science for algorithmic design and analysis, and software engineering to implement the models, and are introduced in [140].
The optimisation process is described as an iterative procedure, which essentially consists of an optimizer and a model [141]. For a given problem, the model identifies objectives, variables and constraints [142]. An iterative sequence continues between the optimizer and the model. The optimizer retrieves the model with a set of values of decision variables, while the model performs the calculation of the objective function and constraints. This information is used again by the optimizer to compute a new set of decision variables until a stopping criteria for the optimization algorithm are satisfied [141].
Computer optimization techniques include optimization algorithms, iterative and heuristic methods. The type of problem to be optimised decides which optimisation algorithm should be adopted. At the same time, there are many different classifications of optimisation problems, depending on the type of decision variables, objective functions and constraints. In [142], different categories are defined, such as: continuous and discrete, global and local, constrained and unconstrained, stochastic [143] and deterministic, multimodal and multi-objective, and heuristic and meta-heuristic optimisation approaches [144].
Sometimes an optimisation method may not find the optimal solution. Often, real systems are impracticable optimization problems due to the characteristics of the problem. For example, in a Linear Programming (LP) optimization problem, when all unknown variables must be integers, the problem becomes an Integer Linear Programming (ILP) or, Integer Programming (IP) problem. IP problems are, in many practical situations, Nondeterministic Polynomial-time hard (NP-hard) [145]. Unlike linear problems, which can be solved efficiently, NP-hard problems may require a very large computational time to obtain the optimum, resulting in exponential times for practical reasons. Thus, in recent years, the optimization community have proposed a lot of optimization approaches; such as approximate methods (including heuristic and metaheuristic approaches) to solve optimisation problems. Heuristic methods have been developed with the aim of choosing the right solution from a large set of solutions, that can be implemented with a minimum computational effort as optimisation techniques [146]. When classical optimisation techniques do not provide the optimal solution, heuristic approaches will be useful for optimisation problems. Metaheuristics are used to find an optimal solution from a discrete search space. The advantage of metaheuristics is that it can combine more than one heuristic method: the first is used to find a primary solution, and then a second can be used to find the best solution [106].
In general, the way of classifying metaheuristic algorithms is based on trajectory and population-based methods, but there are other classifications. In [106,147] In addition of that, other types of metaheuristics can be considered, such as hybrid metaheuristics, which combines other optimisation approaches, and parallel metaheuristics, which carries out several metaheuristic resolution in parallel [106]. For some very complex systems, no heuristic neither metaheuristic method can lead to precise solutions in short resolution times. Parallel computing is therefore an interesting way to obtain good solutions with short run times. Parallel calculation, as its name suggests, performs several calculations in parallel, such that large problems can be broken down into several sub-problems by performing many calculations, simultaneously. Common problems encountered in parallel computing for MG applications are Monte Carlo simulations [106] and dynamic programming [106].
The EMS is based on a mathematical method to compute the best solution for energy dispatching while satisfying grid and ESS constraints and production/consumption balance. Optimisation algorithms are therefore only mathematical techniques developed to solve complex problems. In the ideal case the problem is linear and easy to solve. However, in general the problems of optimising physical systems and especially MGs are non-linear systems that require a strong method to solve. Some the most suited methods for energy management of MGs are presented in the next subsections and advantages and disadvantages of these optimization methods are presented in Table 3.

Linear and Non-Linear Programming Methods
Non-linear optimisation solves optimisation problems whose model is non-linear, i.e., the equations defining the system are non-linear. A code based on linear programming for the energy management of a MG is adopted in [148] allowing optimal planning of the operation of DGs, and their optimal distribution while respecting the operational and economic constraints imposed by the purchase and sale of energy. Furthermore, it allows finding the optimal destination of controllable and non-controllable loads. In [149], an efficient algorithm is presented by Taha and Yasser, that is based on a predictive control model for an island MG. Their objectives are: cost reduction, electricity consumption and gas emissions reduction at the output of the DGs. They therefore have a multiobjective optimisation model with MILP. Vafaei and Kazerani used traditional optimisation techniques in [150] to select and size DERs and ESSs for a MG to minimise operational costs. The formulated optimisation model is a MIP (Mixed Integer Programming) problem in the GAMS environment. In [74], Daniel et al. determined the optimal functioning of the MG by using an extended evaluation and recourse horizon that allows a correct distribution of ESSs. To have a linear formulation, they decompose their problem into two stages, the first is a unit commitment problem and the second is an optimal power flow problem.
Gerro et al. [151] found a multi-objective hierarchical control solution based on an integrated cost and emission optimisation algorithm, adapted to the needs of small remote villages, from solar energy. A control loop is developed for the management of storage elements to notify consumers when prices are reduced by investing in increased storage capacity for the village microgrid. Hossein and Elnaz in [152] developed a stochastic model to increase profits and decrease imbalance costs by taking into account the uncertainties of wind turbine production, solar systems, consumption, market prices in the previous 24 h and imbalances. A new neural network method is used to predict the production of PVs and wind turbines. An energy management system in an interconnected MG is proposed by Tim et al. in [153]. The grid has been integrated with a photovoltaic system and the constraints must meet demand. The model is a centralised approach based on the concept of flexibility for end users. They use quadratic programming to achieve the most optimal economic allocation. Bahramirad et al. proposed in [154] a model of the optimal sizing of the energy storage system for both initial investment and expansion problems. The problem is addressed from an economic point of view, using a mixed integer programming (MIP) approach in order to optimise investment in the operating costs of ESSs and MGs. Mohsen et al. proposed in [155] a technique to distribute ESSs in grid-connected MGs to reduce the operating cost. Therefore, a multi-objective problem is formulated to generate the optimal charge/discharge activities of the storage based on consumption forecasts. Then, the costs of the individual MGs are added together to have a single cost to minimise. The problem becomes a single objective optimisation problem. From the non-linear model, an equivalent linear program without binary/integer variables is driven that is easy to solve. Table 3. Advantages and disadvantages of optimization methods for EMS.

Advantages Drawbacks
Linear programming methods It allows an optimal use of productive resources. It improves the quality of decisions by providing possible and practical solutions.
The objective function and the constraint equalities or inequalities must be linear, which is not always possible.

Non-Linear programming methods
It relies on simplified techniques to solve complicated problems. It gives several possible optimal solutions, which is an advantage over the mixed-integer linear programming (MILP) formulation.
The computation is done in several iterations, and it is therefore computationally expensive.

Heuristic methods
It performs decision making faster and simply through shortcuts and good calculations using rules of thumbs such as intelligent guessing, trial and error, process of elimination, past formulas and analysis of historical data.
The end result may not be the optimal solution, the decision made may be inaccurate and the data selected may be insufficient.

Stochastic methods
It is completely explicit about the assumptions made, and it allows these assumptions to be tested using a number of techniques. As it models random variation in decision variables, it is possible to estimate the uncertainty of these variables and the optimal solution found.
It may be based on very simple and unrealistic assumptions. Its model is too computationally complex to implement and requires quite extensive statistical and computer skills than some simpler deterministic models.

Dynamic programming methods
Dynamic programming divides the main problem into several less complex problems, which can be solved more easily from the smallest to the largest by keeping the intermediate solutions.
Solving problems recursively makes the process a bit complex.

Fuzzy logic methods
The structures of fuzzy logic models are not complex, justifiable and robust because it does not require exact information sources. It can be programmed according to the circumstances in case of sensors failure.
The results are not always accurate. They are therefore perceived as depending on suspicions, sometimes this reasoning is confused with the probability hypothesis.

Neural network methods
Artificial neural networks perform several calculations at once, can give results even with a lack of information thanks to its automatic learning process and its ability to generalize.
It needs processors with parallel processing power, according to their structure.

Multi-agent systems methods
This approach increases the efficiency of the solution mainly through the application of negotiation rules, evaluation, and coordination.
This technique complicates a scheduling problem as it has to decompose criteria for each individual agent.

Metaheuristic Methods
Heuristic algorithms are inspired by nature, they imitate the behaviour of living species (ants, bees, etc.) and collect current information to make a decision and find an optimal solution that must be verified afterwards, and it gives a prediction on how the next state of the event will be. Ogunjuyigbe et al. studied in [131] a multi-objective optimization, trying to reduce costs of the life cycle, dump energy and operating of the MG. The authors use a genetic algorithm to develop a technique to find the optimal location of renewable generation and ESSs in the MG. A MG consisting of wind, fuel cell for storage, DG and electrolyzer is analysed in [156]. The role of the fuel cell is to overcome the intermittency problem by providing energy when wind turbines are not cost-effective and to allow optimal operation of the DGs. They use a particle swarm optimisation algorithm that allows the stack to operate when consumption is immense, to reduce the operating costs of the DG by 70%. In [157], Zhimin et al. proposed a new methodology based on GA to enable high integration of PVs in low voltage networks with batteries as storage element. Their objective functions are: minimising energy cost for customers and releasing distribution network constraints for distribution network operators. The proposed concept has been adopted by Western Power Distribution in the SoLa Bristol smart grid demonstration project. A very interesting idea is proposed in [158] by Kirthiga et al. by developing a methodology for transforming a distribution network into a MG capable of operating autonomously. The authors use PSO and GA to find the optimal sizing and sitting of distributed generators to make MGs autonomous. Other objectives are achieved such as the optimisation of losses and system costs, while respecting network constraints such as load and network constraints, and generator and balance constraints.
In [159], Gwo-Ching developed a quantum genetic algorithm to confirm the validity and accuracy of a mathematical model using real examples for a system containing PVs, wind turbines, water turbines, a fuel cell, gas turbine and a micro gas turbine taking into account different energy efficiencies of the DERs, the operation and maintenance costs and the emissions cost. A study on the optimisation of a MG is presented by Li et al. in [160]. They used the particle swarm algorithm, which can operate a MG in connected or isolated mode. Fluctuations in renewable sources and consumption demands in the MG are taken into account by the method, with appropriate predictions made one day in advance to eliminate these fluctuations. In [161], Fatemeh et al. used a backtracking search optimization algorithm to optimize their MG. The proposed algorithm quickly converges to the optimal solution and avoids local optima. Their objective is to track the uncertainties related to the grid DERs, which are PV, micro-turbine, wind, and battery, as well as the uncertainties related to the market and obviously the uncertainty in the load. In [162], authors developed an expert system for energy management for a MG containing PVs and wind turbines. The developed system predicts the energy production by wind turbine using neural networks. Then, based on these data, an improved fuzzy satisfying algorithm based on bacterial foraging is used in the EMS module to obtain the optimisation of the multi-objective problem.

Dynamic Programming Techniques
The operation of a stand-alone MG containing DGs, PVs and batteries is optimized in terms of operating cost and emission in [163] using a dynamic scheduling technique that takes into consideration system constraints such as load satisfaction and DER generation capacity. An algorithm based on dynamic programming is proposed in [164] for the management of clustered MGs. Authors used a deep learning algorithm running in real time to generate the daily schedule of the MG, ten instructions are sent to the local control units to make a centralized control. Julio et al. presented an EMS for an autonomous residence connected to the main grid based on the state of charge of the batteries [165]. A persistence forecasting method is adapted for solar irradiance and wind speed and load forecasting using the Meteogalicias THREDDS server for weather forecasting. The control of the residence according to the state of charge of the batteries helps to reduce the fluctuation of the energy flow between the residence and the main grid. In [166], Hang et al. presented a technique based on approximate dynamic programming for economic management of the MG. Authors take into consideration RER output over time, energy price and load as stochastic variables. The piecewise linear function approximation with an improved slope updating strategy is used for the proposed method.
In [167], authors developed an EMS based on a dynamic programming approach to reduce the cash flow including the price of energy exchange with the main grid and the cost of battery degradation for a MG connected to the main grid. In [168], authors aimed to increase the profit from the sale of renewable energy and reduce the cost of balancing demand and consumption. To this end, they used energy market data to generate battery control setpoints using a dynamic scheduling method. An EMS for a large building is designed in [169] operating in real time. Authors developed a control algorithm for alternating between all modes of battery operation, charging, discharging and load shedding, and for limiting the output from PVs. They also controlled the DC bus to keep it constant using the uncertainty of the PVs and the energy demand.

Multi-Agent Systems
Multi-agent systems (MAS) is a collection of intelligent agents that interact to solve problems that cannot be solved by a single agent or system. For some time, architectures and designs have been proposed for applications in engineering models, in general. With the increasing use and modelling of DERs for MGs work, MAS are well placed to be adapted to handle the dimensions and complexity of these energy systems. In [170], authors have proposed a new mechanism that pushes customers to contribute to the grid management in order to reduce peak loads and give consumers a high cost-performance ratio. They used the JADE programming language to develop a multi-agent based grid management system taking into consideration the different load patterns and available energy of DERs. A recent simulation platform for EMSs is developed in [171] in the clientserver framework and made available in C ++ . The authors designed a hybrid EMS for a multi-agent based MG that can work with both centralised and decentralised approaches to reduce the cost of MG operation. In [172], authors performed the sizing of a MG composed of PV, wind, DG and batteries using the multi-objective self-adaptive differential evolution algorithm. Due to the multi-task nature of the used technique, the computation time is reduced, such that each part deals with a specific task. Authors, then, developed the EMS of the MG system. The multi-objective optimisation approach developed is used to track the probability of power loss, the price of electricity and the renewable factor.
In [173], Bogaraj and Kanakaraj developed an adaptive scheme based on the concept of MAS for energy management in an isolated MG. The generation system is seen as two parts; a primary part containing the PVs and wind turbines, when they fail to satisfy the load the second part, which is the batteries intervenes to ensure the continuity of the load supply. They have also developed predictive models to give information on wind, irradiance and consumption. In the extreme case, where both parts of the MG are not able to satisfy the load, a load shedding of part of the load is performed according to a fixed priority. A STATCOM-based compensation is designed to provide the necessary reactive power and to minimise voltage fluctuations. In [174], the authors used a multi-agent management methodology based on the JADE differential evolution algorithm to optimize the power generation costs caused by the intermittency of the DERs and the unknown variation in the load shape, especially the critical loads, knowing that the grid consists of two MGs containing DERs, PVs, and wind turbines and a load for each of the networks. In [175], Sajad et al. presented a decentralized multi-agent based algorithm to manage possible power imbalance situations in a PV-based autonomous residence connected to the main grid. The approaches are: grid agents, storage agents and user agents. In [176], Karavas et al. used cognitive maps and fuzzy logic techniques to develop a decentralised EMS based on the multi-agents present in a microgrid. Intelligent agents refer to DERs and ESSs and also for electrolysis and its fuel cells. This decentralised approach has shown several benefits compared to the centralised approach especially during outages.

Stochastic Methods and Robust Programming
The authors in [177] rely on the Lyapunov method to generate an optimization algorithm to deal with the uncertainty due to the intermittency of RERs in an interconnected MG. The method consists of two parts, in the first part a DG is used, in the other part an economic dispatch of conventional and distributed generation is performed based on hourly marketing. In [178], authors presented an optimization of the operation of a grid-connected power generation system. They developed a stochastic scheduling model taking into account the uncertainties of RER and consumption. First, the scheduling model optimizes the primary investment of the MG and then it provides the operation schedule to ensure a reduced cost. In [179], Juan et al. discussed a new charging strategy for optimized operation in a system containing wind turbines, batteries and DG.
A stochastic EMS for frequency gap reduction is developed in [180] and used for economic management of a MG in terms of operation and RERs reserves. The developed approach has been tested for challenging situations and has shown its effectiveness. In [181], authors presented a hierarchical management methodology to monitor and control the energy flow in the MG, i.e., DER generation and load consumption. A small-scale stochastic algorithm is proposed to overcome the uncertainty in the prediction of DERs. In [182], Wencong et al. presented some studies on a modified IEEE 37-bus test line. They formulated a model to reduce the operational cost of the microgrid and the power losses using one of the stochastic approaches. In [183], Taher et al. proposed a stochastic model based on teaching and learning to obtain the best Pareto optimal front. The objectives are cost and emissions minimisation. In this work, authors take into consideration the uncertainties related to the consumption demand, the available power output of DERs, as well as the energy cost in the market.
A stochastic coordination framework is introduced in the architecture of an agricultural MG to reduce the operating cost of the ESSs and lower the exchange cost with the main grid [184]. For weather forecasting, authors used a point estimation method. An EMS based on the productivity of the DERs and the unpredictable variation of the customers consumption is developed in [185]. The EMS is performed in two steps; first it schedules the network respecting the limits of the DERs in order avoid damaging its components. Then, it regulates the frequency by evaluating in real time the limit of energy capacity deviation. In [186], authors presented a stochastic multi-objective technique for managing a hybrid MG. The interest of this work is to reduce the network losses as well as the economic optimization of the RERs operation in the MG. The cost and losses model is developed based on weighting sum, and the solution was achieved by mixed integer linear programming.

Neural Network Techniques
In [187], the authors aim to make their network autonomous, they tried to maximise the exploitation of the RERs and reduce the carbon emissions by reducing the operation of conventional generators. Therefore, they developed an EMS model for their network, which operates in a connected mode. Neural networks are adopted in this work, one part for the management strategy and a second part to monitor the performance of the system in terms of battery degradation and the integration rate of the RERs. Cruz et al. designed an artificial neural network algorithm to run the EMS of a MG composed of PVs, wind turbines and a public load, the energy is stored in batteries [188]. The objective of the algorithm is to give the right instructions to the DERs in order to maintain maximum power generation. In [51], Chen et al. proposed to use time-series and neural feedback network techniques for cost-benefit analysis for the optimal sizing of an energy storage system in a MG. The aim is to predict solar radiation and wind speed. The main problem has the form of a MILP, which is solved in AMPL (A Modelling Language for Mathematical Programming). Authors also introduced a specific artificial neural network algorithm for the prediction of the production of DERs. Finally, they used a simple method for optimization.
In [189], Nnamdi et al. developed a game-theoretic demand response program to manage a MG. They were able to minimise the operating cost of the MG by increasing the output of DERs when fuel prices are low. In [190], Abir and Ali used neural networks to estimate the optimal tilt angle of PV at a given location to optimise the amount of energy produced by the PVs and thus reduce operating costs. A neural network method is used in [191], which consists of determining the optimal arrangement of power lines between micro-sources and load points. A traditional approach is, therefore, presented to design low-cost MGs architectures taking into account network reliability.

Fuzzy Logic Methods
In [192], authors introduced fuzzy logic techniques for the scheduling of storage devices. An adaptive billing price is set for the storage devices invoicing based on the price of local production of the MGs and the amount of the storage devices daily participation in the MGs. It applies a multi-purpose PSO method to find the right energy allocation for the MGs. In [193], Fossati et al. presented a fuzzy-based economic dispatch and MG unit commitment to optimise its energy management. It consists of two GAs; the first algorithm generates the network energy schedule and fuzzy rules and the second algorithm adjusts the fuzzy membership functions. In [194], Lydie et al. developed daily control rules to ensure a reliable grid containing a solar panel and a wind turbine as DERs, the load is assimilated to a residential demand. Taking into account the economic aspect, the control is based on fuzzy logic. In [195], the authors designed an EMS based on a controller containing more than 20 fuzzy logic properties to optimise the power flow in their MG by keeping the ESSs state of charge. In [196], authors have presented an optimal approach to voltage and frequency control using fuzzy logic. This approach has demonstrated high performance and desirable response for different load change scenarios.
In [197], a large-scale MIP model was developed to optimise the operating costs of an energy system (power system, district heating and its combinations). The main objective is to achieve reasonable runtimes and general applicability to all system situations. The method saves between 1 and 2% on operating costs. In [198], the authors designed an EMS to manage the energy flow tasks in a microgrid composed of RERs and ESSs. To achieve this optimization objective, they mixed a genetic algorithm with a Mamdani fuzzy logic algorithm. In [199], the authors presented a highly efficient EMS for the management of a connected network containing controllable and uncontrollable batteries and loads, with the objectives of reducing the power demand to the main grid while increasing the local generation of the RERs, based on a hybrid approach that combines wavelet functions and extended Kalman filtering to predict the consumption and production of RERs. In [200], Teo et al. proposed a methodology for managing ESSs tested against a rule-based control strategy. The simulation is done on MATLAB/Simulink and shows that this study increases the resilience of the MG.

Others Methods
The gradient method algorithm is used in [201] by selecting a power mix of four different types of MGs for economic allocation taking into account the penetration of renewable energy sources, associated costs and revenues. In [202], the authors used the Karush-Kuhn-Tucker (KKT) conditions to select the DERs to form a MG. The KKT method ensures that the true optimum is calculated. The KKT approach applied to nonlinear programming generalises the Lagrange multiplier method, which only allows for equality constraints.
An algorithm for planning MGs is presented in [138] for the optimization of power generation and transmission. The objective is to minimize the total cost of MG planning. To do so, the problem is split into two sub-problems; a planning problem and an annual reliability problem. As the model is a non-linear model, the authors introduced a sequential quadratic programming (SQP) technique to fin an optimal solution. A probabilistic approach is proposed by Niknam et al. in [203]. Authors introduced a probabilistic uncertainty optimisation method and a modified multi-objective algorithm based on Modified Gravitational Search Algorithm to find the Pareto-optimal front for the economic/emissions management of MGs. In [204], Wishart et al. proposed a production system planning, with the objective of minimizing the total cost over a long term. The objective includes the reduction of line losses, reliability costs and initial investments. The Modified Discrete Particle Swarm Optimisation technique is used to optimise the problem by taking into account the system constraints: the supply current, the bus voltage and the DG output power.
In [205], authors have determined the optimal exploitation strategy and the optimisation scheme for the economic and environmental problem of a MG. They applied multi-objective optimisation based on modified game theory. The formulated model is constrained and non-linear, it takes into account NOx, SO 2 and CO 2 emissions. Comparisons are made with Multi-Objective Sequential Quadratic Sequential Programming, Multi-Objective Genetic Algorithms and Multi-Objective Direct Adaptive Mesh Search. The results demonstrate the effectiveness of the proposed approach in minimising the cost of operating the system while meeting the customers demand and system safety. Table 4 describes the main contributions and some limitations of some energy management strategies presented in the literature. Table 4. Major papers dealing with energy management for MGs with focus on optimization approaches.

Ref.
Methods Contributions Limitations [206] Mixed integer non linear programming Minimisation of general operating costs while maintaining the safety of the MG and ensuring their autonomy.
Two very important points are not taken into consideration: battery ESSs and the reduction of emission costs. [74] Mixed integer non linear programming The developed system can take into account the effects of grid imbalance and correct potential reactive power deficits.
Voltage limits are not taken into account. Detailed three-phase models are needed to overcome this problem.
[207] Non-Linear Programming Demand mitigates the variability of renewable resources by allowing user demand to be controllable.
A robust optimisation method must be carried out in response to the demand to overcome the uncertainties of the microgrid.
[153] Non-Linear Programming The developed method allows to optimally manage the use of the battery while minimizing the grid power.
The uncertainty of the PVs and the load are not taken into consideration.
[156] PSO algorithm The operating costs of the DGs are well studied by selecting the right sizing and sitting.
Emissions minimisation is not considered. It must be taken into account in systems containing DGs.
[208] Evolutionary strategy An efficient optimisation is presented that reduces the operating cost of PVs with batteries with an hourly variation in consumption considered in the study.
Seasonal and other types of consumption variations should be taken into account to obtain more accurate results. [209] Particles Swarm Optimization The wind uncertainty is taken into account as well as several important components such as PVs, wind turbines, battery bank, electrolyser, fuel cell and hydrogen tank.
The uncertainty of the wind leads to an increase in the cost, which must also be optimised.
[210] GA and MILP The used technique is a very flexible set of sub-functions, an intelligent convergence behaviour, as well as diversified search approaches and penalty methods for constraint violations.
More parameters can be added in this approach to obtain a self-adopting system. [159] Chaotic quantum genetic algorithm The economic resolution by this method is efficient and presents interesting solutions.
Storage systems are not taken into account, neither is its uncertainty.
[ 166,182] Stochastic The algorithm has a faster convergence rate. It effectively reduces the operational cost by taking into account the inherent intermittency and variability of renewable energy resources.
The proposed model can also be adapted to take into account other uncertainties such as load and customer behaviour.

Ref. Methods
Contributions Limitations [211] Multi-agent systems This approach makes multi-agent systems well suited to the use and control of MGs. A step-by-step conceptual framework and platforms for the construction of multi-agent systems are developed.
Hardware incompatibility, the uncertainty inherent in the complexity of the software and the security risk for malicious external actors limit the use of management information systems for monitoring MGs. [196] Fuzzy logic approach The adapted fuzzy approach improved the coefficients of the PI voltage and frequency controllers.
This work is only one part of energy management of AC MGs. It must be adapted to deal with DC and hybrid microgrids. [200] Fuzzy logic approach The proposed methodology allows a control of the charge and discharge, which gives good results. The power consumption is effectively reduced.
A forecasting system is required to complete the model. [194] Fuzzy logic approach The results show that the load profile is well regulated by fuzzy logic rules.
Emissions should be taken into account to make the model more realistic. The ESSs also need to be inserted (batteries, for instance) allowing for islanded operation.
[212] Multi-agent system Decision-making is facilitated by this method.
The approach is greatly complicated by the requirements for resilient, robust and rapid solutions. [190] Artificial neural network The technique is very effective, as it allows the optimal angle of inclination of pVs to be estimated with an accuracy of only 3 degrees.
This work is not an EMS but it can be integrated into EMS for more decision making.
[183] Stochastic programming The most important advantage of this algorithm is the fast transfer of information between agents, allowing global optima to be found, even for complicated systems.
The only missing part is the storage system. [179] Robust programming The approach is useful for optimising the operation of wind-battery-diesel hybrid networks.
Optimisation of controllable load transfers is not assured.

Future Research and Challenges in MGs
The elements allowing to improve the communication between the components of the MG, the security of the network and the use of artificial intelligence are research areas that require further investigation. Communication systems can be improved thanks to the development of the telecommunication field, wireless tools are undergoing very rapid development allowing much higher speeds and connecting by radio waves a greater number of devices (sensors, converters, control unit, modem Internet, etc.). The development of the various network components must be accompanied by the development of protection systems ensuring the stability of the network, avoiding the accidental destruction of expensive equipment, and data errors. Aspects of artificial intelligence are one of the promising solutions to overcome the problems encountered by the old methods such as: the lack of data (artificial intelligence adapts and can therefore continue without having the missing data), generation of an impractical solution (artificial intelligence understands the physical system, so it is able to recognize if the solution is applicable in reality), and finally it can be added in parallel with another method for more accuracy and speed.

Power-to-Gas Technology
The key element to improve the MGs resilience and ensure electricity supply is energy storage. Grid level-energy storage is mainly implemented using batteries. Unfortunately, batteries suffer from high investment cost, high degradation and replacement cost, and low cycle life. One technology that can be of great interest for the development of MGs is power-togas (P2G). P2G is a technology that uses electric power to produce hydrogen using electrolysis. When using surplus power from renewable resources, the gas is termed green-hydrogen.
Produced hydrogyn may be used as chemical raw material, or converted back into electricity using gas turbines. P2G allows energy from electricity to be stored and transported in the form of compressed gas, often using existing infrastructure for long-term transport and storage of natural gas. P2G is often considered the most promising technology for seasonal renewable energy storage [213].

Scalable Communication
Communication in MGs takes place through sensors installed at all network components. As the number of sensors increases with the integration of new devices, communication becomes more complicated and slow. Therefore, one of the interesting challenges is to develop a scalable communication infrastructure able to handle a very large amount of data and be able to perform new services and integrate other variables related to the new components inserted in the network [214].
Further research is needed to find more relevant tools to ensure good information transmission quality in MGs, targeting the overall operations of MGs, including the transient response of DERs. It is mandatory to reduce the time of sending sensitive information, which can be detected faults, switches and protection relays operating state in order to improve reliability. Control systems, such as voltage and reactive power control, are sometimes sensitive due to poor communication quality, and this problem needs to be studied. The communication between the MG devices and the MG architecture is realized according to the IEC60870-5-104 standard, it is important to move towards another standard IEC61850. This will allow a fast, reliable and secure access and control of substations, as well as a seamless interoperability [215]. The development of big data technologies, such as cloud computing, deep data mining, and machine learning methods, are necessary for the evolution of MGs. Specifically, these approaches allow processing the huge amount of data, RERs, power lines, and consumers bahaviour analysis, and uncertainty optimal management [216].

Cyber-Security Issues
Cyber-attacks are known to be the most common danger encountered in MGs, due to the vulnerability of the monitoring systems. These attacks can collapse the entire network, making it inoperable or endanger the confidentiality of employees and customer data. Attacks can mislead public services by generating false solutions in terms of utilisation capacity and hiding the attacks in progress. Future research must ensure confidentiality, authentication and privacy of information for network security and power delivery warranty.
Technically speaking, cyber-attacks against the MG causing infrastructure failures include cyber security flaws, cascading failures, blackouts, etc. It is therefore mandatory to strengthen the weak points with more coding. Currently, machine learning approaches are the most effective methods to detect and solve the problem of false information injection, by inserting logic meters for example. It is mandatory to further develop these approaches, and make them general so that they are adaptable to various scenarios as discussed in [214].

Machine Learning
Electricity distribution for networks heavily relying on intermittent generation sources can be compromised. In addition of being an additional constraint for electricity suppliers, this represents a major technical challenge to address. Indeed, highly intermittent production sources require more dynamic local control that can be based on various strategies such as interconnections with larger grids, load shedding, and energy storage. The main goal of local aggregator is, therefore, to guarantee the consistency of consumption and production data for real-time monitoring. Artificial intelligence can, then, be a performance tool for aggregators that allow promoting the penetration of renewable energy resources in the local energy mix [217]. Given the high costs of supplying non-interconnected areas such as island and rural areas, the implementation of smart MGs with the help of machine learning has a faster return on investment, which is conducive to experimentation on this type of network.
In addition, machine learning can be of great interest for electric vehicle charging infrastructure market, which is experiencing strong growth. Indeed, electric vehicle is an opportunity to develop large-scale intelligent charging solutions, both for public infrastructures and for private homes. Platforms could then control the charging of the fleet in accordance with the state of the network and consumers energy demand. Then, machine learning paves the way for more smart and reliable management of V2G technology. This would increase the flexibility of the network to cope with this new consumption technology.

Conclusions
This paper reviewed the main steps towards the design of microgrids and indexed the various challenges of their deployments. Several aspects have been addressed, from the selection of the appropriate installation site and the main DER and ESS for optimal operation, the optimal sizing of its components, to the types of control and EMS for an optimal MG operation schedule. The EMS is generally designed for optimal scheduling and efficient power distribution among the DERs, ESSs, and EVs. Several objectives can be selected to design an EMS, such as operational optimization, energy scheduling and resilience, and consideration of several environmental aspects, battery degradation, active demand response integration, line losses and system reliability, and consumer privacy. Thus, based on the desired objectives, the system is modelled, and from this model and its complexity, an optimization method is chosen to perform the solution respecting all the constraints of the chosen grid. A comprehensive and critical review is made of the energy management systems and solving approaches. The most known and used resolution tools are also presented. Uncertainty, related to renewable energy and random load variations, reduces the reliability of microgrids, which must be improved by using heuristic methods, for example to predict future events. Artificial intelligence aspects can be introduced in the future works of MGs optimal operation, in order to improve the components sizing, energy management system and location of renewable resources, considering the uncertainty of the load, weather data and the energy market. Controllable loads are the best solution to smooth the load curve and relieve DERs. Their integration should therefore be maximized by replacing all critical loads with controllable loads where possible.
A particular emphasis has been placed on the integration of EVs into microgrids. Specifically, the possibility of using the EVs fleet as distributed energy storage devices, that has been widely studied in the literature and deeply reviewed in this paper. This is because EVs can be charged using renewable energy resources during off-peak periods to significantly decrease the environmental impact of this type of transportation. The energy available on EV batteries can be used during on peak periods to support the grid and avoid congestion problems and their consequences. EVs have already been introduced in MGs to increase reliability and ensure continuity of generation. This concept has become an attractive topic in the electrical engineering and energy conversion research community, and needs further improvement to bring the expected benefits.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

Abbreviations
The following abbreviations are used in this manuscript: