Genetic-particle swarm algorithm fusion-based reactive power optimization solution method and device for power system
The reactive power optimization method for power systems, which integrates genetic and particle swarm optimization algorithms, solves the problem of finding the global optimal solution in reactive power optimization, improves the economy and stability of power grid dispatch, and realizes the efficient operation of the power system.
Patent Information
- Application Number
- CN202511762233.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-02-06
AI Technical Summary
Existing reactive power optimization methods struggle to find the global optimal solution, are time-consuming to solve, and have poor accuracy, making it difficult to guarantee the voltage stability and economy of the power system.
A reactive power optimization method for power systems based on the fusion of genetic and particle swarm optimization algorithms is adopted. By constructing a parameter model and setting constraints, the selection, crossover and mutation operations of the genetic algorithm are introduced, and nonlinear adjustment of inertia weights and learning factors is adopted to improve the particle swarm optimization algorithm, dynamically update the particle state, avoid local optima, and improve the global search capability.
It enhances the economy and rationality of power grid dispatch, improves the global search capability and convergence performance of the algorithm, and enhances the operational stability and efficiency of the power system.
Smart Images

Figure CN121484992A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power system technology, and in particular to a method and device for reactive power optimization in power systems based on a fusion of genetic and particle swarm optimization algorithms. Background Technology
[0002] With continuous economic development, the capacity of the power grid and the electricity demand of users are constantly increasing, leading to increasingly stringent requirements for power supply reliability and power quality. Voltage quality, as a key indicator of power quality, has received much attention. At the same time, active power loss in the power system is also an important factor that cannot be ignored. Reactive power capacity is crucial in power system operation. Insufficient reactive power capacity directly affects voltage stability, significantly reducing voltage levels and making it difficult for electrical equipment to operate normally. Especially during system disturbances, the voltage may drop sharply below the critical value, even triggering serious accidents such as system collapse or disintegration. Conversely, excessive reactive power capacity also presents numerous drawbacks, causing abnormal voltage increases and seriously threatening system safety and stability as well as the normal operation of equipment. Furthermore, unreasonable reactive power distribution exacerbates line voltage drops, leading to increased line losses. The increase in active power losses not only reduces the operating efficiency of the power system but also adversely affects economical power supply. Reactive power optimization belongs to the category of nonlinear optimization, characterized by multiple constraints, multiple variables, and discreteness. Implementing reactive power optimization has a significant effect on improving voltage levels, ensuring reliable grid operation, and reducing active power losses in the power system, which helps to promote the operation of the power system in a reliable, stable, economical and environmentally friendly direction.
[0003] However, current reactive power optimization methods face many challenges, such as difficulty in finding the global optimal solution, long solution time, and poor accuracy. Summary of the Invention
[0004] The purpose of this application is to provide a method and device for reactive power optimization in power systems based on the fusion of genetic and particle swarm optimization algorithms. This method can enhance the diversity of particle swarm optimization, avoid getting trapped in local optima, improve the global search capability and convergence performance of the algorithm, and enhance the economy and rationality of power grid dispatch.
[0005] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for solving reactive power optimization in power systems based on a fusion of genetic and particle swarm optimization algorithms. The method includes: constructing a parameter model of the target power system; determining the fitness function of control variables and reactive power optimization based on the parameter model; and setting independent constraints for the control variables and state variables in power flow calculation based on power system operation safety requirements and equipment constraints; introducing selection, crossover, and mutation operations of a genetic algorithm, and adopting a nonlinear adjustment strategy for the inertia weight and learning factor of the particle swarm optimization algorithm to form a fusion-improved particle swarm optimization algorithm; initializing the state configuration of the improved particle swarm optimization algorithm, and calculating the fitness value by continuously updating particle velocity and position, dynamically updating individual extreme values and the global extreme value; the state configuration includes: position, velocity, individual extreme value, and global extreme value; selecting particle individuals with fitness below the fitness threshold for crossover and mutation, and updating the optimal value of the particle individuals; continuously iterating until the maximum number of iterations, and outputting the optimal active power loss; the optimal active power loss is the globally optimal active power loss with the smallest fitness value; and performing grid dispatching on the target power grid system based on the optimal active power loss and the corresponding combination of control variables.
[0006] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for reactive power optimization of power systems based on the fusion of genetic-particle swarm optimization algorithm.
[0007] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application first constructs a power system parameter model and constrains control and state variables. Then, it integrates selection, crossover, and mutation operators from a genetic algorithm and introduces a nonlinear adjustment strategy into the inertia weight and learning factor to improve the particle swarm optimization (PSO) algorithm. The inertia weight gradually decreases with the number of iterations, slowing down the particle velocity for finer searching. The individual learning factor decreases while the global learning factor increases, effectively enhancing the diversity of the particle swarm and avoiding getting trapped in local optima, in conjunction with genetic operations. Next, the particle swarm's position, velocity, and other state configurations are initialized. The particle states are iteratively updated, and fitness is calculated, dynamically updating extreme values. Low-fitness particles are selected for crossover and mutation, and the optimal individual values are updated accordingly. After continuous iteration to the maximum number of iterations, the optimal active power loss and corresponding control variable combination are output, which is then used for grid dispatching. This application improves solution accuracy by nonlinearly adjusting the inertia weight and learning factor, while introducing selection, crossover, and mutation operations, enhancing particle swarm diversity, avoiding local optima, improving the algorithm's global search capability and convergence performance, and enhancing the economic efficiency and rationality of the power grid. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 A flowchart illustrating a power system reactive power optimization solution method based on a fusion of genetic and particle swarm optimization algorithms provided in this application embodiment. Figure 1 .
[0010] Figure 2 A flowchart illustrating a power system reactive power optimization solution method based on a fusion of genetic and particle swarm optimization algorithms provided in this application embodiment. Figure 2 .
[0011] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0014] Example 1, such as Figures 1-2 As shown in the figure, this embodiment provides a method for reactive power optimization of power systems based on the fusion of genetic and particle swarm optimization algorithms. The method includes the following steps.
[0015] S1. Construct a parametric model of the target power system, determine the fitness function of the control variables and reactive power optimization based on the parametric model, and set independent constraints for the control variables and state variables in the power flow calculation based on the power system operation safety requirements and equipment constraints.
[0016] Furthermore, the control variables include: generator voltage, transformer turns ratio, and reactive power compensation capacity.
[0017] Furthermore, the state variables include: the voltage amplitude of the nodes other than the generator node, the node voltage phase angle, the node reactive power, and the actual reactive power output of the generator.
[0018] In practical applications, the generator voltage continuously regulates the reactive power output, the static var generator is the compensation device for continuously regulating the reactive power output, and the transformer tap changer is the device that participates in regulating the reactive power output in stages.
[0019] The control variables and fitness functions are determined based on the power system parameter model, and strict inequality and equality constraints are imposed on the control variables and other variables involved in the power flow calculation.
[0020] Reactive power optimization involves selecting appropriate control variables under various constraints to optimize one or more performance aspects of a power system. u and x are the control and state variables, respectively, and their expression is as follows: .
[0021] The objective function for minimizing network losses in the active power of a power system is: .
[0022] The system has n nodes. This indicates that the lines between node j and node i are connected, and the voltage amplitudes at nodes i and j are V. i and V j The conductances and phase angle difference between i and j are G, respectively. ij and .
[0023] The conditions that must be met when calculating reactive power in a power system are equality constraints: .
[0024] In the formula, the active power, reactive power, and node voltage of node i are respectively P i Q i and U i The node voltage of node j is U. j The phase angle difference, conductance, and susceptance between nodes i and j are respectively G ij and B ij .
[0025] The primary goal of reactive power compensation configuration is to ensure the safety and reliability of the entire system. To achieve this goal, the power system needs to impose strict constraints on control variables and other variables in power flow calculations.
[0026] The inequality constraints for the control variables are as follows: .
[0027] The three expressions represent the generator terminal voltage U at the i-th node. Gi On-load tap changer Ti and the number of switching groups Q for reactive power compensation ci The constraints.
[0028] The inequality constraints for the state variables are as follows: .
[0029] The two expressions represent the voltage U at node PQ. i The generator outputs reactive power Q Gi Constraints.
[0030] The parameters, positions, velocities, individual maxima, and global maxima of the particle swarm are initialized. Subsequently, during the algorithm's execution, the particle velocities and positions are continuously updated to calculate fitness values, while the individual maxima and global maxima are dynamically updated.
[0031] S2. By introducing selection, crossover, and mutation operations from a genetic algorithm, and employing a nonlinear adjustment strategy for the inertia weights and learning factors of the particle swarm algorithm, a fusion-improved particle swarm algorithm is formed.
[0032] Furthermore, step S2 specifically includes the following steps.
[0033] S21. Sort the fitness of individuals in the population in ascending order and record the corresponding sorting index.
[0034] S22. Calculate the number of individuals to be selected based on the selection probability and population size.
[0035] S23. Select individual particles whose fitness is lower than the fitness threshold according to the sorting index, and store their position and velocity information respectively.
[0036] S24. Randomly pair up individual particles that are below the fitness threshold and generate crossover individual particles through crossover operation.
[0037] S25. Determine whether the fitness of the crossover particle is lower than its optimal fitness. If yes, replace the current value with the fitness of its offspring. If no, perform a mutation operation first, determine whether the fitness of the mutated particle is lower than its optimal fitness. If yes, replace the current value with the fitness of its offspring and update the optimal value of the particle.
[0038] Furthermore, genetic operators include selection, crossover, and mutation.
[0039] In practical applications, step S2 proceeds as follows.
[0040] 1) Selection sort: Sort the fitness values of individuals in the population in ascending order and obtain the sorted fitness values and their corresponding original indices.
[0041] 2) Determine the number of selections N p Based on the selection probability and population size, the number of individuals to be selected is calculated.
[0042] 3) Individual selection: Based on the sorted indices, select the top N individuals from the population and velocity matrix. p Individuals with lower fitness are stored in [the following locations]: P x Speed information is stored in P v .
[0043] 4) Crossover operation: For each selected individual, randomly choose two different indices s1 and s2, and generate a random number pb between 0 and 1. Generate the position and velocity matrix of the new individual by linearly combining the velocity and position matrices of the two parents. new x and new v The values of specific parts of the new individual are rounded before the program performs the calculation.
[0044] In practical applications, the processes of selection, crossover, and mutation are as follows.
[0045] 1) Selection refers to the competition for survival resources among populations in a given environment. Superior individuals produce more offspring and retain traits that increase their chances of survival for the next generation. The selection operation improves the convergence performance of the algorithm by retaining superior individuals from the previous population and eliminating inferior individuals.
[0046] 2) Crossover refers to the process by which a population produces offspring by combining the traits of its two parents, thereby improving the diversity of the population and preserving the better traits over time.
[0047] 3) Variation refers to the accidental changes that occur in a population through the variation of individuals, which drive the evolution of the population.
[0048] Furthermore, the improved formula for inertia weight is as follows.
[0049] ; In the formula, The improved inertia weight; and These are the maximum and minimum values of the inertia weight, respectively, and represent the current iteration number. This represents the maximum number of iterations.
[0050] Furthermore, the improved formula for the learning factor is as follows.
[0051] ; In the formula, For individual learning factors; is the global learning factor; is the current iteration number; This represents the maximum number of iterations. It is a constant, ranging from 3.4 to 4.
[0052] S3. Initialize the state configuration of the improved particle swarm algorithm, and dynamically update the individual extreme values and global extreme values by continuously updating the particle velocity and position. The state configuration includes: position, velocity, individual extreme value and global extreme value.
[0053] S4. Select individual particles with fitness below the fitness threshold for crossover mutation, and update the optimal value of the individual particles accordingly.
[0054] Furthermore, the fitness threshold is the maximum fitness value among the top 20% of individual particles.
[0055] Optionally, the actual application process of steps S2-S4 is as follows.
[0056] 1) Based on the given power system parameter model, summarize the number of variables to be controlled and determine whether they are continuous or discrete variables requiring different treatments. Initialize particle swarm parameters, position, velocity, and individual and global extrema within the search target space: .
[0057] in, The total number of particles in the community. and They represent the first k individual particles D The displacement and velocity of the dimension, individual extreme values and global extreme values are obtained by power flow calculation by substituting the random position matrix of the control variables.
[0058] 2) Continuously update particle velocity and position, calculate fitness values, and dynamically update individual and global extreme values.
[0059] If the updated fitness function value is less than the original fitness function value, then an individual update is performed; otherwise, the value remains unchanged. The main judgment formula is as follows.
[0060] .
[0061] If the updated fitness function value is less than the global optimal fitness function value, then a global update is performed; otherwise, it remains unchanged. The main judgment formula is as follows.
[0062] .
[0063] 3) Select the top 20% of particles with the lowest fitness into the crossover pool for crossover. If the fitness of the offspring is lower than the individual's optimal fitness, then replace the current value with the fitness of the offspring. .
[0064] 4) Then perform mutation operations, replacing the offspring when their fitness is better: .
[0065] S5. Iterate until the maximum number of iterations is reached, and output the optimal active power loss; the optimal active power loss is the globally optimal active power loss with the smallest fitness value.
[0066] Furthermore, the iterative formula for the improved particle swarm optimization algorithm is as follows: ; In the formula, For the first k The particle in the first t+1 The next iteration in dimension D The speed on; For the first k The particle in the first t The next iteration in dimension D The speed on; Inertial weight; For the first k The particle in the first t +1 iterations in dimension D The position above; For the first k The particle in the first t The next iteration in dimension D The position above; and These are the individual learning factor and the global learning factor, respectively. and All are random numbers; and These are the individual extreme value and the global extreme value, respectively.
[0067] In practical applications, the formula for optimal active power loss is as follows: .
[0068] U i and U j These are the nodes i and j The relevant voltage values, G ij and B ij It is with nodesi and j The related conductance and susceptance values are related to the relationship between them. It is with nodes i and j The relevant phase angle.
[0069] S6. Perform grid dispatching on the target power grid system based on the optimal combination of active power loss and corresponding control variables.
[0070] The improved particle swarm optimization algorithm based on genetics has the following characteristics compared to the basic particle swarm optimization algorithm for reactive power optimization in power systems: 1) Regarding inertia weights, as the number of iterations increases, By gradually reducing the size of the particle swarm, the particle swarm speed decreases, allowing for a more precise search and improved accuracy.
[0071] 2) Regarding the learning factor, as The increase in individual learning factors The global learning factor is continuously decreasing. The fitness value increases continuously. This nonlinear strategy can achieve a good fitness value, but it is prone to getting trapped in local maxima due to the lack of diversity in particle search in the later stages.
[0072] 3) By employing selection, crossover, and mutation techniques using genetic algorithms, the Particle Swarm Optimization (PSO) algorithm is strategically integrated with genetic algorithms. This effectively increases the diversity of the particle swarm, preventing it from prematurely getting trapped in local optima. This combination not only broadens the search range of the algorithm but also enhances its ability to find the global optimum, thereby further improving the performance of the PSO algorithm.
[0073] This application proposes an improved particle swarm optimization (PSO) method for reactive power optimization in power systems based on genetic principles. By defining the reactive power optimization model, variables, and constraints (equality and inequality), the algorithm integrates genetic and particle swarm optimization algorithms, employing a nonlinear adjustment strategy for the learning factor and inertia weight. The algorithm starts by initializing particle swarm parameters, positions, velocities, and individual and global extrema, continuously updating particle velocities and positions and calculating fitness values, dynamically updating extrema. Low-fitness particles are selected for crossover; when the offspring have even lower fitness, the current value is replaced, followed by mutation. If the offspring are better, the current value is replaced. This process iterates until a preset number of iterations is met, outputting the globally optimal fitness value. This algorithm, by leveraging the selection, crossover, and mutation operations of the genetic algorithm, avoids the local optima problem common in particle swarm optimization, improving global search capability and convergence speed. It provides an efficient and reliable solution for reactive power optimization in power systems, contributing to improved economic efficiency and stability.
[0074] Example 2: This application also provides a computer device, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 3As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores and processes data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements the methods described above.
[0075] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0076] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0077] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0078] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for reactive power optimization in power systems based on a fusion of genetic and particle swarm optimization algorithms, characterized in that, The method includes: Construct a parametric model of the target power system, determine the fitness function of the control variables and reactive power optimization based on the parametric model, and set independent constraints for the control variables and the state variables in the power flow calculation based on the power system operation safety requirements and equipment constraints. By introducing selection, crossover, and mutation operations from a genetic algorithm, and employing a nonlinear adjustment strategy for the inertia weights and learning factors of the particle swarm algorithm, a fusion-improved particle swarm algorithm is formed. The state configuration of the improved particle swarm optimization algorithm is initialized, and the fitness value is calculated by continuously updating the particle velocity and position, and the individual extreme value and global extreme value are dynamically updated; the state configuration includes: position, velocity, individual extreme value and global extreme value; Select particles with fitness below the fitness threshold for crossover mutation, and update the optimal value of the particles accordingly. The process is iterated until the maximum number of iterations is reached, and the optimal active power loss is output. The optimal active power loss is the globally optimal active power loss with the smallest fitness value. Power grid dispatching is performed on the target power grid system based on the optimal combination of active power loss and corresponding control variables.
2. The reactive power optimization solution method for power systems based on the fusion of genetic and particle swarm optimization algorithms as described in claim 1, characterized in that, The control variables include: generator voltage, transformer turns ratio, and reactive power compensation capacity.
3. The reactive power optimization solution method for power systems based on the fusion of genetic and particle swarm optimization algorithms as described in claim 1, characterized in that, The state variables include: voltage amplitude of nodes other than generator nodes, node voltage phase angle, node reactive power, and actual reactive power output of generators.
4. The reactive power optimization solution method for power systems based on the fusion of genetic and particle swarm optimization algorithms as described in claim 1, characterized in that, The genetic operators include selection, crossover, and mutation.
5. The method for reactive power optimization in power systems based on the fusion of genetic and particle swarm optimization algorithms as described in claim 1, characterized in that, The improved formula for the inertia weight is as follows: ; In the formula, The improved inertia weight; and These are the minimum and maximum values of the inertia weight, respectively, and represent the current iteration number. This represents the maximum number of iterations.
6. The method for reactive power optimization in power systems based on the fusion of genetic and particle swarm optimization algorithms as described in claim 1, characterized in that, The improved formula for the learning factor is as follows: ; In the formula, For individual learning factors; As a global learning factor; This represents the current iteration number; This represents the maximum number of iterations. It is a constant, ranging from 3.4 to 4.
7. The method for reactive power optimization in power systems based on the fusion of genetic and particle swarm optimization algorithms as described in claim 1, characterized in that, Select particles with fitness below the fitness threshold for crossover and mutation, and update the optimal value of the selected particles. Specifically, this includes: Sort the fitness of individuals in the population in ascending order and record the corresponding sorting index; Calculate the number of individuals to be selected based on the selection probability and population size; Select individual particles whose fitness is lower than the fitness threshold according to the sorting index, and store their position and velocity information respectively; Particles below the fitness threshold are randomly paired, and crossover operations are used to generate crossover particles. Determine if the fitness of the crossover particle is lower than its optimal fitness. If so, replace the current value with the fitness of its offspring. If not, perform a mutation operation first, then determine if the fitness of the mutated particle is lower than its optimal fitness. If so, replace the current value with the fitness of its offspring and update the optimal value of the particle.
8. The method for reactive power optimization in power systems based on the fusion of genetic and particle swarm optimization algorithms as described in claim 1, characterized in that, The fitness threshold is the maximum fitness value among the top 20% of individual particles.
9. The method for reactive power optimization in power systems based on the fusion of genetic and particle swarm optimization algorithms as described in claim 1, characterized in that, The iterative formula for the improved particle swarm optimization algorithm is as follows: ; In the formula, For the first k The particle in the first t+1 The next iteration in dimension D The speed on; For the first k The particle in the first t The next iteration in dimension D The speed on; Inertial weight; For the first k The particle in the first t+1 The next iteration in dimension D The position above; For the first k The particle in the first t The next iteration in dimension D The position above; and These are the individual learning factor and the global learning factor, respectively. and All are random numbers; and These are the individual extreme value and the global extreme value, respectively.
10. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the reactive power optimization solution method for power systems based on the fusion of genetic-particle swarm optimization algorithm as described in any one of claims 1-9.