An Adaptive Particle Swarm Optimization Algorithm Based on Guiding Strategy and Its Application in Reactive Power Optimization

An improved adaptive particle swarm algorithm with guiding strategy (GSAPSO) was proposed, and it was applied to solve the reactive power optimization (RPO). Four kinds of particles containing the main particles, double central particles, cooperative particles and chaos particles were introduced into the population of the developed algorithm, which was to decrease the randomness and promote search efficiency through guiding particle position updating. Moreover, the cluster focus distance-changing rate was responsible for dynamically adjusting inertia weight. Then the convergence rate and accuracy of this algorithm would be elevated by four functions, which would test effectively the proposed. Finally, the optimized algorithm was verified on the RPO of the IEEE 30-bus power system. The performance of PSO, Random weight particle swarm optimization (WPSO) and Linearly decreasing weight of the particle swarm optimization algorithm (LDWPSO) were identified as the referential information, the proposed GSAPSO was more efficient from the comparison. Calculation results demonstrated that higher quality solutions were obtained and convergence rate and accuracy was significantly higher with regard to the GSAPSO algorithm.


Introduction
Reactive power optimization (RPO) has become more and more crucial as a segment of optimal power flow calculation, with the rapid development of China's power grid and the continuous expansion of its scale.The RPO is equal to reasonably distributing reactive power generation for minimizing the active power losses and maintaining all bus voltages within a reasonable range, while satisfying some constraints [1][2][3][4].The way to achieve the aforementioned aims depends on the capacity of shunt capacitors, the output of generators and the adjustment of transformer tap positions [5][6][7][8].
Generally, the nonlinear characteristic is prominent in RPO and is composed of multivariate, multi-constraint, discrete variables and continuous variables.A number of conventional optimization methods or techniques, traditional linear programming (LP) [9], Newton method [10], quadratic programming (QP) [11], and interior point method (IPM) [12], were put forward to deal with RPO.However, due to discontinuity and multi-peak, these techniques did not handle well.In recent years, some of the heuristic algorithms such as genetic algorithm (GA) [8,13], simulated annealing (SA) [14], differential evolution (DE) [15,16], improved shuffled frog leaping algorithm (ISFLA) [17], gray wolf optimizer (GWO) [18], particle swarm optimization (PSO) [19][20][21][22] have been widely developed for solving RPO, and have achieved good results.As a clustering intelligence algorithm, the PSO algorithm simulates the behaviour of bird flock foraging, and achieves the goal of optimization through the cooperation and competition among flock birds [23].Compared to other heuristic techniques, the PSO has a few adjustment parameters and a simple implementation.However, with the increase of variables and more local optimum in the objective function, the PSO algorithm is susceptible to prematurely converging and being put into local optimum.Many researchers have proposed and published potential improvements to the PSO algorithm, which can improve the global and local search ability and avoid the above phenomenon.Kannan et al. [24] proposed a solution for the capacitor optimization configuration in radial distribution using Multi-Agent Particle Swarm Optimization.Zad et al. [25] considered the reactive power control of distributed generations by implementing PSO.Achayuthakan et al. [26] proposed a PSO for RPO achieving reactive power cost allocation.Esmin et al. [22] presented a method to lessen power loss via a hybrid PSO with a mutation operator.Differentially perturbed velocity was used to improve PSO for the ORPD problem of a power system in [27].Singh et al. [19] presented a new PSO for the scheme of optimal reactive power dispatch (ORPD), where improvement was the introduction of an aging leader and challengers.
In this paper, an improved PSO based on a guiding strategy ws developed, which optimized the particle update mode and the adjustment mechanism of inertia weight, which had no negligible impact on the PSO algorithm.In addition, it was applied in order to solve the PRO in a power system and the standard IEEE 30-bus power system was employed.The effectiveness of the GSAPSO was contrasted to classical PSO, random weight PSO (WPSO) and linearly decreasing weight PSO (LDWPSO).
The structure of this paper is presented as follows: A brief description of PSO is brought out in Section 2. Section 3 presents details of improved PSO.Section 4 provides referential methods to test the three PSO algorithms and the comparison is discussed.Section 5 introduces the formulation of the RPO problem, and the solution algorithms are outlined in Section 6. Section 7 exhibits the simulation results showing the solution effectiveness.Conclusions are given in Section 8.

Original Particle Swarm Optimization (PSO)
PSO defines the variables in the solution space as particles without weight and volume.Each particle has two important elements: Velocity and position.The velocity makes a dynamic adjustment on the basis of the flight experience of individuals and groups.The position refers to a potential solution, and the corresponding fitness value can be obtained to judge the quality of the position.Each particle determines the velocity and direction of the flight according to its current location, the optimal location of the individual and the group.
In the S-dimensional space, a randomly initialized population with m particles is generated.The information for each particle i contains its position ( ), the best value of position for particle i is referred to as P i = [p i1 , p i2 , . . ., p is ], whose fitness value is expressed as 'pbest'.Moreover, the best value of the position for the group is recorded as P g = [p g1 , p g2 , . . ., p gs ], and its fitness value is expressed as 'gbest'.In the searching procedure, the velocity and position of each particle are constantly updated through Equations ( 1) and ( 2) respectively.
where k is time of current iteration; r 1 and r 2 are random variables taken between 0 and 1; ω k is the inertia weight at the kth iteration.c 1 and c 2 are acceleration coefficients.P id k is the best value of the ith particle in d dimension.P gd k is the best value among the entire population.The velocity range of the particles should be set in case the particle flies out of the search space too quickly and improve optimization ability simultaneously.

Adaptive Particle Swarm Algorithm with Guiding Strategy(GSAPSO)
In order to prevent blind search during the early stage and slow search speed as well as easily trap in the local optimum in the later period, the GSAPSO was proposed.The GSAPSO was mainly improved in two aspects, one was the mixed particles update mode, on the other hand, the inertia weight was improved.

Strategy for Mixed Particles Update
The standard PSO algorithm initializes the population randomly and has strong randomness.To get better performance in convergence, the particles were divided into four parts in this paper.The first part was the main particles randomly generated in system.The second part consisted of two kinds of central particles [28], which were the central particles produced by the first part and the central particles formed by the individual optimal value of all the particles, respectively.
Usually, the optimal solution has a higher probability of appearing in the center position.Therefore, the central particles are used to accelerate the convergence.In the whole search process, the properties of them were the same as those of ordinary particles, except that they had no velocity characteristics.
In the searching process, the two particles with the worst fitness value in the main particles were replaced by the double central particles, and then the particles were prone to fly towards better searching areas.
The third part was cooperative particles.The idea was to make multiple independent particles start from the global optimal position, first updated in one dimension, and then extra particles were updated randomly in the D dimension.The cooperative particles were used to enhance the capability in global search.The fourth part introduced chaotic particles, generated by logistic mapping.The chaotic particles were used to search for sub-optimal solutions of particles in the region around the boundary.The idea of updating the mixed particles was to exchange the good values obtained by the second, third, and fourth parts with the poor values of the first part during each iteration, so that the whole particles approached the best solution.
x GCP = 1/n where n represents the quantity of main particles; x SCP and x GCP are the central particle produced by the main particles and the individual optimal values, respectively.(2) The cooperative particles update formula was as follows where vec is a velocity variable whose value can be obtained according to Equation (6).The exetime, gen represents the current number and the total number of iterations respectively.α is the update coefficient.The rand is a random variable taken between 0 and 1 and obeys uniform distribution.(3) The chaotic particles were determined as follows where x imax , x imin are the maximum and minimum of the coordinates.k is the chaotic factor.
The update of the first part of the main particles was obtained by Equations ( 1) and (2); the update of the second part of central particles could be obtained by the Equations ( 3) and ( 4); and the third part of cooperative particles update formula was shown by Equations ( 5) and (6).The fourth part of chaotic particles could be updated by Equation (7).

Strategy for Inertia Weight
ω k controls the influence of speed in the kth iteration on the speed in the k + 1th iteration, and ω of the standard PSO algorithm can be regarded as 1.0.The larger the inertia term value, the stronger the global search ability.Conversely, the smaller the inertia term value, the stronger the local search ability.Therefore, the size of ω could be dynamically adjusted according to different periods during the iterative process to balance the ability of local and global explorations.In [29], the LDWPSO was proposed, which linearly reduced the ω value during the iterative process.The principle of the LDWPSO algorithm was that ω was larger for the global search in the initial iteration, while the ω value in the later iteration was smaller, and it was easily put into the local optimum.In [30], a dynamic adaptive nonlinear inertia weight was introduced into the PSO.The algorithm judged the particle distribution of the population by the size of the focus distance-changing rate, and then updated dynamically the nonlinear inertia weight according to different situations, which updated the fitness of particles at a suitable speed, and had the capability of good global search ensuring the convergence speed.
The adjustment strategy of inertia weight was to find the Euclidean spatial distance between all particles and the historical optimal in the population.The distance represented the closeness of the particles to the optimal position.The formulas of the average and maximum focus distance are described as follows: where m is the quantity of particles in the population.D is the quantity of dimensions of each particle.P gd is the best position of the population.X id is the best position of the individual.Then we could get the current focus distance-changing rate of the particle: In the iterative process, the inertia weight was adjusted by the focus distance changing rate, thereby adjusting the ability of the global and the local search.The inertia weight update in [30] was not ideal.After continuous experiment, it was found that the convergence of the algorithm was excellent when the variation curve of the inertia weight with k showed a downward convex trend.Therefore, the Formula (11) was adapted to calculate ω. ω = ln(a − k) + b k ≥ 0.05 0.75 + rand/4 k < 0.05 (11) where the rand was a random variable taken between 0 and 1 and obeyed uniform distribution.
Compared with the linear decreasing weight method, this selection strategy could better adapt to the complex actual environment, adjust the ability of global and local search more flexibly, and the diversity of the population could be preserved simultaneously.

Experimental Setup
In this section, the comparison of optimized algorithm and WPSO and LDWPSO was carried out by means of classical Benchmark functions consisting of the Sphere function, Rosenbrock function, Rastrigin function and Griewank function, which the performance test generally used.The details of four functions are presented as Figure 1: (1) Sphere Function The Sphere function is nonlinear and symmetric, it has a single-peak, which can be separated with different dimensions.It is used to test the optimization precision.
(2) Rosenbrock Function The Rosenbrock function is a typical ill-conditioned function that is difficult to minimize.Since this function provides little information for the search, it is difficult to identify the search direction, and the chance of finding the global optimal solution is low.Therefore, it is often used to evaluate the execution performance.
(3) Rastrigin Function The Rastrigin function is a complex multi-peaks function, with large quantity of local optima.It is prone to making the algorithm put local optimum, which will prematurely converge and not get the global optimal solution.(4) Griewank Function The Griewank function is also a complex multi-peaks function with a large quantity of local minimum.
where the rand was a random variable taken between 0 and 1 and obeyed uniform distribution.Compared with the linear decreasing weight method, this selection strategy could better adapt to the complex actual environment, adjust the ability of global and local search more flexibly, and the diversity of the population could be preserved simultaneously.

Experimental Setup
In this section, the comparison of optimized algorithm and WPSO and LDWPSO was carried out by means of classical Benchmark functions consisting of the Sphere function, Rosenbrock function, Rastrigin function and Griewank function, which the performance test generally used.The details of four functions are presented as Figure 1: (1) Sphere Function The Sphere function is nonlinear and symmetric, it has a single-peak, which can be separated with different dimensions.It is used to test the optimization precision.
(2) Rosenbrock Function The Rosenbrock function is a typical ill-conditioned function that is difficult to minimize.Since this function provides little information for the search, it is difficult to identify the search direction, and the chance of finding the global optimal solution is low.Therefore, it is often used to evaluate the execution performance.
(3) Rastrigin Function The Rastrigin function is a complex multi-peaks function, with large quantity of local optima.It is prone to making the algorithm put local optimum, which will prematurely converge and not get the global optimal solution.
(4) Griewank Function The Griewank function is also a complex multi-peaks function with a large quantity of local minimum.

Parameter Settings
For the four functions, the optimal objective values were all zero.The maximum number of iterations in the first and fourth functions was set to 1000, and that was 2000 in the second and third

Parameter Settings
For the four functions, the optimal objective values were all zero.The maximum number of iterations in the first and fourth functions was set to 1000, and that was 2000 in the second and third functions.The population size was 60, the main particle accounted for 70%, including two central particles, the cooperative particles accounted for 20%, and the chaotic particles accounted for 10%.Learning factor c 1 = c 2 = 2, inertia weight in LDWPSO algorithm was ω max = 0.9, ω min = 0.3.Each function used each algorithm to run 10 times independently.Table 1 shows the relevant information of four functions.

Analysis of Test Results
For LDWPSO, WPSO and the GSAPSO algorithms, the convergence accuracy and speed of the algorithms were analyzed respectively.The statistical results of the experiment are shown in Tables 2  and 3. (1) Algorithm convergence accuracy analysis According to the parameter setting in Section 4.2, the convergence precision of the three PSO algorithms was counted in the same conditions.The best value (BEST), the mean value (MEAN), and the worst value (WORST) of the objective function in ten iterations could characterize the performance of each algorithm.From Table 2, it demonstrated that the GSAPSO was superior to the others for the BEST, the MEAN, and the WORST.Moreover, the three types of values of GSAPSO algorithm were not much different, which indicated that the GSAPSO had better stability.The results of the Sphere function reflected the GSAPSO algorithm was much faster than the LDWPSO and WPSO algorithms to obtain the optimal value.The Rosenbrock function was more complex, and the optimization result not only reflected the convergence speed of the algorithm, but reflected the ability of jumping out local optimum.Therefore, it could be seen that the GSAPSO had a higher convergence accuracy than the others.For Rastrigin and Griewank functions, the GSAPSO could accurately find the optimal value, while the other two algorithms could not get the optimal value for the Griewank function.
(2) Analysis of algorithm convergence speed According to the parameter setting in Section 4.2, the convergence speed of the three algorithms was counted in the same conditions.The average of iterations (AT), the minimum iterations (BT) and the ratio of the number for satisfying the convergence criteria to the total number of experiments (SR) were calculated when each algorithm converged to 10 −2 in 10 iterations.Table 3 shows that the values of AT and BT of the GSAPSO significantly decreased compared to the LDWPSO and WPSO, and the average time required was less for the GSAPSO.It demonstrated that the GSAPSO had a higher computational efficiency.In short, the GSAPSO had superiority in the success rate and computational efficiency compared with the other two algorithms.
The average adaptation curves of the four standard test functions using the three PSO algorithms are shown in Figure 2. From Figure 2, it shows that the GSAPSO algorithm had greatly improved on convergence accuracy and convergence time compared to the LDWPSO and WPSO algorithms, which increased the chance of finding the optimal value for the actual optimization problem.From Figure 2, it shows that the GSAPSO algorithm had greatly improved on convergence accuracy and convergence time compared to the LDWPSO and WPSO algorithms, which increased the chance of finding the optimal value for the actual optimization problem.

Objective Functions
Minimizing the active power losses and maintaining voltage stability are the purposes of the RPO to power system.The bus voltage and the reactive power of the generators both had a certain range of limits, which also would have had an impact on the results at the same time, so the two state variables were added to the objective function as quadratic penalty terms.The RPO problem was formulated as: where U i is the voltage magnitude at bus i. N B , N PQ , N PV are the total of buses, the set of PQ buses and the set of PV buses respectively.λ 1 , λ 2 are the penalty terms, which are assigned according to respective importance of variables.In this paper, it was assumed λ 1 = 100, λ 2 = 10.g ij , θ ij were the mutual conductance and voltage angle difference between bus i and j.U ilim , Q Gi,lim in Equation ( 12) was defined as follows:

Constraints
The constraints were segmented into two parts, which are described as follows: Equality constraints: Inequality constraints (control variables): where N G , N C , N T are the quantity of generators, capacitor banks and transformers respectively.U Gi is the voltage magnitude at generator bus i. Q Ci is the compensation capacity of ith shunt capacitor; T k is the tap position of kth transformer.The inequality constraints on state variables were as follows: where Q Gi is the reactive power of ith generator; U imin , U imax , Q Gi,min , Q Gi,max are the minimum and maximum of the corresponding variables respectively.

Treatment of Control Variables
The voltage of the generator is a continuous variable, the transformer tap position and the capacity of capacitor banks are discrete variables.Continuous variables were encoded in real numbers, and integers were applied to encode discrete variables in this paper.
where X is individual position of particles; U Gi is the voltage magnitude of the ith generator.T i is the tap ratio of ith transformer.C i is the capacity of ith capacitor banks.The subscripts N, M, and K represent the quantity of generator buses, adjustable transformers, and compensation buses, respectively.

Treatment of Discrete Variables
This study uses the rounding method to process discrete variables.Their formulas are: where round(•) is the rounding function; stepT, stepQ C are the value of tap positions and capacitor banks, respectively; T step , Q C,step are the step size of adjustable transformers and capacitor banks, respectively.

GSAPSO Algorithm for RPO
Step 1: Initialize parameters (including population size, learning factor, inertia weight range and initial value, the maximum number of iterations, the particle velocity range, control variables and its adjustment range).
Step 2: Divide the population into four parts, and initialize the position and velocity for all the particles.
Step 3: Initialize the power flow calculation parameters and calculate the fitness value of each particle based on the fitness function (Equation ( 12)), and then update the optimal value of the individual and population.
Step 4: If the better particles appear (for the central particles in the second part or the chaotic particles in the fourth part), replace the poor particles in the first part with them, and update the particles.
Step 6: Update the position and velocity of four part particles for the next generation, according to Equations (1) to (5).
Step 7: Calculate the fitness value of particles, and update the best position of the individual and population.
Step 8: If one of the stopping criteria (maximum iterations or fitness accuracy) is satisfied, the search procedure is stopped, else go to Step 4.

Simulation
The simulation experiment using standard IEEE 30 bus power system was performed to validate the GSAPSO.Detailed parameters of the system can be found in the literature [31].The topological structure of it is shown in Figure 3, which consists of six generator buses and four transformers.To the nature of buses, bus 1 was balanced bus, bus 2, 5, 8, 11 and 13 were PV buses, and the other buses were PQ buses.Twelve control variables were involved in optimal reactive power compensation, including six generator voltages, four tap changing transformers, and two shunt compensation capacitor banks.The four branches (6-9, 6-10, 4-12 and 27-28) had transformers with tap changing.In addition, the installation location of shunt compensation capacitor banks were generally ensured at buses 10 and Energies 2019, 12, 1690 10 of 14 24 [31].The reference capacity of the whole power system was 100 MVA and the control variable were set as shown in Table 4.
Energies 2019, 12, x FOR PEER REVIEW 11 of 15 the nature of buses, bus 1 was balanced bus, bus 2, 5, 8, 11 and 13 were PV buses, and the other buses were PQ buses.Twelve control variables were involved in optimal reactive power compensation, including six generator voltages, four tap changing transformers, and two shunt compensation capacitor banks.The four branches (6-9, 6-10, 4-12 and 27-28) had transformers with tap changing.In addition, the installation location of shunt compensation capacitor banks were generally ensured at buses 10 and 24 [31].The reference capacity of the whole power system was 100 MVA and the control variable were set as shown in Table 4.The number of iterations during the calculation period was 100; the other parameter settings were the same with those stated in Section 4.2.Under the initial conditions, the generator voltage and the transformer ratio were both set to 1.0 p.u.When the compensation capacitor capacity was 0 Mvar, the initial network loss was 8.421 MW through the power flow calculation.
For evaluating the performance of GSAPSO for reactive power compensation effectively, the results were compared with PSO, LDWPSO and WPSO. 10 independent trails were carried out and the convergence accuracy took 10 −4 .The optimal values, the worst values and the average values of various algorithms were compared.The results are presented in Table 5.The number of iterations during the calculation period was 100; the other parameter settings were the same with those stated in Section 4.2.Under the initial conditions, the generator voltage and the transformer ratio were both set to 1.0 p.u.When the compensation capacitor capacity was 0 Mvar, the initial network loss was 8.421 MW through the power flow calculation.
For evaluating the performance of GSAPSO for reactive power compensation effectively, the results were compared with PSO, LDWPSO and WPSO. 10 independent trails were carried out and the convergence accuracy took 10 −4 .The optimal values, the worst values and the average values of various algorithms were compared.The results are presented in Table 5.From Table 5, the minimum network loss after the reactive power optimization calculated by the GSAPSO algorithm was 6.8239 MW, the average network loss was 6.8336 MW, the number of optimal solution iterations was 45 and the average number of iterations was 64.6.It demonstrated that the performance of GSAPSO was better than the PSO, LDWPSO and WPSO algorithms.By comparing the variances, we could see that the GSAPSO had a better convergence stability and robustness.
The GSAPSO considered the effective information provided by multiple particles in the optimization process.However, the other three algorithms only considered the role of the optimal individual in the later iteration, so that the algorithms converged slowly near the optimal value.GSAPSO increased the diversity of the population through double central particles, chaotic particles and synergistic particles and jumped out the local optimum value, which enhanced the global optimization ability.
Table 6 presents the details of control variables after optimization.GSAPSO obtaind the minimum power losses and 18.966% loss reduction, which was better than the other algorithms.Figure 4 shows the convergence curve of the average fitness value using different algorithms.From Figure 4, it was revealed that GSAPSO performed excellently compared to the other algorithms for the RPO problem.The GSAPSO took around 45 iterations to converge, whereas WPSO, LDWPSO took around 55 iterations and 75 iterations, respectively.The PSO could not converge even after 100 iterations.The voltage magnitudes of buses before and after reactive power optimization are presented in Figure 5.
Energies 2019, 12, x FOR PEER REVIEW 13 of 15 Figure 4 shows the convergence curve of the average fitness value using different algorithms.From Figure 4, it was revealed that GSAPSO performed excellently compared to the other algorithms for the RPO problem.The GSAPSO took around 45 iterations to converge, whereas WPSO, LDWPSO took around 55 iterations and 75 iterations, respectively.The PSO could not converge even after 100 iterations.The voltage magnitudes of buses before and after reactive power optimization are presented in Figure 5.We can see that the bus voltage magnitudes after reactive power optimization were significantly higher than before optimization.Moreover, they are more stable, the minimum value is 1.0091 p.u. and all values are within the limited range.

Conclusions
This paper has presented the GSAPSO, which was proposed by improving the particle update modes and the inertia weight of the algorithm in the iterative process, through which the accuracy and ability of global convergence were effectively improved.The simulation experiments were conducted on four benchmark functions, which validly tested the improved PSO.The salient feature of the improved was that GSAPSO had an obviously higher convergence rate, convergence accuracy and success rate than LDWPSO and WPSO.Then the GSAPSO algorithm was applied for RPO problem on the IEEE30 bus system.The simulation results revealed that the optimal loss reduction rate could reach 18.966%, the optimal solution iteration number was 45 times, which had great improvement compared with 64.6 times, the average iteration number in others algorithms.Moreover, the minimum of bus voltage was 1.0091 p.u. and whole bus voltages were more stable.We can see that the bus voltage magnitudes after reactive power optimization were significantly higher than before optimization.Moreover, they are more stable, the minimum value is 1.0091 p.u. and all values are within the limited range.

Conclusions
This paper has presented the GSAPSO, which was proposed by improving the particle update modes and the inertia weight of the algorithm in the iterative process, through which the accuracy and ability of global convergence were effectively improved.The simulation experiments were conducted on four benchmark functions, which validly tested the improved PSO.The salient feature of the improved was that GSAPSO had an obviously higher convergence rate, convergence accuracy and success rate than LDWPSO and WPSO.Then the GSAPSO algorithm was applied for RPO problem on the IEEE30 bus system.The simulation results revealed that the optimal loss reduction rate could reach 18.966%, the optimal solution iteration number was 45 times, which had great improvement compared with 64.6 times, the average iteration number in others algorithms.Moreover, the minimum of bus voltage was 1.0091 p.u. and whole bus voltages were more stable.The proposed GSAPSO algorithm obtained lesser power losses and a more stable voltage compared to the others.The simulation results demonstrated that the GSAPSO had an excellent performance for solving the RPO problems.

Figure 4 .
Figure 4. Convergence curves of average fitness using different algorithms.Figure 4. Convergence curves of average fitness using different algorithms.

Figure 4 .
Figure 4. Convergence curves of average fitness using different algorithms.Figure 4. Convergence curves of average fitness using different algorithms.

Figure 4 .
Figure 4. Convergence curves of average fitness using different algorithms.

Figure 5 .
Figure 5.The bus voltage before and after optimization.

5 .
The bus voltage before and after optimization.

Table 1 .
Related information of four functions.

Table 5 .
The results with four algorithms.

Table 6 .
The optimized control variables with four optimization algorithms.