A wind farm reactive power compensation calculation method and system
By introducing the concept of simulated annealing into the particle swarm optimization algorithm and adaptively adjusting the inertia weight and learning factor, the problems of slow iteration speed and low convergence accuracy of the particle swarm optimization algorithm in wind farm power quality optimization are solved, achieving more efficient power quality optimization and improving grid stability and power supply reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUBEI TIANSHUN ZERO CARBON TECH CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-06-19
AI Technical Summary
Existing particle swarm optimization algorithms suffer from slow iteration speed, low convergence accuracy, and susceptibility to local minima in wind farm power quality optimization. In particular, when wind farms are connected to the grid, problems such as harmonic pollution and voltage fluctuations are severe, affecting grid stability.
By introducing the concept of simulated annealing into the particle swarm optimization algorithm, and by adaptively adjusting the inertia weight and learning factor, combined with the annealing calculation of the simulated annealing algorithm, particles are allowed to search globally, thereby improving the global optimization capability.
It achieves faster convergence speed and higher optimization accuracy, improves the power quality of wind farms, reduces equipment wear, and enhances power supply reliability and grid stability.
Smart Images

Figure CN122242551A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wind power generation technology, specifically relating to a method and system for calculating reactive power compensation in wind farms. Background Technology
[0002] With the increasing complexity of modern power systems and the widespread application of renewable energy, power quality issues are becoming increasingly prominent. Especially in applications with concentrated nonlinear loads such as wind farms, problems like harmonic pollution, voltage fluctuations, and frequency deviations are severe, seriously affecting the stable operation of the power grid and the normal operation of user equipment.
[0003] Therefore, optimizing power quality has become an important issue in power system design and operation. By optimizing power quality, we can improve power supply reliability, reduce energy waste, reduce equipment wear and tear, and also contribute to achieving the goals of a smart grid.
[0004] In existing technologies, for the power quality optimization problem of wind farm grid connection, the particle swarm optimization (PSO) algorithm can be used for parameter optimization. The PSO algorithm is used for the static optimization of wind farm control parameters, such as voltage regulation gain and reactive power compensation capacity. Its basic process includes initializing the particle swarm, iteratively updating particle positions and velocities, and evaluating the optimal solution based on the fitness function.
[0005] For example, patent application number CN202510770940.7 discloses a power quality optimization control method based on an improved particle swarm optimization algorithm, including the following steps:
[0006] S1: Build a wind farm simulation model, and based on the simulation model, obtain the initial voltage deviation, frequency deviation and total harmonic distortion of the power grid.
[0007] S2: Calculate the initial fitness using a multi-objective fitness function based on the initial voltage deviation, frequency deviation, and total harmonic distortion.
[0008] S3: Based on the particle swarm optimization algorithm, improve the adaptive inertia weight and learning factor to randomly generate the initial control parameters of the power grid.
[0009] S4: Based on the initial control parameters of the power grid, adjust the simulation model to obtain the current voltage deviation, frequency deviation, and total harmonic distortion. Based on the current voltage deviation, frequency deviation, and total harmonic distortion, calculate the current fitness and the current control parameters.
[0010] S5: Preset the maximum number of iterations for fitness. If the current fitness iteration count is equal to the maximum number of iterations, output the power grid control parameters corresponding to the current fitness. If the current fitness iteration count has not reached the maximum number of iterations, re-enter step S3.
[0011] While the particle swarm optimization (PSO) algorithm is simple and easy to implement, and it restricts the velocity of updated particles, it does not restrict their positions. This can lead to poor positional conditions, resulting in slow iteration speed and low convergence accuracy. Furthermore, the PSO algorithm is susceptible to random oscillations in the later stages of iteration, requiring particles to search for a long time near the global optimum, further slowing convergence and making it prone to getting trapped in local minima. Summary of the Invention
[0012] To address the aforementioned problems, this invention provides a method and system for calculating reactive power compensation in wind farms. It incorporates the concept of simulated annealing into the particle swarm optimization algorithm. By combining the advantages of both algorithms and addressing the shortcomings of the particle swarm optimization algorithm, it achieves better global optimization. The technical solution is as follows: On one hand, embodiments of the present invention provide a method for calculating reactive power compensation in wind farms, the method comprising: S1: Obtain the control variables, initial data, and algorithm parameters of the wind farm, and initialize the particle swarm; S2: Perform power flow calculations for each particle; S3: Calculate individual fitness values; S4: Update the individual best position and global extreme value; S5: Update particle velocity and particle position; S6: Determine whether the fitness value meets the predetermined rules based on the particle position; if yes, proceed to step S7; if no, the particle mutates and step S2 is repeated. S7: Perform annealing calculations using the simulated annealing (SA) algorithm and determine whether the termination condition is met. If yes, output the optimal solution; otherwise, proceed to step S2 until the termination condition is met.
[0013] In step S1, The initial data and algorithm parameters include: The number of particles M, the upper and lower limits of the inertial weight ω, the learning factors c1 and c2, and the maximum particle velocity V. max Annealing start temperature T0, annealing end temperature T; annealing cooling coefficient B; Mente Carlo length L k Maximum number of iterations; The process of initializing the particle swarm is as follows: Obtain an N-dimensional particle swarm of size M, represented as X = {X1, X2, ..., XM}; randomly assign the initial position X of each particle. i 0 and initial velocity V i 0 The current position is set to the individual best position p for each particle. i and from the individual's best position pi Find the global extremum g in i .
[0014] In step S3, the process of calculating the individual fitness value is as follows: based on the initial position X of each particle... i 0 and the position X after iteration i t The fitness value F of each particle at time D is calculated using the objective function. i D If the calculated fitness value F of the particle i D If a position is better than the current best individual position, then replace the current best individual position with the current best individual position; if the best position among all the best individual positions of all particles is better than the current global extremum, then update the position of that particle to the global extremum.
[0015] In step S5, the process of updating the particle velocity and particle position is as follows: calculate the particle velocity V. i and particle position X i And the velocity of each particle is limited to its flight speed; if the particle's flight speed exceeds the maximum flight speed V set by the particle swarm, it will be restricted. max Then its speed is set to V. max If the particle's velocity is less than the minimum flight speed V set by the particle swarm. min Then its speed is set to V. min ; The particle velocity V is calculated using the following formula. i and particle position X i : V i t+1 =(ω max -(ω max -ω min ) / iter max iter) V i t +c1r1(p i t -x i t )+c2r2(g i t -x i t ); X i t+1 =X i t + V i t+1 ; Where t is the number of iterations, ω is the inertia weight, c1 and c2 are learning factors, and iter max `p` and `iter` represent the maximum number of iterations and the current iteration number, respectively, of the particle swarm optimization algorithm. i For the best position for an individual, g i For the global extremum, r1 and r2 are both random numbers between 0 and 1.
[0016] Step S6 includes: at two positions X i and X j Next, calculate the change in fitness value ΔE, ΔE = E j -E i If ΔE < 0, then accept the new state as the current solution; if ΔE ≥ 0, and p r If the value of exp(-ΔE / kT) is greater than or equal to a random number in [0,1), then the new state is accepted as the current solution; if the updated particle state does not meet the above conditions, then the particle is mutated and returned to step S2; where T is the termination temperature and k is the Boltzmann constant.
[0017] In step S6, the mutation process is as follows: If the individual is X t The next generation of particles is X. t+1 ; X t+1 =X t +λrand; Where rand is a normally distributed random number with a standard deviation of 0 and a mean square deviation of 1; λ is the coefficient of variation of the particle.
[0018] Step S7 includes: If the new solution is accepted, then the annealing process is performed, which is represented as: T t+1 = BT t .
[0019] In step S7, the termination condition is: the current number of iterations is greater than or equal to the maximum number set by the algorithm, or the convergence accuracy of the algorithm's optimization result is less than the set value.
[0020] Specifically, the particle number M is 20-100, the upper limit of the inertial weight ω is 0.8, and the lower limit of the inertial weight ω is 0.4; the learning factors C1 and C2 are both 1.8-2.2; the simulated annealing starting temperature T0 is 100°C, the annealing cooling coefficient B is 0.95, and the Mente Carlo length L... k It is 50; the maximum velocity of the particle is V. max The search range is 40-60% of the variable range.
[0021] On the other hand, embodiments of the present invention also provide a wind farm reactive power compensation calculation system, the system comprising: The parameter acquisition and initialization module is used to acquire the control variables, initial data and algorithm parameters of the wind farm, and initialize the particle swarm. The power flow calculation module is used to perform power flow calculations for each particle. The fitness calculation module is used to calculate the fitness value of an individual. The update module is used to update the individual best position, global extremum, particle velocity, and particle position. The particle position determination module is used to determine whether the fitness value meets the predetermined rules based on the particle position. The particle mutation module is used to mutate particles and send them to the power flow calculation module when the particle position determination module determines that the fitness value does not meet the predetermined rules. The simulated annealing module is used by the particle position determination module to perform annealing calculations using the simulated annealing (SA) algorithm when the fitness value meets the predetermined rules. The endpoint determination module is used to determine whether the result of the simulated annealing module meets the termination condition. If yes, it is sent to the output module; otherwise, it is sent to the power flow calculation module. The output module is used to output the optimal solution.
[0022] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows: This method incorporates a simulated annealing mechanism into the process of updating the velocity and position of each particle, and allows the objective function value to deteriorate within a certain range according to the probability acceptance criterion. This method can adaptively adjust the annealing temperature. As the temperature continues to decrease, the particles will gradually form a low-energy ground state, jump out of the local extremum, and thus converge to the global extremum. Attached Figure Description
[0023] Figure 1 This is a flowchart of the reactive power compensation calculation method for wind farms provided in an embodiment of the present invention; Figure 2 This is a flowchart for performing power flow calculations; Figure 3 This is the wiring diagram of the IEEE-30 node system for a wind farm; Figure 4 This is a partial parametric graph of the nodes; Figure 5 This is a diagram showing the voltage parameters at the six generator terminals; Figure 6 This is a parameter diagram of the capacitor bank; Figure 7 This is a parameter diagram of four transformers; Figure 8 This is a graph showing the generator output data; Figure 9It is a graph showing the active power output of the wind farm, the voltage at the grid connection point, and the reactive power compensation capacity. Figure 10 This is a comparison chart of the results obtained by the method of this patent and the PSO algorithm. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings.
[0025] Example 1 See Figure 1 Example 1 provides a method for calculating reactive power compensation in wind farms, the method comprising: S1: Obtain the control variables, initial data, and algorithm parameters of the wind farm, and initialize the particle swarm.
[0026] S2: Perform power flow calculations for each particle.
[0027] S3: Calculate individual fitness values.
[0028] S4: Update the individual best position and global extreme value.
[0029] S5: Update particle velocity and particle position.
[0030] S6: Determine whether the fitness value meets the predetermined rules based on the particle position; if yes, proceed to step S7; if no, the particle mutates and step S2 is repeated.
[0031] S7: Perform annealing calculations using the simulated annealing (SA) algorithm and determine whether the termination condition is met. If yes, output the optimal solution; otherwise, proceed to step S2 until the termination condition is met.
[0032] Example 2 See Figure 1 Example 2 provides a method for calculating reactive power compensation in wind farms, the method comprising: S1: Obtain the control variables, initial data, and algorithm parameters of the wind farm, and initialize the particle swarm.
[0033] The initial data and algorithm parameters include: The number of particles M, the upper and lower limits of the inertial weight ω, the learning factors c1 and c2, and the maximum particle velocity V. max Annealing start temperature T0, annealing end temperature T; annealing cooling coefficient B; Mente Carlo length L k Maximum number of iterations, etc.
[0034] The process of initializing the particle swarm is as follows: Obtain an N-dimensional particle swarm of size M, represented as X = {X1, X2, ..., XM}; randomly assign the initial position X of each particle. i 0 and initial velocity V i 0 The current position is set to the individual best position p for each particle. i and from the individual's best position p i Find the global extremum g in i .
[0035] S2: Perform power flow calculations for each particle. This process is consistent with existing techniques. See also... Figure 2 The specific process is as follows: S201: Given wind speed V and initial node voltage U.
[0036] S202: Calculate the relationship between generator wind speed and power using the following formula, then sum the active power output of each wind turbine in the wind farm to obtain the total active power output P of the wind farm: .
[0037] Where ρ is the air density, with units of kg / m³. 3 V is the wind speed in m / s; R is the impeller blade radius in m; Cp is the wind energy utilization coefficient, which is related to the tip speed.
[0038] S203: Based on the asynchronous generator model established using P and U, the reactive power Q that the wind farm needs to absorb is obtained. The process is as follows: The slip ratio s is calculated using the following formula: .
[0039] In the formula, x1 is the stator reactance, and x2 is the rotor reactance; m r2 is the excitation reactance; r2 is the rotor resistance; P is the active power output of the wind farm; U is the node voltage; x k =x1+x2.
[0040] The relationship between the power factor angle φ and the slip s is as follows: .
[0041] The reactive power Q can be obtained from the following formula: .
[0042] If Q < 0, it means that the asynchronous generator in actual operation absorbs reactive power from the system.
[0043] S204: Treat the wind farm node as a PQ node, and correct the corresponding Jacobian matrix elements according to the following formula to obtain the updated value U' of the wind farm node voltage.
[0044] .
[0045] S205: If U' ≠ U, then let U = 0.5 (U + U'), return to step S202, and execute steps S202 and S203 until the difference between the two voltages is within a specified range. The specified range is |U - U'| less than 10. -5 .
[0046] S3: Calculate individual fitness values. The process is as follows: based on the initial position X of each particle... i 0 and the position X after iteration i t The fitness value F of each particle at time D is calculated using the objective function. i D If the calculated fitness value F of the particle i D If a position is better than the current best individual position, then replace the current best individual position with the current best individual position; if the best position among all the best individual positions of all particles is better than the current global extremum, then update the position of that particle to the global extremum.
[0047] S4: Update the individual best position and global extremum. This process is consistent with existing techniques.
[0048] S5: Update particle velocity and particle position. The update process is as follows: Calculate particle velocity V. i and particle position X i And the velocity of each particle is limited to its flight speed; if the particle's flight speed exceeds the maximum flight speed V set by the particle swarm, it will be restricted. max Then its speed is set to V. max If the particle's velocity is less than the minimum flight speed V set by the particle swarm. min Then its speed is set to V. min .
[0049] The particle velocity V is calculated using the following formula. i and particle position X i : V i t+1 =(ω max -(ω max -ω min ) / iter max iter) V i t +c1r1(p i t -x i t )+c2r2(g i t -x i t ); X i t+1 =X i t + V i t+1 .
[0050] Where t is the number of iterations, ω is the inertia weight, c1 and c2 are learning factors, and iter max `p` and `iter` represent the maximum number of iterations and the current iteration number, respectively, of the particle swarm optimization algorithm. i For the best position for an individual, g i For the global extremum, r1 and r2 are both random numbers between 0 and 1.
[0051] Where, ω max -(ω max -ω min ) / iter max iter is an adaptive inertial weight that is adjusted adaptively to enhance the ability to search for the optimal solution globally.
[0052] S6: Determine whether the fitness value meets the predetermined rules based on the particle's position; if yes, proceed to step S7; if no, the particle mutates and step S2 is repeated. The determination process is as follows: At two positions X i and X j Next, calculate the change in fitness value ΔE, ΔE = E j -E i If ΔE < 0, then accept the new state as the current solution; if ΔE ≥ 0, and p r If the value of exp(-ΔE / kT) is greater than or equal to a random number in [0,1), then the new state is accepted as the current solution; if the updated particle state does not meet the above conditions, then the particle is mutated and returned to step S2; where T is the termination temperature and k is the Boltzmann constant.
[0053] The mutation process is as follows: If the individual is X t The next generation of particles is X. t+1 ; X t+1 =X t+λrand.
[0054] Where rand is a normally distributed random number with a standard deviation of 0 and a mean square deviation of 1; λ is the coefficient of variation of the particle. Specifically: λ=3(f(X t When ) < 0.5) or max(| X t |,0.7)(f(X) t (≥0.5)
[0055] S7: Perform annealing calculations using the simulated annealing (SA) algorithm and determine if the termination condition is met. If yes, output the optimal solution; otherwise, proceed to step S2 until the termination condition is met. The specific process is as follows: If the new solution is accepted, then the annealing process is performed, which is represented as: T t+1 = BT t .
[0056] The annealing process includes the following three parts: (1) Heating process. Heating can enhance the thermal motion of particles, allowing them to deviate from their equilibrium positions.
[0057] (2) Isothermal process. The system itself always changes in the direction of decreasing free energy. When the free energy decreases to the minimum, the system reaches equilibrium.
[0058] (3) Cooling process. Cooling gradually weakens the thermal motion of particles, causing them to gradually change from a disordered state to an ordered state, and the energy of the system will continuously decrease.
[0059] The optimization process of simulated annealing involves simulating the objective function F as energy E. An initial temperature T0 and an initial optimal solution X0 are set. The temperature T0 is then continuously decreased, and for each decreasing temperature T, a process of "generating a new state → determining acceptance conditions → accepting / discarding" is performed. When the temperature T decreases to its minimum, the system reaches its ground state, at which point the objective function F is minimized. This is achieved through probability P. r Make a judgment.
[0060] The termination condition is: the current number of iterations is greater than or equal to the maximum number set by the algorithm, or the convergence accuracy of the algorithm's optimization result is less than the set value.
[0061] This patent can use minimizing active power loss as the objective function.
[0062] The objective function F (which is the same as in the prior art) is: .
[0063] .
[0064] Where i and j are any nodes, n is the sum of all nodes directly connected to node i, and G ij and Q ij These represent the conductance and voltage phase angle difference between nodes i and j, respectively.
[0065] U imax U imin Q represents the upper and lower limits of the node voltage; Gimax Q Gimin Let α represent the upper and lower limits of the reactive power output of the generator, α represent all PQ nodes in the system, β represent the number of nodes of all generators in the system, and λ represent the upper and lower limits of the reactive power output of the generator. V and λ G As a penalty factor, the specific description of the penalty orientation is as follows: .
[0066] Example 3 Example 3 provides a method for calculating reactive power compensation in wind farms, which is basically the same as Example 2, except that: the number of particles M is 20-100, the upper limit of the inertial weight ω is 0.8, and the lower limit of the inertial weight ω is 0.4; the learning factors C1 and C2 are both 2; the starting temperature T0 of the simulated annealing is 100, and the annealing cooling coefficient B is 0.95; the Mente Carlo length L... k It is 50; the maximum velocity of the particle is V. max The search range is 40-60% of the variable range.
[0067] Example 4 Example 4 provides a method for calculating reactive power compensation in a wind farm, which is basically the same as Example 2, except that: specifically, the particle number M9 is 50, the upper limit of the inertial weight ω is 0.8, and the lower limit of the inertial weight ω is 0.4; the learning factors C1 and C2 are both 2; the starting temperature T0 of the simulated annealing is 100, and the annealing cooling coefficient B is 0.95; the Mente Carlo length L... k It is 50; the maximum velocity of the particle is V. max The search range is 50%. A capacitor is used as the reactive power compensation device, and the controlled variable is the motor terminal voltage V. Gi Capacitive reactive power compensation capacity Q Gi Node voltage amplitude V iThe wind farm is equipped with 30 constant-speed, constant-frequency asynchronous wind turbine generators, each with a capacity of 2500kW, and a power factor of 0.98. The IEEE-30 node power system of the wind power system includes six generators connected to nodes 1, 2, 5, 8, 11, and 13; four adjustable transformers connected to branches 6-9, 6-10, 4-12, and 27-28; a total of 41 branches and 21 load nodes; three reactive power compensation nodes (nodes 9, 10, and 24); and five sets of 4Mvar capacitors. The PV nodes in the system are 2, 5, 8, 11, and 13, the balancing node is 1, and the others are PQ nodes.
[0068] The original parameters of some nodes are as follows: Figure 4 As shown (not listed in this patent).
[0069] The generator voltage reference power is 100MW, with 13 control variables set. The upper and lower limits of the generator terminal voltages for the six generators are 0.94 and 1.06, respectively, with a step size of 0.01. The voltage parameters of the six generator terminals are as follows: Figure 5 As shown.
[0070] The capacitor's capacitance has upper and lower limits of 0.0 and 0.5, respectively, with a step size of 0.01. The parameters of the capacitor bank are as follows: Figure 6 As shown.
[0071] The parameters of the four transformers are as follows: Figure 7 As shown.
[0072] Generator output data as follows Figure 8 As shown.
[0073] The wind speed density at the wind farm is ρ = 1.21 kg / m³. 3 The rotor radius is r=40m and the rated wind speed is 15m / s.
[0074] Calculations based on the method of this patent yielded the following relationship between the active power output of the wind farm, the grid connection voltage, and the reactive power compensation capacity under different wind speeds: Figure 9 As shown.
[0075] Depend on Figure 9 As wind speed increases, the active power output of the wind farm gradually increases, while the reactive power compensation capacity gradually decreases. The voltage at the grid connection point of the wind farm and the power system will first increase and then decrease. Although some fluctuations occur, they are all very close to 1 p.u., and the fluctuation range is very small. The per-unit voltage of node 9 before grid connection of the wind farm is 0.973, which shows that the voltage stability at the grid connection point is good.
[0076] Taking a wind speed of 12 m / s as an example, the results are compared with those obtained by the PSO algorithm. Figure 10 As shown.
[0077] Depend on Figure 10 It can be seen that by using the method of this patent, the average voltage of the power system is significantly improved, while the active power loss of the system is significantly reduced. The optimization results are better than those of the PSO algorithm, and the convergence speed is also faster than that of the PSO algorithm.
[0078] Example 5 Example 5 provides a reactive power compensation calculation system for a wind farm, the system comprising: The parameter acquisition and initialization module is used to acquire the control variables, initial data and algorithm parameters of the wind farm, and initialize the particle swarm.
[0079] The power flow calculation module is used to perform power flow calculations for each particle.
[0080] The fitness calculation module is used to calculate the fitness value of an individual.
[0081] The update module is used to update the individual best position, global extremum, particle velocity, and particle position.
[0082] The particle position determination module is used to determine whether the fitness value meets the predetermined rules based on the particle position.
[0083] The particle mutation module is used by the particle position determination module to mutate particles and send them to the power flow calculation module when the fitness value does not meet the predetermined rules.
[0084] The simulated annealing module is used by the particle position determination module to perform annealing calculations using the simulated annealing (SA) algorithm when the fitness value meets the predetermined rules.
[0085] The endpoint determination module is used to determine whether the result of the simulated annealing module meets the termination condition. If yes, it is sent to the output module; otherwise, it is sent to the power flow calculation module.
[0086] The output module is used to output the optimal solution.
[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for calculating reactive power compensation in wind farms, characterized in that, The method includes: S1: Obtain the control variables, initial data, and algorithm parameters of the wind farm, and initialize the particle swarm; S2: Perform power flow calculations for each particle; S3: Calculate individual fitness values; S4: Update the individual best position and global extreme value; S5: Update particle velocity and particle position; S6: Determine whether the fitness value meets the predetermined rules based on the particle position; if yes, proceed to step S7; if no, the particle mutates and step S2 is repeated. S7: Perform annealing calculations using the simulated annealing (SA) algorithm and determine whether the termination condition is met. If yes, output the optimal solution; otherwise, proceed to step S2 until the termination condition is met.
2. The method according to claim 1, characterized in that, In step S1, The initial data and algorithm parameters include: The number of particles M, the upper and lower limits of the inertial weight ω, the learning factors c1 and c2, and the maximum particle velocity V. max Annealing start temperature T0, annealing end temperature T; annealing cooling coefficient B; Mente Carlo length L k Maximum number of iterations; The process of initializing the particle swarm is as follows: Obtain an N-dimensional particle swarm of size M, represented as X = {X1, X2, ..., XM}; randomly assign the initial position X of each particle. i 0 and initial velocity V i 0 The current position is set to the individual best position p for each particle. i and from the individual's best position p i Find the global extremum g in i .
3. The method according to claim 2, characterized in that, In step S3, the process of calculating the individual fitness value is as follows: Based on the initial position X of each particle i 0 and the position X after iteration i t The fitness value F of each particle at time D is calculated using the objective function. i D If the calculated fitness value F of the particle i D If a position is better than the current best individual position, then replace the current best individual position with the current best individual position; if the best position among all the best individual positions of all particles is better than the current global extremum, then update the position of that particle to the global extremum.
4. The method according to claim 3, characterized in that, In step S5, the process of updating the particle velocity and particle position is as follows: calculate the particle velocity V. i and particle position X i And the velocity of each particle is limited to its flight speed; if the particle's flight speed exceeds the maximum flight speed V set by the particle swarm, it will be restricted. max Then its speed is set to V. max If the particle's velocity is less than the minimum flight speed V set by the particle swarm. min Then its speed is set to V. min ; The particle velocity V is calculated using the following formula. i and particle position X i : V i t+1 =(ω) max -(oh max -oh min ) / iter max (iter) V i t +c1r1(p i t -x i t )+c2r2(g i t -x i t ); X i t+1 =X i t + V i t+1 ; Where t is the number of iterations, ω is the inertia weight, c1 and c2 are learning factors, and iter max `p` and `iter` represent the maximum number of iterations and the current iteration number, respectively, of the particle swarm optimization algorithm. i For the best position for an individual, g i For the global extremum, r1 and r2 are both random numbers between 0 and 1.
5. The method according to claim 4, characterized in that, Step S6 includes: At two positions X i and X j Next, calculate the change in fitness value ΔE, ΔE = E j -E i If ΔE < 0, then accept the new state as the current solution; if ΔE ≥ 0, and p r If the value of exp(-ΔE / kT) is greater than or equal to a random number in [0,1), then the new state is accepted as the current solution; if the updated particle state does not meet the above conditions, then the particle is mutated and returned to step S2; where T is the termination temperature and k is the Boltzmann constant.
6. The method according to claim 5, characterized in that, In step S6, the mutation process is as follows: If the individual is X t The next generation of particles is X. t+1 ; X t+1 =X t +λrand; Where rand is a normally distributed random number with a standard deviation of 0 and a mean square deviation of 1; λ is the coefficient of variation of the particle.
7. The method according to claim 1, characterized in that, Step S7 includes: If the new solution is accepted, then the annealing process is performed, which is represented as: T t+1 = BT t .
8. The method according to claim 1, characterized in that, In step S7, the termination condition is: the current number of iterations is greater than or equal to the maximum number of iterations set by the algorithm, or the convergence accuracy of the optimization result of the algorithm is less than the set value.
9. The method according to claim 2, characterized in that, The particle number M is 20-100, the upper limit of the inertial weight ω is 0.8, and the lower limit of the inertial weight ω is 0.4; the learning factors C1 and C2 are both 1.8-2.2; the simulated annealing starting temperature T0 is 100°C, and the annealing cooling coefficient B is 0.95; the Mente Carlo length L... k It is 50; the maximum velocity of the particle is V. max The search range is 40-60% of the variable range.
10. A reactive power compensation calculation system for wind farms, characterized in that, include: The parameter acquisition and initialization module is used to acquire the control variables, initial data and algorithm parameters of the wind farm, and initialize the particle swarm. The power flow calculation module is used to perform power flow calculations for each particle. The fitness calculation module is used to calculate the fitness value of an individual. The update module is used to update the individual best position, global extremum, particle velocity, and particle position. The particle position determination module is used to determine whether the fitness value meets the predetermined rules based on the particle position. The particle mutation module is used to mutate particles and send them to the power flow calculation module when the particle position determination module determines that the fitness value does not meet the predetermined rules. The simulated annealing module is used by the particle position determination module to perform annealing calculations using the simulated annealing (SA) algorithm when the fitness value meets the predetermined rules. The endpoint determination module is used to determine whether the result of the simulated annealing module meets the termination condition. If yes, it is sent to the output module; otherwise, it is sent to the power flow calculation module. The output module is used to output the optimal solution.