Research on optimization algorithm of distribution network reconstruction based on cuckoo search-particle swarm optimization

As the distribution network environment becomes more complex, improving the optimization effect and running time is the key to distribution network reconfiguration. In this paper, firstly, the minimum branch power loss is used as the evaluation index of the result, and the hybrid algorithm of PSO algorithm and CS algorithm is selected as the optimization method of the reconstruction problem. Secondly, the mathematical model of the distribution network introduced by DG is simplified, and the static distribution network weight is used. It is a simplified way of power flow solving by introducing DG into the distribution network model. Based on the CS-PSO algorithm, the optimization calculation of the distribution network reconfiguration with DG is carried out. Finally, a calculation example proves the rationality and effectiveness of the method.


CS-PSO algorithms for distribution network reconstruction 2.1 Distribution network reconstruction model
Distribution network reconstruction is to use the change of the branch switch in the feeder to obtain a new network structure, and then optimize the power flow path to achieve functions such as load balancing, improvement of power quality, and reduction of active power loss. In essence, it is a set of seeking optimal switch combinations. Depending on the preference, the objective function can include reducing network loss and balancing load. This paper chooses the lowest active power loss on the distribution network line as the objective function, and it can be expressed as: In the formula, is the total number of branches in the system; i is the branch number; is the resistance of branch i; is the effective value of the current flowing through branch i; is the breaking variable of branch i, =0 i  means the line is disconnected, and =1 i  means the branch switch is closed.
In the traditional distribution network, the validity of the solution can be judged as long as the power flow constraints and topology constraints are met. The specific constraints are as follows: (1) Topological radioactivity constraint: the system structure satisfies the radial structure; (2) Power flow constraint: Gi P is the active power component in the generator output at node i, Gi Q is the reactive power component in the generator output at node i, Di P represents the active power out of the network at node i, represents the reactive power out of the network at node i, Di Q is the amount of reactive power flowing out of the network from node i, ij b is the conductance of branch j, ij g is the susceptance of branch visits, (2) (3) Constraints on branch transmission power: S i , S i,max are the apparent power and allowable maximum value of branch i, respectively. N b represents the total number of branches.
,max , 1, , (4) Node voltage constraints: U i , U i,min and U i,max are respectively the node voltage value of node i and its upper and lower limits; N represents the total number of nodes in the network. ,min ,max , 1, , According to the branch relationship between the nodes in the branch data, the nodes are connected into a network structure in the program. Through the operation of the switch, the network structure is transformed into a tree structure, and the power flow is calculated by Newton Raphson iteration method to obtain the node voltage and phase angle of each node, and the current of each branch is obtained. In this way, the network loss of the distribution network is obtained, and it is judged whether the obtained topology structure meets the requirements of the objective function.

Cuckoo algorithm
The CS algorithm is proposed by observing the reproduction phenomenon of cuckoos in the ecosystem. When the cuckoo reproduces, it puts its own eggs in the nests of other birds for incubation. When other birds do not find them, the eggs will be kept for hatching, but when other birds find foreign eggs in the nest, and then this egg often faces the risk of being destroyed by other birds, which means that the optimized solution of the egg has a probability of being discarded. This is also a feature of the CS algorithm. Randomly generated particles have the probability of being discarded, so the randomness and uncertainty of the algorithm are improved. At the same time, the Levy flight mechanism [8] followed by birds was also introduced as the basis for particle jumping.
The following conditions are set for the behaviour of each egg, that is, the particle search behaviour: (1) Each cuckoo generates an egg, which is then randomly placed in a nest at a certain location; (2) High-quality eggs in other nests are retained, thereby evolving the next generation (3) The total number of other nests n that can be used by cuckoos is fixed, that is, the total number of eggs produced is fixed. The probability that the eggs produced by cuckoos in the nest will be recognized and discarded by other birds is Under the above set conditions, plus Levy's flight motion law, the cuckoo's nest search trajectory and nest coordinates iteration formula is: In the formula,   represents the step distance, is a random number of the flight trajectory, and the length and direction of the trajectory change are given arbitrarily.  is a given value greater than zero, and can be selected according to actual usage, generally =0.01  . The Levy route trajectory function is as follows: and v are the random quantities provided by the normal distribution function and obey the function law of the following formula:

Particle Swarm Algorithm
The PSO algorithm [9] was published by Kennedy and Eberhart in 1995. It originated from the study of bird flock activity foraging. Individuals and groups in avian society influence each other, share information through social behaviour communication, learn from each other's existing experience, make the search process more concentrated, and quickly locate targets. This characteristic of PSO algorithm makes it possess the characteristic of fast convergence. The PSO algorithm focuses on the processing of particles, using the collaborative information between particle swarms and the guiding effect of historically optimal particles, using the fitness of the objective function to mark the optimization degree of particles, and changing the state of particles by updating the speed and position information. It is convenient to program to realize the particle update process. It is widely used in power system reactive power compensation optimization, parameter identification, distribution network planning and other issues.
In the classic PSO model, the calculation formula for the velocity and position of the particle i in the t+1 generation is as follows: In the formula: the particle: x x x represents the coordinates of a point in the n-dimensional space; 1 2 ( , , , ) represents the best position that the particle has passed by memorizing so far; 1 2 ( , , , ) represents the speed of the particle; 1 2 ( , , , ) represents the optimal position in the entire population. r 1 and r 2 are random numbers on the interval [0,1]; the constants c 1 and c 2 indicate the degree of influence of the particle by its own experience and group experience, and are the calculation coefficients that determine the magnitude of its effect v is a positive value defined in advance, used to limit the jump length to prevent the next generation of particles from exceeding the agreed range of the solution set, resulting in the waste of invalid particles. The above-mentioned speed update formula consists of three parts: The first part is the motion trajectory, which is the inheritance and maintenance of the previous speed of the particle according to a certain weight, which is equivalent to giving the particle the characteristic of retaining the previous generation of information. The second part is the individual cognition of the particle, which is the affirmation of the best position that one has passed, and the affirmation of one's own search ability, which is equivalent to giving particles the characteristics of self-thinking, self-affirmation and self-belief. The third part is the overall social communication part, through the mutual communication with all particles in the group, learning the current optimal solution of the PSO and moving to the optimal solution, which is equivalent to giving the particles the ability to learn and communicate. By adjusting the learning coefficients c1 and c2, these three parts are balanced and influenced each other to ensure the optimization ability of the algorithm. In different application scenarios, the learning coefficients c1 and c2 need to be assigned based on experience and actual conditions.

CS-PSO algorithm
Due to the high stability of the PSO algorithm, the PSO algorithm is the main body of the CS-PSO algorithm, and the CS algorithm is supplemented. On the basis of ensuring the iterative speed and optimization effect, the PSO algorithm is improved to make up for the defect that the particles are easy to fall into the local optimum in the PSO algorithm.
The basic idea of the PSO and CS hybrid optimization algorithm: In one iteration, first use the PSO algorithm to update the speed and position of the particle i to obtain the optimal position pi of a group of particles. If the fitness value of pi is greater than the global optimal, then pi enters the CS algorithm to continue iterative updates. In the CS algorithm, pi performs the long-step jump of Levy flight and retains the experience information after the jump for the next generation of evolution. If the performance of pi is not good, there is a certain probability that it will be discarded. The optimal particle before the iteration is still retained, and the particle evolution is not affected as much as possible to make it jump out of the local optimal. The hybrid algorithm mixes the use of the PSO algorithm and the CS algorithm, and uses the characteristics of the long jump of the CS algorithm and a certain probability of discarding unfavourable particles to make up for the defects of the PSO algorithm. At the same time, the PSO algorithm search is performed first and then the CS algorithm search is performed, which increases the evolution. The number of steps makes it take longer for the same iterative algebra.
Due to the strong stability of the PSO algorithm, it maintains good experimental repeatability for the search effect. The CS algorithm is added to compensate for the defects of the PSO algorithm. On the basis of maintaining the stability and effectiveness of the original PSO algorithm, the search efficiency is improved, reduce the number of iterations and promote the particles to jump out of the local optimum in order to achieve better search results, and reduce the instability of the CS algorithm caused by abandoned particles.
The steps of PSO and CS hybrid optimization algorithm to solve the reconstruction problem are shown in Figure 1.
In order to prove the feasibility of the reconstruction algorithm, the hybrid algorithm is compared with the deterministic algorithm and the random algorithm in the traditional IEEE standard data. Select the optimal flow algorithm in the deterministic algorithm, and select the single CS algorithm and the single PSO algorithm in the random algorithm, and compare and verify with the CS-PSO algorithm.
Compare the intelligent algorithms, use the PSO method and the CS algorithm, and select the IEEE84 node standard system. Since the PSO, CS, and CS-PSO hybrid algorithms are all random algorithms, the program is run 50 times each, and the statistical reconstruction results are taken respectively. The average value, the result of 84-node system optimization, forms the data curve in Figure  2. It can be seen from the calculation example that the convergence of the PSO algorithm is extremely high within the 10th generation, and the speed is much higher than the other two algorithms. However, it stops in the process of continuing the search. The optimal solution is gradually searched out around the 20th generation. The CS algorithm is relatively stable, it gradually converges slowly, and the gradient shown in the figure 2 is larger. The evolution curve of the CS-PSO algorithm complements the other two and compensates for the defects of the PSO algorithm, but the final optimized solution is the same as the CS algorithm. The CS-PSO algorithm is better than the PSO and CS algorithm in terms of the number of evolution and the results obtained. The CS-PSO algorithm combines the CS algorithm's jumping out of the local optimum and the rapid convergence of the PSO algorithm, which improves the PSO algorithm's large-scale optimization ability in the solution set space.

Distribution network reconstruction with distributed power generation
Because wind power and photovoltaic power generation fluctuate too much with the change of the natural environment, they are uncontrollable to a certain extent and are generally described by normal distribution. DG, including fuel cells and micro gas turbines, relies on the combustion of fossil fuels, and the output power is stable and can be adjusted according to actual needs.
Since uncontrollable DG has a great negative impact on the power grid, real-time dispatch of virtual power plant information data network is used to integrate DG, and adjustable power supply is used to compensate for the adjustable power supply, so as to achieve the stability of power grid output. Incorporating the uncontrollable DG into the virtual power plant management produces a largecapacity adjustable power source, thereby converting the uncontrollable DG into a power point with schedulable output. Joining the DG distribution network constraints increases the constraints on the DG. The constraints on the topology are the same as equations (9), (10) and (11), the constraints on the power flow are as follows: (1) Power flow constraint: DGi P is the active energy input to the distribution network by the DG installed at node i, DGi Q is the reactive energy input to the distribution network by the DG installed at node i, DGi P represents the active energy absorbed by the DG installed at node i from the grid, DGi Q is the reactive energy absorbed by the DG installed at node i from the grid, and the rest is the same as equation (9).
(2) Constraints on DG output power: n is the number of connected DGs, DGi P , DGi Q are the active power and reactive power output by the i-th DG, The main feature of the distribution network reconstruction with DG is that the output of the DG is included in the optimization range. The position and output of the DG have varying degrees of influence on the distribution network line loss.

The reconfiguration of distribution network including electric vehicles
According to the load characteristics, a day is divided into two time periods, which are the low period 23:00-7:59, and the rising and peak periods 8:00-22:59. The network losses of these two periods are P lossa and P lossb .
Since the electric load of an EV changes with time, in order to still ensure the optimal operation of the distribution system during the dynamic load change process, a single optimization result of the reconstruction objective function cannot guarantee the optimal operation of the power grid. Therefore, in order to balance the two time periods, the two time periods are comprehensively planned to reduce the active power loss of the composite network and the objective function for the optimization of the distribution network reconfiguration problem is:

Simplified distribution network
This paper assumes that all branches in the network are equipped with switches, so that all branches can be switched to control the opening and closing of branches.
When solving actual problems, it can be judged according to the installation situation of network branch switches, which will affect the number of branch sets in the simplified branch group, but does not affect the process of simplifying the network itself. Take 69 nodes as an example, the following figure 3 is a diagram to simplify the steps of the network process.

Fig3. Simplified network G process steps
The steps to simplify the network are as follows: (1) Close all switches to form a closed loop network (2) Delete the branch that cannot form a closed loop (3) Combine equivalent branches into one branch (4) Simplified network G is obtained, and the operation of the switch in the simplified network needs to meet the restrictions on the use of radioactive open loop in the distribution network, the specific operating regulations are: 1) For branches that do not form a ring network, their switches must be closed 2) In a simplified branch, at most one switch is open. If the above two conditions are not met, G will produce islands that are not connected to the power supply.

Coding
Due to the overlap of the ring network, the improved decimal method and other methods will often get invalid solutions, while the Mayeda method does not need to confirm the connectivity of the graph, only the operation of matrix addition is required, which is convenient and quick to obtain the network changes after the previous exchange of branches. Thus, the next branch selection is carried out on the basis of the original change.

Simulation analysis
The calculation example combines EV and DG to optimize the charging and discharging power of the V2G charging station, and use it and DG to contribute to the uniform power flow. The calculation example uses the CS-PSO algorithm to optimize the output of EV and DG to carry out random search and simultaneously carry out distribution network reconstruction. The calculation example uses a 69-node system and is optimized under the characteristics of a 200,000 EVs comprehensive daily load charging curve. The comprehensive system is shown in Figure 4.

Fig4. 69-node system diagram with DG and PEV
The maximum discharge power of V2G is 200kW, and the maximum charging power is 400kW.The two time period node load expectations of 200,000 EV are evenly distributed to the load nodes, and the above calculation example is optimized to obtain V2G and DG optimized output Table 1 and Table 2.And the network loss comparison between non-optimized output and optimized output is shown in Table 3.The node voltages in the table are all expressed in standard unit values. It can be seen from Table 3 that under the premise of adjustable power supply, it is necessary to optimize output to reduce network loss. However, if considering energy utilization such as abandoning wind and water, the highest utilization rate cannot be achieved. The objective function needs to be adjusted, discussing from the two aspects of reducing power abandonment and reducing network loss.

Conclusion
With the increasingly serious energy problem, more and more measures are applied to the power grid in order to save resources and reduce losses. Distribution network loss is an important part of energy loss, distribution network reconfiguration, as an important measure to reduce distribution network loss, has been widely studied in recent years. From heuristic algorithms, mathematical programming methods, intelligent algorithms to various hybrid algorithms, the optimization algorithms applied to distribution network reconfiguration have their own advantages and disadvantages. It is still necessary to continue to explore optimization algorithms. With the use of renewable resources of distributed power and the use of electric vehicles using electric energy or hybrid energy is increasing. The injected power of DG into the distribution network has redistributed the original load distribution.