Optimal Location and Sizing of Distributed Generators and Energy Storage Systems in Microgrids: A Review

: This article reviews the main methodologies employed for the optimal location, sizing, and operation of Distributed Generators (DGs) and Energy Storage Systems (ESSs) in electrical networks. For such purpose, we ﬁrst analyzed the devices that comprise a microgrid (MG) in an environment with Distributed Energy Resources (DERs) and their modes of operation. Following that, we examined the planning and operation of each DER considered in this study (DGs and ESSs). Finally, we addressed the joint integration of DGs and ESSs into MGs. From this literature review, we were able to identify both the objective functions and constraints that are most commonly used to formulate the problem of the optimal integration and operation of DGs and ESSs in MGs. Moreover, this review allowed us to identify the methodologies that have been employed for such integration, as well as the current needs in the ﬁeld. With this information, the purpose is to develop new mathematical formulations and approaches for the optimal integration and operation of DERs into MGs that provide ﬁnancial and operational beneﬁts.


Introduction General Context
Microgrids (MGs) are presented as an effective way to solve the problem of power supply in areas connected and disconnected from electrical systems [1].They consist mainly of a generator (slack generator), Energy Storage Systems (ESSs), distribution lines that connect the different points of connection to the system, and the electrical loads of users.MGs use renewable or non-renewable energy sources or sources at the point of connection of the electrical network.Although some studies in the specialized literature have considered other types of distributed energy technologies (e.g., fuel cells, ultracapacitors, static compensators [2][3][4][5].This paper focuses on the most widely used and developed renewable energy resources and energy storage systems.Further information on the electronic power devices mentioned above and their primary control strategies can be found in [6][7][8][9]. By considering the aforementioned information, the types of components to be used in MGs and their mode of operation depend on the needs and financial capacity of network operators.MGs have two modes of operation: islanded or grid-connected.Since both modes of operation allow for the integration of ESSs, MGs can be divided into four categories: (1) islanded MG with no ESS, (2) islanded MG with ESS, (3) grid-connected MG with no EES, and (4) grid-connected MG with ESS.In terms of planning and operation, the latter is the most complex and complete MG [10].
All MGs have electrical loads, which are classified as critical and non-critical based on the type of user.Critical loads require the system to be sized to ensure that the load is always powered, whereas non-critical loads enable disconnection devices to be included in the MG.
Figure 1 shows the power generation and consumption devices that can be found in conventional MGs.The blue arrows indicate the power that is injected to the system; the red arrows indicate the power that is demanded by the devices.Due to their proximity to the end user, the integration of different load types, and the high variability in demand as a result of users' consumption behavior, MGs face several operational issues.This places them at a disadvantage in some scenarios in which the generator's primary energy source is limited or extremely variable, such as in the case of power generation systems based on renewable resources.Thus, it becomes necessary to make the most of the energy resource available in the area where an MG is located, which could help to maximize the hours of energy supply (for islanded MGs) and lower energy purchase costs.
The foregoing can be accomplished by integrating Distributed Energy Resources (DERs) and ESSs into MGs.Such integration can be addressed from two different approaches: (i) from the electrical system design and (ii) from a maximization perspective in a scenario with no Distributed Generators (DGs) and ESSs.In the first approach, the idea is to identify the points in the system suitable for connection to the electrical system, as well as the nodes where the DGs will be installed.In the latter case, one of the generators is selected as the main generator (slack generator) and the others as DGs that contribute to the system's power generation.In such initial design, ESSs (mainly batteries) could also be incorporated into the MG to extend the energy supply period, store excess power, and manage the energy resource in the MG.All of this could lead to improvements in the MG's technical, financial, and environmental indicators [11].
In the second approach, DGs based on renewable energy resources, as well as ESSs, are integrated into the MG to lower its operating costs (costs associated with energy production, energy purchase, and power losses), improve its operating conditions (more hours of power supplied to end users, improved voltage profiles, increased electrical coverage), and lessen the environmental impacts caused by power generation (lower CO 2 emissions) [12].Additionally, from this approach, conventional power distribution systems (such as secondary networks or electrical systems of residential and commercial buildings) could be transformed into MGs by integrating DGs and ESSs into the system.This would allow this type of electrical networks to operate more independently and lower their operating costs.
In Spain, the incentives for producing energy using renewable sources range from 30 to 50% of the initial investment costs depending on whether it is a large, medium-sized, or small company.These incentives are regulated by Royal Decree 413 of 2014, which is part of the Energy Efficiency Program aimed at large, medium-sized, and small enterprises [13].In Chile, multiple projects involving renewable energy resources (with voltages ranging from 11 to 100 kVs) have been developed [14].In the United States, renewable energy resources are required to be used under the Net Metering mechanism, which measures the energy flowing from the generation plant to the grid.In addition, this mechanism allows the installation of renewable energy resources with small and large generators (500 kW and 4 MW, respectively) [15].In England, renewable electricity generation projects over 50 kW up to 100 MW are supported by a feed-in tariff scheme and receive financial incentives, which promote the adoption of distributed renewable energy technologies [16].In Colombia, several regulations promote the integration of non-conventional renewable energy sources into the national electrical system: Law 1715, Decree 0570 of 2018 and Resolutions 030, 038, and 060 by the Energy and Gas Regulatory Commission (abbreviated as CREG in Spanish) [17].As a result of such integration, the electrical network's point of connection would shift from having a primary, totally dependent role to a secondary role, in which the MG owner or operator may decide whether to buy or even sell energy depending on the energy requirements and production levels of the MG.
A variety of optimization strategies based on the intelligent control of the devices that make up a MG can be found in the specialized literature.Through an intelligent and hierarchical control, and by setting the operating point of each device to the optimal reference value, these strategies have managed to minimize a network's power losses [18][19][20][21] and total operating costs [22,23].Likewise, from our literature review, we noticed that current approaches concentrate on data protection in MGs by mitigating false data injection attacks [24][25][26].
Despite the importance of the intelligent operation and data security issues in MGs, this paper addresses the issue of optimal integration (i.e., location and sizing) of DGs and ESSs into electrical networks, not only in a country such as Colombia but also globally.The reason for this is that there is currently a global need to adopt energy solutions that are environmentally friendly and offer a cost-effective and high-quality service.Thus, in this study, we will analyze the main contributions made in recent years regarding objective functions, operational constraints, and solution methodologies (concerning the location and sizing of DERs), particularly for existing MGs consisting only of the main generator, distribution lines, and loads.The following are some of the most important contributions of this article:

•
A complete description of the problem of optimally locating and sizing DGs and ESSs in MGs, as well as of the methodologies most widely employed to solve it.

•
A thorough description of the most extensively used codification to solve the problem of optimally integrating DGs, ESSs, or both technologies at the same time into MGs.

•
A comprehensive review of the existing methodologies (which use specialized software or sequential programming methods) for solving the problem of the optimal (individual or joint) integration of DGs and ESSs into MGs.For each methodology, we analyze the type of solution method that is employed, the test systems that are considered, the proposed objective functions, and the methods used for comparison purposes.In addition, we examine whether the repeatability of the solution and the computation time needed by the solution method are evaluated.• An identification of current gaps and needs regarding the problem of optimally integrating DGs and ESSs into MGs from a financial, technical, and environmental perspective.

Optimal Integration of DGs and ESSs into Microgrids
This section examines different methodologies and codifications that have been used to achieve an optimal integration of DGs and ESSs into MGs.

Analysis and Identification of the Problem
To assess the relevance and impact of the various methodologies proposed for the optimal integration of DGs and ESSs into MGs, it is first imperative to identify the primary characteristics of an MG and the proper way to integrate such devices into electrical networks.The integration of such devices into MGs is quite similar to their integration into distribution networks because both types of networks operate under similar conditions:

•
They are located near the end user.

•
They are generally operated in a radial topology.

•
The shunt effect of the lines is not considered given their short length.

•
They operate with a single slack generator, which is responsible for maintaining the system's power balance.

•
In Colombia, the voltage levels are set to ±10% of the system's nominal voltage [27,28].
Given these similarities, this literature review considers studies into both MGs and distribution networks and seeks to identify, in such studies, the most relevant methodologies employed for the proper integration of DERs (DGs and ESSs) into electrical networks.
In recent years, various authors have proposed integrating DERs (e.g., DGs based on renewable energy resources and ESSs [29][30][31][32][33]) into electrical networks to improve their operation, as well as implementing intelligent strategies to ensure their smooth operation.To optimally integrate and locate these DERs into MGs, select the right technology, and ensure their proper operation, it is crucial to follow a methodology that allows us to identify the technical requirements, input data, and integration sequence of the DERs. Figure 2 presents the methodology proposed for the proper integration of DGs and ESSs into MGs.In the first stage of the methodology proposed here, data on the climate, topography, and energy demand in the region where the MG is located are collected and analyzed.The second stage is generating curves of the Non-conventional Energy Sources (NCESs), which use the region's energy resource to produce electricity, and the power-demand curves, which depict the fluctuations in power consumption by the loads connected to the MG (users).The former may be modeled using prediction techniques [34,35], and the latter using historical data on the MG's behavior.If such historical data are not available, those who wish to integrate DERs into the MG must gather them because the sizing of the DERs varies drastically across different scenarios depending on the load and generation curves [36].

Location and selection of energy storage
If such information is not available, deterministic or stochastic models can be used to calculate the values of the loads in the period under analysis [37].From the deterministic approach, the values of the loads can be obtained by creating demand curves and identifying the power required by consumers' equipment connected to the network.From the stochastic approach, which is the most complex one, the system's behavior is analyzed over a specific time period (months or years) to find the type of probability distribution that best represents the problem and assign a demand value to each hour or time interval [36].
For an optimal DG location and sizing, the geographic location of the MG must be taken into account, as this will help determine the type of renewable technologies that may be installed and the variables associated with them.Additionally, if power is supplied by a local network operator, the availability of such energy supply must be considered.In the case of using Conventional Energy Sources (CESs), which rely on fossil fuels, it is important to investigate which non-renewable energy sources are present in the area, as well as their associated costs (e.g., fuel and transportation costs).When using NCESs, it is critical to take into consideration, besides the installation and operating costs, the variable characteristics of different renewable energy sources [38], including solar irradiance and temperature in photovoltaic (PV) generation [39], variation in water flows and falls in hydropower generation [40], and wind variability in wind generation [28].
For their part, ESSs are selected and sized based on the operation of the distribution system and its requirements, as the behavior and location of the DGs and electrical loads (e.g., energy and power levels, storage characteristics, life cycle) will determine which size and type of ESS must be used [41].Importantly, finding the proper location and size for DGs and ESSs in MGs can be completed separately or jointly.This, however, has a direct impact on the complexity of the mathematical models that are built to represent the problem [42,43] because the more elements in the network, the greater the variables and constraints.Additionally, solving both problems together requires the use of more robust methods, as since there are more variables and the mathematical model becomes more complex, the solution space expands and there is a greater likelihood of falling into local optima due to the model's non-linear and non-convex nature [44].
The optimal integration of DERs into electrical networks (whether separate or joint integration) can be represented by means of the master-slave methodology illustrated in Figure 3.In this figure, the master stage selects the DERs and finds a proper location for them in the network, and the slave stage determines the right size for each DER using an optimal power flow method or optimal sizing strategy.The purpose of such an optimal sizing strategy is to find the most suitable power configuration for the DERs, considering the objective functions specified in the mathematical formulation [31,45].The weights, as well as the technical, financial, and/or environmental indicators, of such objective functions, which can be single-or multi-objective, are defined by the owner or operator of the MG based on the requirements of the network or the established goals.Finally, as can be seen in Figure 3, power or load flow analysis tools must be applied to calculate the effects of a potential integration and operation of DGs and ESSs over a given period of time.As a result of this power or load flow analysis, it is possible to obtain the system's different variables (e.g., nodal voltages and line currents).These variables can be used to estimate the various technical, financial, and environmental aspects that describe the impact of integrating DGs and ESSs into electrical systems, including voltage stability, power losses, line loadability, operating costs, and CO 2 emissions [46,47].

Load flow
The method chosen for solving the system of equations used to represent the power flow problem in MGs in an environment with DERs will determine the convergence quality and necessary computation times [48].These two aspects have a direct influence on the effectiveness of the method employed for the proper location and sizing of DGs and ESSs.Moreover, the objective functions established by the operator or owner of the DERs, as well as compliance with the system's constraints, are verified considering the power flow analysis results, which serves as a decision criterion to locate and size such resources and define the technologies that will be used.
Over recent decades, the load flow problem has been solved using a variety of techniques and methodologies [49,50] which have led to significant reductions in convergence errors and computation times.Some of these techniques include linear methods [48], quadratic programming [51], convex formulations [52], and non-linear methods [53].Likewise, commercial tools such as MATPOWER [54], DIgSILENT, PowerFactory [55], Pow-erWorld [56], ETAP, and PSAT [57]-all of which have varying levels of complexity and processing requirements-have been employed to estimate the power flow.Since the choice of the method or tool to calculate the load flow will determine the complexity, effectiveness, and computation times required by any methodology used for the proper integration of DERs into electrical networks, it is crucial to analyze the methods and tools available in the specialized literature.
After reviewing recent publications in the field, we found several studies in which the results obtained by both traditional and novel load flow methods in Direct (DC) and Alternating Current (AC) networks (with radial and meshed topologies) are analyzed to identify those with the lowest convergence errors and shortest computation times [58][59][60][61].Based on the findings of those studies, we may conclude that the most effective load flow techniques for meshed networks are those based on successive approximations, whereas those for radial networks are forward/backward sweep methods.Furthermore, the authors of such studies recommend using a method that is based on successive approximations to estimate the power flow when the network topology can change and take both a radial and meshed topology.
According to the information obtained from this review, it is possible to select the load flow method to be employed in the methodologies for the optimal integration and operation of DGs and ESSs.Importantly, the effectiveness and convergence of the technique chosen to solve the load flow problem will directly impact the solution's quality and the computation time required by the methodologies used for the optimal integration and operation of DGs and ESSs into electrical networks [31].

Codification of the Problem and Interpretation of Its Different Stages
The codification presented in Figure 4 can be used to locate DGs and ESSs in distribution systems, which takes place in the master stage [45,62].In this figure, we observe a vector of size 1 × (N − 1), which is used to encode the problem of the optimal location of DERs in electrical networks.Each column in the vector corresponds to a node, and N denotes the total quantity of nodes in the distribution system.A slack node is not included in the codification because it has enough power to supply the system in the absence of DGs or ESSs.However, if it is determined or essential to potentiate the slack node, it can be included in the problem's codification.In the case of islanded MGs, the integration of DERs in all system nodes can be analyzed.
Additionally, the codification shown in Figure 4 allows a different type of DG, ESS, or a combination of both to be assigned to each node.Each technology takes a value from 1 to k, where k is the k-th option of technology or combination of technologies to be integrated into the distribution system.In other words, depending on the technologies available for installation, a DER of type 1 may correspond to a DG, a DER of type 2 to an ESS, a DER of type 3 to a combination of a DG and an ESS, and so on.
According to the example presented in Figure 4, a DER of type 2 is placed at node 1, a DER of type 1 is placed at node 2, a DER of type k is placed at node 3, no DER is placed at node N − 1, and a DER of type 1 is placed at node N − 2. With such technologies assigned to each node, the purpose is to solve the optimal integration of DERs into the network.
Since this is an integer codification and the power balance equations in distributed generation are non-linear [63], the master stage represents a non-linear integer programming problem that should be solved using high-performance optimization methods that provide feasible and good quality solutions in short computation times.However, if only one type of distributed generation or energy storage technology was to be installed, the problem would have a binary codification, with a value of 1 or 0 indicating the location or not (respectively) of the device in the distribution system.This binary codification is one of the most frequently employed in the specialized literature [31,38,64].
Figure 5 depicts the codification of the sizing problem.Such sizing is performed on the DGs whose location was already determined in the master stage.In this case, a vector of size 1 × (N − 1) is employed, with each column containing the position of each node in the electrical system, except the slack node [31].Each DG is sized by assigning it a power level between the minimum and maximum power that the type of generation technology installed at each node can inject.This power level is calculated based on the energy potential of the region where the network is located, as well as on the power generation constraints specified by the network operator [65].
As an example, in Figure 4, the DGs are placed at nodes 2, 3, and N − 1 and assigned a power of 1.1, 2.2, and 0.8 kW, respectively.Importantly, the type of energy generation technology, the technical constraints, and the power generation levels must be defined in a previous stage.In this study, such information is provided by the master stage.An example of a codification for sizing ESSs in MGs and assigning them charging and discharging operations is presented in Figure 6.In this case, as in the previous two cases (see Figures 4 and 5), a vector of size 1 × (N − 1) is used.Each column in the vector contains the system nodes and the power that should be injected (supplied) or absorbed by the ESSs in the system.
As shown in Figure 6, batteries are placed at nodes 2, 3, and N − 1, with powers of −0.1, −0.1, and 1.2 kW, respectively, and with the batteries at nodes 2 and N − 1 being in charging mode and the battery at node 3 in injection mode.Importantly, the ESSs' charge and discharge power limits are determined based on the technical characteristics of the specific technology, as well as on the charge and discharge periods and maximum and minimum state of charge [10,66].The master stage provides these data and defines the technologies to be installed and their locations in the network.The codifications presented above are the most extensively employed in the field and perform well for hourly analyses.This type of analysis is useful for determining the optimal operation of an existing system.However, to evaluate the proper integration of DERs into electrical networks, one should consider the hourly variation that power generation and demand exhibit, which requires converting the vectors into matrices that represent the system's operation over a 24-hour period.This allows multiple scenarios of power generation and demand within different time periods to be analyzed in order to find the best impact of DER integration [67].
As observed in the codifications shown above, the problem of optimally locating DERs in MGs can be represented by means of a binary or integer non-linear mathematical formulation (see Figure 3), which requires strategies of the same nature to be solved [68].For the problem of properly sizing and operating DGs and ESSs in MGs, optimal power flow methods should be used to optimally size these devices, whose location in the MG is determined in the master stage [69].
As can be seen in Figures 4-6, the sizing problem employs continuous variables.These variables, when combined with the equations related to the objective functions (technical, financial, and environmental improvements) and the constraints that describe a MG operating in distributed generation (e.g., power balance, power limits, maximum and minimum state of charge, current limits, and voltage profiles), generate a continuous non-linear programming problem [70], which must be solved using high-performance optimization techniques.Hence, it is critical, as with the problem addressed in the master stage, to obtain high-quality solutions as fast as possible, i.e., to assess the greatest number of scenarios in the shortest amount of time.This is crucial in both short-and medium-term energy projects.
Considering all of the above, optimally locating and sizing DGs and ESSs in distribution networks requires mixed-integer non-linear programming.In the literature, said problem is known to be highly complex, mathematically and computationally speaking [63].

Optimal Integration of DERs into Microgrids
The problem of optimally integrating DGs and ESSs into MGs is treated as a mixedinteger non-linear optimization problem, and it is subject to the set of technical and operational constraints that describe the operation of MGs in an environment with DERs.In recent years, various tools have been used to solve this problem, with commercial software [11] and optimization methodologies based on intelligent mathematical methods [71,72] standing out.Likewise, depending on the needs of network operators or the goal of DERs' owners, different technical, financial, and environmental indicators have been employed as objective functions.Some such indicators include the reduction in power losses, as well as of investment and operating costs; the reduction in CO 2 emissions; the improvement of line loadability; and the optimization of voltage profiles and stability [1,73].
The next subsections present a literature review of each of the necessary steps for optimally integrating DERs (DGs and ESSs) into electrical networks.The main purpose behind this is to identify the contributions that have been made on the matter and the current needs regarding the integration of the DERs under analysis.

Power Generation Demand Curves
Data on power generation and demand are the primary inputs for any electrical system planning and operation strategy [74].Regarding the problem analyzed in this paper, data on power generation using renewable energy sources and on users' power demand directly influence the process of optimally locating and sizing DERs in MGs.In general, these data vary greatly across different power generation and demand scenarios.
Concerning power generation using renewable energy sources, it is critical to collect and evaluate data on each type of DER installed in the MG, which are directly related to the geographic location and weather conditions.These data could be employed to determine and/or forecast the operation of renewable DGs and the power they should supply.
There are a variety of technical reports that provide generation profiles of existing energy resources around the world.In Colombia, for instance, the Mining and Energy Planning Unit (abbreviated as UPME in Spanish) has encouraged the construction of maps to evaluate the energy potential of multiple regions in said country.Examples of this include the hydropower atlas [75], the solar and ultraviolet radiation and ozone atlas [76], and the wind atlas [77].The energy potential of renewable energy sources, however, also depend on topographic and environmental factors, which vary over time and cause the energy resource to change as well.
Therefore, although such profiles offer a first approximation to the potential of an existing energy resource, it is recommended to conduct on-site measurements to estimate its potential in a specific region [69].This would prevent such an approximation from not accurately representing the energy potential of the technology to be installed due to climate or topographic changes in the region, and the expected outcomes of DER integration from not being achieved, which would affect the payback period and project profitability.
In this vein, various companies around the world devote part of their efforts and resources to storing data on renewable energy sources and power demands in different regions to provide users with more realistic profiles.In Colombia, for example, the Institute for the Planning and Promotion of Energy Solutions for Non-interconnected Zones (abbreviated as IPSE in Spanish) and XM-the operator of the interconnected system and administrator of Colombia's wholesale energy market-provide daily power generation and demand curves for both interconnected and non-interconnected zones.
As an example, Figure 7 shows the weekly average solar irradiance and power consumption for Medellín in Antioquia in Figure 7a (interconnected zone) and Capurganá in Chocó in Figure 7b (non-interconnected zone).From this figure, although the solar irradiance curves of both cities follow a Gaussian distribution, we observe varied irradiance values during the day, which is attributed to the atmospheric and climate conditions of each city.Regarding the demand curves, Figure 7c,d, power consumption is directly related to the culture and development of each city, which causes their power consumption behavior to be completely different.
In recent years, several techniques have been proposed to assess the energy potential of different renewable energy resources using historical data or on-site measurements.Such techniques include statistical approaches, stochastic models, Big Data analysis strategies, and artificial intelligence-based methods [78][79][80][81][82][83].The estimation accuracy of these techniques vary, and they provide estimates over different time periods (short-, medium-, and long-term horizons).Thus, the choice of the appropriate technique will depend on the estimation accuracy requirements of the MG operator or owner and on the time periods for which the estimates are to be calculated [10].
For all of the reasons mentioned above, when developing a project to integrate renewable DGs into an MG, it is critical to select a method that provides the most accurate estimates of the energy potential of the area where the MG is located; this is in order to best represent the technical, financial, and environmental impacts of DER integration.However, if no historical data or on-site measurements are available, a representative curve of the region's power generation and demand can be employed.
Data on the power consumption behavior of users connected to an MG are also crucial for solving the problem of optimally integrating DERs, as such information helps to identify the system's most critical operational aspects and energy requirements.Based on users' power consumption behavior, it is possible to propose base scenarios that represent the network's technical, financial, and environmental conditions, and then evaluate the impact of DER integration on such conditions [84].The techniques mentioned above for predicting the energy potential of renewable energy resources can also be used to estimate the load curves, which represent the power consumption behavior of users connected to an electrical network.
In addition to such techniques, other approaches, such as regression models, the Box-Jenkins method, metaheuristic techniques, and econometric models [85][86][87], are also reported in the specialized literature to estimate power demand curves.These approaches enable power demand predictions to be made at the times specified by network operators or owners of the DERs that will be installed in an electrical system.In order to propose mathematical formulations to estimate power demand over time using known values, such approaches require data on the characteristics of loads (e.g., socioeconomic stratum, type of user, historical data on power consumption, and climate conditions) [88].After reviewing the studies in which such approaches were proposed, we found that the authors' main goal was to reduce computation times and improve estimation accuracy to obtain the best demand estimate in the shortest amount of time.
If all of the data needed to apply the methods mentioned above for load curve estimation are not available, other methodologies based on the calculation of the nominal powers of users' equipment and hours of usage of each device can be employed [89].Through this hourly consumption analysis, it is possible to estimate the power consumption behavior of the users connected to the network.The main disadvantage of this approach, however, is that it is highly susceptible to human error when determining the hours of consumption or usage of the devices.Finally, another way to estimate users' power consumption curves is to use the power demand tables per region provided by network operators, which allow power consumption to be estimated based on an analysis of the number of users and the socioeconomic stratum.However, although these curves are widely used [90], they do not accurately represent the consumption behavior of a specific user, which can have a considerable impact on the estimation of the technical, financial, and environmental benefits derived from DER integration.
In short, when developing a project for integrating DGs and ESSs into an electrical network, the choice of the method to estimate users' power demand will depend on the data supplied for the selected test system (e.g., types of load and hours of operation), its geographic location (e.g., weather data and consumption conditions), and its historical power demand data, if available [88].

Optimal Location and Sizing of DGs and ESSs
Importantly, the optimal integration of DERs into an MG will determine the technical, financial, and environmental impacts on its operating conditions, as explained earlier in this paper.For this reason, such integration has been extensively studied in recent decades, with the goal of maximizing benefits for network operators or owners [91][92][93][94][95][96].According to the results of several studies on the matter, in order to select an adequate technology and properly locate and size DERs in electrical systems, we should develop approaches that offer high-quality solutions in short computation times.
The problem of the optimal location and sizing of DGs and ESSs in electrical systems is frequently solved by applying a master-slave methodology, such as the one discussed earlier.This is owing to the fact that the location (master stage) and sizing (slave stage) problems include different types of variables: the former includes binary or integer variables, while the latter includes continuous variables [38].In the specialized literature, there are publications that address the integration of DERs separately (DGs or ESSs) or jointly (DGs and ESSs), with the mathematical complexity of the problem growing as the type and number of DERs that will be installed in the system increases [31].Below, we present and describe the studies that were found to have the biggest influence when performing this literature review.

Optimal Integration of Distributed Generators
Optimally locating and sizing DGs in electrical systems is a problem that several authors have addressed, designing methodologies that use DGs based on renewable energy resources.These technologies have been widely researched over the last decade because of their financial benefits (low-cost power generation) and lower environmental impacts when compared to other energy sources that rely on fossil fuels [97].The mathematical formulations employed to solve this problem consider various technical (e.g., power loss reduction and voltage profile and line loadability improvement), financial (minimization of energy purchase, investment, and operating costs), and environmental aspects (reduction in CO 2 emissions from sources based on fossil fuels) [98].Furthermore, these formulations take into account constraints that illustrate the operation of electrical systems in a environment of distributed generation (e.g., overall power balance, nodal voltage limits, line current limits, maximum number of DGs that can be installed, and maximum and minimum power allowed for the network and the DGs).
Regarding the technical aspects, other authors [63] developed a methodology based on a mixed-integer second-order conic programming model to optimally integrate photovoltaic (PV) DGs into electrical networks.Their main objective was to minimize active power losses.They employed the 33-and 69-node test systems for the simulations, and their results demonstrated that the developed methodology was efficient (regarding the quality of the solution and its computation times) in dealing with the non-convex nature of power flow equations that are found in electric power distribution networks.However, their methodology has a high mathematical complexity and requires the use of specialized software-the General Algebraic Modeling System (GAMS) in this case.
In [99], the authors sought to reduce power losses by using (1) a convex approximation of the power flow equations in AC and (2) mathematical formulations for the intelligent integration of wind and solar power DGs into an electrical power distribution system.Their main goal was to produce quick solutions for DG integration and the reconfiguration of the electrical network, relieve line congestion, and mitigate voltage issues.They employed the GAMS to assess the performance of methodology they suggested in three test systems: 34-, 70-, and 135-node test feeders.They, however, did not compare their results with those of other studies in the field.
AMPL is another software package used for solving the DG-sizing problem.In [100], a heuristic method was employed to locate a series of DGs in an electrical network.In that study, reducing power losses and improving the voltage profile were part of the objective function.The solution methodology they proposed was simulated in a 90-node distribution system using different study cases.The authors of this study, nonetheless, failed to compare their methodology with other methods (in terms of performance) and did not evaluate computation times.In addition, they employed heuristic methods for DG location, which may produce solutions that become stuck in local optima.
Importantly, if specialized software is used to solve the mathematical formulation of the optimization problems described above, two additional issues should be considered: (1) acquiring a license and (2) adjusting input and output data to the conditions imposed by the method or software being employed.Even though this raises the costs and the solution's complexity, we must highlight the high quality of the solutions provided by this type of software.
To reduce the need for specialized software to achieve an optimal integration of DGs into electrical systems, various authors have recommended using evolutionary algorithms based on sequential programming, which can be run on any platform [31].For example, in [101], a multi-objective methodology based on Particle Swarm Optimization (PSO) was used to locate a series of DGs in an electrical network, and an optimal power flow tool was employed to size them.In this paper, the authors considered the integration of multiple DGs using various load and generation scenarios.This multi-objective method revealed the advantages of analyzing several indicators (technical and financial aspects) in the same scenario of distributed generation, as it provided a balanced technical solution while respecting the network owner's or operator's investment.Moreover, the authors considered short-circuit levels to represent the requirements of protective devices, in addition to active and reactive power losses, voltage profiles, and line loadability.
In [31], a parallel version of the Population-Based Incremental Learning (PBIL) technique was employed to optimally locate DGs in electrical networks, and the traditional PSO method was adopted to solve their optimal size.The main goal was to minimize power losses.In that study, the authors highlighted the benefits of using parallel processing tools to reduce the computation of the algorithms.In addition, they showed how this time reduction may be leveraged to improve the algorithm's exploration and, thus, produce high-quality solutions faster.
Regarding the financial aspects, the authors of [102], for instance, proposed a hybrid methodology that employs the Chu and Beasley genetic algorithm and a heuristic approach for technology selection and DG location and sizing.Their main objective was to lower the costs associated with power losses.One of the major problems of this proposed methodology, nonetheless, is the high likelihood of becoming trapped in local optima due to the use of heuristic methods.In such study, the authors employed an objective function that included three types of costs: the feeder's investment, those related to power losses, and those of operating the DGs.
There are also studies that use power loss sensitivity factors for DG location.For example, the authors of [103] employed the Bacterial Foraging Optimization Algorithm (BFOA) to define the location and size of DGs within an electrical power network.The objective function they considered included operating costs, power losses, and nodal voltage deviations, and their proposed methodology was evaluated in two IEEE test systems, i.e., the 33-and the 69-node test feeders.Their findings showed that the BFOA was able to quickly find a moderately adequate solution to the problem they examined.The heuristic method they used, however, sacrifices solution quality for speed, which is regarded as a problem in this literature review.
In [73], the authors employed a stochastic programming framework to study the same problem (i.e., establishing the optimal size and location of DERs in low-voltage electrical distribution networks), taking into account the demand response and a high level of penetration of electric vehicles.They solved said problem using a genetic algorithm and considered several financial variables (such as DERs' operating and capital costs) and technical constraints regarding the network's power balance.The renewable energy sources they took into account included wind and solar PV systems, and their proposed framework was validated using the 69-node test system.
In [104], another stochastic programming method was used to optimally size DERs in an MG and, thus, maximize its financial benefits.Such a method involves two stages: (i) planning, which includes DG selection and sizing; and (ii) operation, which evaluates the mode of operation, the objective function, and the system's operational constraints.Moreover, the authors of such study employed various case studies to investigate the impact of various key factors on the most adequate sizes of the DERs.Their primary objective was to lower the net cost, which is subject to different constraints (at the systemand component-levels) in both modes (i.e., grid-connected and islanded) and the possibility of surviving outages that occur at random.Different studies have also addressed how to optimally size and locate DERs in electrical networks from the perspective of cooperative game theory, as in [105].In the latter, the authors presented a methodology consisting of two stages.In the first one, a set of candidate locations for the DGs is selected using the minimization of the equivalent marginal cost per unit of active power (which is the objective function in this case).In stage two of this methodology, the Shapley value in cooperative game theory is calculated to establish the optimal size and location for the distributed generators.The authors used two IEEE test feeders (14-and 30-node systems) for the simulations and found that the proposed methodology reduced the total generation costs.
Moreover, in [106], the authors created a multiscale optimization model to define the configuration, capacity, and geographic location of an MG in Ontario.Such a model took into account the project's net present value, the MG's power balance, the substations' maximum current capacity, and the physical availability of land and DERs for the MG.The authors first performed a multi-criteria spatial decision analysis in GIS to find potential locations where solar, wind, or micro-turbine systems could be installed.These potential locations were then used as input for the mathematical formulation, which included costs, earnings, and the inherent constraints of DER operation and installation.
In the specialized literature, several studies have addressed both technical and financial aspects.Postigo et al. [107] proposed a methodology to enhance continuous energy supply in radial distribution systems installed in rural places by optimally designing MGs that can supply energy to all customers following an outage.In their proposed methodology, the sizes of the DGs and their locations in the MG are selected using multi-criteria optimization and considering investment and improvement of system reliability.The authors recommend optimizing the size and number of DGs, as well as the infrastructure that connects generation sites and substations, in order to minimize both the net present value and the investment costs of the project.
In [108], the authors presented a multi-objective approach that employs a Genetic Algorithm (GA) and can calculate the optimal location and size of DGs in electrical systems.Their proposed formulation included, as objective functions, the reliability of the service, its operational efficiency, and the cost of the power supplied by the network operator, which should be the primary concerns of any planning of power distribution systems.In this study, however, the authors failed to compare the their approach to other solution methodologies.In addition, they did not take into account environmental indicators in the objective functions.
Regarding the environmental aspects, the number of studies into these aspects is lower than that of publications focused on technical and financial factors.Among such studies, we highlight [109], in which a mixed-integer non-linear programming model was solved in GAMS using the CONOPT solver, which deals with mixed and integer variables.Such a model was validated in the 21-node test system, and the numerical results revealed a significant reduction in pollutant emissions when PV systems were optimally integrated into the network.The number one objective in such a study was to reduce, as much as possible, the greenhouse gas emissions produced by diesel generators in islanded networks.In our literature review, we found no other studies that addressed environmental aspects through DG integration.However, there are publications that analyze the optimal power flow in networks with DGs already installed, with the aim of reducing CO 2 emissions [110].
Several studies based on evolutionary algorithms have also been developed to improve the various technical, financial, and environmental indicators of distribution networks through DG integration [111][112][113].According to the findings reported in such studies, intelligent algorithm-based methods should be used to address and solve the problem of the optimal integration of DGs into electrical systems.In addition, such studies have proven that such integration has been one of the most researched topics in the field in recent decades.
Based on this literature review, we may conclude that intelligent algorithms based on sequential programming are widely employed because, in addition to their excellent relationship between computation time and solution quality, they can be implemented without the need for specialized software.Another reason for their extensive use is their low complexity when compared to numerical methods based on higher level mathematical processes such as convex and conic methods.
Moreover, we noticed that statistical analyses are required to compare the results of the various solution methodologies that have been developed and to more thoroughly examine the repeatability and reproducibility of the solutions they provide in different test scenarios.Additionally, we observed a tendency to evaluate the computation times that these methodologies require to find a solution.The reason for this is that such information can be used to select efficient techniques (in terms of solution quality and computational requirements) that allow network planners or owners of DGs to evaluate the highest number of scenarios in the shortest possible time and meet the deadlines of short-and medium-term energy projects.In this regard, we also identified a trend in the last decade to use parallel processing tools [31].Additionally, we could not find a representative number of studies that incorporated environmental aspects in the proposed strategies for DG location and sizing, which is why they must be included in the modeling stage.
All of the aforementioned aspects will be taken into account when establishing the objectives of this project for the integration of DGs into MGs, as the primary goal is to cover the greatest number of needs that were identified in this literature review.
Finally, according to the UPME report [114], which presents statistics on certifications granted to power generation projects to qualify for the NCES tax incentives established in Law 1715 of 2014 [115], the number of requests and approvals for certificates for solar projects has increased, from roughly 50 in 2016 to 450 in 2021.Additionally, compared to other non-conventional energy sources such as geothermal, wind, biomass, and small hydroelectric plants, the majority of the certified projects correspond to solar energy projects.This trend is evident for both projects in the National Interconnected System (NIS) and projects in Non-interconnected Zones (NIZs), as there are over 800 certified projects in the NIS and approximately 50 certified projects in NIZs.
Table 1 lists a group of studies that have examined the optimal location of DGs in electrical networks.For each study, it specifies the author(s) and reference, the optimization technique that was used to solve the location problem, the test systems that were employed to assess the suggested methodology, the selected objective function (classified as technical and operational, financial, or environmental), whether the author(s) evaluated computation times, whether they analyzed the repeatability of the solution they obtained, and whether the performance of the proposed methodology was compared to that of other methods.
After analyzing the information presented in this table, technical and operational and financial aspects are the most commonly considered indicators in objective functions when proposing strategies for properly locating DGs into electrical networks, while environmental aspects have recently started to gain traction.Regarding the solution methods, software tools are not as relevant as optimization techniques.The test systems used for validation vary greatly across studies, and some authors have made changes to those available in the literature in this field.Moreover, not many studies have analyzed computation times or repeatability, both of which are critical when selecting an optimization technique to solve a given problem.Finally, we observed that, often, the performance of the methodologies that are proposed (measured as solution quality and computational costs) is not compared to that of other techniques, which makes it difficult to demonstrate the advantages of each technique in solving the problem being addressed.

Optimal Integration of Energy Storage Systems
The optimal integration of ESSs into MGs is a recent and emerging field of research with fewer publications than the optimal integration of DGs [116].However, the number of studies that strive to find a solution to the problem of their optimal location and integration into electrical networks (particularly MGs) has increased exponentially in recent years.
The main issue with the optimal integration of ESSs lies in their operation, as it adds many constraints to the problem's mathematical formulation [10].This is the case of the equations that control the maximum and minimum state of charge and the levels within which power can be absorbed or injected, all of which are associated with the power level of the ESSs to be installed in the MG and their charge and discharge periods [117].Importantly, for each ESS integrated into the MG, a set of such equations must be included in the formulation of the problem, which increases its complexity, especially when the network has multiple nodes, as electrical systems do.
A variety of methodologies for optimally integrating ESSs into MGs, and electrical systems in general, can be found in the specialized literature.For example, in [118], the authors proposed a methodology consisting of two stages.In the first stage of this methodology, the ESSs are located in the network by means of a load factor analysis (heuristic method), and in the second stage, their optimal size is determined using a constant power operation.In addition, the charge and discharge periods of the ESSs are examined to establish their required intervals of operation and, thus, maintain a constant voltage profile during demand changes, assuming fixed charge and discharge times for the devices.The authors of this paper, however, did not compare the performance of their proposed methodology with that of other techniques documented in the literature, nor did they assess the computation time that the proposed methodology requires to find a solution.
Using a known location for the ESSs in the system under analysis, the authors of [119] designed a recurrent neural network-based methodology for operating such devices.This methodology allows the system's power balance to be maintained and the voltage of the electrical network to be controlled.In this study, the authors used different power demand scenarios to test their proposed methodology but did not compare its performance with that of other methods.
As in DG integration, the techniques that focus on technical aspects of the network stand out among the most widely used for optimally integrating ESSs into electrical systems and MGs.For example, in [120], the authors employed a matrix codification of the Chu and Beasley genetic algorithm to select the type of ESSs to be integrated into an electrical system and find the location for such devices that provides the best benefits.They used MATPOWER to determine the operation scheme of such devices and solve the power-flow problem.In this study, the objective function, which was the minimization of the system's power losses, was subject to a mathematical formulation that assumed the batteries' charge and discharge periods to be the same.This, however, does not accurately reflect the real operation of this type of devices because it takes into account constant levels of power injection and absorption by the ESSs.Additionally, the authors did not compare the results they obtained with those of other related studies, nor did they analyze computation times, which is critical for validating a methodology's effectiveness and robustness.
In [121], the authors used a coalition formation algorithm to determine the operation scheme of multiple ESSs installed in an electrical system.They used, as the objective function, the minimization of the system's power losses, which they managed to optimize by analyzing the charging and discharging processes of the ESSs.The authors, however, did not assess computation times or the repeatability of the solution.
In [122], the authors employed a heuristic approach based on a power loss sensitivity indicator to optimally locate and size ESSs in an electrical system.Such an approach uses PSO to minimize the system's power losses.The problem with this approach is that using heuristic methods for DER location often leads to local optima, which limits the quality of the solution.
For their part, the authors of [123] developed a methodology that uses the coyote optimization algorithm to address the problem examined here (i.e., the optimal location and sizing of ESSs in electrical networks).Their objective function was to reduce power losses.To demonstrate the methodology's efficiency, the authors compared its performance with that of different metaheuristic algorithms.Nonetheless, they did not evaluate its repeatability, nor did they analyze computation times, which is key to validating a methodology's robustness.
In [124], the authors presented a mixed-integer quadratic convex model to locate and select the type of ESS to be integrated into electrical systems and solved it in GAMS.The objective function in that study was the minimization of a system's power losses in a scenario of daily operation with DGs already installed in it.They compared the results of their solution methodology to others provided by the mixed-integer non-linear programming model representing the problem under analysis.The authors, however, did not compare the computation times of the solution methods they employed.
Moreover, in [125], a second-order cone programming model and a semidefinite programming model were used to solve the problem of the optimal operation of ESSs in unbalanced three-phase systems, considering active and reactive power injection/absorption.The authors of this study employed, as the objective function, the minimization of the system's power losses and daily operating costs.Although they did not mention the software they employed to simulate the proposed systems and test cases, they compared computation times and analyzed the solutions produced by the two proposed convex models, which were solved using different solvers.
The studies into the optimal integration of ESSs into electrical systems have also focused on improving environmental aspects.For instance, in [126], the authors presented a mixed-integer non-linear programming model for locating and selecting the type of ESS to be integrated into electrical systems powered by diesel generators.This model was solved using GAMS, and its main goal was to reduce greenhouse gas emissions.Even though the authors compared their results to those of other approaches, they did not assess computation times.
In [127], the authors presented a second-order cone programming model, which was solved using a MATLAB CVX tool, to find the optimal operation of ESSs in electrical networks.They used, as the objective function, the minimization of CO 2 emissions and the costs associated with power losses in a single day of operation.Additionally, they employed multiple simulation scenarios, assuming a unity power factor for the ESSs.They, however, failed to compare their results with those of other approaches and evaluate computation times.Furthermore, in [128], an optimization technique was proposed to optimally integrate ESSs into electrical networks.This technique uses Pareto optimum fronts and multiple objective functions.The problem under analysis was represented using a mixed-integer linear programming model, and the primary goal was to lower the costs of investment in such devices, as well as the CO 2 emissions from power generation using fossil fuels.In this study, the authors employed different types of energy storage technologies and load curves but did not compare their results to those of other approaches.The reason for this is that their main purpose was to analyze the impact of integrating ESSs into electrical systems rather than to assess their methodology's performance.
For their part, the authors of [110] used a non-linear programming model to address the problem of the optimal operation of ESSs in electrical networks.Such a model, which was solved using GAMS, sought to reduce CO 2 emissions and the costs associated with power losses in a single day of operation by employing weighting factors for each term.According to the results, the proposed model managed to reduce CO 2 emissions and power losses.However, these results were not compared to those of other methods.Likewise, the authors failed to assess computation times.
As in DG integration, the study of the technical and financial aspects of electrical systems in ESS integration has attracted increasing interest in recent years.For example, in [129], a mixed-integer programming model was developed to plan the expansion of electrical networks, considering the integration of ESSs.This problem was solved using commercial software both for the integration model and for obtaining the power flows.The goal in this study was to maximize the system's social benefits and minimize the operating and investment costs of the ESSs over a given planning horizon.Thus, a proper planning of an electrical system would make it possible to improve its technical conditions.
In [130], the authors described the operation and configuration of ESSs by employing a method known as receding horizon control, which was solved using convex optimization.The primary objective of this study was to minimize ESSs' configuration and operating costs.Although the authors assessed computation times, they did not compare their results with those of other solution methods.
In [131], the authors addressed a slightly different problem (i.e., the optimal operation of ESSs and DGs) employing a non-linear programming model, which was solved in GAMS.Their objective function was the minimization of the costs of operating the network.The main drawbacks of this study were that computation times were not assessed and that other solution methods were not used for comparison purposes.
Similarly, in [132], a non-linear programming model was developed to determine the optimal operation of ESSs, considering the possibility of active and reactive power injection/absorption. Said model was solved using GAMS.In this study, the minimization of the network's daily operating costs was used as the objective function.However, one of its main shortcomings is that computation times were not assessed and the proposed method was not compared to others.
In [133], a second-order cone programming model was employed to find the optimal operation of ESSs.This model-which was solved using GAMS-considered the possibility of active and reactive power injection/absorption by implementing a basic passivity-based control.In this study, the main objective was to lower the network's daily operating costs.Moreover, the results and computation times of the proposed method were compared to the solution provided by the non-linear programming model.
For their part, the authors of [134] solved the problem of the optimal location-reallocation of ESSs in DC MGs, which was represented by a mixed-integer non-linear programming model.This model, which was solved in GAMS, sought to lower the energy purchase costs at the node interconnected with the electrical network, as well as the costs associated with the daily power losses.In this study, however, computation times were not evaluated, and the performance of the proposed method was not compared to that of other methods.
In [69], the authors employed a semidefinite programming model to determine the optimal operation of ESSs in DC MGs with high distributed generation penetration.To solve such model, the authors used the specialized MATLAB CVX tool.Additionally, they employed, as the objective function, the reduction in the MG's operating costs.To validate the methodology's precision and quality, the authors compared its results with those obtained by the commercial optimization software GAMS.They, however, did not assess computation times.
As in the studies mentioned above, different methodologies that use specialized software for the optimal integration of ESSs into electrical networks have been recently proposed.Although these methodologies yield high-quality solutions, they require the use of commercial optimization software, which is sometimes highly expensive.In addition, this type of software requires adapting the input and output data according to its requirements, which increases the complexity of the analysis and implementation phases [10].Another major disadvantage of using specialized software (e.g., GAMS) to solve non-linear problems with binary variables, as in the integration of ESSs and DGs, is that the solution may not achieve the global optimum, and, in most cases, it becomes stuck in local optima.
In light of these issues, researchers have recently tried to reduce and even avoid the use of commercial software to solve the problem of the optimal integration of ESSs into electrical systems and MGs.For instance, they have proposed intelligent methods based on metaheuristic algorithms, that is, robust modeling and optimization tools that help to solve highly complex engineering problems in an efficient and practical way and with reduced computation times.Moreover, these methods offer good quality solutions that reach, or at least approach, the global optimum [135].
For example, the authors of [136] used the simulated annealing algorithm to locate the ESSs and an optimal power flow tool to establish their operation scheme.They employed, as the objective function, the maximization of the project's financial benefits, considering ESSs' installation and operating costs.Likewise, they analyzed variations in the energy costs and life cycle of the ESSs using different constant demand scenarios.They, however, did not evaluate computation times, nor did they assess the repeatability of the solutions.
In [10], the authors employed a master-slave methodology to find the optimal operation of the ESSs.The master stage of this methodology uses the PSO algorithm, and, in the slave stage, the power flow method based on successive approximations.Additionally, the authors used, as the objective function, the reduction in the energy purchase costs at the main node of the electrical network.To verify the methodology's efficiency and robustness, the authors compared its performance with that of three metaheuristic algorithms.Additionally, they assessed the repeatability of the solution and analyzed computation times.
In [137], the authors presented a multi-objective gravitational search algorithm and a hybrid (PSO-genetic algorithm) methodology to address the problem of optimally locating and sizing ESSs in electrical networks, considering the presence of wind turbines.They employed, as the objective function, the minimization of the following three terms: operating costs, voltage profile deviation, and greenhouse gas emissions.Different scenarios were used to test the proposed methodology, and the results and computation times of each metaheuristic algorithm were compared.The methodology's repeatability and robustness, however, was not assessed.
For their part, the authors of [138] solved the problem of finding the optimal operation of ESSs in electrical networks with wind generators and capacitors.Their primary purpose was to lower the system's operating costs and daily energy losses.To this end, they implemented the non-sorting genetic algorithm.Although the authors compared the algorithm's performance with that of other methods and evaluated its repeatability and robustness, they did not analyze computation times.
Finally, in [139], the gray wolf optimizer was employed to find the optimal location and size for ESSs in electrical networks.In this study, the minimization of the system's annual operating costs was used as the objective function.To validate the methodology's efficiency, its performance was compared to that of two classical methodologies.However, no statistical analysis was carried out, nor were computation times assessed.
From this literature review, we may conclude that the problem of optimally integrating ESSs into electrical networks and MGs can be solved using intelligent software based on metaheuristic algorithms.As in DG integration, the purpose of this strategy is to obtain greater technical, financial, and environmental benefits in the shortest computation times.We, however, observed that a limited number of studies use metaheuristic optimization techniques, which suggests that, at the time of this review, this type of methodology had not attracted the interest of authors in the field.Despite this, we identified a great interest among researchers in analyzing the technical and financial aspects of electrical networks to achieve an efficient operation; minimize investment and operating costs; and meet the energy, power, and service quality parameters.All of this is necessary to meet the energy demand in accordance with the conditions imposed by energy regulators, such as the CREG in Colombia [140].
Table 2 lists the methodologies we found in the literature for solving the problem of optimally integrating ESSs into electrical networks.By analyzing the information presented in this table, we can confirm the tendency to develop strategies for improving financial aspects in electrical networks and, to a lesser extent, environmental and technical indicators.We can also highlight the significant implementation of specialized software (i.e., GAMS and CVX), as well as bio-inspired algorithms based on sequential programming, to solve the mathematical models that represent the ESS integration problem.Regarding the test systems employed for validating the proposed solution methodologies, we found that the 33-and 69-node systems are the most widely used.In addition, we observed that the repeatability and computation times were not analyzed in many cases, making it difficult to determine the effectiveness of the algorithm each time it is run, as well as the speed at which these strategies provide a feasible solution.Finally, we noticed that few authors compare their results to those of other methods in order to assess the efficiency of their proposed strategies, which makes it difficult to evaluate solution quality and computation times.The problem of optimally sizing and locating DGs and ESSs in electrical networks has also been addressed jointly.For example, in [141], a mixed-integer quadratic programming model was used to optimally plan and operate MGs, taking into account the integration of (PV and gas) DGs and ESSs.To solve this model, the authors proposed a stochastic optimization technique consisting of two stages.The first stage focused on the optimal location and sizing problem, and the second stage dealt with the operation of the devices.Their objective function was to lower the operating and investment costs for the network operator.To test the methodology, the authors used different simulation scenarios.However, they did not compare its performance with that of other methods, nor did they analyze computation times.
In [117], a method based on operating states was used to find the proper operation of ESSs and DGs in an islanded DC MG.For this purpose, the authors developed a mathematical formulation that included all DERs' technical and operational constraints.The authors, nonetheless, employed a single-node network in their simulations, leaving aside the non-linearities and requirements of networks that have multiple nodes.
In [142], the authors proposed a new hybrid (PSO-genetic algorithm) approach to solve the problem addressed here (i.e., the optimal location and sizing of ESSs and DGs in electrical networks).Their objective function was to minimize the network's investment and operating costs.To evaluate the methodology's efficiency, they compared its performance to that of other methods.However, they did not assess computation times.
For their part, the authors of [143] used a modified version of a genetic algorithm to address the problem of optimally integrating renewable energy sources (e.g., wind turbines and PV panels).The authors considered their investment and operating costs (depending on the type of technology), as well as their location and sizing.The mathematical model included an AC optimal power flow to guarantee the network stability.The simulations were performed in the 33-node test system over a time horizon of 8760 h (1 year).In addition, the following two scenarios were taken into consideration to analyze the variability of the investment: (i) an islanded system, in which the power demand was supplied solely by the DGs and ESSs; (ii) and a grid-connected system, in which the main network supported the system.According to the results, when the 33-node test system was connected to the network, it reduced the installed capacity by 37%.Although the authors validated their results using the DC optimal power flow and the linearized way, they did not compare them with those of other techniques.
The authors of [144] developed a strategy for optimally sizing DGs and designing a MG while studying various technical and financial constraints.The solution method was an energy management algorithm intended for a hybrid MG consisting of PV sources, wind turbines, ESSs, and fuel.Moreover, the authors of this study analyzed two hydrogen production methods, with the goal of minimizing the total costs, natural gas consumption, and overall energy exchange with the main network.The different types of waste from the system were used to provide the fuel cell with the hydrogen necessary to produce electricity.Furthermore, the annual load, wind speed, and solar radiation were used as input data to prove the method's effectiveness.Based on the results, the demands were successfully satisfied, and the optimization constraints were properly met.
In [145], a non-linear programming model was developed to operate electrical systems (considering the integration of ESSs and DGs) and solved in GAMS.The minimization of the system's operating costs, power losses, and greenhouse gas emissions, as well as the improvement in its voltage profiles were used as the objective functions.In this study, however, the authors did not analyze computation times and used no other methods for comparison purposes.
These same limitations were observed in [146].In such study, a control strategy was presented to manage a MG's energy and power levels by optimally integrating DERs (ESSs and DGs).The objective function was to lower the operating costs of the MG and mitigate its environmental impact.The proposed methodology uses an evolutionary algorithm to find the optimal operation of the ESSs and DGs.
In [147], the equilibrium optimization algorithm was employed for optimally integrating ESSs and DGs into electrical networks.In this study, the objective function was to minimize: (i) the costs of the energy not supplied, (ii) the operating and investment costs of the elements to be integrated, (iii) power losses, and (iv) CO 2 emissions.To validate the method's effectiveness, the authors provided different study cases and compared its performance to that of other methods.However, they did not assess computation times, nor did they conduct a statistical analysis.
In [148], the authors described the optimal operation of ESSs and DGs in DC and AC electrical systems.Renewable DGs were represented using a daily generation curve, while ESSs were formulated with a linear representation that considered their operational limits.This problem was addressed by means of a non-linear programming model, which was solved using GAMS and whose purpose was to minimize power losses and greenhouse gas emissions in one day of operation.Although the authors considered various scenarios, they did not compare the performance of their methodology with that of other methods, nor did they analyze computation times.
For their part, the authors of [149] proposed an optimized home energy management model that included ESSs and DGs based on renewable sources.The mathematical optimization problem was formulated by means of multiple knapsack problems, and it sought to reduce household electricity bills.To validate the results, the authors used different metaheuristic algorithms for comparison purposes and analyzed computation times.However, they did not assess the solutions' repeatability.
Similarly, the authors of [42,93] presented an optimization strategy for properly integrating ESSs and DGs into electrical systems.A mixed-integer non-linear programming model was employed to represent the problem, and it was solved using a genetic algorithm.The primary purpose was to lower the investment, operating, and maintenance costs over a given planning horizon.The numerical results demonstrated the advantages of implementing ESSs and DGs in medium-voltage networks.However, despite considering different study cases, the authors of this study did not compare their results with those of other studies.Likewise, they failed to assess computation times and the methodology's repeatability and robustness.
Lastly, the authors of [150] designed a methodology for the optimal operation of ESSs and DGs in electrical networks.Their primary objective was to minimize the costs of the energy not supplied, as well as the network's operating costs.The problem under analysis was solved using PSO.To validate the results and for comparison purposes, the authors employed other evolutionary algorithms.Additionally, they evaluated the methodology's repeatability and robustness.However, they did not assess computation times.
Table 3 summarizes the methodologies we found in the literature for solving the problem of the optimal integration and operation of ESSs and DGs in electrical networks.As in the studies into ESS integration, there is a clear tendency to develop methodologies focused on improving the financial aspects of the network.However, the environmental, technical, and operational indicators show an important potential for development.Regarding the solution of the mathematical models that represent the problem, we can highlight a strong implementation of heuristic algorithms based on sequential programming.Moreover, given the complexity of the problem, we observed a limited use of specialized software.With respect to the test systems employed for evaluating the methodologies, the 33-node system is the most widely employed.Furthermore, we noticed that most of the authors did not analyze computation times and repeatability, making it difficult to demonstrate the algorithms' robustness and efficiency and the speed at which these strategies provide a feasible solution.Finally, we identified the same trend as in the studies into ESS integration: few authors compare their results with those of other methodologies documented in the specialized literature, making it difficult to evaluate the strategies' efficiency.
Figure 8 presents the optimization techniques typically used for optimally integrating ESSs and DGs into electrical networks.In addition, it shows the most commonly employed objective functions to solve such an optimization problem from the technical and operational, financial, and environmental perspectives.From the technical and operational perspective, we find power loss minimization and voltage stability and short-circuit level index improvement.From the financial perspective, we have the reduction in the CapEx and OpEx of the DERs and in the costs associated with power losses.Lastly, from the environmental perspective, there is the reduction in CO 2 emissions.

Conclusions
From this literature review, we realized that the joint integration and operation of ESSs and DGs into electrical networks is an emerging subject of research, as evidenced by the low number of studies available in the specialized literature.Additionally, we noticed that most publications focus on the most widely employed and developed distributed generation and energy storage technologies.To analyze DER integration, we first identified all the devices that make up a conventional MG, as well as the different stages required for properly integrating DERs into a MG.
In this paper, we described the most extensively used codifications for solving the problem of the optimal (separate or joint) integration (location and sizing) of DERs into MGs.This allowed us to determine that it is a non-linear and non-convex problem, given the discrete and continuous nature of the variables that make it up, as well as the non-linear nature of its power balance equations.With the help of these codifications, researchers from all over the world could evaluate new optimization methodologies that work with binary, discrete, continuous, and mixed variables to achieve the best possible outcomes in solving the problem addressed here.
After analyzing the most relevant solution methodologies for solving the problem examined here (i.e., the optimal integration of DGs and ESSs into electrical networks), we found that the majority of them use commercial software tools and sequential programming methods seeking to enhance the financial, technical, and environmental aspects of electrical networks.In particular, we observed a tendency to develop technically and financially efficient approaches aimed at lowering DERs' investment, operating, and maintenance costs while respecting all the operational and technical constraints of MGs and electrical systems in an environment with DERs.Additionally, we observed that several studies have focused on improving the technical aspects of electrical networks by employing, as objective functions, the minimization of power losses, the optimization of voltage profiles and stability, and the improvement in line loadability.Nonetheless, regardless of whether a solution methodology uses an objective function focused on technical aspects or not, all the operational and technical limits of a MG must be taken into account within the set of constraints that describe the mathematical model.Finally, regarding the environmental aspects, we identified that it is an emerging topic, with all efforts concentrating on the reduction in pollutant emissions from fossil fuels.More research on in this matter needs to be developed in order to lessen the environmental impact caused by energy consumption.
Furthermore, from this literature review, we identified the need to examine the efficiency of the solutions provided by the different approaches, as well as their processing requirements.The idea behind this is to assess their repeatability, effectiveness, and robustness.For such a purpose, different authors have proposed hybrid solution methodologies that employ parallel processing tools to shorten computation times.
Concerning future lines of research in the field, we noticed the need to consider, in the mathematical models, all the details of the different devices that make up a conventional MG (e.g., power limits, lifetime, technical degradation), this with the goal of increasing the efficiency of the methodologies in improving MGs' financial, technical, and environmental conditions.Additionally, future studies could include all DERs that are currently in use and those that are being developed (which can be found in recent reviews focused on power electronic systems and generation devices) in order for MGs to be dynamic and resilient and to improve the financial conditions and quality of life of the users connected to them.Likewise, some authors recommend developing new master-slave methodologies that employ parallel processing tools to shorten computation times.Furthermore, by using discrete-continuous codifications and optimization methodologies tailored for these types of codifications, the problem of DER integration could be solved with a unique optimization method, thus reducing its complexity and computation times.Lastly, future research could employ multi-objective approaches to solving the problem examined here by combining technical, financial, and environmental objective functions and with the goal of promoting the efficient operation of MGs and lowering greenhouse gas emissions from fossil fuels.
After a successful MG planning, the next step should be focused on proposing operation methodologies for the DERs installed in the MG in order to guarantee that these control and optimization strategies satisfy all the requirements established by the owner, operator, and user of the MG.These operation methodologies, just like the planning methodologies examined in this paper, must also produce outstanding results in terms of repeatability, solution quality, and computation time.

Figure 2 .
Figure 2. Stages of the methodology proposed for optimally integrating distributed energy resources into microgrids.

Figure 3 .
Figure 3. Master-slave methodology for the proper integration of DGs and ESSs into distribution networks.

Figure 4 .
Figure 4. Codification to locate DGs and ESSs in distribution networks.

Figure 5 .
Figure 5. Codification for locating distributed generators in distribution networks.

Figure 6 .
Figure 6.Codification to locate ESSs in distribution networks.

Figure 7 .
Figure 7. Variable solar irradiation and demand in an urban and rural area in Colombia.

Figure 8 .
Figure 8. Objective functions and optimization techniques used for the optimal sizing and location of ESSs and DGs into electrical networks.

Table 1 .
Methodologies used in the literature for the optimal location and sizing of DGs.