Research on Reactive Power Optimization Control Method for Distribution Network with DGs Based on Improved Second-Order Oscillating PSO Algorithm

,


Introduction
With the rapid increase of traditional fossil energy consumption and the increasingly serious environmental pollution, countries around the world have begun to develop and utilize renewable energy. DG integration into the distribution network can efectively reduce carbon emissions and achieve efcient use of renewable power generation. In practical operation, however, distributed DGs often have characteristics such as intermittent and uncertain power supply, and the integration of DGs into the distribution network will afect the magnitude and direction of the original power grid fow, resulting in a decrease in local voltage quality of the distribution network, increasing system losses, and signifcantly reducing the overall power supply reliability of the distribution network. With the continuous increase of gridconnected capacity of DGs, its impact on voltage quality and system network loss will become increasingly serious. Terefore, precise reactive power optimization models and efcient control algorithms for distribution networks containing DGs are of great importance. Tis has signifcant theoretical value and practical signifcance for optimizing the overall scheduling of distribution networks containing DGs, improving the voltage quality of distribution networks, and reducing their operating costs.
Te conventional distribution network mainly has the following characteristics [1]. (1) Te structure is radial. Tere is only one feeder between a single node and the power supply. (2) Energy fows unidirectionally. Due to the radial grid structure, the direction of electric energy only fows from the distribution transformer to the load node. (3) Te power control capability is limited. Te quantity of controllable devices is limited in the distribution network, so the operation state of the network varies less. With the integration of a large number of distributed power sources into the distribution network, the structure and operation mode of the power system at the medium and low voltage level will be changed, and the characteristics of the distribution network will also be changed. Te main efects are as follows [2]. (1) DG always has the characteristics of intermittence and uncertainty, and the integration of DGs into the distribution network will change the magnitude and direction of the power fow of the original distribution network, resulting in the decrease of the local voltage quality of the distribution network and increasing the system network loss. (2) Electricity supply does not match demand in time and space, which leads to energy waste and brings great challenges to the stable operation of the power grid. (3) Te demand of distribution network for regulation ability is further increased to adapt to the structural transformation and the uncertainty of power fow.
Te conventional distribution network normally regulates the voltage through transformers and reactive power compensation equipment. Choi and Kim [3] proposed to control the node voltage by changing the tap of the on-load tap changer, but the adjustment ability of this scheme to the terminal node of the distribution network is very limited, which is only suitable for the situation where the system reactive power can be balanced or has a certain reserve. Elrayyah et al. [4] pointed out that the most widely used method of regulating voltage in distribution network is to add reactive power compensation devices. However, the voltage regulation of conventional reactive power compensation device has certain regional limitations and improves the investment and maintenance cost.
With the integration of DGs, the reactive power and voltage optimization of distribution network are gradually complicated. On the one hand, more electronic converters make the number of adjustable reactive power supply in the distribution network increase greatly [5]. On the other hand, the intermittence and uncertainty of renewable power generation lead to the increase of power fow complexity of distribution network and the decrease of the regularity of node voltage characteristics, which also leads to the complexity of reactive power and voltage optimization control [6].
In the last few years, a lot of eforts have been made to demonstrate how the voltage optimization can be implemented in distribution systems [7]. On the one hand, some researches proposed to improve voltage quality from the perspective of picking the appropriate place and size of DGs. In [8], an optimal method of sizing and placement of DGs and distribution static synchronous compensator in the radial distribution network was proposed to lower active power losses, enhance voltage stability and profle, and minimize costs. In [9], a hybrid analytical and metaheuristic optimization technique is proposed to fnd the proper locations and sizes for the DG and distribution static synchronous compensator in distribution networks to minimize the total losses and improve the voltage profle. On the other hand, the voltage quality of distribution network with DGs is improved by advanced optimal control methods. In [10], the central controller was used to optimize parameters of piecewise linear functions and control the power output of PV units. In [11], the reactive power of DGs is controlled locally according to a piecewise linear static V-Q characteristic, and the central controller computes the reactive power regulation based on model predictive control. Considering the uncertainties of DG units and demand, a robust constrained model predictive control was proposed for voltage control in [12]. In [13], a particle swarm optimization (PSO) algorithm was used to solve the multiobjective mixed-integer nonlinear programming problem. In [14], an MPC-based framework was proposed to realize the local control of DG units, and the alternating direction method of multipliers algorithm was adopted to obtain the near-global optimization of voltage control. In [12], considering uncertainties from DG units and demands, a robust constrained model predictive control strategy was formulated for centralized voltage control. In [15], a two-stage voltage control strategy was proposed to coordinate DG units and OLTC. First, the OLTC operation is scheduled, and then the reactive power outputs of DG units are controlled. In [16], a new successive linear approximation method was proposed to handle the nonlinearity of the power fow equations, and then the reactive power optimal dispatch problem was solved by it. In [17], a data-driven stochastic reactive power optimization model was introduced to address uncertain DGs integrated into distribution networks. In [18], a power fow coordination and optimization control method based on deep reinforcement learning for power grid with DGs was proposed. In [19,20], optimal distributed control strategies based on alternating direction method of multipliers and distributed MPC were proposed, which reduce the voltage deviation by optimizing the reactive power output of DGs. In [13], a PSO algorithm was used to solve the multiobjective mixed-integer nonlinear programming problem. From the references, the multiobjective optimization technique is commonly used to optimize the voltage of distribution network, while various solving methods for multiobjective optimization often face problems such as difculty in convergence and inability to fnd a global optimal solution. In this paper, a reactive power optimization control method for distribution network with DGs based on an improved second-order oscillating particle swarm optimization algorithm is proposed.
Te main research results and contribution of this paper are as follows. (1) Te power output mathematical models of the photovoltaic system, wind turbine, and battery energy storage are established. (2) Te infuence of DGs on voltage is analysed, and a reactive power optimization mathematical model is established to minimize the network loss and node voltage deviation of the distribution network. (3) Te inherent defects of the standard PSO algorithm are analysed from the perspective of control, and a second-order oscillating PSO algorithm with constriction factor is proposed to solve the reactive power optimization problem of distribution network with DGs. (4) An IEEE 33 bus distribution network model with DGs is simulated and analysed in static and dynamic scenarios. Simulation results confrm the performance and correctness of the proposed control method. With the proposed control methods, the convergence speed and optimization efect of reactive power optimization in distribution network with DGs are improved.
that the inverter capacity is empty and participates in the reactive power optimization of the distribution network. Figure 1 shows the equivalent circuit of the photovoltaic power generation system.
Assuming that the external power grid is an ideal threephase symmetrical voltage source, ignoring the infuence of coupling inductance and distributed parameters, one of the phases is taken for analysis. Te external grid voltage U s is set as the reference voltage, that is, _ U s � U s ∠0; the output voltage U PV of the photovoltaic inverter is set to _ U PV � U PV ∠δ, where δ is the angle between the photovoltaic inverter voltage and the grid voltage; ignoring the line resistance R, the current I on the line is Te power provided by the photovoltaic power generation system to the grid is as follows: In (2), S PV represents the apparent power of photovoltaic inverter; P PV and Q PV represent the active and reactive power of the photovoltaic power generation system, respectively.
In the distribution network, the angle δ between the output voltage of the photovoltaic inverter and the grid voltage is generally negligible, so it can be approximated as sin δ � δ, cos δ � 1. (3) Tus, (2) can be approximately simplifed as follows: Te reactive power output capacity Q PV of the photovoltaic power generation system is mainly limited by the apparent power capacity and active output of the photovoltaic inverter.
in which S PV,max is the maximum apparent power capacity of the photovoltaic inverter and P PV,max is the maximum active power of the photovoltaic power generation system. Te photovoltaic power generation system normally operates in the maximum power point tracking (MPPT) mode. If the power loss in the inverter is ignored, the output power of the solar panel can be considered as the output power of the photovoltaic inverter. At this time, the function of regulating Q PV can be realized by inverter control. Also, the photovoltaic power station can be equivalent to the PQ node during the power fow calculation.

Double-Fed Induction Generator Power Output Mathematical Model.
Since double-fed induction generator (DFIG) can realize the decoupling control of active and reactive power and has the fexible ability of reactive power regulation, it has become one of the most widely used wind turbines. Terefore, the wind power generation system in the distribution network studied in this paper adopts DFIG. Te equivalent circuit diagram of DFIG is shown in Figure 2.
Ignoring the internal energy loss of the wind turbine, the total power output of DFIG to the grid is P WT � P M � P s + P r � (1 − s)P s , in which P s and P r represent the active power output of DFIG stator winding and rotor winding, respectively; s represents the slip rate; and Q s and Q c represent the reactive power output of the stator-side converter and grid-side converter, respectively. Considering the maximum current constraint of the rotor winding, the reactive power regulation range of the DFIG stator-side converter is Journal of Control Science and Engineering 3 in which U s is the amplitude of DFIG stator winding voltage; X s and X m are the stator winding reactance and excitation reactance, respectively; and I rmax is the maximum value of DFIG rotor winding current. Similarly, considering the maximum current constraint of the stator winding, the reactive power regulation range of the stator-side converter is shown in the following equation: in which I smax is the maximum value of DFIG stator winding current.
In summary, the reactive power regulation range of DFIG stator side is shown in the following equation: DFIG usually operates in constant power factor mode. When the wind speed is low, the grid-side converter of the wind turbine will operate in the under-excitation state, and the converter can participate in the reactive power regulation. Te reactive power regulation capability of the DFIG grid-side converter is mainly limited by its maximum capacity. Te reactive power regulation range of the DFIG grid side is as follows: in which S cmax is the maximum apparent power of the wind turbine grid-side converter and s represents the slip rate. Terefore, the reactive power range of the DFIG output to the external grid is as shown in the following equation:

Battery Energy Storage System Power Output
Mathematical Model. Te battery pack and inverter are important components of the battery energy storage system. Figure 3 shows the equivalent circuit of the grid-connected battery energy storage system, in which the energy storage system and the external main grid have the ability to supply power to the distribution network load. When the total active power output of DGs in the distribution network is greater than the total load of the distribution network, the battery pack is charged, so it can be equivalent to a load. When the total active power output of DGs in the distribution network is not enough to support the total load of the distribution network, the battery group discharges. At this time, the battery group is similar to photovoltaic and wind power and can be equivalent to a power source. Te charging and discharging amount of each period of battery energy storage is related to its own self-discharge rate and charging and discharging power. If the pulse characteristics of the battery pack are ignored, the state of charging of the adjacent period satisfes the following coupling relationship: in which E BA (t + 1) and E BA (t) represent the remaining power of the battery energy storage in the t + 1th and tth period, respectively; σ represents the self-discharge rate of the battery pack per hour; p BA is the charging and discharging power of battery energy storage in the tth period; η c and η d represent the charging and discharging efciency of battery energy storage, respectively; and F char and F dis represent the charging and discharging states of the battery pack at time t, which are variables of 0 or 1, respectively.

The Influence of DGs on Distribution Network
Te integration of DGs into the distribution network will destroy the original single-source radial structure, and the power fow will also vary, which will afect the node voltage and network loss of the distribution network. In this paper, a simplifed distribution network connected with DG is taken as an example to analyse the impact of DG on node voltage and network loss. Te topology of the simplifed distribution network is shown in Figure 4.  transverse component is generally ignored and only the infuence of the longitudinal component of the voltage is considered [21]. Te voltage drop is as follows: in which U N represents the rated voltage of the distribution network. Te total voltage drop of the distribution network is as follows: Te voltages at nodes 1 and 2 can be obtained: When a DG device reaches node 1 (as shown in the dotted line of Figure 4), the voltage loss ∆U 1 becomes in which P DG and Q DG , respectively, represent the active and reactive power of the DG device. Ten, the voltage of node 1 and node 2 can be expressed as follows: By comparing (15) and (17), it can be seen that the integration of DGs into the distribution network will increase the node voltage of the distribution network, and the increase of the node voltage is related to the power output of the DG device.

Te Infuence of DG on Power
Loss. Te integration of DG will also afect the system power loss, and the degree of infuence varies with the power fow. In order to simplify the analysis process, assuming that the node voltage of the distribution network with the integration of DG remains unchanged, this paper only considers the steady states of the distribution network in Figure 4.
In the original distribution network, the power fow is unidirectional, and the current fowing into each load is Te power loss on two feeders of the distribution network is as follows: in which ∆S 1 and ∆S 2 represent the line loss between nodes 0 and 1 and nodes 1 and 2, respectively. Te total loss of the distribution network is as follows: Figure 3: Equivalent circuit of grid-connected battery energy storage system. Journal of Control Science and Engineering When a DG is integrated into node 1 and reaches the steady state, it injects active and reactive power into the distribution network, and the load current fowing into node 1 becomes Tus, the line loss between nodes 0 and 1 becomes Te total loss of the distribution network with the integration of DG is as follows: By comparing (20) and (23), it can be seen that with the integration of DG, the network loss will change, and the total loss variation is closely related to the output of the DG.

Reactive Power and Voltage Optimal Control
Method of Distribution Network Based on Improved Second-Order Oscillating PSO Algorithm

Objective Function.
In this paper, the system network loss and the voltage deviation of each node are taken as the optimization objectives, and the overlimit of each node voltage and the power purchase power from the superior power grid are added to the total objective function in the form of penalty function. Te specifc expression is as follows: (1) Overall active power loss objective function: in which n represents the total number of branches in the distribution network; U i and U j represent the node voltage amplitude of i and j nodes, respectively; G ij represents the conductance between i and j nodes; θ ij represents the phase diference of node voltage between i and j nodes; and P loss represents the network loss of the distribution network before optimization. (2) Voltage deviation objective function: in which m represents the number of nodes in the distribution network; U i represents the voltage amplitude of node i; U 0 represents the voltage amplitude of the balance node of the distribution network; and ∆U sum represents the sum of voltage deviations of each node before optimization. (3) Comprehensive objective function: in which U lim represents the limit of the voltage amplitude of each node in the distribution network, and its value rules are as follows (calculated in per unit value): In the above objective function, α and β are the weight coefcients of the targets f 1 and f 2 , respectively. In order to balance the infuence of distribution network loss and voltage deviation, the values of α and β are 0.5; P in and Q in represent the active and reactive power purchased from the superior power grid, respectively. Te reactive power optimization model in this paper only considers the local consumption of DGs, regardless of the factors such as the distribution network selling electricity to the main grid. Tat is to say, the power can only fow from the main network to the distribution network in one direction, and the fow is irreversible. Te penalty coefcient of the penalty function is expressed by λ 1 and λ 2 , where λ 1 represents the penalty coefcient of the node voltage exceeding the limits and λ 2 represents the penalty coefcient of the power purchased from the main grid.

Equality Constraint.
Te equality constraint of the proposed reactive power optimization model in this paper is the power fow constraint equation of the distribution network, and its expression is as follows: in which P Gi , P Gj , Q Li , and Q Lj represent the active and reactive power of power supply and load of i and j nodes, respectively, and B ij represent the susceptance between i and j nodes.

Inequality Constraint.
In the reactive power optimization process, some variables need to be constrained. Tese variable constraints can be divided into two categories: control variable constraint and state variable constraint. Te control variable constraints in this paper include the upper and lower limits of the output of each DG and that of the grid-connected static VAR compensator (SVC) compensation capacity.
(1) Constraints of DG reactive power output: Q DGi,min ≤ Q DGi ≤ Q DGi,max , (i � 1, 2, . . . , s), (29) in which Q DGi represents the reactive power output of the i th DG; Q DGi,max and Q DGi,min represent the maximum and minimum reactive power output of the i th DG, respectively; and s represents the number of DG in the distribution network.
(2) SVC compensation capacity constraints: 1, 2, . . . , t), (30) in which Q SVCi represents the reactive power of the i th SVC in the distribution network and Q SVCi,max and Q SVCi,min represent the upper and lower limits of the i th SVC, respectively.
(3) Voltage amplitude constraints: in which U i represents the voltage amplitude of node i except the balance node and U imax and U i min represent the upper and lower limits of voltage amplitude of node i, respectively.

Multiobjective Optimization Method
Based on an Improved PSO Algorithm. PSO, also known as bird swarm algorithm, has the advantages of fewer parameter settings, simple structure, and strong robustness. However, the standard PSO algorithm is easy to fall into the local optimal solution in the later period of iteration when the parameters are constant, which will produce the phenomenon of "prematurity" and lead to the decrease of convergence accuracy.

Mathematical Analysis of the Limitations of Standard PSO.
In the standard PSO algorithm, the update of the particle velocity is only related to the position of the particle and the optimal value of the individual and the group at the previous moment, ignoring the infuence of the change of the particle position on the update of the velocity, which leads to the efective information of each particle being not fully utilized. Te relevant mathematical explanation is as follows.
In the iteration formula of the standard PSO algorithm [22], suppose φ 1 � rand1 · c 1 and φ 2 � rand2 · c 2 , and then the velocity and position update formula of the standard PSO algorithm can be transformed into the following form: When the individual and the group optimal values of the particle are determined, the velocity of the particle is only related to the rate of change in particle position. In the classical kinematic equation, the velocity expression of the i th particle is shown in the following equation: in which a i represents the acceleration of the i th particle and ∆t represents the time interval, which is represented by an iteration. If the inertia coefcient ω is 1, the acceleration a i can be expressed as It can be seen that when the individual optimal value and the group optimal value are determined, the relationship between the particle position and the number of iterations is a second-order constant coefcient diferential equation. Te general solution of the equation can be obtained by solving the formula as follows: in which C 1 and C 2 are two diferent constants. Obviously, the position x of the particle is the value of the constant amplitude oscillation with the increase of the number of iterations k, which will fuctuate continuously in a fxed interval. Moreover, it leads to the inability of the particle position to efectively oscillate and converge, making the algorithm easy to fall into the local optimal solution. Terefore, the method to suppress the constant amplitude oscillation of each particle position with the number of iterations k will give a solution to the "premature" phenomenon.

Basic Principle of Second-Order Oscillating PSO.
It can be seen from (32) that in the k + 1 th iteration, the velocity of the particle is the composition of the velocity of the particle, the individual optimal velocity increment, and the group optimal velocity increment in the k th iteration. If only the incremental part of the individual optimal speed is considered, (32) can be expressed as follows: Its diferential expression is Converting the complex frequency domain for analysis, the Laplace transform of (36) can be obtained: Furthermore, (38) can be expressed as Clearly, the optimal speed increment part of the individual is equivalent to a frst-order inertial link with a time constant of 1, an inertial gain of φ 1 , P best,i as input, and x i (s) as output. Similarly, the optimal speed increment of the group is also equivalent to a frst-order inertial link with a time constant of 1, an inertial gain of φ 2 , G best,i as input, and x i (s) as output. Terefore, the velocity increment of the standard PSO is actually composed of two frst-order oscillation links with P best,i and G best,i inputs in parallel.
A second-order oscillating particle swarm optimization (SOOPSO) algorithm [23] is proposed by replacing the two frst-order oscillating links with two second-order oscillating links. Te algorithm simulates the change of particle velocity more accurately and improves the global search ability of PSO algorithm. After introducing the second-order oscillating link, the algorithm has a stronger global optimization ability at the initial period of iteration (k < T/2), which makes the algorithm oscillate and converge. In the later period iteration of the algorithm (k ≥ T/2), it is necessary to strengthen the local optimization ability to make the algorithm converge gradually. Te update formula of particle velocity changes as follows:

Second-Order Oscillating PSO with Constriction Factor.
In order to enhance the global convergence of the SOOPSO algorithm and further improve the optimization performance of the algorithm, this paper proposed a constriction factor χ to replace the inertia coefcient ω on the basis of the second-order oscillating PSO algorithm to achieve a better convergence efect. Te mathematical iteration formula is as follows: in which the constriction factor is in which φ represents the sum of two learning factors c 1 and c 2 , and then the update formula of particle velocity becomes Compared with the inertia coefcient, the introduced constriction factor in the update formula of particle velocity can more efectively adjust the direction of velocity and enhance the regional search ability of PSO algorithm. 8 Journal of Control Science and Engineering Figure 5 shows the fowchart of the improved secondorder oscillating PSO. Te specifc implementation steps of the SOOPSO algorithm after replacing the constriction factor are as follows: (1) Input the initial parameters of the algorithm, calculate the value of the constriction factor χ, and initialize the velocity and position of the particle swarm. (2) Calculate and compare the ftness values of each particle according to equation (26) and select the individual optimal value and the group optimal value. (3) Judge the current iteration number k and calculate the values of convergence coefcients ξ 1 and ξ 2 according to (40). (4) Te velocity and position of the k + 1 th iteration of the particle are calculated by the improved update formula (41). (5) Calculate the ftness value of each particle after updating and recalculate the individual optimal value and the group optimal value of the population. (6) Determine whether the termination condition is satisfed, and if it is satisfed, the calculation is terminated and output the result; if not, return to the third step to continue the iterative calculation until the termination condition is satisfed.

Performance Analysis of SOOPSO with Constriction
Factor. In order to analyse the convergence performance of the SOOPSO algorithm with constriction factors, three classic benchmark optimization problems were selected for solving experiments, including unimodal functions, multimodal functions, and combination functions. Meanwhile, the experimental results were compared and analysed with the SOOPSO algorithm and the standard PSO algorithm with linear inertia coefcients. Among them, the number of particles for all three algorithms is set to 30, and the maximum number of iterations for the algorithm is set to 500. Te learning factor for the SOOPSO algorithm with a constriction factor is c 1 � c (1) Sphere function: Te sphere function is a typical continuous unimodal function, with a solution space of d dimension which is set to 20 in this paper. Te global minimum value of the function is obtained at (x 1 , x 2 , . . . , x d ) � (0, 0, . . . , 0). Te distribution diagram of this function in twodimensional form and the convergence curve obtained by applying three algorithms are shown in Figure 6. As shown in Figure 6, the convergence speed and accuracy of the SOOPSO algorithm with constriction factor are better than those of the SOOPSO algorithm with linear inertia coefcient and the standard PSO algorithm in solving continuous unimodal functions.
(2) Rosenbrock function: Te Rosenbrock function is a multimodal function with multiple local minima, where the global minimum of the function is located at the parabolic valley (x 1 , x 2 , . . . , x d ) � (1, 1, . . . , 1). However, even though this parabolic valley is relatively easy to fnd, it is still difcult to converge to the global minimum. Te dimension d of the solution space was set to 20, and the distribution diagram of this function in twodimensional form and the convergence curves solved by the three algorithms are shown in Figure 7. From Figure 7(b), it can be seen that the convergence rates of the three algorithms are roughly similar, but only the SOOPSO algorithm with a constriction factor can converge to the global optimal solution, while the convergence accuracy of the SOOPSO algorithm with linear inertia coefcient is only second to that of the SOOPSO algorithm with a contraction factor. Te standard PSO algorithm ultimately falls into the local optimal solution.

Journal of Control Science and Engineering
Te Ackley function has multiple local minima and a global minimum, which is obtained at (x 1 , x 2 , . . . , x d ) � (1, 1, . . . , 1). Tis function can easily trap optimization algorithms such as hill climbing into many local optima and is widely used to test the ability of optimization algorithms to jump out of local optima. Te search range of the algorithm Input the initial parameters of the algorithm, calculate the constriction factor and initialize the particle swarm Start Termination condition is satisfied?
Calculate the fitness values of each particle, and select the individual optimal value Judge the current iteration number k, and calculate the values of convergence coefficients Output the result

No
Calculate the fitness value of each particle after updating, and recalculate the optimal value of the population Calculate the velocity and position of the k + 1th iteration End is set between [−32, 32], and the dimension d of the search space is 20. Te two-dimensional distribution and convergence curves solved using the three algorithms are shown in Figure 8.
From Figure 8, it can be seen that compared to the other two algorithms, the SOOPSO algorithm with a constriction factor has the fastest convergence speed in the early stage and quickly jumps out of the local optimal solution to converge to the global optimal.
Trough the experiments of the three test functions mentioned above, it can be found that the improved SOOPSO algorithm exhibits good optimization performance for both simple unimodal functions and complex multimodal functions. Te convergence speed and accuracy of the algorithm are also better than those of the standard PSO algorithm and the SOOPSO algorithm with linear inertia coefcients.

Case Study
In order to verify the efectiveness of the proposed control method, this paper constructs a distribution network model containing DGs and battery packs on the basis of the standard IEEE 33 bus distribution network. Lithium storage battery packs with a rated capacity of 3.75 MWh are connected to node 6 and node 28, whose upper and lower limits of charge and discharge power are [−0.3 MW, 0.3 MW], and the self-discharge rate σ per hour is 0.01. Photovoltaic power stations with capacity of 0.8 MW and 0.05 MW are integrated to nodes 9 and 12, respectively. Wind turbines with capacity of 0.6 MW and 0.1 MW are integrated to nodes 17 and 19, respectively. Te reference node of the system is 0 nodes, and the voltage reference is 12.66 kV. Te reference value of the apparent power is 10 MVA. Te total active power and reactive power of the distribution network load are 5084.26 kW and 2547.32 kvar, respectively. Te topology of the IEEE 33 bus distribution network with integration of DG and SVC devices is shown in Figure 9. Te simulation environment of this paper is AMD Ryzen5-4600 U CPU @ 2.10 GHz, 16.00 G memory, and the simulation software is MATLAB R2018b.

Reactive Power Optimization Efect in Steady State.
According to the mathematical model of reactive power optimization obtained above, the reactive power optimization simulation in the steady state at a certain time is carried out. Te active power of each distributed DG and battery pack is shown in Table 1.
Te standard PSO, SOOPSO with linear inertia coefcient, and SOOPSO with constriction factor are used to simulate the case study. Te parameters of the three algorithms are set as follows: the number of particles in the population is set to 50; the maximum number of iterations of the algorithm is 50; and the dimension of the search space is 8. In the standard PSO algorithm, the learning factor c 1 � c 2 � 1.2 and the inertia coefcient ω � 0.6. In the SOOPSO algorithm with linear inertia coefcient, the learning factor c 1 � c 2 ∈ [0.2, 1.8] and inertia coefcient ω ∈ [0.4, 0.9], which decrease linearly with the increase of iteration time. In the SOOPSO algorithm with contraction factor, the learning factor c 1 � c 2 � 1.5 and contraction factor χ are taken as in (41).
Te steady-state simulation results with abovementioned reactive power optimization are shown in Table 2.
It can be seen from Table 2 that the system loss of the distribution network with DGs optimized by the three algorithms has decreased. Among them, the distribution network loss optimized by the SOOPSO algorithm with constriction factor is 0.1477 MW, which is 49.31% lower than that of pre-optimization, and is relatively lower than that of the other two algorithms. It can be seen that the SOOPSO algorithm with constriction factor has certain advantages in reducing system loss.
As shown in Figure 10, without reactive power optimization, the voltage of each node in the distribution network is generally low, especially nodes 17 and 32 at the end of feeders. Te voltage amplitudes are 0.9467 and 0.9212, respectively, which are already lower than the limited node voltage lower limit of 0.95. After reactive power optimization, it can be seen that three algorithms can improve the node voltage to a certain extent, so that the overall voltage level is closer to the reference voltage. At the same time,    among the three algorithms selected, the SOOPSO algorithm with constriction factor has the best optimization efect, and the voltage amplitude of each node does not exceed the limit.
For nodes 17 and 32, the voltage amplitude optimized by the SOOPSO algorithm with constriction factor increases from 0.9467 and 0.9212 to 1.0100 and 0.9694, respectively.   Figure 11 shows the objective function convergence curves of reactive power optimization of three algorithms. It can be seen that the SOOPSO algorithm with constriction factor has better convergence speed.

Dynamic Reactive Power Optimization Efect.
In order to verify the efectiveness of the proposed control algorithm in dynamic reactive power optimization, the simulation is carried out in one day, which is divided into 24 periods. Figures 12 and 13 show the active load and reactive load of each node in the IEEE 33 bus distribution network with DGs within 24 hours.
Te active power of each DG and battery pack in the distribution network is shown in Figure 14.
After optimization, the network loss under dynamic conditions is shown in Figure 15 and Table 3. Compared with the other two algorithms, the SOOPSO algorithm with constriction factor has a better efect on reducing the network loss of the system. Figure 16 shows the results of active power and reactive power purchased from the main grid. Table 4 shows the numerical analysis of simulation results. By optimization, both the active power and reactive power from the main grid are signifcantly reduced.
By comparing and simulating the results in both steady state and dynamic situation, the efectiveness of the SOOPSO algorithm with the constriction factor proposed in this paper is verifed.

. Conclusion
Tis paper proposes a reactive power optimization control method for distribution network with DGs based on improved second-order oscillating PSO algorithm. Te overall conclusion can be summarized in the following points: (1) According to the simplifed radial distribution network model, the infuence of DGs on the node voltage and system loss of distribution network is analysed. (2) A mathematical model of reactive power optimization for distribution network with DGs is established with the multiobjective of minimizing the active power loss and node voltage deviation. (3) Te inherent defects of the standard PSO algorithm are analysed from the perspective of control theory, and a SOOPSO algorithm with constriction factor is proposed, which can improve the convergence speed of PSO. (4) Te proposed control method is verifed by the IEEE 33 bus distribution network with DGs under steady state and dynamic conditions. Te simulation results show that the proposed SOOPSO algorithm with constriction factor has more advantages in convergence speed. Besides, it can efectively reduce the system network loss and node voltage deviation and improve the power supply stability of the distribution network with DGs.
Although this paper has done some research and discussion on reactive power optimization of distribution network with DGs, there are still some aspects that need to be further studied: (1) In the next step, the reactive power output of DGs and static reactive power compensation device can be optimized in combination with real case simulation to improve the applicability of the model and algorithm. (2) Te reactive power compensation equipment in the case study only considers the static reactive power compensation device, and there are many kinds of reactive power compensation equipment in the current distribution network. Terefore, it can be considered to increase the switching capacitor, the on-load voltage regulating transformer, and the dynamic reactive power compensation device, so that the DGs can cooperate with a variety of reactive power compensation devices to further enrich the simulation examples.

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

Conflicts of Interest
Te authors declare that they have no conficts of interest.