Optimal Inverter-Based Resource Installation to Minimize Technical Energy Losses in Distribution Systems

This paper proposes an algorithm for the optimal installation of inverter-based resources (IBR) composed of wind energy conversion systems, photovoltaic systems, and battery energy storage systems in distribution systems using genetic algorithm (GA) and the cuckoo search (CS) as optimization techniques. The OpenDSS software is used to calculate the power flow in the distribution system with different penetration levels of IBRs. It is used a standard load shape of the IEEE 123 bus system programmed in OpenDSS and irradiance, temperature, and wind speed curves from Brazil. The proposed algorithm, using a genetic algorithm and cuckoo search, was able to define the quantity and the location of hybrid renewable generation arrangements reducing electrical energy losses. Case studies were carried out for maximum penetration from 20% to 60%, totaling 5 cases, where each simulation was performed for a period of 24 hours. It is simple, fast and efficient, achieving satisfactory results and being able to be applied to larger systems. The proposed method stands out for the possibility of using IBR in conjunction with energy storage, in addition to having a customizable hybrid array and being able to carry out case studies with high penetration while optimally locating and sizing the hybrid array configured accordingly with the needs of each problem, reducing losses and maintaining the quality of the system’s electrical voltage.


I. INTRODUCTION
Inverter-based Resources (IBRs), e.g., wind, photovoltaic (PV), and battery energy storage systems (BESS), have become attractive solutions with the increased demand and the need to reduce carbon emission in power generation.The IBRs are an alternative to meet the demand due to the low investment risk and short installation time, as they are located The associate editor coordinating the review of this manuscript and approving it for publication was Salvatore Favuzza .close to the loads and have a low occupation of physical space, allowing their installation in large load centers [1], [2].However, the connection of IBRs results in several technical and economic challenges due to the intermittent nature of wind, irradiance and temperature.Nevertheless, an optimal installation of IBRs minimizes system losses, reduces feeder demand, and reduces initial investment and operating costs, as well as improves power quality, stability, reliability, and system resiliency.However, even with these advantages, large insertion of IBR demands the need to develop new tools to improve system management, as insertion causes problems such as the appearance of reverse power flow and increased harmonic injection into the network [1], [2], [3], [4].
Most countries have increased the use of IBRs.For instance, between 2020 and 2021, Brazil had an increase of installed renewable energy by 6.6%, while Germany and the USA increased by 4.9% and 11.1%, respectively [5].According to [6], in 2021, Brazil had around 181.6 GW of installed capacity, of which 60.2% was hydropower, 11.4% wind and 2.6% photovoltaic.Electric power generation was supplied by several energy sources, where hydraulics generated 55.3%, wind 11.0%, and photovoltaics 2.6%.The photovoltaic generation grew the most between 2020 and 2021.
The increased insertion of intermittent generation has changed the way distribution systems are planned and operated.As higher penetration is achieved, generation and load balancing during normal operating conditions and abnormal events becomes more dynamic [7], [8].Therefore, the growth of IBRs insertion has resulted in the development of techniques for optimal IBRs incision.However, research to define the best placement for renewable resources faces several technical challenges: the cost of installing distributed generation systems; the integration of distributed generation with the existing electrical grid, as energy generation is intermittent and in variable amounts; regulation, as government policies can directly affect the adoption and implementation of these technologies; maintenance, which can be more complex and require specialized technical skills; improve voltage stability; and reliability, as this generation is susceptible to external factors, such as adverse weather conditions or failures in the existing electrical network [9], [10], [11].
Multi-objective optimization techniques have been developed to place IBRs with the aim of reducing carbon emissions and improving economy [12].[13] opted for the optimal installation aiming at reducing costs and average generation, considering the intermittent nature of these sources and using stochastic processes to perform their estimates.Reference [14] used a differential evolution algorithm to integrate the IBRs into the distribution system to maximize their generation and improve the power factor.Classic optimization methods such as particle swarm optimization (PSO) are used to minimize the total harmonic distortion (THD), the total cost of distributed generation units and greenhouse gas emissions from the optimal installation of IBRs [15].For instance, the optimal installation of distributed wind generation improves the voltage profile of the feeder, reduces the emission of pollutants, increases the resilience and efficiency of the system, and reduces technical losses [16].Conversely, the inadequate installation of distributed generation can result in other problems, such as the increase in the operational cost [8], [17].The use of optimization methods can avoid these problems by installing the hybrid array optimally.
Most methods for optimal installation of IBRs use only solar, wind or fuel cells, does not consider storage systems, and does not evaluate high penetration of IBRs.The most common challenges found in the literature are: the difficulty in performing the optimal allocation of distributed generation, as it must consider the generation capacity, location and type of generation used; the physical limitations of the system, which must consider the limitations of voltage, current, and generation capacity to prevent the grid from becoming inefficient or inoperative; economic viability, regardless of the method used, it must take into account the costs involved in implementing the IBR; integration with the existing electrical system, the intermittency of solar and wind generation is a challenge due to the intermittency of generation, energy quality, stability and voltage control; coordination with the power grid, which can be a major challenge especially when there are multiple distributed generation sources connected to the system [9], [10], [11], [18], [19], [20], [21], [22].
Based on the literature review, it is necessary to adopt technology solutions to minimize the negative impacts of the high insertion of IBRs in the electrical system, as improper installation of IBRs can result in a costly or ineffective system.When installing IBRs, choosing the most appropriate technologies and solutions and considering long-term economic viability are necessary.It is necessary to implement power flow control strategies, which allow the coordination of distributed generation with the electrical grid efficiently and safely.
In order to overcome the aforementioned limitations, this paper proposes an algorithm based on the genetic algorithm (GA) and cuckoo search (CS) optimization techniques to perform the optimal installation of IBRs in distribution systems with the following contributions: 1) solve the problem of the increase of technical losses based on the optimal installation of IBRs in order to minimize the technical losses of electric energy in the distribution system; 2) provide an insight into the behavior of high penetration IBRs (wind, photovoltaic, and battery energy storage) at steady state over a 24 hour period, aimed at achieving optimal installation of high penetration IBRs; 3) propose a simple, fast, and effective method for optimally installing IBRs and reducing energy losses; 4) have the possibility of using the proposed algorithm for large systems, in addition to being able to use other configurations of IBRs; 5) consider different penetration levels, such as 60%, because the future power system will require this condition; 6) propose an algorithm capable of successfully defining the amount and location of IBRs in the system.
OpenDSS is used to calculate the load flow, not exceeding the limits of the system operator.As expected, a standard test system model, the IEEE 123 bus, was used with challenging scenarios with wind turbines, solar plants, and BESS in modern power distribution systems.A comparison of the proposed method with some of the most similar ones in the literature proved the effectiveness of the proposed method.

II. THEORETICAL DEVELOPMENT
In this section, theories and equations used in this paper are discussed, focusing on the power flow and the heuristic goals used in the development of this work.

A. PROBLEM FORMULATION
The problem to be solved in this paper is to determine the optimal installation of hybrid arrangements in electrical energy distribution systems so that it is possible to minimize energy losses in the system.As the possible installation locations of the hybrid arrangements are the system buses, the problem is characterized as combinatorial optimization.Thus, the objective function of the method was elaborated according to (1) and aims at minimizing the system's technical energy losses.
where n is the number of feeder sections; P k (t) are the active losses in the section k for each hour (t), which ends in bus k.
The energy losses are the results of the power flow calculation, which is used repeatedly in a resolution of one hour, at the end of the 24 hours, the total daily losses are obtained.The losses of each piece of equipment used are present in the losses in each section of the feeder and are also accounted for.GA and CS are the meta-heuristics used to solve the combinatorial optimization problem and to analyze the associated costs, an economic analysis was performed using the net present cost.

B. POWER FLOW
The power flow has the function of obtaining the operational state of an electrical network in a steady state, signaling the paths taken by the active and reactive power in all the elements of the electrical network.The power flow provides system operation in a steady state, being possible to verify if the voltages are within the limits, the static stability of the system, the economic dispatch, the reliability, and the technical losses.
The OpenDSS software was used for the calculation of the power flow.It was designed to execute a power flow in which the power system volume is the dominant source of energy and is used by distribution companies [23].A complete 3-phase model was used, which allows 3-phase quantities.There are several ways of executing the power flow and being used in this research is the ''daily'' mode.Another positive point of OpenDSS is the possibility of communicating with external programs.At the end of the power flow execution, the losses, voltages, flows and other information are available for the whole system [23].
Other advantages of using OpenDSS are its flexibility in modeling electrical distribution systems, as it allows detailed modeling of electrical equipment in circuits and lines.OpenDSS is capable of simulating the integration of distributed generation systems, including renewable sources and energy storage.Furthermore, it can be easily integrated with other tools such as MATLAB and Python programming language [24].
To calculate the power flow, OpenDSS uses the sum of currents method (or nodal analysis), which provides a VOLUME 11, 2023 123963 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
procedure capable of analyzing circuits using nodal voltages as circuit variables.This method has a smaller number of equations to be solved simultaneously [25].The sum of the current method starts by selecting a node as a reference and assigning voltage values to the other nodes.Applying Kirchhoff's first law at each node and using Ohm's law to express branch currents in terms of nodal voltages, the current method solves the resulting simultaneous equations to obtain the nodal voltages.These equations can be solved using iterative numerical methods such as Newton's method.This method is illustrated in Fig. 1.
OpenDSS builds nodal admittance matrices for system elements from system data for power flow resolution.A primitive admittance matrix is calculated for each circuit element.These small nodal admittance matrices are used to build the admittance matrix of the main system Y System [23].
After building the matrix Y System , the initial voltage vector of the system is estimated and the compensating currents (I Inj ) are calculated.The currents are a function of voltage and represent the non-linear portion of currents from load elements, generators, PV systems and storage.An initial estimate on the voltages (V Bus ) is obtained by performing a direct solution of (2), in which loads and generators are modeled by their linear equivalents without injection currents.
Solving the matrices and using (3), it is possible to estimate the voltage in the bus (V n+1 ).
The process repeats, after building the matrix Y System , the initial voltage vector of the system is estimated and the compensating currents are calculated.Again, solving the matrices, the new estimate of the voltage in the bus is calculated V n+1 .This process is repeated until the convergence criterion, defined in (4). where: This simple iterative solution has been found to converge very well for the majority of electrical distribution systems that have adequate capacity to service the load.This is because the distribution systems have a dominant mass energy source (generally large generating units), which is the case for most distribution systems [23].

C. GENETIC ALGORITHM
As developed by [26], the traditional theory of the GA assumes that it works by discovering, emphasizing, and recombining good ''features'' of solutions.That is, good solutions tend to be made up of good ''features'', which are combinations of values that make strings more suitable.This implies that in a given generation, while the GA is evaluating ''n'' strings in the population, it estimates the average fitness of a much larger number of individuals, where the average fitness of an individual is defined as the average fitness of all possibles of these individuals [27].
The chromosome is made up of ''genes'', where these genes can be binary, decimal or floating.GA has three main operators: crossover, selection, and mutation.Crossing is performed between two chromosomes of a population, giving rise to two new chromosomes.Selection, on the other hand, consists of selecting the best solutions and discarding the worst solutions.For the selection, combat in the arena was used, where two chromosomes are randomly selected and compete to see the best solution.One solution continues into the next generation while the other is phased out.The mutation occurs infrequently in the population and starts by selecting a chromosome at random, then it causes the change in its genes at random.Unlike the crossover that aims to homogenize the population, tending to an optimal solution, the mutation has the opposite effect and tries to get out of this optimal solution.If the optimum is local, the mutation is likely to be successful.There is still a condition that is not part of the three main operators, but that is of great importance, which are penalties and restriction criteria.They are ways of reducing the value of conformity adequacy that do not fit the constraints imposed by the problem [28].The flowchart of the genetic algorithm is shown in Fig. 2.
A typical GA has between 50 and 500 generations, where each generation is an iteration of the process.The ''ages'' are the set of generations, and at the end of each era, there are usually one or more chromosomes suitable to be considered optimal solutions.Randomness plays a prominent role in each execution, that is, each execution has its behavior, but must converge to the same local optimum at the end of the method execution.

D. CUCKOO SEARCH
The CS is based on the behavior of cuckoo species [29].Cuckoos lay eggs in other birds' nests during reproduction, as their eggs are similar to those of other species, which makes it possible for cuckoo chicks to turn into adult cuckoos.Some cuckoo eggs are discovered and eliminated by the host bird, and it is still possible to abandon the nest and create a new one in another location.Some studies have demonstrated the use of Lévy's flight for the locomotion of some birds and its great potential in the area of optimization.CS consists of three basic rules, which were elaborated when comparing the algorithm with GA and Particle Swarm [29].In addition to having a fast convergence, and being simple and efficient, CS is widely used in optimization problems.Other CS applications can be observed in other areas such as scheduling, resource selection, image processing, planning and forecasting [29], [30].
In CS, each new solution is represented by a cuckoo egg and each current solution by an egg in a nest.The solution is evaluated based on its fitness, which represents its ability to serve as a solution to the problem studied.If a new solution is better than the previous solutions, then it replaces the worst selection in the set of solutions.Using the Lévy flight, our solutions are obtained to explore the search space, and, finally, a solution present in the worst nests is discarded respecting a certain probability of abandonment [29].CS's 3 basic rules are: 1) Each cuckoo lays one egg at a time in a random nest; 2) The best solutions are kept for the next generation; 3) Each nest contains only one egg; the number of available nests is fixed and the egg laid by the cuckoo is there is a probability that the egg will be discovered by the host bird.The flowchart of the cuckoo search can be observed in Fig. 3.

E. COST ANALYSIS
This subsection provides the basic knowledge about the subjects related to economics used in this work.Data referring to the cost of materials used in hybrid arrangements are difficult to access since they are part of the companies' strategic planning.Thus, for the present work, values found in international energy surveys were used.
To estimate the costs of the selected system, the Net Present Cost (NPC) was applied.This methodology combines costs and evaluates future costs in the present.With the application of the NPC, it is possible to simulate the costs related to the entire useful life of the selected system, using the simulation of one year of operation of the system [31].
The costs considered in the calculation of the NPC are the capital cost which is the initial cost of purchasing and installing a system, the operation and maintenance throughout its life cycle, and the cost of replacing system components whose useful life is less than the system lifetime.The NPC was formulated as can be seen in ( 5) [32]: (5) on what: where N i is the number of components of a given technology; CC i is the capital cost, or cost of purchasing and installing the system; RC i is the replacement cost of components with a useful life of less than N ; K i is the conversion factor from future cost RC i to present cost; O&M are the operating and maintenance costs; PWA(ir, R) is the conversion factor of future costs from O&M to present cost; L 1 the number of times each component is replaced during R; L 2 is the lifetime of the component i; ir the interest rate considered; and, R is the lifetime of the entire system.

III. LOAD AND GENERATION
The methods used and presented in this section introduce the load and generation models used in the paper, as well as the data used in the case studies.VOLUME 11, 2023 123965 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

A. LOAD LEVELS
To minimize energy losses in electrical systems, the methodology consists of determining the optimal installation of a hybrid arrangement (wind generation, photovoltaic generation, and energy storage systems) in electrical energy distribution systems, respecting the voltage limits adopted [33], [34].In addition, the hybrid arrangement will not be installed on the substation bus.The system buses are the places where the hybrid arrays can be installed, which characterizes the problem as a combinatorial optimization problem.
At the end of the daily power flow calculation, OpenDSS provides the active losses of the system.The heuristic methods used here were GA and CS to solve the combinatorial optimization problem.The load curve lasted 24 hours and the default values existing in OpenDSS were used.This load shape is shown in Fig. 4.

B. GENERATION MODEL
According to [35], the active power produced by the turbine is given by: where P wind (v) is active power generated by the turbine in kW; p r is the turbine rated power in kW; v c is the turbine cut-in speed in m/s; v f is the turbine cut-out speed in m/s; v r is the rated wind speed in m/s; v is the wind speed in m/s.This generation model is used together with OpenDSS to simplify and speed up the power flow calculation.
According to [23] and [36], the maximum output power of the array photovoltaic energy is estimated by the following equation: where P out is the maximum output power of the array, adjusted for the ambient condition local in kW; P STC mp is the maximum power of the photovoltaic array under STC (Standard Test Conditions) in kW; G i (pu) is the incident irradiance normalized concerning a base value in pu; G i (base) is the base incident irradiance, usually the maximum value of the time series, in kW/m 2 ; factor(T mod ) is the P STC mp correction factor as a function of the module temperature.
OpenDSS has models of wind turbines, photovoltaics, and the BESS.In the modeling of wind turbines, the data found through (8) are used.For photovoltaic modeling, it is necessary to enter the inverter performance data, irradiance, and temperature data.So OpenDSS can use (9) to calculate the output power of the photovoltaic system.Finally, to model the BESS, simply insert the charging and discharging curve of the storage system.

C. DATA AND HYPOTHESES
The decimal alphabet was used to solve the problem, and an example of a chromosome (cuckoo egg) is shown in Fig. 5.Each solution consists of a vector of 3 positions, where each position refers to the bus of the system where a turbine is installed and its values change according to the buses of the studied system.
The authors recommend using all input data from the same location, although the proposed methodology accepts data and distribution systems from any other country, such as wind speed from the USA, temperature and irradiance from Germany, or a real distribution system from England.However, the case studies used data from Brazil and an IEEE test system.
Data from Brazil indicate that the average cost of installation and operation is R$/kW 4,750.00 and R$/kWh 65.00, respectively for turbines.The solar plant is R$/kW 4,250.00 and R$/kWh 50.00, for installation and operation.For BESS are R$/kW 380.00 for installation and R$/kWh 65.00 for operation.The system used was the IEEE 123 bus present as a model in OpenDSS itself and for the daily calculation the default load shape was chosen, also present in OpenDSS itself.The daily mode considers a resolution with intervals of one hour for analysis, that is, one power flow simulation per hour based on the corresponding load/generation profile.Table 2 summarizes the data of the wind turbines used that were chosen based on the models most found in Brazil, the variety of models aims to explore different analyzes of the results.The wind speed curve used is shown in Fig. 6.
In Table 2 are shown the manufacturer, the turbine models, the rated power, the rated speed of the turbines, cut-in, cut-off, and the hub height.They were considered in the simulations.The daily wind speed data comes from Brazil and refers to the year 2020.A power plant of 1 MW was used for the photovoltaic system, the irradiance and temperature curves are shown in Fig 7 and 8, respectively.For BESS, a system with a nominal power of 1 MW and a nominal storage of 4 MWh with a power factor of 0.92 was used.The charging and discharging curve is shown in Fig 9 .The entire hybrid arrangement is connected to the system bus with a voltage of 12.47 kV.
The routine was executed ten times for each case to obtain reliable results and to verify if all executions would culminate in the same optimum, or if there would be any divergence.The results of the heuristic goals depend directly on the initial estimate, which is due to the various random processes present in the methods, such as crossover, selection, mutation, Lévy flight, and probability of abandonment.All simulations were run ten times for each case and performed using the IEEE 123 bus system, whose information is shown in Table 3.The same GA and CS configurations were used for all simulations.These configurations are shown in Table 4 and Table 5.Table 4 summarizes the GA configuration, such as the population, crossing, mutation, era, and generation.Table 5 shows the CS parameters, containing the number of cuckoo eggs, total iterations, number of nests, and probability of abandonment.
With the meteorological data shown so far, the values of wind and solar generation were estimated as shown in

IV. PROPOSED ALGORITHM
After starting, the proposed algorithm loads the system and hybrid array data then reads the chosen optimization method (CS or GA) and runs it together with OpenDSS to find the smallest energy losses.The configuration of the hybrid array, the system, and the optimization technique in the algorithm constitutes a preliminary step that is only necessary for the first iteration.It is worth mentioning that the calculation of energy losses in the distribution network must be redone whenever there is a change in the buses where the arrangements were installed.More details about the algorithm are shown in Fig. 12.
The flowchart of the proposed algorithm starts by loading data from the test system, from the hybrid arrangement and selecting the optimization technique (CS or GA) as well as loading their respective data.After performing the preliminary step and selecting the optimization method, the algorithm can follow two paths.
If the AG is chosen, the first individuals of the GA population are randomly created.With the help of OpenDSS, the fitness of individuals is calculated and penalties are applied, if necessary.The crossing operation is performed with the initial population to obtain population growth.The new individuals have their fitness calculated with the help of OpenDSS.Once the population has reached its maximum limit, the algorithm performs the GA selection operation to reduce the population.After these operations, the mutation is performed in some individuals of the ''surviving'' population.After the mutation, the process is repeated until the end of the pre-established Eras occurs.When the last Era is executed, the results obtained by the algorithm are made available to the user and the processing ends.After each era, is performed another mutation in the population, and this variation reached an optimal result faster than without this mutation at the end of the eras.
If the CS is selected as the optimization technique, the initial population is created randomly and its fitness is calculated with the help of OpenDSS.Then, new possible solutions are generated through Lévy's flight and their fitness is evaluated.If the stopping criterion is not reached, the process is repeated from the Lévy flight.But, if the stopping criterion is reached, the results obtained by the algorithm are displayed on the screen and the processing ends.
The present work allows the installation of more than one hybrid arrangement in the buses of the system, besides using two optimization methods and comparing them with each other.This work also has additional information at the end of the routine execution, such as the cost to install and operate the hybrid arrangement, in addition to the voltage profile.Finally, as can be seen in the next chapter, the decimal alphabet is used, both in GA and in CS, which allows a reduced number in the size of the solution and less computational effort.
Although predominant data from Brazil are used, any data sets can be used as long as they follow the pattern used in this method.To define the curves of wind speed, irradiance, temperature, load and discharge of the BESS, just define a vector with 24 positions (one for each hour of the day) with the respective values for each curve and unit of measurement.For wind speed use m/s, for irradiance use W/m 2 , for temperature use degrees and for BESS 1 pu to discharge, and -1 pu to charge.
It is possible to use any wind turbine model, just add the following information: 1) Turbine model; 2) Rated power; 3) Cut-in; 4) Cut-off; 5) Rated speed; 6) Hub height; 7) turbine power curve.In the case of photovoltaic plants, simply insert: 1) efficiency curve (eff vs pu); 2) Rated power of the solar plant; 3) Active Power; 4) Power Factor.Finally, to define the BESS it is enough: 1) Rated Power; 2) Instantaneous Active Power 3) Rated Storage Capacity; 4) Power Factor.
To adjust the parameters used to configure the optimization methods, just insert the data present in Table 4 for the genetic algorithm and Table 5 for the cuckoo search.For the test system, it is necessary to have the model completely in OpenDSS and the proposed methodology informs the path of the file, the feeder bus, and the buses that are restricted by the problem, if there is.

V. RESULTS
In this section are found the results obtained with the use of the proposed methodology.In all cases, the results refer to one day (24 hours) and they respected the voltage limits adopted by the National Electric Energy Agency (ANEEL), the Brazilian electric energy agency.To calculate the payback, a useful life of 20 years was considered and the routine was programmed to minimize energy losses.The load curves used in the system are standard values of the IEEE 123 bus system, the wind speed curve was built based on data provided by the National Institute of Meteorology (INMET), and the irradiance and temperature curves were provided from Maceió, a Brazilian's city, by Federal University of Alagoas.
In the built tables, it is possible to compare the results obtained for two hybrid arrangements, where each one of them has a different model of the wind turbine.Two configurations of IBRs were used and can be seen in Fig. 13.The first is composed of a wind turbine of 1.6 MW (GE Energy), a photovoltaic plant of 1.0 MW, and a BESS system of 1.0 MW.The second configuration is composed of a wind turbine of 2.0 MW (Gamesa), a photovoltaic plant of 1.0 MW, and a BESS system of 1.0 MW.Maximum penetration varied between 20% and 60%.The number of hybrid arrays was defined by the method itself, as well as the places where the arrays should be connected to the system.Table 6 to Table 10 summarize the turbine model used in the hybrid arrangement, the number of arrangements for each case, the final demand required from the feeder, the final value of losses after the installation of the hybrid arrangement, the installed power of the hybrid arrangement, the total generation of renewable energy injected by the array, the minimum and maximum voltages, the penetration of renewable generation, the reduction of energy losses, the total investment (considering the acquisition, installation and operation of the hybrid array in 20 years), the payback, the accuracy of the optimization methods, and the average execution time.
Fig. 14 to Fig. 26 show the locations where the hybrid arrays were installed (red dots) in the test system.The width of the blue lines in the system indicates the load flow in each section.The greater the width of the line, the greater the load flow.As expected, the largest load flow is concentrated at the feeder outlet.From Table 8, the optimization techniques did not converge in 100% of the cases, so it is possible to observe the results obtained in each of the simulations in graphs as shown in Fig. 20.A convergence curve was also created comparing GA to CS in Fig. 29.
Ten case studies were carried out, which were grouped two by two according to the maximum penetration of each case.Each case study was run 10 times for each heuristic goal.As both optimization methods reached the same optima, they VOLUME 11, 2023 123969 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.were grouped in tables, thus, a total of 200 simulations were performed to test the accuracy of the optimization methods.

VI. DISCUSSION
Two DFIG turbine models were used for the simulations (GE Energy -1.6-82.5 and Gamesa -G114/2000).These models were chosen because they are from different manufacturers and are present in wind farms in Brazil.In all case studies, the method was able to reduce energy losses, avoid violations of voltage limits imposed by ANEEL and violate the maximum penetration limit imposed.In all cases, the same curve of wind speed, irradiance, temperature, loading and unloading of the BESS was used to better evaluate the behavior of the method as the maximum penetration increased.
Starting with a maximum penetration of 20%, two hybrid arrays were used, the first using GE's wind turbine model and the second using Gamesa's.In studies of optimal installation, an optimal penetration of a maximum of 20% is considered, to avoid disturbances that the high renewable penetration can cause in the system [33], [34].In Table 6 it is shown that the arrangement that has the GE turbine model managed to 123970 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.reduce losses in a better way than the Gamesa model, being installed in 3 arrangements in the test system.This can be seen in Fig. 14 and Fig. 15.A greater amount of arrangement enabled greater installed power, more energy generated and a greater reduction in demand required from the main feeder.
For the first arrangement, the method installed them on buses 80, 89, and 108.In the second arrangement, they were installed on buses 78 and 87.The buses are close to each other, which is understandable since there is a tendency to install IBR close to the ends of the feeder to reduce the technical losses of electrical energy.GA and CS obtained the same precision and reached the same optimum, however, CS was faster than GA.
For cases with a maximum penetration of 30% (Table 7, Fig. 16 and Fig. 17) the number of arrangements using the GE turbine is higher than the number according to the  arrangement, providing a greater installed power, generated energy and consequently a reduction in demand and technical losses.However, it causes a 50% greater expense than the second arrangement.There is a reduction in demand on the main branch of the feeder.Again the CS was faster than the GA.
When considering a maximum penetration of 40%, the more spread out the arrays are, the lower the demand in the main branch of the feeder, the array composed by the GE model was installed on buses 49, 65, 80, 89, 97, and 108, as can be seen in Fig. 18.The arrangements containing the Gamesa model were installed on buses 48, 65, 77, 87, and 105, which can be seen in Fig. 19.Analyzing the data available in Table 8, even with the second arrangement having installed a lower power in the hybrid VOLUME 11, 2023 123971 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.arrangement, it was able to generate more renewable energy than the first arrangement.This allowed a greater reduction in demand and technical losses when compared to the first hybrid arrangement.Using the second arrangement was more advantageous in this case since it reduces losses and has a lower investment.For the first time, the CS method did not obtain 100% accuracy, as can be seen in Fig. 20, which does not disqualify the method, since a greater number of arrays would require an adjustment in the optimization parameters.
Table 9 summarizes the results obtained when considering a maximum penetration of 50%.The first case installed a greater number of arrays and obtained a greater installed power and a greater renewable generation.However, the second case has a cost of approximately 22% lower.As the number of arrays increases, so does the complexity  of the optimal installation problem, that is, the parameters initially defined for the optimization methods to solve the problem are no longer able to reach 100% accuracy.As the number of installed arrays increases, they are distributed in 123972 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.the feeder near the terminal bus, as can be seen in Fig. 21 and Fig. 22.In Fig. 23 and Fig. 24 it is possible to observe the values that each optimization technique reached during the case studies considering hybrid arrangement 1 and hybrid arrangement 2, respectively.Finally, cases were performed for a maximum allowable penetration of 60%.Table 10 shows a reduction of more than 55% in the demand that was originally requested from the    main feeder.The arrangements are in close regions, both for the GE model and using the Gamesa model, as can be seen in Fig. 25 and Fig. 26.As stated earlier, the optimization methods would need to have their parameters redefined to achieve the performance they had in the first case studies of this work.In terms of speed, the CS was faster than the GA, however, the GA was more accurate.The accuracy of each technique can be seen in Fig. 27 and Fig. 28, where it is possible to observe the values found for each case of hybrid arrangement.
A convergence curve was created comparing GA and CS that can be seen in Fig. 29.This curve represents one of the simulations carried out in the case study for a maximum penetration of 60% using hybrid arrangement 2. In this case, both optimization methods used converged to the same optimum (1,230 kW).In this execution, it is possible to notice that the GA reached the optimum faster than the CS.

VII. CONCLUSION
An optimal method of installing hybrid arrays was proposed to minimize energy losses in the IEEE 123 bus system.The method used two meta-heuristics separately, the genetic algorithm and the cuckoo search, which are used for combinatorial optimization problems, in which there are several variables and a wide range of solutions.
Each hybrid array consists of a wind turbine, a solar plant and a battery energy storage system BESS.As wind turbines generate more energy, cases where one arrangement had the wind turbine model GE Energy -1.6-82.5 and the other arrangement used Gamesa -G114/2000 were analyzed.
The proposed method was able to define the quantity and location of the inverter-based resources in the test system in all case studies, respecting the voltage limits imposed by ANEEL regardless of the degree of penetration.Whenever a possible solution violated the voltage limits, the method detected and made it impossible to use this solution, whether using genetic algorithm or cuckoo search.Both heuristic targets used converged to the same optimum, although they have different accuracies and average durations.The genetic algorithm proved to be a more robust, slower method, but it converged to the same optimum every time.Cuckoo search, on the other hand, is a simpler, easier to program, and faster method, but it has a lower accuracy than the genetic algorithm.As the complexity of the problem increased, the parameters of the heuristics should have been changed so that they could continue with their high performance.
The proposed algorithm, with both methods, was able to install the hybrid arrays in a satisfactory, simple, fast, and effective way.In addition, it is able to install the hybrid arrays in an optimized way to reduce energy losses in the electricity distribution system.Finally, there is the possibility of using the algorithm developed for large systems, requiring further studies and simulations with other test systems and other hybrid array configurations.
Among the contributions, there is the ability to optimally install (locating and sizing) hybrid arrangements (which can be configured to have wind and/or photovoltaic sources, in addition to having, or not, battery system) in distribution systems to reduce the technical losses of daily energy and rely on a brief economic analysis.The arrangements can be configured in the way that best meets the needs of the 123974 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
researcher, the values used in this work are just to evaluate the method.
The next steps of the research will be to carry out simulations using annual losses, obtain input values (wind speed, temperature, and irradiance) through the geographic coordinates of the site, use systems-larger tests, and develop the proposed method by adding the capacity to install hybrid arrays for situations of the high incidence of a wind speed or high temperatures, using input curves with ''extreme'' characteristics.

FIGURE 5 .
FIGURE 5. Example of chromosome and cuckoo egg used in case study.

VOLUME 11, 2023 123967
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

FIGURE 12 .
FIGURE 12. Flowchart of the proposed algorithm.

FIGURE 14 .
FIGURE 14. Results of a maximum penetration of 20% using hybrid arrangemen 1.

FIGURE 15 .
FIGURE 15. Results of a maximum penetration of 20% using hybrid arrangemen 2.

FIGURE 16 .
FIGURE 16. Results of a maximum penetration of 30% using hybrid arrangemen 1.

FIGURE 17 .
FIGURE 17.Results of a maximum penetration of 30% using hybrid arrangemen 2.

FIGURE 18 .
FIGURE 18. Results of a maximum penetration of 40% using hybrid arrangemen 1.

FIGURE 19 .
FIGURE 19.Results of a maximum penetration of 40% using hybrid arrangemen 2.

FIGURE 21 .
FIGURE 21. Results of a maximum penetration of 50% using hybrid arrangemen 1.

FIGURE 22 .
FIGURE 22.Results of a maximum penetration of 50% using hybrid arrangemen 2.

FIGURE 23 .
FIGURE 23.Bar chart results of a maximum penetration of 50% using hybrid arrangemen 1.

FIGURE 24 .
FIGURE 24.Bar chart results of a maximum penetration of 50% using hybrid arrangemen 2.

FIGURE 25 .
FIGURE 25. Results of a maximum penetration of 60% using hybrid arrangemen 1.

FIGURE 26 .
FIGURE 26.Results of a maximum penetration of 60% using hybrid arrangemen 2.

VOLUME 11, 2023 123973
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

FIGURE 27 .
FIGURE 27.Bar chart results of a maximum penetration of 60% using hybrid arrangemen 1.

FIGURE 28 .
FIGURE 28.Bar chart results of a maximum penetration of 60% using hybrid arrangemen 2.

FIGURE 29 .
FIGURE 29.GA and BC convergence curve for a maximum penetration of 60% using hybrid arrangemen 2.
FIGURE 6. Wind speed daily curve.

TABLE 4 .
GA parameters for the IEEE 123 bus system.

TABLE 5 .
CS parameters for the IEEE 123 bus system.

TABLE 6 .
Results of a maximum penetration of 20%.

TABLE 7 .
Results of a maximum penetration of 30%.

TABLE 8 .
Results of a maximum penetration of 40%.

TABLE 10 .
Results of a maximum penetration of 60%.