Energy Management in Microgrids with Renewable Energy Sources: A Literature Review

: Renewable energy sources have emerged as an alternative to meet the growing demand for energy, mitigate climate change, and contribute to sustainable development. The integration of these systems is carried out in a distributed manner via microgrid systems; this provides a set of technological solutions that allows information exchange between the consumers and the distributed generation centers, which implies that they need to be managed optimally. Energy management in microgrids is deﬁned as an information and control system that provides the necessary functionality, which ensures that both the generation and distribution systems supply energy at minimal operational costs. This paper presents a literature review of energy management in microgrid systems using renewable energies, along with a comparative analysis of the di ﬀ erent optimization objectives, constraints, solution approaches, and simulation tools applied to both the interconnected and isolated microgrids. To manage the intermittent nature of renewable energy, energy storage technology is considered to be an attractive option due to increased technological maturity, energy density, and capability of providing grid services such as frequency response. Finally, future directions on predictive modeling mainly for energy storage systems are also proposed.


Introduction
The exponential demand for energy has led to the depletion of fossil fuels such as petroleum, oil, and carbon. This, in turn, increases the greenhouse effect gases. Energy systems have incorporated small-scale and large-scale renewable sources such as solar, wind, biomass, and tidal energy to mitigate the aforementioned problems on a global scale [1]. Global energy demand will grow by more than a quarter to 2040, when renewable sources are expected to represent 40 percent of the global energy mix. The reliability of the renewable sources is a major challenge due mainly to mismatch between energy demand and supply [2]. Renewable energy resources, distributed generation (DG), energy storage systems, and microgrids (MG) are the common concepts discussed in several papers [3]. The increase in the demand for energy and the rethinking of power systems has led to energy being generated near the places of consumption. This energy is derived from renewable sources, which are becoming increasingly competitive due to a drop in prices, especially in the case of photovoltaic solar and wind energies [4].
Due to strong dependency on climatic and meteorological conditions, in many cases the optimal system is a hybrid renewable energy system (considering one or more renewable sources) with battery storage systems (and in some cases including diesel generator) [5]. The hybrid energy systems are typically used for electricity supply for several applications such as houses or farms in rural areas without grid extension, telecommunication antennas, and equipment, and many other stand-alone In a microgrid, it is essential to maintain the power supply-demand balance for stability because the generation of the intermittent distributed sources such as photovoltaic and wind turbines is difficult to predict and their generation may fluctuate significantly depending on the availability of the primary sources (solar irradiation and wind). The supply-demand balancing problem becomes even more important when the microgrid is operating in stand-alone mode where only limited supply is available to balance the demand [16]. Energy management optimization in microgrids is usually considered as an offline optimization problem [17].
Microgrids supported with renewable energies can be classified as smartgrids, which provide a set of technological solutions to allow information exchange between the consumers and the distributed generation. An energy management system (EMS) is defined as an information system, which provides the necessary functionality when supported on a platform to ensure that generation, transmission, and distribution supply energy at minimal cost [18]. Energy management in the microgrids involves a control software that permits the optimal operation of the system [19]. This is achieved by considering the minimal required cost and two microgrid operation modes (isolated and interconnected). The variability of resources such as solar irradiation and wind speed must be accounted for when considering microgrids with renewable energy sources [20].
A review on the studies related to the energy management of microgrids can be found in [21]. A few authors have solved the problem of energy management using different techniques to achieve In a microgrid, it is essential to maintain the power supply-demand balance for stability because the generation of the intermittent distributed sources such as photovoltaic and wind turbines is difficult to predict and their generation may fluctuate significantly depending on the availability of the primary sources (solar irradiation and wind). The supply-demand balancing problem becomes even more important when the microgrid is operating in stand-alone mode where only limited supply is available to balance the demand [16]. Energy management optimization in microgrids is usually considered as an offline optimization problem [17].
Microgrids supported with renewable energies can be classified as smartgrids, which provide a set of technological solutions to allow information exchange between the consumers and the distributed generation. An energy management system (EMS) is defined as an information system, which provides the necessary functionality when supported on a platform to ensure that generation, transmission, and distribution supply energy at minimal cost [18]. Energy management in the microgrids involves a control software that permits the optimal operation of the system [19]. This is achieved by considering the minimal required cost and two microgrid operation modes (isolated and interconnected). The variability of resources such as solar irradiation and wind speed must be accounted for when considering microgrids with renewable energy sources [20].
A review on the studies related to the energy management of microgrids can be found in [21]. A few authors have solved the problem of energy management using different techniques to achieve an optimal microgrid operation. However, these techniques must incorporate better solution strategies due to the integration of distributed generation, storage elements, and electric vehicles.
Other recent papers [22] have reviewed various integration methods for renewable energy systems based on storage and demand response. This covers two main areas, namely (1) the optimal usage of storage, and (2) improvement of user participation via demand response mechanisms and other collaborative methods. The authors in [23] reviewed energy management strategies for hybrid renewable energies. The above review covered different configurations of stand-alone and grid-connected hybrid systems. Other review papers [24] have shown the control objectives of the microgrid supervisory controllers (MGSC) and energy management systems (EMS) for microgrids. Table 1 shows the contributions of the review papers related to the energy management of microgrids. Unlike the cited papers, this paper focuses on the incorporation of better strategies for the control of energy (both heat and electrical) flow between the hybrid system sources and load. Furthermore methods of energy management in stand-alone hybrid microgrid considering the battery degradation are also discussed.

Reference
Contributions [21] Authors presented a comparative analysis on decision making strategies for microgrid energy management systems. These methods are selected based on their suitability, practicability, and tractability, for optimal operation of microgrids. [22] Energy management integration methods, demand response, and storage systems are reviewed. Authors used more accurate models for storage including key factors such as the derating factors due temperature charge/discharge rate and ageing. [23] Authors presented a review on strategies and approaches used to implement energy management in stand-alone and grid-connected hybrid renewable energy systems. [24] Authors showed an extensive review on energy management methodologies applied in microgrids. EMS for real-time power regulation and short-/long-term energy management are reviewed. [25] Authors showed previous solutions approaches, optimization techniques, and tools used to solve energy management problem in microgrids. It includes heuristic, agent-based, MPC, evolutionary algorithms, and other methods. [26] Authors showed an overview of the latest research developments using optimization algorithms in microgrid planning and planning methodologies. [27] Authors presented an overview of current hybrid microgrids and optimization methods and applications. [28] Authors showed in detail the optimization of distributed energy microgrids in both the grid-connected and stand-alone mode.

Microgrid Optimization Techniques
Energy management of a microgrid involves a comprehensive automated system that is primarily aimed at achieving optimal resource scheduling [25][26][27]. It is based on advanced information technology and can optimize the management of distributed energy sources and energy storage system [28]. The microgrid optimization problem typically involves the following objectives: Maximize the output power of the generators at a particular time; Minimize the operating costs of the microgrid; Maximize the lifetime of energy storage systems; Minimize the environmental costs.
Some of the classic optimization methods include mixed integer linear and non-linear programming. The objective function and constraints used in linear programming are linear functions with real-valued and whole-valued decision variables. Dynamic programming methods are used to solve more complex problems that can be discretized and sequenced. The problem is typically broken down into sub-problems that are optimally solved. Then, these solutions are superimposed to develop an optimal solution for the original problem.
Metaheuristics is another important alternative in microgrid optimization. Heuristic techniques are combined to approximate the best solution using genetic algorithms, biological evolution, and statistical mechanisms for achieving optimal operation and control of microgrid energy.
Predictive control techniques are used in applications where predicting the generation and loading is necessary to guarantee effective management of stored energy. This typically combines stochastic programming and control. The most remarkable among these techniques are the ones to predict the deterioration of elements of the grid, mainly storage systems.
Optimization methods based on a multi-agent used on microgrids allow a decentralized management of the microgrid and consist of sections having autonomous behavior to execute the tasks with defined objectives. These agents, which include loads, distributed generators and storage systems, communicate with each other to achieve a minimal cost.
Stochastic methods and robust programming are used to solve the optimization functions when the parameters have random variables, particularly in artificial neural networks, fuzzy logic, and game theory.
A few more methods can be derived from a combination of the aforementioned techniques such as stochastic and heuristic methods and enumeration algorithms.

Microgrid Energy Management with Renewable Energy Generation
A microgrid is composed of different distributed generation resources that are connected to the utility grid via a common point. Figure 2 shows a microgrid energy management mode along with several features that are modules of human machine interfaces (HMI), control and data acquisition, load forecast, optimization, etc. [29].
Appl. Sci. 2019, 9, x FOR PEER REVIEW 4 of 27 are used to solve more complex problems that can be discretized and sequenced. The problem is typically broken down into sub-problems that are optimally solved. Then, these solutions are superimposed to develop an optimal solution for the original problem. Metaheuristics is another important alternative in microgrid optimization. Heuristic techniques are combined to approximate the best solution using genetic algorithms, biological evolution, and statistical mechanisms for achieving optimal operation and control of microgrid energy.
Predictive control techniques are used in applications where predicting the generation and loading is necessary to guarantee effective management of stored energy. This typically combines stochastic programming and control. The most remarkable among these techniques are the ones to predict the deterioration of elements of the grid, mainly storage systems.
Optimization methods based on a multi-agent used on microgrids allow a decentralized management of the microgrid and consist of sections having autonomous behavior to execute the tasks with defined objectives. These agents, which include loads, distributed generators and storage systems, communicate with each other to achieve a minimal cost.
Stochastic methods and robust programming are used to solve the optimization functions when the parameters have random variables, particularly in artificial neural networks, fuzzy logic, and game theory.
A few more methods can be derived from a combination of the aforementioned techniques such as stochastic and heuristic methods and enumeration algorithms.

Microgrid Energy Management with Renewable Energy Generation
A microgrid is composed of different distributed generation resources that are connected to the utility grid via a common point. Figure 2 shows a microgrid energy management mode along with several features that are modules of human machine interfaces (HMI), control and data acquisition, load forecast, optimization, etc. [29]. Many researchers have addressed energy management by implementing different approaches. However, all approaches have focused on determining the most optimal and efficient microgrid operation. The following sub-sections discuss and classify these strategies and solutions.

Energy Management Based on Linear and Non-Linear Programming Methods
Ahmad et al. [30] presented a technical and economic method to optimize a MG based on mixed integer linear programming (MILP). This paper presents the advantages of programming the generation of distributed sources, managing the intermittency and volatility of this type of generation, and reducing load peaks. The cost function is solved via linear programming based on a general algebraic modeling system (GAMS). Simulations to optimize MG size are performed via software called HOMER. Taha and Yasser [31] presented a robust algorithm based on a predictive Many researchers have addressed energy management by implementing different approaches. However, all approaches have focused on determining the most optimal and efficient microgrid operation. The following sub-sections discuss and classify these strategies and solutions.

Energy Management Based on Linear and Non-Linear Programming Methods
Ahmad et al. [30] presented a technical and economic method to optimize a MG based on mixed integer linear programming (MILP). This paper presents the advantages of programming the generation of distributed sources, managing the intermittency and volatility of this type of generation, and reducing load peaks. The cost function is solved via linear programming based on a general algebraic modeling system (GAMS). Simulations to optimize MG size are performed via software called HOMER. Taha and Yasser [31] presented a robust algorithm based on a predictive control model for an isolated MG. The model incorporates multi-objective optimization with MILP, which minimizes the cost, energy consumption, and gas emission due to diesel generation in the MG.
Sukumar et al. [32] proposed a mixed method for MG energy management. This was achieved by combining the utility grid and fuel cell power. The problem is solved using linear optimization methods, and the on/off states of the utility grid are solved via MILP. A particle swarm optimization (PSO) method was used to obtain an optimal energy storage system size.
Tim et al. [33] proposed a system for energy management in an interconnected MG that adopted a centralized approach based on the concept of flexibility for the final users. An optimal economic dispatch was obtained using quadratic programming. This grid was integrated with a photovoltaic system and the constraints must satisfy the demand. The algorithm was tested on an IEEE 33 node modified grid.
Delgado and Domínguez-Navarro [34] presented an algorithm based on linear programming for MG energy management that allowed the optimal operation of either generators or controllable and non-controllable loads. The optimization problem involves the optimal dispatch of generators (diesel) while meeting the operational and economic constraints imposed by the purchase and sale of energy corresponding to each component (generators, storage systems, and loads).
Helal et al. [35] analyzed an energy management system for a hybrid AC/DC MG in an isolated community that employs a photovoltaic system for desalination. The proposed optimization algorithm was based on the mixed integer non-linear programming, wherein the objective function minimizes the daily operating costs.
Umeozor and Trifkovic [36] researched the energy management of a MG based on MILP via the parametrization of the uncertainty of solar and wind energy generation in the MG. The optimization is achieved at two levels. First, the parametrization scheme is selected; second, the operational decisions are made the problem considers the variation in market prices and the disposition of the storage systems.
Xing et al. [37] presented an energy management system based on multiple time-scales. The optimization problem considers two aspects: A diary static programming and dynamic compensation in real time. This is solved via a mixed-integer quadratic programming method using optimal load flows, and the load state of the batteries are predicted using wind and solar radiation data.
Correa et al. [38] proposed an energy management system based on a virtual power plant (VPP). The studied MG has solar panels and storage systems and works in an interconnected manner. These elements are programmed/modeled using linear programming methods to minimize the operating costs. Renewable energies are incorporated into an energetic model, similar to the Colombian one, and are mainly based on hydric resources.
Cardoso et al. [39] analyzed a new model to observe the battery degradation of a MG. The problem is solved using stochastic mixed-integer linear programming, taking several factors such as loads and different sources of energy generation, costs, constraints, grid topology, and local fees for energy into consideration.
Behzadi and Niasati [40] analyzed a hybrid system that consists of a photovoltaic (PV) system, battery, and fuel cells. Performance analysis was conducted using the TRNSYS software, and the sizing was determined either using the genetic algorithm in the HOGA software (now called iHOGA), manual calculations, or the HOMER software. Three energy management strategies were tested for energy dispatch in this hybrid system. The excess energy was checked in each system and a decision was taken to either produce hydrogen or charge the battery or both.

Energy Management Based on Metaheuristic Methods
Dufo-López et al. [41] proposed a control strategy for the optimal energy management of a hybrid system based on genetic algorithms. The system is composed of renewable sources (PV, wind, and hydro), an AC generator, electrolyzer, and fuel cells. Energy management is optimized to minimize the operating costs, which enables the use of the excess energy generated by the renewable sources to charge the batteries or produce hydrogen in the electrolyzer. The load that cannot be supplied by the renewable sources can be obtained by either discharging the battery or using fuel cells.
Das et al. [42] studied the effect of adding internal combustion engines and gas turbines to a stand-alone hybrid MG with photovoltaic modules. A multi-objective genetic algorithm was used to optimize this system based on the energy costs and overall efficiency. Two strategies, both electric and thermal, were used to track the load. All the analyzed systems satisfied the electrical demand when combined with both heating and cooling.
Luna et al. [43] presented an energy management system that operates in real time. Three cases were studied considering the perfect, imperfect, and exact predictions. The employed optimization model was tested in both a connected and an isolated MG, with large imbalances between the generation and load.
An economic dispatch and battery degradation model has been proposed in [44], wherein genetic algorithms were used for energy supply options via a diesel generator. The results showed that an increase in the battery lifespan decreases the operational costs of a MG. This method was validated in a hybrid MG composed of a diesel generator and photovoltaic system.
Chaouachi et al. [45] proposed a multi-objective, intelligent energy management system for a MG that minimizes the operational costs and environmental impact. An artificial neural network has been developed to predict the photovoltaic and wind power generation 24 and 1 h in advance, respectively, along with the load demand. The multi-objective intelligent energy management system is composed of multi-objective linear programming. The battery scheduling is obtained using a fuzzy logic-based expert system.
Li et al. [46] presented a study on MG optimization based on the particle swarm algorithm that can operate a connected or isolated MG. The proposed approach considers the fluctuations in the renewable sources and load demands in the MG, with appropriate advance (24 h) forecasts available to overcome these fluctuations.
Nivedha et al. [47] analyzed a MG containing/supporting wind power generation, fuel cells, a diesel generator, and an electrolyzer. A fuel cell is used when the energy demand is not covered by the wind turbine, to ensure energy balance when operating diesel generators to reduce the operational costs. The fuel cell operates to meet the high load demand, resulting in economic MG operation with a~70% cost saving using the particle swarm optimization algorithm.
Abedini et al. [48] presented an energy management system for a photovoltaic/wind/diesel stand-alone hybrid MG, which is optimized using a particle swarm algorithm with Gaussian mutation. This study minimizes both the capital and fuel costs of the system.
Nikmehr et al. [49] studied an optimal generation algorithm applied to a MG based on optimization via the imperial competitive algorithm. This algorithm solves the load uncertainty and distributed generators, along with the economic dispatch of the generating units. This algorithm is comparable to methods such as the Monte Carlo method, and has been tested in interconnected MGs.
Marzband et al. [50] presented an energy management system for an isolated MG using the artificial bee colony algorithm (ABC). A stochastic approach is required to analyze the economic dispatch of the generating units inside a MG, given the intermittent nature of solar energy resources and wind generation. The results showed a 30% decrease in costs. The non-dispatchable generation and load uncertainty are managed using neural networks and Markov chains.
Kuitaba et al. [51] presented a new method to optimize an interconnected MG, which combines an expert system based on fuzzy logic and a metaheuristic algorithm known as Grey Wolf optimization. This method involves minimizing both the costs of the generating units and the emission levels of the fossil fuel sources. This method lowers MG costs by considering the optimal capacity of the batteries and reducing the consumption of fossil fuels.
Papari et al. [52] analyzed energy management in a MG connected to a direct current utility grid. The optimization is implemented using the crow search algorithm (CSA), which is a metaheuristic optimization method that imitates the behavior of a crow to store and hide food.
Wasilewski [53] presented a metaheuristic optimization method to optimize a MG. The methods include the evolutionary and particle swarm algorithms. These methods account for the fact that the deterministic conditions assumed in the problem impose an important limit on the employed methodology. However, it also recognizes the uncertainty of using renewable energies.
Ogunjuyigbe et al. [54] presented a technique based on a genetic algorithm for the optimal location of both renewable generation and batteries in a stand-alone MG. The proposed multi-objectives are to reduce operational and life cycle costs, and dump energy. The optimization allows variations in the radiation and wind sources, and extracts data from a load profile to optimize the MG.
Kumar and Saravanan [55] proposed an algorithm based on the demand prediction over 24 h in a MG using the artificial fish swarm optimization method. Thus, the demand can be planned in advance, considering both renewable and non-renewable generation. The algorithm is used to program the sources, load, and storage elements. They system includes a wind turbine, two photovoltaic generators, a fuel cell, a micro-turbine, and a diesel generator.
A particle swarm algorithm has been proposed in a recent paper by Hossain et al. [56] for energy management in a grid-connected MG. A model for charging and discharging a battery has been formulated. The proposed cost function reduces costs by 12% over a total time horizon/period of 96 h, with time intervals of one hour. These results can be adjusted in real time.
Azaza and Wallin [57] studied energy management in a MG with a hybrid system consisting of wind turbines, photovoltaic panels, diesel generator, and battery storage. A multi-objective particle swarm optimization is used, which evaluates the probability of losing energy supply over a time horizon/period of 6 months each during summer and winter.
Motevasel and Seifi [58] presented an expert system for energy management (EEMS) in a MG that contains wind turbines and photovoltaic generation. Neural networks are used to predict wind turbine generation. The bacterial foraging algorithm is used for the optimization, while the optimization of the multi-objective problem is obtained by the EEMS module by applying an improved bacterial foraging-based fuzzy satisfactory algorithm.
Rouholamini and Mohammadian [59] proposed optimal energy management for a grid-connected hybrid generation system, including PV generator, wind turbine, fuel cell, and electrolyzer. This system trades power with the local grid using real time electricity pricing over a 24-h time horizon/period based on the simulation results. The interior search algorithm was used to optimize the energy management in the above case.

Energy Management Based on Dynamic Programming Techniques
Shuai et al. [60] proposed an energy management system for a MG based on dynamic programming and mixed-integer non-linear programming optimization. The MG is interconnected to the grid and decisions are made using the Bellman equation. Historical data are used off-line, while considering the power flow and battery storage as constraints. Using the algorithm in multiple MGs simultaneously is a feasible possibility.
Almada et al. [61] proposed a centralized system for energy management of a MG either in the stand-alone or interconnected modes. In the stand-alone mode, the fuel cell only works if the battery is less than 80%. In the interconnected mode, a 60% threshold is required to ensure reliable behavior.
Wu et al. [62] proposed an algorithm based on dynamic programming for the management and control of stand-alone MGs. The deep learning algorithm works in real time, which permits intra-day scheduling to obtain a control strategy for MG optimization, while sending information from local controllers within the framework of centralized management.
Zhuo [63] proposed an energy management system using dynamic programming to manage a MG with renewable generation sources and batteries. The objective was to maximize the benefits from the sale of renewable energy and minimize the cost required to satisfy the energy demand. The author used a non-regulated energy market where electricity prices fluctuate and the battery control actions are determined by dynamic programming.
Choudar et al. [64] presented an energy management model based on the battery state of charge and ultra-capacitors. The hierarchic structure of optimal MG management has four states or operating modes: Normal operating mode, photovoltaic limitation mode, recovering, and stand-alone modes.
Marabet et al. [65] proposed an energy management system for a laboratory scaled hybrid MG with wind, photovoltaic, and battery energy. The control and data acquisition system are operated in real time. The energy management system is based on a set of rules, and optimizes the MG performance by controlling and supervising the power generation, load, and storage elements.
Luu et al. [66] presented a dynamic programming method and methodology based on the rules applied to a stand-alone MG containing diesel and photovoltaic generators, and a battery. The constraints are governed by the power balance between generation and consumption, along with the capacity of each distributed generator. Dynamic programming is used to minimize the operational and emission costs. The constraints are the power balance between offer and demand, along with the operating capacity of each distributed generator.

Energy Management Based on Multi-Agent Systems
Boudoudouh and Maâroufi [67] proposed an energy management system in a MG with renewable energy sources. Simulations were run using the Matlab-Simulink and java platform for agent developers (JADE) software. The reliability of this model was validated by fulfilling requirements such as autonomy and adaptability in the MG management system with load variation.
Raju et al. [68] studied energy management in a grid outage divided into two MGs, which contains two photovoltaic and wind generators each and a local load. A multi-agent management system based on the differential evolution algorithm in JADE was used to minimize the generation costs from the intermittent nature of the solar resource and randomness of load. This system also addressed the price variation in the grid, and the critical loads were considered while selecting the best solution.
Bogaraj and Kanakaraj [69] presented an energy management proposal based on intelligent multi-agents for a stand-alone MG, which maintains the energetic balance between the loads, distributed generators, and batteries. The agents consist of photovoltaic systems, wind turbines, fuel cells, and battery banks. Loads are divided in three groups based on their priority. The auto-regressive moving average models (ARMA) were used to predict the generation. Cases covering high and low irradiation, and low wind were analyzed. The system used a dynamic compensator to balance the reactive power.
Anvari-Moghaddam et al. [70] presented an energy management system for a microgrid that includes houses and buildings. The optimization process for the energy management system involves the coordination of management in distributed generation (DG) and response to the demand. The main objectives of the cost function are to minimize the operating costs and meet the thermic and electrical needs of the clients. The communication platform used by the agents is based on the hypertext (HTPP) communication protocol.
In the study investigated in [71], Nunna and Doolla used an energy management system based on multi-agents, which considers different types of load patterns and the energy available from the distributed energetic resources. They proposed a novel mechanism that encouraged clients to participate. This proposal was validated in interconnected grids using the JADE programming language. The management system reduces the consumption peaks and offers the clients an attraction benefit-cost ratio.
Dou and Liu [72] presented a decentralized multi-objective hierarchical system based on the agents in an interconnected smart MG, minimizing the operating and emission costs and line losses.
The authors in [73] researched decentralized energy management based on the multi-agents contained in a MG, using cognitive maps with fuzzy logic. The intelligent agents refer to the distributed generators, batteries, electrolyzer, and fuel cells. Centralized and decentralized approaches were compared and it showed that the decentralized approach offers the advantage of partial operation under certain circumstances such as during a system malfunction or failure.
Mao et al. [74] presented a hybrid energy management system for a MG based on multi-agents, which incorporates both the centralized and decentralized approaches and optimizes the economic operation of the MG. A novel simulation platform for energy management systems was designed based on the client-server framework and implemented in the C++ environment.
Netto et al. [75] developed a real time framework for energy management in a smart MG in the islanded mode using a multi-agent system. The RSCAD software was used to simulate the MG using the TCP/IP protocol for the purposes of testing and real time operation.

Energy Management in Microgrids Based on Stochastic Methods and Robust Programming
Che Hu et al. [76] showed an energy management model for a MG wherein the uncertainty in the supply and energy demand are taken into account. Uncertainty in wind and photovoltaic generation, and demanded energy is considered. The stochastic programming of two states was formulated using the GAMS and was tested on a real grid at the Nuclear Energy Research Centre in Taiwan. The battery capacity was optimized in the first stage, while an optimal operation strategy for the MG was evaluated in the second stage.
The author in [77] presented an optimization system for a hybrid MG using a multi-objective stochastic technique. The objective function presented in this study minimizes the system losses and reduces the operating cost of the renewable resources, which were used at different points of the MG. The problem was formulated using the weighting sum for the total operating cost and losses of the feeding systems. The proposed scheme was solved using mixed integer linear programming and tested on the IEEE 37 node distribution system.
Lu et al. [78] proposed a dynamic pricing mechanism that achieves an optimal operating performance. This mechanism was applied to a grid composed of multiple MGs, to evaluate the uncertainty of renewable energy integration on a large scale. An optimization scheme was developed at two levels: The pricing mechanism guaranteed the market operator's energy operation in the upper level, while in the lower level the MG transactions were developed.
Xiang et al. [79] proposed an optimization model for an interconnected MG based on a model using the Taguchi orthogonal matrices. The uncertainty in the renewable energy and load demand were determined by an interval based on error prediction.
Hu et al. [80] introduced an optimization method for an interconnected grid that is divided in two stages. A conventional generator is used in the first stage, while the second stage ensures an economical dispatch of the conventional and distributed generation using hourly marketing. This combination permits management of the uncertainty in renewable generation using the Lyapunov optimization method.
Shen et al. [81] presented a stochastic energy management model for an interconnected MG. The uncertainty level is managed using Latin hypercube sampling based on the Monte Carlo method, which generates various scenarios for the distributed resources, load, and electricity price. A sensitivity analysis is performed to determine the standard deviation of the expected price and level of reliability.
Rezai and Kalantar [82] proposed a stochastic energy management system for a stand-alone MG based on the minimization of frequency deviations. Operating costs of the MG include conventional and distributed generation, and reserves and incentives for generation using renewable sources. The outputs of the conventional generators were also analyzed for various contingencies to demonstrate the robustness of the proposed approach.
Su et al. [83] studied a model for the efficient programming of an interconnected MG, which minimizes the operating costs of the conventional generators, battery degradation, and commercial costs corresponding to the energy from the utility grid. This model follows two stages.
The first stage involves optimization of the MG, while the second stage involves analysis of the power output to calculate the MG energy losses in real time.
Farzin et al. [84] proposed an energy management system for an isolated MG. The islanding event was treated as a normal probability distribution of the failures in the utility grid. The objective was to minimize the MG operating costs. This included costs associated with the microturbine operation, wind turbines, batteries, and load disconnection.
Liu et al. [85] proposed an energy management system for an interconnected MG considering renewable energies and load uncertainties. The energy management is divided in two sub-problems: The first involves scheduling within the defined energy boundaries for system protection, while the second evaluates the real time energy capacity deviation limit for frequency regulation. The presented approach was found to be more cost effective.
Kuztnesova et al. [86] proposed a decentralized energy management system for an interconnected MG using agent-based modeling and robust optimization. The MG performance was evaluated in terms of the cost from the power imbalances associated with the uncertainty of renewable generation and load power demand.
Zachar and Daoutidis [87] proposed a hierarchic control mechanism to regulate and supervise the loads and dispatchable energy inside a MG. Stochastic optimization was used on a low scale to avoid errors in the forecast of renewable energies. Deterministic optimization was realized on a fast scale to update the optimal dispatch conditions.
Battistelli et al. [88] proposed an energy management system for a remote hybrid AC/DC MG, which ensures economical dispatch in spite of the uncertainties associated with the use renewable energy sources. A load control is determined (thermic and electric vehicles) based on the demand, while taking the limits of the generators, controllable loads, and charge and discharge of batteries into consideration.
Lujano et al. [89] developed an optimal load management method for hybrid systems composed by the wind tubine, battery bank, and diesel generator. The autoregressive moving average (ARMA) was used to predict the wind speed.
The results showed that the load management strategy improved wind power usage by shifting the controllable loads to the wind power peaks, thus increasing the charge in the battery bank. This research contributed strategies for the energy management of hybrid MGs.

Energy Management Using Predictive Control Methods
Zhai et al. [90] proposed a predictive robust control that can be applied to a stand-alone MG. The management model employed mixed integer programming. The MG is composed of wind and PV generators, batteries, and loads.
Zhang et al. [91] presented a model predictive control (MPC) method to manage a MG that integrates both distributed and renewable generation. The model's objective is to reduce the costs and constraints in both generation and energy demand.
Minchala Ávila et al. [92] proposed a methodology based on predictive control for energy management in a stand-alone MG. The controller operates the battery energy in a centralized manner and performs a load elimination strategy to ensure balance in the MG power output.
Ju et al. [93] investigated an energy management system for a hybrid MG taking the degradation costs of the energy storage systems into consideration. The proposal consists of a two-layer predictive control for the hybrid MGs, which use batteries and supercapacitors as storage systems. An important contribution of this work is that the degradation costs of the supercapacitors and batteries were modeled, which allows more accurate assessment of the MG operating costs.
Valencia et al. [94] proposed an energy management model for a MG that uses predictive control, which involves the prediction of the intervals using fuzzy logic. This allows the representation of the non-linearity and dynamic behavior of the renewable sources.
Genesan et al. [95] presented an energy management system for a MG based on a control algorithm to integrate and manage various types of generation such as the PV, distributed generation, energy storage systems, and UPS from the supply grid and different loads. The transition problem between the storage systems and PV generation is solved via control and communication, which functions on a TCP/IP protocol.
García Torres and Bordons [96] introduced optimal programming in a hybrid MG, based on a predictive control model that is solved using mixed integer quadratic programming. They integrated the operating costs and MG optimization, which includes the degradation costs of all the components of the hybrid system, mainly the hydrogen-based storage systems.
Solanki et al. [97] presented a mathematical model of the smart loads and energy management of a stand-alone MG. Loads are modeled using neural networks. Energy management is realized with the predictive control method, which performs an optimal power dispatch taking the elements and controllable loads into consideration.
Oh et al. [98] proposed a multi-step predictive control model for a MG over a time horizon/period of 180 min in 15 min steps. This includes conventional and renewable energy generators, energy storage elements, and both critical and non-critical loads. The cost function was formulated considering the costs associated with fuel consumption, renewable energy reduction, battery state of charge, and amount of load shedding.
A proposal has been presented by Prodan et al. [99] for the energy management of a MG based on a fault-tolerant predictive control design. One of their many contributions includes the extension of the useful battery life by decreasing the charge and discharge cycles.
Wu et al. [100] presented an optimal solution for the operation of a hybrid system using solar energy and battery storage. The battery plays a significant role in the storage of grid power during off-peak periods and supply of power to the customers during peak demand. Thus, scheduling the hybrid system leads to the minimal power consumption from the grid and reduces a customer's monthly cost.
Thirugnanam et al. [11] proposed a battery strategy management. The main objective tries to reduce the fuel consumption in DG, reduce fluctuating PV power, and control the battery charge and/or discharge rate to improve the battery life cycle. The battery charge/discharge rate control model considers the battery SOC limits, wherein the batteries are not charged or discharged beyond the specified limits.
Dufo-López et al. [101] presented a technique to optimize the daily operation of a diesel-wind-PV hybrid, using MPC with forecast data of the irradiation, wind speed, temperature, and daily load. The main contribution of this work is daily optimization that accounts for the degradation of the lead-acid battery by corrosion and capacity losses, using the advanced model presented by Schiffer et al. [102]. This parameter is important when considering the operating costs of the MG, as the useful life and replacement of the batteries can be estimated more accurately. The optimization is executed using genetic algorithms.

Energy Management Based on Artificial Intelligence Techniques
Elseid et al. [103] defined the role of energy management in a MG as a system that autonomously performs the hourly optimal dispatch of the micro and utility grids (when interconnected) to meet the energy demand. In the above study, the authors used a CPLEX algorithm developed by IBM.
Mondal et al. [104] proposed an energy management model for a smart MG based on game theory, using a distributed energy management model. In this scheme, the MG selects a strategy to maximize its benefits with respect to the cost and adequate use of energy.
Prathyush and Jasmín [105] proposed an energy management system for a MG using a fuzzy logic controller that employs 25 rules. The main objective is to decrease the grid power deviation, while preserving the battery state of charge.
Leonori et al. [106] proposed an adaptive neural fuzzy inference system using an echo state network as a predictor. The objective was to maximize the income generated from energy exchange with the grid. The results showed that the energy management performance improved by 30% over a 10 h prediction horizon/period.
De Santis et al. [107] introduced an energy management system for an interconnected MG using fuzzy logic based on the Mamdani algorithm. The main objective is to take decisions on the management tasks of the energy flow in the MG model, which is composed of renewable energy sources and energy storage elements. The optimization was realized in a scheme that combines fuzzy logic and generic algorithms.
Venayagamoorthy et al. [108] proposed an energy management model for a MG connected to the main power grid. The MG maximizes the use of renewable energies and minimizes carbon emissions, which makes it self-sustainable. The management system is modeled using evolutionary adaptive dynamic programming and learning concepts using two neural networks. One of the neural networks is used for the management strategy, while the other used to check for an optimal performance. The performance index is evaluated in terms of the battery life, use of renewable energy, and minimization of the controllable load.
Ma et al. [109] proposed an algorithm using game theory based on the leaders and followers for energy management. This approach aims at maximizing the benefits available to active consumers of the MG, while keeping the Stackelberg balance to ensure an optimal distribution of benefits.
Jia et al. [110] formulated an adaptive intelligence technique for the energy management of an interconnected MG, which uses energy storage elements. The objective is to minimize any load fluctuations due to uncertainties in the renewable energy generation. The load profile is managed by storage elements and ultra-capacitors.
Arcos-Avilés et al. [111] presented an energy management algorithm based on low-complexity fuzzy logic control for a residential grid-connected MG, which includes renewable distributed generation and batteries.
Aldaouab et al. [112] proposed an optimization method using genetic algorithms for residential and commercial MGs. The MG uses PV-solar energy, microturbines, a diesel generator, and an energy storage system.
Liu et al. [113] proposed a Stackelberg game approach for energy management in a MG. A management system model that takes the fee for the PV energy into account was introduced, which includes the profits from the MG operator and a utility model for the PV consumers.
Nnamdi and Xiaohua [114] proposed program consisting on an incentive-based demand response for the operations of the grid connected MG. The game theory based demand response program (GTDR) was used to investigate the grid connected operational mode of a MG. The results showed that lower costs could be achieved in the MG when the DG benefit of the grid operator is maximized at the expense of minimizing the fuel/transaction costs.

Energy Management Based on Other Miscellaneous Techniques
Astaneh et al. [115] proposed an optimization scheme to find the most economic configuration for a stand-alone MG, which has a storage system with lithium batteries, and considered different control strategies for energy management. The lifetime of lithium batteries is estimated using an advanced model based on electrochemistry to evaluate the battery longevity and its lifetime.
Neves et al. [116] presented a comparative study on the different objectives of the optimization techniques for the management of stand-alone MGs. This approach is primarily based on linear programming and genetic algorithms. The results showed that the optimization of the controllable loads could result in an operating cost reduction and inclusion of renewable energies.
Wei et al. [117] proposed an iterative and adaptive algorithm based on dynamic programming to enable optimal energy management and control a residential MG. The charge/discharge level of the battery is treated as a discreet problem in hourly steps. The decisions on the energy supply for a residential load with respect to the energy fee are made in real time.
Yan et al. [118] studied the design and optimization of a MG using a combination of techniques such as mixed integer programming for the optimization of energy management, and the probabilistic Markov model to represent the uncertainty of PV generation. The design included a linear model to evaluate the MG lifetime.
Akter et al. [119] proposed a hierarchic energy management model for an interconnected residential MG serving prosumers, which includes a local control mechanism that shares information with a central controller for energy management.
In the research presented in [120], an energy management system was designed for a hybrid system combining wind, PV, and diesel generation. The system operates both on-and off-grid. Thus, there exists a control mechanism within the inverter for transfers between the micro and utility grids.
Lai et al. [121] proposed a techno-economic analysis of an off-grid photovoltaic with graphite/LiCoO2 storage used to supply an anaerobic digestion biogas power plant (AD). The main contribution is the economical study of the hybrid system including the battery degradation costs. An optimal operating regime is developed for the hybrid system, followed by a study on the levelized cost of electricity (LCOE). Figure 3 presents a summary of the energy management methodologies used for the MGs based on the above-reviewed literature. Different researches have proposed several methodologies related to energy management in MGs. Many methods are based on classical approaches such as mixed integer linear and nonlinear programming. Linear programming can be considered a good approach depending on objective and constraints, while artificial intelligence methods are focused to approach situations where other methods lead to unsatisfactory results, including renewable generation forecasting and optimal operation of energy storage considering battery aging, among others. An optimal operating regime is developed for the hybrid system, followed by a study on the levelized cost of electricity (LCOE). Figure 3 presents a summary of the energy management methodologies used for the MGs based on the above-reviewed literature. Different researches have proposed several methodologies related to energy management in MGs. Many methods are based on classical approaches such as mixed integer linear and nonlinear programming. Linear programming can be considered a good approach depending on objective and constraints, while artificial intelligence methods are focused to approach situations where other methods lead to unsatisfactory results, including renewable generation forecasting and optimal operation of energy storage considering battery aging, among others.

Optimization Techniques
Different optimization techniques are generally applied to maximize the power output of each particular source, minimize electricity costs, or maximize storage systems. Figure 4 presents the most commonly employed optimization techniques and algorithms presented in the literature review. Main advantages and disadvantages are briefly presented in Table 2.
Various techniques have been used by different researches. Energy management and the optimization of control in a MG can have one or more objective functions. These functions can vary

Optimization Techniques
Different optimization techniques are generally applied to maximize the power output of each particular source, minimize electricity costs, or maximize storage systems. Figure 4 presents the most commonly employed optimization techniques and algorithms presented in the literature review. Main advantages and disadvantages are briefly presented in Table 2.
Various techniques have been used by different researches. Energy management and the optimization of control in a MG can have one or more objective functions. These functions can vary depending on the optimization problem presented. This can result in a mono-objective or multi-objective problem, which can include the minimization of costs (operation and maintenance cost, fuel cost, and degradation cost of storage elements such as batteries or capacitors), minimization of the emissions and minimization of the unmet load. Table 3 shows a comparison between the different optimization and management methods used in the MGs. Different researchers have proposed metaheuristic techniques to solve the problem of optimization due to multi-constraints, multi-dimensional, and highly nonlinear combinatorial problems. Other authors presented stochastic dynamic programming methods for optimizing the energy management problem with multidimensional objectives. Game theory has been proposed for some researchers to solve problems with conflicting objective functions.   Table 2. Comparative analysis of optimization mathematical models.

MILP
Linear programming (LP) is a fast way to solve the problems and the linear constraints result in a convex feasible region, being guaranteed in many cases to obtain the global optimum solution.
Reliability and economic stochastical analysis. Limited capabilities for applications with not differentiable and/or continuous objective functions.

MINLP
It uses simple operations to solve complex problems. It can obtain more than one optimal solution to choose from, which is an advantage over the MILP formulation.
High number of iterations (high computational effort).

Dynamic programming (DP)
It can split the problem into subproblems, optimizing each subproblem and therefore solving sequential problems.
Complex implementation due to high number of recursive functions.

Genetic algorithms (GA)
Population-based evolutionary algorithms that include operations such as crossover, mutation, and selection to find the optimal solution. Adequate convergence speed.
Crossover and mutation parameters, and population and stopping criterial parameters must be set.

Optimization Techniques
Linear and non-linear programming   Table 2. Comparative analysis of optimization mathematical models.

MILP
Linear programming (LP) is a fast way to solve the problems and the linear constraints result in a convex feasible region, being guaranteed in many cases to obtain the global optimum solution.
Reliability and economic stochastical analysis. Limited capabilities for applications with not differentiable and/or continuous objective functions.

MINLP
It uses simple operations to solve complex problems. It can obtain more than one optimal solution to choose from, which is an advantage over the MILP formulation.
High number of iterations (high computational effort).

Dynamic programming (DP)
It can split the problem into subproblems, optimizing each subproblem and therefore solving sequential problems.
Complex implementation due to high number of recursive functions.
Genetic algorithms (GA) Population-based evolutionary algorithms that include operations such as crossover, mutation, and selection to find the optimal solution. Adequate convergence speed. Widely used in many fields.
Crossover and mutation parameters, and population and stopping criterial parameters must be set.

Particle swarm optimization (PSO)
Good performance in scattering and optimization problems. High computational complexities.
Artificial bee colony Robust population-based algorithm simple to implementate. Adequate convergence speed. Complex formulation.
Artificial Fish Swarm Few parameters, fast convergence, high accuracy, and flexibility.
Same advantages of GA but without its disadvantages (crossover and mutation).

Bacterial foraging algorithm
Size and non-linearity of the problem does not affect much. Converge to the optimal solution where analytical methods do not converge.
Large and complex search space. Mono-objective [51] Fuzzy logic (Grey Wolf Optimization) Optimization of the size of the battery energy storage and of the generation plan.

Power balance Power of the generators Battery load
Battery degradation cost is not considered. Multi-objective [53] Evolutionary algorithm (EA) and the particle swarm optimization (PSO) Algorithm Application of an energy hub model for optimization of a multicarrier MG.

Power balance Voltage in the transformers
Deterministic conditions assumed are a limitation.
Mono-objective   Study on the economic projection of the hybrid system with the battery degradation costs. An optimal operating regime is developed for hybrid system, followed by a study on the levelized cost of electricity (LCOE). Accuracy of degradation costs of the energy storage.

Power balance SOC battery
Temperature not considered in the capacity fade model. Dynamic state of charge cycling conditions not considered.

Microgrid Operating Modes
A considerable number of papers have been published on interconnected microgrids, while discussing various modes of microgrid operation. On the other hand, the stand-alone mode is considered by many authors as an alternative supply measure mainly in the rural areas or regions with no conventional grids [122]. Thus, both the on-and off-grid operating modes are a feasible alternative. Table 4 summarizes the above considerations.  Table 5 presents a summary of the most popular simulation tools, wherein tools such as Matlab/Simulink (MathWorks, Natick, MA, USA) and MATPOWER have particular importance. Matlab is a numerical computing environment of 4th generation programming language, it can interface with other languages such as C, C++, C#, Java, Fortran, and Python. MATPOWER is an open-source tool that is used to simulate optimal power flows, which uses Monte Carlo to evaluate the performance of MG. Alternately, other tools such as GAMS, which is an optimization language for linear, nonlinear, and mixed programming, have been used by many authors to solve the uncertainty problem in energy management and for optimal dimensioning of the microgrid. Other tools such as CPLEX have been employed, which is an optimizer based on the C language and is compatible with other languages like C++, Java, and Python. The simulation and modeling of microgrids has been analyzed with programs such as Simulink and PSCAD/EMTDC (Manitoba Hydro International Ltd., Winnipeg, Manitoba, Canada). Both tools are used for power control and energy management in microgrids.

Modelling and Simulation Tools
Software such as HOMER (Pro Version, HOMER Energy LLC, Boulder, CO, USA), HOGA (or its updated version iHOGA) (Pro+ Version, University of Zaragoza, Zaragoza, Spain), or HYBRID2 (University of Massachusets, NREL/NWTC, Golden, CO, USA) also deserve a mention, which can be used to optimize the operation and energy management of hybrid systems with renewable energies.

Conclusions and Future Research
The literature review highlighted two approaches for microgrid energy management: The centralized and decentralized approaches. The first incorporates optimization using the available information in the absence of a coordination strategy between the actors in a microgrid. A computer centre transmits the optimal settings to each participant. The second approach implements optimization using partial information and a strategy for coordinating the microgrid participants; each participant evaluates its own optimal settings. Centralized management is mostly implemented in metaheuristic methods, and decentralized management is frequently implemented in methods based on multi-agents. Many publications have proposed centralized management for microgrids. However, the incursion of distributed energy resources (DER) may cause this type of management to face issues when implemented in a centralized information system because there might be a demand for high computational cost due to the large quantity of data. Distributed energy management may be an alternative solution to this problem. It solves the problem of data processing and reduces processing needs by using distributed controllers that manage the data in real time and require communication equipment that might result in additional costs (for e.g., Bluetooth, Wi-Fi, wireless networks, and IoT). An energy management model for a microgrid includes data acquisition systems, supervised control, human machine interface (HMI), and the monitoring and data analysis of meteorological variables.
The literature review mainly presented management methods based on foresight and short-term management. The choice of centralized or decentralized management ensures that the microgrid designer and operator realize a cost-benefit balance. This enables one to determine the management model that is most convenient for the microgrid. Though decentralized management offers more flexibility, an integral analysis is necessary to ensure reliable and safe system operation.
The energy management problem or optimization control in a microgrid becomes a mono-objective management/optimization model when a single cost function is presented. This function typically corresponds to the operating cost of the microgrids. The problem becomes a multi-objective management/optimization model when it simultaneously presents a solution to the technical, economic, and environmental problems. Based on the literature, different authors have addressed the problem and provided solutions using methods such as the classic ones with linear and nonlinear programming, heuristic methods, predictive control, dynamic programming, agent-based methods, and artificial intelligence. These methods are chosen based on their practicality, reliability, and resource availability in the microgrid environment.
With regard to storage systems in microgrids, lithium batteries can be an important alternative to lead-acid batteries in the future. The advantages of Li-ion batteries compared to lead-acid batteries are a long cycle life, fast charging, high energy density, and low maintenance. Currently, lead acid batteries are economically better than Li-ion batteries when used in microgrids, but a decrease in the acquisition cost of lithium batteries is expected in the coming years that will cause them to be competitive with those of lead-acid. Thus, further research on the optimal energy management of energy systems and the management of lithium batteries is required while considering more accurate degradation models to accurately predict the battery lifetime in real operating conditions. Funding: This research was funded by Government of Aragon "Gobierno de Aragón. Grupo de referencia Gestión estratégica de la energía eléctrica", grant number 28850.

Conflicts of Interest:
The authors declare no conflict of interest.