An Improved Particle Swarm Optimization Algorithm for Optimal Allocation of Distributed Generation Units in Radial Power Systems

In this paper, an improved particle swarm optimization method (PSO) is proposed to optimally size and place a DG unit in an electrical power system so as to improve voltage profile and reduce active power losses in the system. An IEEE 34 distribution bus system is used as a case study for this research. A new equation of weight inertia is proposed so as to improve the performance of the PSO conventional algorithm.-is development is done by controlling the inertia weight which affects the updating velocity of particles in the algorithm. Matlab codes are developed for the adapted electrical power system and the improved PSO algorithm. Results show that the proposed PSO algorithm successfully finds the optimal size and location of the desired DG unit with a capacity of 1.6722MW at bus number 10. -is makes the voltage magnitude of the selected bus equal to 1.0055 pu and improves the status of the electrical power system in general. -e minimum value of fitness losses using the applied algorithm is found to be 0.0.0406 while the average elapsed time is 62.2325 s. In addition to that, the proposed PSO algorithm reduces the active power losses by 31.6%.-is means that the average elapsed time is reduced by 21% by using the proposed PSO algorithm as compared to the conventional PSO algorithm that is based on the liner inertia weight equation.


Introduction
Currently, the power demand has increased which in turn increases electrical energy production almost to its capacity limits. e fast growth of electrical power demand makes the transmission systems reach their maximum capacity. erefore, the utilities that are responsible for electrical power grid have to invest more money to expand their capacity to meet the demanded power and to prevent any interruption of electricity [1]. Following that, many solutions are suggested to solve this problem. One of these solutions is distributed generation (DG) [2]. DG units are grid-connected units that are located near customers and deliver power to the grid regardless of its capacity or type. In general, power system operation depends on centralized power plants, whereas the energy flows in a unidirectional way from generation toward distribution. In the meanwhile, the introduction of DG to the electrical power system changes the nature of the system from passive networks to an active network. Active electrical power networks imply power flow in a bidirectional way due to the distributed resources along the network [3]. Several benefits can be obtained from DG such as voltage support, improved power quality, loss reduction, transmission and distribution infrastructure support, and improved system reliability.
Installing DGs in the electrical power system may be depending on the weakest buses but this is not an optimal solution as it may cause negative impacts on the power system such as higher power losses, voltage fluctuation problem, and a reduction of system's stability. Moreover, DGs may have drawbacks like unwanted reverse power flow, power quality problems, and reliability problems especially when renewable resources are used as DGs [2]. us, before installing a DG unit in an electrical power system, appropriate planning is required. Several aspects must be taken into consideration in this optimization process such as the number, capacity, and location of the DG units [2]. In general, the objective function of this optimization process implies minimization of the total power loss of the system, minimization of energy losses, minimization of system's average interruption duration index, minimization of cost, minimization of voltage deviations, maximization of DG capacity, maximization of profit, maximization of benefit/ cost ratio, and maximization of voltage limit loadability [4].
ere are a lot of optimization methods that differ in basics, computing time, and applications that can be used for this purpose [5,6]. e most effective methods are heuristicbased methods. Heuristic methods apply an iterative generation process which can act as a lead for its subordinate heuristic to find the optimal or near-optimal solution for the optimization problem.
In specific, PSO has been utilized many times in the literature for optimal sizing and placement of DG in the electrical power system. In [15], PSO, gravitational search algorithm (GSA), and improved gravitational search algorithm (IGSA) have been utilized to find the optimum size and place of a DG unit based on IEEE 69-bus radial distribution system. e proposed objective function aimed to minimize the real power losses, voltage deviation, average voltage total harmonic distortion (THDv), and system average voltage dip magnitude (SAVDM). According to the results, by utilizing the PSO algorithm, the minimum value of total losses is achieved. Similarly, in [16], PSO has been proposed for optimal DG placement taking into account maximizing voltage level and minimizing power losses. Moreover, a comparison between PSO and other methods is proposed in this research. According to this research, PSO is found to be better in performance as compared to the other two methods. In addition to that, in [17], a particle optimization method is used for multi-DG placement for loss reduction and voltage profile improvement. As a result, the PSO algorithm reduced power losses and improved the system's voltage profile.
On the other hand, in [18], an improved particle swarm optimization for optimal allocation of distributed energy resources has been used. e performance of the proposed PSO algorithm is improved by suggesting LEA and GSA algorithm. In this research, LEA utilized the inherent inability of PSO to deal with continuous decision variables, thus avoiding several local trappings. In the meanwhile, GSA virtually squeezes the problem search space so as to maintain adequate diversity. As a result, the proposed PSO performs better than the conventional PSO algorithm. In the meanwhile, in [19], a new algorithm called PFDE is proposed for multiple DG sizing and location. e voltage stability index, active power losses, and voltage profile are considered as objective functions that need to be optimized. e obtained results by the newly proposed algorithm are compared with the results of using a single objective weighted sum method in GA/PSO, GA, and PSO. According to the results, PFDE has a higher convergence speed than GA/PSO, GA, and PSO.
Based on that, the PSO algorithm is recommended for optimal sizing and placement of DG in the power system. However, PSO performance can be improved by either modifying the algorithm itself or hybridizing the algorithm by other optimization algorithms. erefore, in this research, an improved PSO algorithm is proposed by modifying the algorithm's searching methodology by proposing a new nonlinear equation of the algorithm's weight inertia.

Optimal Sizing and Placement of Distributed Generation Using Improved PSO
One of the most effective metaheuristic optimization methods that are being utilized for optimal sizing and placement of DG is PSO. PSO can be considered as a computational method that reaches an optimal solution for problems by iteratively updating the solution depending on some constraints [20]. PSO is a randomly population-based optimization method that was developed by Kennedy in 1997 [21]. e main idea of it depends on the food searching behavior of birds, fish, and insects with no leader that is looking for food's place [22]. Exploration and exploitation are two terms that represent the operation of the optimization process. When the searching algorithm tries to explore different regions in search space for the optimum place, the process is called exploration. On the other hand, when the searching algorithm tries to concentrate on a specific region in order to refine a candidate solution, the process is called exploitation. Using these two concepts, the particles in a swarm try to find the optimum solution with the help of their memory by storing data such as their own best position and the global best position for the whole swarm [23].
In PSO, each particle in the search space has solution and fitness, velocity, its own best position, and its global best position. e individual member of the swarm is called a particle. Each particle has its own dimensional coordinate position and the particles perform the swarm. Fitness is the function (objective function) that is used as an interface between the optimum problem and the physical one and determines the accuracy of the solution. In the search space, there are two terms that are being updated at each iteration. e first one is the position in the search space that the fitness function returns as the best one for a specific position P best t . Meanwhile, the second one is the position in the search space that the fitness function returns as the best one for the whole swarm G best . Also, upper and lower bounds of the velocity for the movement of the particles in the search space can be considered as constraints V Max and V Min [24]. In PSO, each particle is represented in a d-dimensional space, represents the position and velocity of the i th particle, respectively.

Applied Computational Intelligence and Soft Computing
At each iteration, the velocity is updated and used to update the position as shown in the following equation: where r 1 and r 2 are two random variables in the range of zero to one, c 1 and c 2 are positive constants which determine how far the PSO particles are from P best and G best , ω is the inertia weight, ωV is the inertia that keeps the particle movements in the same direction, c 1 r 1 (P best − x i ) is the personal influence which improves the individuals, and c 2 r 2 (G best − X i ) is the social influence which makes the particle moves toward the best neighbor's direction. By using equation (1), the position of each particle can be updated as follows: e convergence of the algorithm is controlled by inertia weight (ω) which is chosen in a suitable way so as to give a good balance between global and local exploration. Here, if ω ≥ 1, the velocities increase with time and PSO diverges, while if 1 > ω > 0, PSO converges. Inertia weigh ω plays a key role in the process of providing a balance between exploration and exploitation processes. In addition, it determines the contribution of the previous velocity of each particle with the current velocity.
e conventional PSO has no inertia constant [25]. Following that, the concept of inertia weight was introduced as a constant value by [26]. In [26], the author states that a large inertia weight facilities a global search while small inertia weight facilities a local search [26,27]. It also has a great influence on the optimization performance. e high value of ω is useful to improve the convergence speed of the algorithm, while low ω improves the convergence precision of the algorithm [26]. e linear equation of inertia weight that is used in conventional PSO can be described as follows [28]: where ω max is the maximum weight, ω min is the minimum weight, iter is the current iteration, maxiter is the maximum number of iterations, and ω is the constant weight. e optimization process of PSO for optimal sizing and placement of a DG unit in the electrical power system can be summarized by the following steps [25]: (i) Initialization: at this stage, different configurations are introduced such as the configuration of the distributed network, candidates for DG sizing and location, the initial population that is established randomly, the number of iterations, and finally the objective function. In addition, random values of velocity and position are interdicted at this stage. (ii) Calculation of the fitness function (f (x)): after start searching in the search space, the fitness function calculates the summation of each particle. (iii) After that, P best and G best t for all populations are calculated at each iteration. e lower fitness value for the current iteration is called P best . Meanwhile, the lowest fitness for P best is compared with the previous iteration and recorded as G best .
(iv) e new velocity and position are calculated using equations (1) and (2) for the next iteration. en, the new position is updated again. Here, if the condition does not meet the specified accuracy, then the algorithm gets back to step 2. (v) Finally, the optimum value or the desired output is set as G best .
According to the literature, there are some problems that PSO fails to solve because of having particles that are trapped at a local optimum solution, not the global one. In addition, PSO has three main dominant constants which are inertia weight ω, c 1 , and c 2 whereas any change in these three constants will affect the performance of the algorithm. ese parameters need to be adjusted optimally because if the adjustment is inaccurate, it leads to a diverged solution.
In order to improve the PSO algorithm, a time-variant inertia weight has been introduced by many researchers which helps to come out quickly from a region where the velocity becomes stagnant [28].
ere are many different strategies that have been proposed to change inertia weight, which can be divided into two categories, linear strategies [29] and nonlinear strategies [30]. e linear strategy suggests that inertia weight with the number of iterations being increased can be decreased linearly as in equation (3), which can ensure early larger ω value so as to accelerate convergence and a smaller value of ω so as to avoid falling into a local optimum point. In the meanwhile, nonlinear strategies not only suggest ω in the initial stage in a better way, but they also reduce the time needed to get the optimum solution. Moreover, with nonlinear inertia strategies, all particles can be quickly spread all over the search space so as to determine the approximate range of global extremes. erefore, nonlinear strategies may provide better performance than linear strategies [27].
Specifically, many researchers have proposed different weight inertia equations for improving the PSO algorithm for optimal sizing and placement of DG in the power system [31][32][33][34][35]. According to these researches, there is no specific role to derive an equation for optimum varying of weight inertia. In general, this inertia weight linearly decreases with respect to time. Generally, for initial stages of the search process, large inertia weight is recommended to enhance the global exploration (searching new area), while, for the last stages, the inertia weight is reduced for local exploration (fine-tuning the current search area). Based on that, in this research, a nonlinear strategy (equation (4)) is proposed as a time-varying inertia weight which decreases exponentially with time. By starting from maximum toward minimum weight, the exponential inertia weight reduces computational time in PSO and improves the algorithm's convergence: where ω max is the maximum weight, ω min is the minimum weight, iter is the current iteration, and maxiter is the maximum number of iterations.
On the other hand, to determine the optimal DG sizing, minimization of power system losses (Ploss) is considered.
Applied Computational Intelligence and Soft Computing e unit for Ploss is kW and the normalization equation is as follows: e mathematical equation of objective function for DG sizing is formulated as where Ploss i � |I i | 2 × R i , where I i and R i are the electric current and electrical resistance at bus i, respectively. e technical constraints considered in the optimization problem are the DG, voltage, and power flow constraints. e DG is limited by the available power sources at any given location.
us, it is necessary to constraint the capacity between its maximum and minimum levels of active power, which is given by e system operation should be kept within ±5% of voltage deviation and the voltage constraint is given by

Results and Discussion
In this research, an improved PSO optimization algorithm is proposed for optimal placement and sizing of DGs in the electrical power system. IEEE 34 bus network is used as a case study to perform this research. Power flow analysis is utilized so as to study the performance of the adopted electrical power system before and after placing the optimally sized DG unit. us, in this section, power flow analyses of the adopted system with and without DG units that are placed and sized based on the conventional PSO algorithm as well as the proposed PSO algorithm are presented. e adopted electrical network consists of 34 buses with one generation bus, 29 load buses, and 33 branches. IEEE 34 bus network has a radial configuration as can be seen in Figure 1. e total generation of the network is 5.89 MW (P g ) and 3.52 MVAr (Q g ). In the meanwhile, the total loads of the network are 5.56 MW (P d ) and 3.42 MVAr (Q d ) distributed over 29 load buses. Figure 2 shows the results of the conducted load flow analysis in terms of voltage magnitudes and angles.
From the figure, the buses that are far from the power source have low voltage magnitude as compared to the buses that are located near the generation source. e buses which are in the range of bus 19 to bus 27 have the lowest voltage magnitude as compared to other buses. All of these buses have a voltage magnitude below 0.95 pu. Phase angles for all buses seem good and there are no instability problems. Anyway, it is assumed that any DG placement at buses 19 to 27 can support this power system in a positive way.
Moreover, active and reactive power losses are determined from the conducted power flow analysis. Figure 3 shows a summary of the active and reactive power losses for each branch. e total losses in the whole network are 0.329 MW (P losses ) which is 5.58% of the total active power generation, while the reactive power losses are 0.10 MVAr (Q losses ), which is 2.84% of the total reactive power generation.
In this research, the optimal sizing of DG is done considering a conventional PSO algorithm with a liner inertia weight equation. After that, the proposed inertia weight equation (equation (4)) is incorporated with the PSO algorithm so as to improve the performance of the algorithm.
In the used PSO code, 50 particles are generated to find the size and location of one DG unit which has three dimensions. In addition, constants are used to update the velocity of the algorithm such as inertia weight which has 0.9 and 0.4 as maximum and minimum values, respectively, as recommended by [30]. In addition, c 1 and c 2 are positive constants that are used in the algorithm whereas these constants are assumed to be equal to 2 as recommended by [21]. e applied DG is assumed to supply active power only, while the maximum penetration level allowed is assumed to be 41.15% of the total generation [36]. e capacity of the DG is assumed to be in the range of 1.2-2 MW. Buses that are located between bus 2 and 34 are considered a possible location for the DG unit. A constraint for bus voltage magnitude is assumed to be between 0.9 pu and 1.05 pu. From the figures, the voltage magnitude at the located bus becomes 1.0055 pu and improved the status of the power system in general. In addition to that, the applied PSO optimization algorithm reduced the active power losses by 31.6%. Table 1 shows a summary of the improvement done by installing a DG in the adopted electrical power system.
A comparison between the conventional PSO algorithm and the improved algorithm is presented in terms of elapsed time. Table 2 shows a comparison between the conventional PSO algorithm in [36] and the proposed PSO algorithm. From the table, an improvement in the algorithm's performance is achieved by the new proposed algorithm as the lowest elapsed time is achieved by using it.
To highlight the effect of the installation of a DG unit on the operating parameters of the testing system, the cost of this proposal is briefly discussed. According to [34], the total cost of 1 kWp of a large-scale distributed generation is about 1,200 USD/Wp. Such a system has a life cycle time of 25 years. In the meanwhile, real power losses can be financially evaluated by the cost of the total amount of kWh through the life cycle of the distributed generation. In this research, the cost of the kWh is assumed to be 0.14 USD. Meanwhile, the cost of reactive power losses can be estimated depending on the status of the network which is indicated by the power factor of the network. In general, the kVArh in this research is assumed to be 0.2 USD considering the relatively low power factor.
According to the results, a DG is installed considering the best place and the best capacity for minimum losses at  Applied Computational Intelligence and Soft Computing bus 24 with a capacity of 1.6115 MW. In this case, the cost of the suggested DG is 1,933,800 USD while the amount of power losses is reduced by 0.104 MW. Considering the nature of the installed DG system (generates real power only), the savings of the reactive power are neglected. Following that, the estimated saving of this practice over the life cycle time of the DG system is 3,188,640 USD. is clarifies that installing a DG unit could significantly decrease the total cost and power losses. However, this is not the only benefit of installing DG as it affects positively system's voltage and stability.

Conclusion
In this paper, an improved particle swarm optimization (IPSO) was proposed to find the optimum size and location of a distributed generation unit in the IEEE 34 bus electrical power system in order to improve voltage profile and reduce losses. A new equation of weight inertia was proposed so as to improve the performance of the PSO conventional algorithm.
is development was done by controlling the inertia weight that affected the updating velocity of particles in the algorithm. is development had a significant impact on the performance of the conventional PSO algorithm which is based on liner inertial weight equation. Results showed that 5.58% of the total active power generation was consumed as active power losses before the installation of the DG unit in the electrical power system. In the meanwhile, 2.84% of the total reactive power generation was consumed as losses before the installation of DG in the electrical power system. Moreover, results indicated that buses that are located in the range of bus number 19 and bus number 27 had the lowest voltage magnitude (below 0.95) before the installation of the DG unit in the system. Following that, the applied improved PSO algorithm successfully found the optimal size and location of the desired DG unit with a capacity of 1.6722 MW at bus number 10. is made the voltage magnitude at the located bus equal 1.0055 pu and improved the status of the power system in general. e minimum value of fitness losses by using the applied algorithm was 0.0.0406 while the average elapse time was 78.6212 s. In addition to that, the applied PSO optimization algorithm reduced the active power losses by 31.6%. In order to show the significance of the proposed algorithm, a comparison is conducted with the conventional PSO algorithm for the same case. As a result, the conventional PSO algorithm that is based on liner inertia weight equation consumed 78.6212 s to provide the optimum solution. In the meanwhile, the proposed algorithm consumed 62.2325 s to provide the optimum solution. In conclusion, it was found that installing the DG unit at the optimum bus with optimum size reduced active power losses and improved voltage profile better than installing DG unit at the farthest buses or weakest buses based on the current role of thumps in the literature.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare no conflicts of interest.     Applied Computational Intelligence and Soft Computing