Power distribution network optimization method based on reactive power margin and improved sparrow search algorithm
By employing a distribution network optimization method based on reactive power margin and an improved sparrow search algorithm, the equivalent reactive power margin of nodes is calculated and combined with the location update and crossover operation of the improved sparrow search algorithm. This solves the problem of local optima in distribution network optimization and achieves higher operational stability and lower network losses.
Patent Information
- Application Number
- CN202511750711.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-17
AI Technical Summary
Existing algorithms such as genetic algorithms, particle swarm optimization algorithms, and sparrow search algorithms are prone to getting trapped in local optima in distribution network optimization, and it is difficult to simultaneously guarantee operational stability and minimize network losses.
A distribution network optimization method based on reactive power margin and improved sparrow search algorithm is adopted. By calculating the equivalent reactive power margin of nodes, reactive power compensation device nodes are set. The objective function is optimized by combining the position update formulas of discoverer, follower and watcher of improved sparrow search algorithm to avoid local optima. The search capability is improved by using horizontal and vertical cross operations.
This effectively avoids the algorithm getting trapped in local optima, improves the operational stability and voltage amplitude of the distribution network, reduces network losses, and ensures the safe and efficient operation of the power system.
Smart Images

Figure CN121688918A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of power systems, and particularly relates to a distribution network optimization method based on reactive power margin and improved sparrow search algorithm. BACKGROUND
[0002] With the rapid development of new power systems, the wide application of new energy brings great challenges to the safe and stable operation of distribution networks, so it is necessary to provide security for the operation of distribution networks and reasonably plan the distribution networks. On the premise of ensuring safe operation, the economic benefits of the distribution networks are improved as much as possible, and the system network loss is reduced.
[0003] At present, although genetic algorithm (GA), particle swarm optimization algorithm (PSO), improved particle swarm optimization algorithm (IPSO) and sparrow search algorithm (SSA) and other algorithms can be used for network loss optimization, it is still not clear which algorithm can make the operation stability of the distribution network optimal and the network loss minimum after optimization. In addition, the above algorithms are prone to local optimization, and effective solutions to this problem are still lacking.
[0004] Based on this, the application provides a distribution network optimization method based on reactive power margin and improved sparrow search algorithm, which aims to ensure the operation stability of the distribution network, reduce the network loss, and effectively avoid the algorithm falling into local optimization. SUMMARY
[0005] The application provides a distribution network optimization method based on reactive power margin and improved sparrow search algorithm, which aims to ensure the operation stability of the distribution network, reduce the network loss, and effectively avoid the algorithm falling into local optimization.
[0006] In order to achieve the above purpose, the application provides the following technical content: A distribution network optimization method based on reactive power margin and improved sparrow search algorithm, comprising the following steps: S1: based on the network parameter information of the distribution network, calculating the equivalent reactive power margin of each node in the distribution network, counting the nodes needing to switch the reactive power compensation device, and setting the number of nodes needing to switch the reactive power compensation device as N ; S2: establishing a target function; S3: establishing a reactive power planning constraint condition; S4: optimizing by using the improved sparrow search algorithm to make the target function minimum; specifically comprising the following steps: S4.1: initializing the population size, and respectively setting the number of discoverers, followers and alarmers; calculating the target function value of each individual in the population, i.e. the fitness value of each individual; S4.2: updating the position of the discoverer; the formula is:
[0007] where, denotes the position of the th l finder at the tth iteration; denotes the position of the th l finder at the t+1th iteration; denotes the non-linear inertia at the tth iteration; r 1 is a random number in [0, 1]; denotes the position of the global best individual at the tth iteration, i.e., the position of the individual with the minimum fitness value at the tth iteration; where, ; where, denotes the non-linear inertia at the tth iteration; denotes the small inertia for the convergence period; denotes the large inertia for the convergence period; T is the maximum number of iterations set; denotes the control parameter; S4.3: update the position of the follower; the formula is:
[0008] where, denotes the position of the th m follower at the tth iteration; denotes the position of the th m follower at the t+1th iteration; denotes the non-linear inertia at the tth iteration; r 1 is a random number in [0, 1]; denotes the position of the global best individual at the tth iteration, i.e., the position of the individual with the minimum fitness value at the tth iteration; denotes the position of the global worst individual at the tth iteration, i.e., the position of the individual with the maximum fitness value at the tth iteration; F m,t denotes the fitness value of the th m follower at the tth iteration; F best denotes the minimum fitness value at the tth iteration; S4.4: the scout performs the lateral and longitudinal crossover operations; the formula of the lateral crossover operation is:
[0009] where, denotes the position of the th a scout at the tth iteration; denotes the position of the th aThe position of the vigilant at the (t+1)th iteration; r 1 is a random number in the range [0, 1]. Indicates the first b The position of the vigilant at the t-th iteration; Indicates the first b The position of the vigilant at the (t+1)th iteration; The formula for vertical crossover operation is:
[0010] In the formula, Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... o The dimensional values of each dimension; Indicates the first a When a vigilant is in its (t+1)th iteration, its own (t)th iteration... o The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its (t+1)th iteration, its own (t)th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... o The dimensional values of each dimension.
[0011] Further, step S2 includes the following steps: S2.1: Calculate the active power loss of all nodes in the distribution network;
[0012] In the formula, f 1 represents the active power loss at all nodes of the distribution network; N s This indicates the total number of nodes in the distribution network; G ij Indicates the first i The node and the first j Electrical conductance between nodes; i and j They represent the first i The and the first j 1 node Indicates the first i The node and the first j The phase angle difference between the nodes;U i the voltage amplitude of the node i ; U j the voltage amplitude of the node j ; S2.2: Calculate the voltage deviation of all nodes of the power distribution network in the time domain from the 1st hour to the tth hour, and the formula is: D
[0013] wherein, f 2 is the voltage deviation of all nodes of the power distribution network; t represents the tth hour; t represents the tth hour set, D =24; D s represents the number of all nodes in the power distribution network; D j,t represents the voltage amplitude of the node N in the tth hour; U j,额 represents the rated voltage of the node j ; U S2.3: Calculate the switching cost of the reactive power compensation device of the node j in S1; N
[0014] wherein, f 3 is the switching cost of the reactive power compensation device of the node N ; x b represents the number of the reactive power compensation device switched at the node N in the node b ; represents the unit price of the reactive power compensation device; N represents the number of nodes requiring switching of the reactive power compensation device; S2.4: Establish the objective function;
[0015] F represents the objective function; are weight coefficients; P b , U b , C b are normalized reference values.
[0016] Further, in step S1, the equivalent reactive power margin of each node is calculated; the formula is:
[0017] wherein, Q yd,z represents the equivalent reactive power margin of the z th node; r Pf,z represents the active power reactive power margin of the z th branch connected to the node f ; r Qf,z represents the reactive power reactive power margin of the z th branch connected to the node f ; f represents the z th branch connected to the node f ; f ∈[1, N z ], and is an integer; N z represents the total number of branches connected to the node z ; D f represents the reactive power loss of the f th branch; wherein,
[0018] in the formula, r Pf,z represents the active power reactive power margin of the z th branch connected to the node f ; U z represents the voltage amplitude of the node z ; b f represents the susceptance of the f th branch; P f represents the active power of the f th branch; g f represents the conductance of the f th branch; r Qf,z represents the reactive power reactive power margin of the z th branch connected to the node f ; Q f represents the reactive power of the f th branch; D f represents thef reactive power loss of branch.
[0019] Further, the reactive power planning constraint condition in step S3 comprises: establishing power flow constraint equation:
[0020] wherein, P i and Q i represent active power and reactive power of node i respectively, i ∈[1, N s ] and is an integer; U i and U j represent voltage amplitude of node i and node j ; G ij represent conductance between node i and node j ; B ij represent susceptance between node i and node j ; N s represent the number of all nodes in power distribution network; represent phase angle difference between node i and node j ; inequality constraint equation:
[0021] wherein, U i,min , U i,max are lower and upper limits of voltage at node i respectively; U i represent voltage amplitude of node i ; Q i,min , Q i,max are minimum and maximum values of reactive power compensation capacity of reactive power compensation device at node i respectively; Q i represent reactive power at node i ; k i represent the number of reactive power compensation devices put into operation at node i ;k max This represents the maximum number of reactive power compensation devices that can be switched on or off.
[0022] Furthermore, Set to 0.2; Set to 0.9.
[0023] The beneficial effects that can be achieved by adopting the above technologies are: 1. The Sparrow Search algorithm was selected to optimize the objective function, which can ensure that the voltage amplitude of each node is above 0.95 per unit, thus ensuring the stability of each node.
[0024] 2. After improving the traditional sparrow search algorithm, the stability of each node is further enhanced and the network loss is reduced. Attached Figure Description
[0025] Figure 1 This is the flowchart of this solution; Figure 2 These are the convergence curves of the objective function during the iteration process of each algorithm; Figure 3 These are the voltage amplitude diagrams of the 33 nodes after optimization by various algorithms; Figure 4 This is a bar chart showing the network loss of the 33-node distribution network after optimization by various algorithms. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] like Figure 1 As shown, a distribution network optimization method based on reactive power margin and an improved sparrow search algorithm specifically includes the following steps: S1: Based on the network parameter information of the distribution network, calculate the equivalent reactive power margin of each node in the distribution network; and identify the nodes that need to switch on / off reactive power compensation devices. Specifically, this includes the following steps: S1.1: Calculate the equivalent reactive power margin of each node; the formula is:
[0028] In equation (1), Q yd,z Indicates the first z The equivalent reactive power margin of each node;r Pf,z Represents nodes z Connected, the first f Active power and reactive power margin of each branch; r Qf,z Represents nodes z Connected, the first f Reactive power and reactive margin of each branch; f Represents nodes z The connected first f A side road, f ∈[1, N z ], and is an integer; N z Represents nodes z The total number of connected branches; D f Indicates the first f The reactive power loss of the branch circuit.
[0029] in,
[0030] In the formula, r Pf,z Represents nodes z Connected, the first f Active power and reactive power margin of each branch; U z Represents a node z The voltage amplitude; b f Indicates the first f The susceptance of the branch circuit; P f Indicates the first f The active power of each branch; g f Indicates the first f The conductivity of the branch circuit; r Qf,z Represents nodes z Connected, the first f Reactive power and reactive margin of each branch; Q f Indicates the first f The reactive power of each branch circuit; D f Indicates the first f The reactive power loss of each branch. All of the above parameters are known quantities. Therefore, the equivalent reactive power margin of each node can be calculated according to S1.1.
[0031] S1.2: Statistics on the nodes that need to be switched on and off using reactive power compensation devices.
[0032] For example: set a reactive power margin threshold; designate nodes with reactive power margins below the threshold as nodes requiring reactive power compensation devices to be switched on. Nodes with reactive power margins below the threshold are designated as... N Then the N Nodes with values below the threshold need to switch on / off the reactive power compensation device.
[0033] S2: Establish the objective function.
[0034] Specifically, the following steps are included: S2.1: Calculate the active power loss at all nodes in the distribution network. The formula is:
[0035] In equation (2), f 1 represents the active power loss at all nodes of the distribution network; N s This indicates the total number of nodes in the distribution network; G ij Indicates the first i The node and the first j Electrical conductance between nodes; i and j They represent the first i The and the first j One node; Indicates the first i The node and the first j The phase angle difference between the nodes; U i Represents a node i The voltage amplitude; U j Represents a node j The voltage amplitude.
[0036] S2.2: From the first hour to the... D Within a time domain of one hour, the voltage deviation of all nodes in the distribution network is calculated hourly. The formula is:
[0037] In equation (3), f 2 represents the voltage deviation at all nodes of the distribution network. t Indicates the first t Hours D Indicates the set number D Hours, this plan D =24; N s This indicates the total number of nodes in the distribution network; U j,t Represents a node j The voltage amplitude in hour t; Uj,额 Represents a node j The rated voltage; S2.3: Calculate S1 N The switching cost of reactive power compensation devices at each node. The formula is:
[0038] In equation (4), f 3 is N Cost of switching on reactive power compensation devices at each node; x b express N The node in the node b The number of reactive power compensation devices switched on at each node b ∈[1, N ], and is an integer; This indicates the unit price of the reactive power compensation device; N The number of nodes that need to be switched on and off is indicated by S1.
[0039] S2.4: Combining the weighting coefficients, establish the objective function, the formula is:
[0040] In equation (5), F Represent the objective function; All are weighting coefficients; P b , U b , C b All are normalized baseline values.
[0041] S3: Establish reactive power planning constraints. This includes the following steps: S3.1: Establish power flow constraint equations.
[0042] The formula is:
[0043] In the formula, P i and Q i Representing nodes respectively i Active power and reactive power, i ∈[1, N s ], and is an integer; U i and U j Represents a node i and nodes j The voltage amplitude; Gij Represents a node i and nodes j The electrical conductance between them; B ij Represents a node i and nodes j The susceptance between; N s This indicates the total number of nodes in the distribution network; Represents a node i and nodes j The phase angle difference between them.
[0044] S3.2: Inequality constraint equations.
[0045] The formula is:
[0046] In equation (6), U i,min , U i,max They are nodes i The voltage at the lower and upper limits; U i Represents a node i The voltage amplitude; Q i,min , Q i,max They are nodes i Minimum and maximum reactive power compensation capacity of the reactive power compensation device; Q i Represents a node i reactive power at the location; k i Represents a node i The number of reactive power compensation devices installed at the location; k max This represents the maximum number of reactive power compensation devices that can be switched on or off.
[0047] S4: Optimize using an improved sparrow search algorithm to minimize the objective function and obtain the final planning scheme.
[0048] Traditional algorithms such as the genetic algorithm (GA), particle swarm optimization (PSO), and sparrow search algorithm (SSA) are prone to getting trapped in local optima and have slow convergence speeds. Therefore, this paper proposes an improved sparrow search algorithm to address these issues. Specifically, it includes the following steps: S4.1: Initialize population size C=50; the number of discoverers is set to 5, followers to 40, and guards to 5. Calculate the objective function value for each individual in the population, i.e., the fitness value of each individual; S4.2: Update the location of the discoverer; The discoverer position update formula of the traditional Sparrow Search Algorithm (SSA) is:
[0049] In the formula, Indicates the first l The position of the discoverer at the t-th iteration l ∈[1,5], and is an integer; Indicates the first l The position of the discoverer in the (t+1)th iteration; For control parameters; T The maximum number of iterations is set. This represents the position of the globally optimal individual at the t-th iteration, which is the position of the individual with the smallest fitness value at the t-th iteration.
[0050] The traditional discoverer position update formula lacks effective control over the discoverer position update step size, resulting in poor balance between global and local search capabilities. Therefore, this paper introduces nonlinear inertia to improve its search ability and convergence speed, as shown in the formula:
[0051] In the formula, This represents the nonlinear inertia at the t-th iteration; This indicates a relatively small inertia during the convergence period, set to 0.2; This indicates a relatively large inertia during the convergence period, set to 0.9; T The maximum number of iterations is set. This indicates the control parameters.
[0052] Based on nonlinear inertia, the position update formula for the discoverer in this scheme is:
[0053] In equation (7), Indicates the first l The position of the discoverer at the t-th iteration; Indicates the first l The position of the discoverer in the (t+1)th iteration; This represents the nonlinear inertia at the t-th iteration; r 1 is a random number in the range [0, 1]. This represents the position of the globally optimal individual at the t-th iteration, which is the position of the individual with the smallest fitness value at the t-th iteration. S4.3: Update the position of the follower; the formula is:
[0054] In equation (8), Indicates the first m The position of a follower in the t-th iteration m ∈[1,40]; Indicates the first m The position of the follower in the (t+1)th iteration; This represents the nonlinear inertia at the t-th iteration; r 1 is a random number in the range [0, 1]. This represents the position of the globally optimal individual at the t-th iteration, which is the position of the individual with the smallest fitness value at the t-th iteration. This represents the position of the worst individual globally at the t-th iteration, which is the position of the individual with the highest fitness value at the t-th iteration. F m,t Indicates the first m The fitness value of a follower at the t-th iteration; F best This represents the minimum fitness value at the t-th iteration.
[0055] S4.4: The vigilant performs lateral and longitudinal cross-operations; Since traditional sparrow search algorithms often get stuck in local optima in the later stages, in order to avoid this, we implement horizontal crossover strategy and vertical crossover strategy respectively. Horizontal crossover strategy is used to exchange information between different individuals, while vertical crossover strategy is used to reorganize between different dimensions within the same individual.
[0056] The formula for horizontal crossover operation is:
[0057] In the formula, Indicates the first a The position of the vigilant at the t-th iteration. a ∈[1,5], and is an integer; Indicates the first a The position of the vigilant at the (t+1)th iteration; r 1 is a random number in the range [0, 1]. Indicates the first b The position of the vigilant at the t-th iteration. b ∈[1,5], and is an integer; Indicates the first b The position of the vigilant at the (t+1)th iteration. a and b The selection method is random selection.
[0058] The formula for vertical crossover operation is:
[0059] In the formula, Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... o The dimensional values of each dimension; Indicates the first a When a vigilant is in its (t+1)th iteration, its own (t)th iteration... o The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its (t+1)th iteration, its own (t)th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... o The dimensional values of each dimension.
[0060] in, o and p The selection rule is random selection; the dimension value means: that is, in the aforementioned objective function f 1. f 2 or f The value of 3; dimension is... f 1. f 2 or f 3.
[0061] S4.5: Repeat S4.2-S4.4 multiple times until the set number of iterations (100 times) is reached, to obtain the minimum objective function value and the corresponding solution. f 1. f 2 and f 3).
[0062] Calculation example: This solution uses an IEEE 33-node distribution network as an example.
[0063] First, the equivalent reactive power margin value of each node is calculated through step S1, and the results are shown in Table 1.
[0064] Table 1. Equivalent reactive power margin values for each node Node No. Equivalent Reactive Margin Value Node No. Equivalent Reactive Margin Value Node No. Equivalent Reactive Margin Value 1 5.45721 12 4.80441 23 4.85108 2 5.39723 13 4.81428 24 4.93401 3 5.36172 14 4.82567 25 4.76604 4 5.11719 15 4.78352 26 4.75990 5 4.92879 16 4.75857 27 4.73282 6 4.84583 17 4.72926 28 4.68825 7 4.83412 18 4.68395 29 4.65165 8 4.75720 19 4.69812 30 4.61939 9 4.60071 20 4.69053 31 4.83082 10 4.65372 21 4.75659 32 4.85011 11 4.72452 22 4.66916 33 4.87265 Since the equivalent reactive power margin values of nodes 9, 18 and 30 are relatively small, for the sake of convenience in illustration, nodes 9, 18 and 30 are selected as the nodes that need to switch on the reactive power compensation device.
[0065] The reactive power compensation devices that can be switched on and off at these three nodes are shown in Table 2.
[0066] Table 2. Parameters of reactive power compensation devices that can be switched at three nodes. Reactive Compensation Device Name Node No. Installable Group No. / Unit Single Capacity / kVar C1 9 0-10 100 C2 18 0-10 100 C3 30 0-10 100 After establishing the objective function, iterative algorithms were employed using GA (Genetic Algorithm), PSO (Particle Swarm Optimization), IPSO (Improved Particle Swarm Optimization), SSA (Sparrow Search Algorithm), and the proposed ISSA (Improved Sparrow Search Algorithm). The results are shown in [the table below]. Figure 2 ;from Figure 2 It can be seen that the improved sparrow search algorithm (ISSA) exhibits the best convergence speed, convergence accuracy and stability in this experiment, and has the best optimization performance among these algorithms.
[0067] Figure 3 This shows the voltage amplitude of each node after optimization using the above algorithm, from... Figure 3 As can be seen, the Sparrow Search Algorithm (SSA) was chosen as the preferred iterative optimization algorithm because, compared to other algorithms (Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Improved Particle Swarm Optimization (IPSO), it can effectively ensure that the voltage amplitude of each node is greater than the set minimum voltage amplitude (i.e., ...). Figure 3 (0.95 per unit value).
[0068] Furthermore, a comparison reveals that the improved Sparrow Search Algorithm ISSA in this scheme, compared to the traditional Sparrow Search Algorithm SSA, not only exhibits larger voltage amplitudes at most nodes but also demonstrates superior performance in terms of voltage curve smoothness and overall consistency. It effectively reduces voltage fluctuations between nodes, resulting in a more uniform and stable voltage distribution in the power system. Simultaneously, compared to the unoptimized version and other algorithms, it satisfies voltage constraints to a greater extent and has a wider range of applicability. Even under complex operating conditions, it can more reliably maintain the voltage of each node within a reasonable range, providing stronger assurance for the safe and efficient operation of the power system.
[0069] Figure 4 The figure shows the network loss of all nodes after optimization by the above algorithm. As can be seen from the figure, the improved Sparrow Search algorithm ISSA has the lowest network loss, providing a stronger guarantee for the safe and efficient operation of the power system.
[0070] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.
Claims
1. A power distribution network optimization method based on reactive margin and improved sparrow search algorithm, characterized in that, Comprising the following steps: S1: based on the network parameter information of the power distribution network, calculating the equivalent reactive power margin of each node in the power distribution network, counting the nodes needing to switch in reactive power compensation devices, and setting the number of nodes needing to switch in reactive power compensation devices as N ; S2: establishing a target function; S3: establishing a reactive power planning constraint condition; S4: optimizing by using an improved sparrow search algorithm to minimize the target function; specifically comprising the following steps: S4.1: initializing the population size, and respectively setting the number of discoverers, followers and sentinels; calculating the target function value of each individual in the population, i.e. the fitness value of each individual; S4.2: updating the position of the discoverer; the formula is: ; wherein, denotes the position of the tth individual of the population at the tth iteration; l denotes the position of the tth individual of the population at the tth iteration; denotes the position of the tth individual of the population at the tth iteration; l denotes the position of the tth individual of the population at the tth iteration; denotes the non-linear inertia at the tth iteration; r 1 is a random number in [0, 1]; denotes the position of the global optimum individual at the tth iteration, i.e. the position of the individual with the minimum fitness value at the tth iteration; wherein, wherein, denotes the non-linear inertia at the tth iteration; denotes the small inertia for the convergence period; denotes the large inertia for the convergence period; T is the maximum number of iterations set; denotes the control parameter; S4.3: updating the position of the follower; the formula is: ; In the formula, Indicates the first m The position of each follower at the t-th iteration; Indicates the first m The position of the follower in the (t+1)th iteration; This represents the nonlinear inertia at the t-th iteration; r 1 is a random number in the range [0, 1]. This represents the position of the globally optimal individual at the t-th iteration, which is the position of the individual with the smallest fitness value at the t-th iteration. This represents the position of the worst individual globally at the t-th iteration, which is the position of the individual with the highest fitness value at the t-th iteration. F m,t Indicates the first m The fitness value of a follower at the t-th iteration; F best This represents the minimum fitness value at the t-th iteration; S4.4: the sentinel performs horizontal and vertical cross operation; The formula of horizontal cross operation is: ; wherein, represents the position of the tth iteration of the tth guard; a represents the position of the tth iteration of the tth guard; represents the position of the t+1th iteration of the tth guard; a represents the position of the t+1th iteration of the tth guard; r 1 is a random number in [0, 1]; represents the position of the tth iteration of the tth guard; b represents the position of the tth iteration of the tth guard; represents the position of the t+1th iteration of the tth guard; and b represents the position of the t+1th iteration of the tth guard; ; In the formula, Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... o The dimensional values of each dimension; Indicates the first a When a vigilant is in its (t+1)th iteration, its own (t)th iteration... o The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its (t+1)th iteration, its own (t)th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... p The dimensional values of each dimension; Indicates the first a When a vigilant is in its t-th iteration, its own t-th iteration... o The dimensional values of each dimension.
2. The power distribution network optimization method based on reactive margin and improved sparrow search algorithm according to claim 1, characterized in that, Step S2 comprises the following steps: S2.1: calculating the active power loss of all nodes in the distribution network; ; wherein f 1 represents the active power losses of all nodes of the distribution network; N s N represents the number of all nodes in the distribution network; G ij Gij represents the conductance between the i-th node and the j-th node; i Gij represents the conductance between the i-th node and the j-th node; j Gij represents the conductance between the i-th node and the j-th node; i and j N represents the number of all nodes in the distribution network; i N represents the number of all nodes in the distribution network; j N represents the number of all nodes in the distribution network; represents the phase angle difference between the first node and the second node; i j U i represents the voltage amplitude of the node i U j represents the voltage amplitude of the node j S2.2: In the time domain of the first hour to the first D hour, the voltage deviation of all nodes of the power distribution network is calculated hour by hour, and the formula is: ; In the formula, f 2 represents the voltage deviation at all nodes of the distribution network; t Indicates the first t Hours; D Indicates the set number D Hours D =24; N s This indicates the total number of nodes in the distribution network; U j,t Represents a node j The voltage amplitude in hour t; U j,额 Represents a node j The rated voltage; S2.3: Calculate the cost of reactive power compensation device switching of the node in S1 N S2.3: Calculate the cost of reactive power compensation device switching of the node in S1 ; In the formula, f 3 is N the cost of switching the reactive power compensation device of the node; x b represents N the number of reactive power compensation devices switched at the b node; represents the unit price of the reactive power compensation device; N represents the number of nodes that need to switch the reactive power compensation device; S2.4: establishing a target function; ; wherein, F represents an objective function; are weight coefficients; P b , U b , C b are normalized reference values.
3. The power distribution network optimization method based on reactive margin and improved sparrow search algorithm according to claim 1, characterized in that, In step S1, the equivalent reactive power margin of each node is calculated; the formula is: ; wherein, Q yd,z represents the equivalent reactive power margin of the z th node; r Pf,z represents the active power reactive power margin of the z th branch connected to the node f ; r Qf,z represents the reactive power reactive power margin of the z th branch connected to the node f ; f represents the z th branch connected to the node f , f ∈ [1, N z ], and is an integer; N z represents the total number of branches connected to the node z ; D f represents the reactive power loss of the f th branch; Wherein, ; In the formula, r Pf,z Represents nodes z Connected, the first f Active power and reactive power margin of each branch; U z Represents a node z The voltage amplitude; b f Indicates the first f The susceptance of the branch circuit; P f Indicates the first f The active power of each branch; g f Indicates the first f The conductivity of the branch circuit; r Qf,z Represents nodes z Connected, the first f Reactive power and reactive margin of each branch; Q f Indicates the first f The reactive power of each branch circuit; D f Indicates the first f The reactive power loss of the branch circuit.
4. The power distribution network optimization method based on reactive margin and improved sparrow search algorithm according to claim 2, characterized in that, The reactive power planning constraint condition in step S3 includes: Establishing a power flow constraint equation: ; wherein P i and Q i denote the active power and the reactive power of node i , i ∈ [1, N s ], respectively, and are integers; U i and U j denote the voltage magnitudes of node i and node j ; G ij denote the conductance between node i and node j ; B ij denote the susceptance between node i and node j ; N s denote the number of all nodes in the power distribution network; denote the phase angle difference between node i and node j ; Inequality constraint equation: ; wherein, U i,min , U i,max are the lower and upper limits of the voltage at node i ; U i denotes the voltage amplitude at node i ; Q i,min , Q i,max are the minimum and maximum reactive power compensation capacity of the reactive power compensation device at node i ; Q i denotes the reactive power at node i ; k i denotes the number of reactive power compensation devices switched in at node i ; k max is the maximum number of switching of reactive power compensation devices.
5. The power distribution network optimization method based on reactive margin and improved sparrow search algorithm according to claim 1, characterized in that, is set to 0.2; is set to 0.9.