Location and size of renewable energy sources and capacitors in radial distribution systems with commercial losses

Distributed generation (DG) in radial distribution systems helps improving energy efficiency by reducing technical losses, which enhances power quality, improves reliability, decreases network congestion, and provides other benefits. Although DG must be useful in distribution systems with commercial losses, better relationships and solutions are necessary, especially those that include renewable sources. In this research, we used photovoltaic panels, wind turbines, and capacitors to evaluate the effects of compensating real and reactive power in distribution systems with a high percentage of commercial losses. As the search for the best place to compensate the network necessitates considering a combination of real power, reactive power, and nodes, we considered finding solutions using three metaheuristic algorithms: a genetic algorithm (GA), a particle swarm optimization (PSO), and a bat-inspired algorithm (BA). The main results showed that locating and sizing renewable-energy sources and capacitors, according to commercial losses, help reducing technical losses and power generation costs. Wind turbines reduced technical losses further because they had both the lowest investment costs and a large amount of available resources compared with the results obtained with photovoltaic panels, which showed only some technical loss reduction and a small increase in costs. The hybrid system also showed a good reduction, especially when fewer photovoltaic panels were used.

Although these actions help to identify and reduce power losses, researchers must develop new methods to guarantee power grid sustainability.DSO and governments spend large amounts of money to normalize power grids and prevent user fraud [1].However, the network deteriorates again after a few years because of both fraud and the expenditure of resources for maintenance, which decreases the opportunity for better investment in the network.Therefore, as continuous user fraud degrades the electrical installations and causes critical damage to other equipment, we propose locating generators and capacitors according to commercial losses to improve energy efficiency.In this proposal, we assume that electricity regulation allows DSOs to participate in organizing user generation to maintain network optimization; similarly, DSOs can install new DGs to enhance the network and reduce the effects of commercial losses.This article evaluates the application of renewable sources and capacitors in networks with commercial losses to reduce technical losses and power generation costs.For this purpose, we propose to install photovoltaic panels and wind turbines, which use energy resources that are normally available in cities.We define the objective function as the minimization of technical losses and power generation costs and use electrical constraints as the power balance, power generation limits, voltage limits, and current limits.As commercial losses are associated with each load node, we include them in

INTRODUCTION
Total power losses of distribution systems break down into technical losses and commercial losses.Technical losses are losses produced by network parameters that increase costs, increase network congestion, reduce power transfer, and create voltage stability problems.Commercial losses result from energy theft, errors in metering, billing, and data, and differences in energy balances [1][2][3]; their greater impacts include interference in network expansion and negative environmental effects.
In Latin American countries, some distribution systems suffer a large percentage of power losses, becoming inefficient and causing major problems for distribution system operators (DSO) because of the high costs of maintenance.Consequently, electricity companies, government entities, and researchers are continually interested in finding new methods to improve network efficiency.
On the one hand, feeder restructuring [4], DG [4][5][6][7][8], capacitor placement [4,9], and network reconfiguration [10][11] can reduce technical losses.From these listed solutions, one remarkable technique is to install renewable energy sources close to loads.In [12], authors use this method for improving reliability and power losses; in [13] and [14] authors use it to reduce power losses in rural areas.On the other hand, disconnecting illegal users, reviewing billing and data, calibrating meters and other activities to normalize services usually reduce commercial losses [2][3][15][16][17].To mitigate this problem, some applications focus on detecting and the algorithms as constraints to limit the number of renewable energy sources and capacitors.Besides, the problem considers finding the real and reactive power of generators and capacitors, likewise, the installation nodes.In addition, we use metaheuristic algorithms such as GA, PSO, and BA to solve the problem and determine the best results.

Technical losses
Technical losses negatively affect distribution systems because they reduce the network's energy efficiency.We calculated this type of loss in a distribution system as (1) shows [20]: where P i and Q i are the real and reactive power injected into the node i. P j and Q j are the real and reactive power injected to the node j.
(2) and (3) define parameters A ij and B ij .
R ij is the resistance of the branch between the nodes i and j.V i and d i are the voltage magnitude and the voltage angle of the node i. V j and d j are the voltage magnitude and the voltage angle of the node j.
Technical losses increase as the power network becomes more congested because of the increase in branch current.Hence, commercial losses are an important issue, because they significantly increase branch currents.In this work, we contributed to the problem's solution by considering the location of renewable sources and capacitors near the commercial losses to reduce technical losses and improve energy efficiency.

Commercial losses
One way of calculating commercial losses is to consider the difference between the power supplied and the power consumed.Indeed, the consumption must include the power of loads and other technical losses associated with the network of the load node i.Hence, we calculated real and reactive powers related to the commercial losses in node i as in (4) and (5).
P NtLossi and Q NtLossi are the real and reactive power related to the commercial losses.P Gi and Q Gi are the total real and reactive power supplied to node i. P Lossi and Q Lossi are the real and reactive power related to technical losses at node i.Finally, P Li and Q Li are the total real and reactive power consumption billed to the users connected to node i.
This calculation of commercial losses for each node of the distribution system is useful to identify the power compensation needs and benefits related to technical losses and power generation costs.In this research, we considered the commercial losses as the constraints to select the maximum number of generators and capacitors.

Energy Consumption
We determined the total power consumed in the distribution system by the sum of the power of loads, commercial losses, and technical losses, as shown in (6): where i is the node number and k is the branch number.n PQ is the number of PQ nodes, and n b is the number of branches.P Li is the power consumed by users, and P NtLossi represents the commercial losses at each load.Finally, P Lossk represents the technical loss at each branch k.
The total energy consumed in the power system is equal to the real power losses multiplied by the time of consumption.This total energy corresponds to the consumption of a day (24 hours) as expressed in (7): where E T is the total energy consumed during a day, h is the hour, P Th is the power produced per hour, and Δ Th is the time divided by hour.

Load and Commercial Losses
Daily load data is useful to represent variation in power consumption at nodes for simulations.We considered the maximum power consumption of a load and represented variations during the day.The power varies with the multiplication of the maximum power of node i and the differential power representing the changes during the day, as expressed in (8): where P Li-h is the real power in the time h of load node i, P Li is the constant real power of load node i, and ΔP Li-h is the per unit value at time h.
Commercial losses (P NtLossi-h ) are equal to the multiplication of the power of load (P Li-h ) and the percentage of commercial losses at each node (%P NtLossi ), as expressed in (9): Figure 1 shows a typical load demand curve of residential users to represent the consumption of all nodes in the network during a day.Power values are expressed per unit; we created this curve considering data of studies about typical residential electricity consumption in Colombia [21].In addition, Figure 1 shows the commercial loss estimation during the day, assuming that it is 16% of the power consumed in the load node, based on the historical data of power losses of some distribution systems in Colombia [22].As load is expressed per unit, application to the power system has been performed by multiplying each hour by the nominal value of each load in the network.

Renewable Energies Data
To conduct this research, we obtained the energy resources from a historical database with data measured in the municipality of Riohacha, located to the north of Colombia [23].
Figure 2 shows the daily wind speed and solar radiation curves used for the simulations.We used a photovoltaic panel of 350 W, producing an equivalent of eight hours a day in the zone, according to the data represented in this figure.Moreover, we selected a small wind turbine with 1100 W and maintained the power factor of 0.98.In addition, we calculated the power produced by renewable generators using the resources represented in Figure 2.
The total energy that photovoltaic panels or wind turbines produce during a day is equal to the multiplication of the power produced according to the resources defined in Figure 2 and the hour period of the day, as shown in (10): where E G is the total energy produced by renewable generators during a day, P Gh is the power produced per hour, and ΔT h is the time divided by hour.

Number of Renewable Sources
The compensation model involved determining the maximum number of photovoltaic panels and wind turbines at each node i, as shown in (11) and (12).These equations calculated the expected values that represented the maximum real power to compensate commercial losses at the same node in all hours (maximum real power of commercial losses at peak demand) and the maximum power capacity of the available renewable generators.In this study, batteries were not considered to store energy to reduce investment costs: where N pi and N wi are the number of panels and wind turbines to be installed at node i. P NtLossi is the real power related to commercial losses to compensate at node i. P Panel and P Turbine are the real power produced by photovoltaic panels and wind turbines.w p and w w are constants that define the compensation from each renewable source.In this research, the test was conducted considering photovoltaic panels as w p =1 and w w =0, wind turbines as w p =0 and w w =1, and hybrid generators with changes in w p and w w between 0 and 1.

Number of Capacitors
We determined the maximum numbers of capacitors needed to compensate the reactive power related to the commercial losses at each node i using (13).
In other words, we calculated this value using the maximum reactive power related to commercial losses at the same node in all hours (maximum reactive power of commercial losses at peak demand) and the maximum power capacity of the available capacitors: where N ci represents the number of capacitors installed at node i. Q NtLossi is the reactive power related to commercial losses used to compensate node i.In addition, Q Capacitor is the reactive power of capacitors.
Capacitors supply reactive power during the day; we calculate the energy as expressed in ( 14): where E CT is the total energy supplied by capacitors during a day, h is the hour, Q Ch is the reactive power supplied per hour, and ΔT h is the time divided by hour.

Power Generation Costs
We defined the total generation cost, C T , as the sum of the cost of generating power with conventional sources C G and the cost of generating power with renewable sources C Ren , as (15) shows: The first term of ( 15), C G, represents the cost of generating power with conventional sources.Its value is the sum of the power produced by thermal and hydro sources [24], as (16) shows: C G = (a Ti P Ti 2 +b Ti P Ti +c Ti ) where i is the node number and n is the number of nodes.Other terms such as a Ti , b Ti, and c Ti are constants of the thermal generation cost.Moreover, b Hi and c Hi are constants of the hydro generation costs.Finally, the terms P Ti and P Hi are the power supplied by thermal and hydro generators.We simulated the cost of generating with these conventional sources according to the typical values found in the Colombian electricity market in 2015.
The second term of (15), C Ren, represents the cost of generating power with renewable energy sources.The value is the sum of the power generation costs introduced by photovoltaic panels and wind turbines, as expressed in (17): where i is the node number and n is the number of nodes.c Si and c Wi are constants of the solar and wind power generation costs.P Solari and P Windi are the power supplied by photovoltaic panels and wind turbines.We simulated the cost of generating with these renewable energy sources according to the typical values found in the Colombian electricity market in 2015, which can represent high costs according to the technologies used.
Consequently, we calculated the daily costs of generating power with both conventional and renewable DG by multiplying the total cost per hour and the periods during the 24 hours of a day [8], as expressed in (18): where C E is the total cost of producing electricity during a day, h is the hour, C Th is the power generation cost, and ΔT h is the time divided by hour.This final energy cost allows us to evaluate the best location for and size of renewable energy sources.

OPTIMIZATION MODEL
This problem considers the minimization of technical losses and power generation cost, as (19) shows: This problem is subject to the following constraints: Real power limits Reactive power limits Number of wind turbines Voltage level at node i where P Lossk represents the technical losses at branch k.C Ti is the total power generation cost (including renewable energy sources).The term n g is the number of generators, and the term n b is the number of branches.Additionally, w 1 and w 2 are the weighting factors that multiply technical losses and power generation costs.In this research, w 1 and w 2 were intended to normalize the values of both functions defined in (19) to equilibrate the algorithms' search process.Doing so ensured that all functions were homogeneous; otherwise, any of them would have been at a disadvantage.We calculated the values of w 1 and w 2 by performing multiple simulations to obtain the values that best fit for the assessed problems.
P Gi and Q Gi are the real and reactive power generation.P L and Q L are the total real and reactive power of loads.P Loss and Q Loss are the total real and reactive power related to technical losses.V i is the voltage at node i, i ij is the current from nodes i to j, i ji is the current from nodes j to i, and P Gi Min and P Gi Max are the minimum and maximum real power generation, respectively.Q Gi Min and Q Gi Max are the minimum and maximum reactive power generation.i ij Max and i ji Max are the maximum line currents from nodes i to j and j to i. V i Min and V i Max are the minimum and maximum voltage at node i. N pi and N Wi are the number of photovoltaic panels and the number of wind turbines located at node i. N pi Max and N Wi Max are the maximum number of photovoltaic panels and wind turbines to locate at node i. P Reni and Q Ci are the real power supplied by renewable energy sources and the reactive power supplied by capacitors.P NtLossi and Q NtLossi are the real and reactive power related to commercial losses at each node i.

Problem codification
Each individual or particle inside the metaheuristic algorithm corresponds to a solution of the problem.Hence, we used the codification shown in Figure 3 to represent the changing values and find the final solution that represents the real power and location node of generators and capacitors.
In Figure 3, the terms x, y, and z represent the power supplied by photovoltaic panels, the power supplied by wind turbines, and the node number of a generator located in the distribution system, respectively.
Moreover, v and w represent the power of capacitors and the node number of a capacitor located in the distribution system, respectively.Finally, the term i represents the generator or capacitor number, and the term n represents the number of generators or capacitors.
For instance, Figure 3a shows that the length of section I is three times the number of renewable generators to be located because the values of real power, reactive power, and node number must be allocated.In addition, Figure 3b shows that the length of section II is twice the number of capacitors to be located because the values of reactive power and the node number must be allocated.The Authors.

Genetic Algorithm
The evolution of living organisms inspired this metaheuristic, as presented in [25].GA relies on the competition of bodies for resources and their capacity to adapt and survive.One of the algorithm's main characteristics is elitism: the best individuals of each generation are inserted into the next generation; these individuals are best able to adapt or adjust to environmental conditions.Additionally, the algorithm uses a crossing method based on a random point or single-point crossover, where individuals are recombined using the sections to the right and left of a random cutting point.Moreover, a mutation is considered as a random selection of an allele from an individual, which is modified.
This algorithm considers the following steps [26] The literature shows some applications of this metaheuristic to power system planning, such as the integration of renewable resources in smart grids [27], the location and size of DG [28][29][30][31][32][33], and renewable DG [34,35].In this research, we used the algorithm to find the location and size of photovoltaic panels, wind turbines, and capacitors.After all simulations have been completed with this algorithm, we compare them with the solutions of the next two algorithms.

Particle Swarm Optimization
This metaheuristic is based on populations and the social behavior of flocks of birds in flight [36], and it uses iterative and stochastic methods.A particle, x i , is a potential solution to the problem studied, and movement is achieved to improve the best solution.
This algorithm considers the following steps [26]: 1. Randomly initialize the population.2. Initialize the velocity of particles.3. Evaluate the fitness and select the best location.4. While the number of generations is lower than the limit nr, do: a. Update the velocity of all particles using (20).b.Update the new position of particles using (21).c.Find the new best solutions.5. End while.
In (20), the velocity changes using the best local position of particles pBest i k and the previous position of each particle x ki .In this equation, the term w is the factor of inertia of the particle, k is the number of iterations, φ 1 and φ 2 are weights that control the cognitive and social components, and rand 1 and rand 2 are random numbers between 0 and 1.Finally, the term g i represents the particle with the best fitness [26].
The algorithm also updates the velocity with the differences between the best particle located in the solution and the previous position of each particle.
The algorithm uses a random number to generate various velocities for particles moving toward the global optimum.In this work, we defined ϕ 1 and ϕ 2 as 0.3 and 0.5, respectively.
The algorithm calculates the new position of each particle i, x i k+1 , using the current position of each particle, x i k , and the new velocity of each particle, v i k+1 , as shown in (21).
This metaheuristic approach shows important applications in DG planning, such as those carried out by [37][38][39][40][41].As we did with GA, we used PSO to find the location and size of photovoltaic panels, wind turbines, and capacitors.After all simulations were completed, we compared the three algorithms presented in this research to identify the best solutions for the problem.

Bat-inspired Algorithm
This algorithm is based on the behavior of bats as they search for prey [42].This last algorithm implemented performs a search of the best solutions, starting with an initial population of bats and moving with a calculated frequency and velocity through iterations.
This algorithm considers the following steps [42] We defined the frequency between the maximum, f max , and minimum value, f min , and multiplied it by a random number β with uniform distribution, as shown in (22).
The BA updates the new velocity of each bat v i k+1 using the previous velocity v i k , the current position of each bat x i k , the best position of bats x best , and the frequency f i , as shown in (23).
The BA calculates the new position of each bat i, x i k+1 , using the current position of each bat, x i k , and the new velocity of each bat, v i k+1 , as shown in (21).
This metaheuristic has been used for important applications in DG planning [43][44][45].Like the procedure applied to other algorithms, we used this last algorithm to find location and size of photovoltaic panels, wind turbines, and capacitors.After all simulations have been completed, we compared the results with the solutions found with other algorithms.

TEST SYSTEMS AND SIMULATIONS Distribution Test Systems
In Latin American countries, it is common to use radial distribution systems, some of which have large commercial losses.For that reason, we considered two test systems: 33-node and 69-node radial distribution systems.
Figure 4 shows the diagram of the 33-node radial distribution system, which considers a total load of 3715 kW and 2300 kVAr and a total supply of 3926 kW and 2443 kVAr.The voltage limits at load nodes are defined as V Min =0.9 p.u. and V Max =1.1 p.u.
Figure 5 shows the 69-node radial distribution system according to the data reported in [46].This distribution system considered a total load of 4014 kW and 2845 kVAr and a total generation 4265 KW and 2957 KVAR.The voltage limits at load nodes are considered as 10% of the rated voltage or V Min =0.9 p.u. and V Max =1.1 p.u.

Scenarios for Simulation
In this research, we used three tests to identify the solutions to the problem.The first test considered finding solutions to an objective function with BA, PSO, and GA algorithms, testing photovoltaic panels, wind turbines, and hybrid sources for the 33-node and 69-node radial distribution systems.
The second test consisted of locating between one and nine hybrid renewable sources and capacitors to identify the amount of power compensation required to reduce the technical losses and power generation costs for the two radial distribution systems.Finally, the third test consisted of finding suitable power compensations for hybrid renewable sources with capacitors.

Convergence of the Algorithms
Figure 6 shows a comparison of the three metaheuristic algorithms used to solve the same problem.The output of the metaheuristic algorithms presented in this Figure corresponds to the average of the solutions through iterations.Results show that the BA algorithm converged faster than the other two algorithms and quickly reduced the objective function defined in (18).However, the GA algorithm converged after a larger number of iterations to find good results.The PSO began to reduce the objective function after several iterations but remained at a local minimum.
These results allow us to conclude that BA obtains the best results for the problem under investigation with less computational effort.For that reason, this algorithm becomes an important alternative for finding the location of renewable DG in radial distribution systems with commercial losses.

Location and Size of Renewable Energy Sources and Capacitors
Figure 7 and Figure 8 present the objective function reduction in the 33-node and 69-node radial distribution systems, respectively.The test consisted of evaluating the objective function with constraints, considering a base case with no sources and cases with photovoltaic panels and capacitors, wind turbines and capacitors, and hybrid solutions with capacitors.The fitness corresponds to the value presented (19) as the minimization of technical losses and power generation costs.For both figures, the percentages of the fitness reduction accord with the base case; in other words, the maximum value of the fitness occurs when no generation is installed.
From the perspective of the algorithms, the results that Figure 8 presents show that the BA obtains better results for all scenarios tested, although GA is close to the best solution found.Additionally, PSO found no good results for any of the proposed scenarios, which concurs with the results shown in Figure 6.
From the perspective of the sources, the results show that the objective function reduces according to the renewable energy source used to compensate for the real power.The wind turbine was the best technology for reducing technical losses and power generation costs because of the amount of power it can supply during the day.Photovoltaic panels obtained less reduction of technical losses because of the cost of technology, which does not allow a large reduction of the objective function.Hybrid solutions offer a good reduction of the objective function for both distribution systems.
Table 1 shows the results for fitness, power generation costs, and technical losses for the three algorithms used to solve the problem.The test consisted of finding the location of generators in five nodes of the radial distribution system according to the maximum compensation of commercial losses to determine the impact on technical losses and power generation costs.
In this table, the term PV represents the photovoltaic panels, the term WT the wind turbines, and the term Hybrid the combinations of both sources (PV and WT).Additionally, the term Ploss represents the technical losses and the term Cap the capacitors.Moreover, the term PV+Cap represents the installation of photovoltaic panels and capacitors, the term WT+Cap the installation of wind turbines and capacitors, and the term Hybrid+Cap the installation of photovoltaic panels, wind turbines, and capacitors.Finally, the fitness, generation cost, and power losses are expressed in percentage values according to the base case; in other words, the maximum value occurs when no generation is installed.
The fitness is reduced in all cases, but the reduction is maximized for the technical losses, and power generation costs are slightly increased to accomplish the objective.These conditions were presented because of the cost of renewable energy sources, particularly that of photovoltaic panels.The results obtained in this research related to power generation costs are limited to the conventional and unconventional generation technologies available in Colombia in the year 2015; however, decreasing technology costs will  allow better options to optimize these generation costs and improve energy efficiency.
For the 33-node radial distribution system, the two nodes found most frequently among all solutions are 30 and 32.For the 69-node radial distribution system, the nodes found most frequently among all solutions are 61 and 64.These results do not mean that those nodes must always be preferred, because the algorithms found them in combination with three other nodes, as defined in the experiment of this research with commercial loss constraints expressed in (19).If those results must be determined, we recommend performing a new test for a different number of generators, considering the results found in the next simulations shown in this paper.

Effects of number of sources
Figure 9 shows the location and size of different numbers renewable energy and capacitor sources installed for the 33-node and 69-node radial distribution systems.For these simulations, we used hybrid sources, considering that photovoltaic panels and wind turbines located in the same node can provide similar power to the network; in other words, w p =0.5 and w w =0.5, as defined in (11) and (12).In this figure, we observed that when the number of sources increased, the fitness decreased.This is more notable for a lower number of generators and capacitors because of the importance of compensating large commercial losses, particularly for nodes located far from the main source.The slopes of the curves behave similarly when the fitness decreases, although the percentages of the curves are in different bases or according to each base case.Therefore, the previous data allow us to assert that when the number of locations of renewable generation sources increases, the technical losses decrease significantly, and thus energy efficiency improves.

Compensation
Figure 10 shows the reduction of the objective function for different percentages of hybrid sources for the 33-node (Figure 10a) and 69-node (Figure 10b) radial distribution systems.The percentage of sources are according to the maximum power to compensate at each node and are obtained with the terms w p and w w , as shown in (11) and (12).The test involved changing the percentage of sources (photovoltaic panels and wind turbines) and considering capacitors to identify the effects on the different terms in the objectives (fitness, generation costs, and technical losses).The percentage of the objectives obtained in this Figure are according to the base case, where the initial percentage (100%) corresponds to the values with no generation or capacitors installed.
Figure 10 shows that the technical loss reduction is higher when compensation is achieved with a low percentage of solar resources and high percentage of wind resources because of the amount of resources available for the test.Technical losses decreased for photovoltaic panels because of the resources available during the day, but power generation costs increased slightly.Wind turbines help to reduce technical losses and power generation costs, making them the best option evaluated.This implies that the compensation is better when the hybrid has a larger percentage of wind turbines, although in the results, the generation costs remain close to the initial value or the base case.

CONCLUSIONS
In this paper, we present the location and size of renewable energy sources and capacitors in distribution with commercial losses.The results show that compensation in nodes with a considerable value of commercial losses helps reduce the general function, defined as minimization of technical losses and power generation costs.
Application of this method resulted in technical loss reduction for most cases evaluated.Furthermore, the results related to the power generation costs were not uniform; some cases increased and some decreased, but all values were close to the base case.For example, in the 33-node radial distribution system, the use of photovoltaic panels reduced technical losses up to 10.7% and increased generation costs up to 0.5%.Moreover, the use of wind turbines reduced technical losses up to 13% and reduced power generation costs up to 0.1%.In the same system, the use of hybrid sources reduced technical losses up to 12.6% and increased the power generation costs up to 0.2%.When we apply the same method to the 69-node radial distribution system, the use of photovoltaic panels reduced the technical losses up to 15.8% and increased power generation costs up to 1.2%.In addition, the use of wind turbines reduced technical losses up to 22% and reduced generation costs up to 0.3%.Finally, in the same system, the use of hybrid sources reduced the technical losses up to 19% and increased the generation costs up to 0.5%.All these results show that installing renewable energy sources and capacitors in distribution systems with commercial losses is a good option for improving energy efficiency; but, we can obtain better results if the renewable energy generation technologies reduce the costs, as these are limited to local values in this research.When testing the best hybrid solutions, the results showed that the objective function reduced up to 6.85%, but the best power generation costs resulted from the use of more wind technologies than photovoltaic panels.From the three metaheuristic algorithms used in this research to find the location of photovoltaic panels, wind turbines, and capacitors (PSO, GA, and BA), the BA algorithm converged faster than the other two and could find better solutions.The results showed that BA obtained an average fitness of 92.42% for the 33-node radial distribution system and 88.9% for the 69-node radial distribution system.The results obtained with GA were close to the best results, but GA required a larger number of iterations to find the solutions reported.
In future works, we will be investigating new methods that reduce the effects of commercial losses on power quality, reliability, and stability.We will consider new models to mitigate these effects by using the smart grid.

Figure 1 .
Figure 1.Real power demand and commercial losses.Source: The Authors.

Figure 2 .
Figure 2. Daily solar and wind resources.Source:The Authors.

Figure 3 .
Figure 3. Problem codification: (a) section I: location and size of renewable sources; (b) section II: location and size of capacitors.Source: The Authors.

Figure 6 .
Figure 6.Average of solutions using PSO, GA, and BA.

Figure 7 .
Figure 7. Fitness reduction for the 33-node radial distribution system.

Figure 8 .
Figure 8. Fitness reduction for the 69-node radial distribution system.

Figure 9 .
Figure 9. Fitness reduction according to number of sources located.

Figure 10 .
Figure 10.Fitness reduction with percentage of compensation for the (a) 33-node and (b) 69-node radial distribution systems.

Table 1 .
Fitness, power generation costs, and technical loss results.