A method for preventing transient stability of power systems based on agent model

By adopting the combination of convolutional neural network model and genetic algorithm in the power system, the problem of difficult to take into account both the computational efficiency and accuracy in the transient stability prevention and control method of the power system is solved, and efficient and accurate prevention and control strategy generation is achieved to meet the needs of the The power system has a rapid decision-making requirement.

CN118508535BActive Publication Date: 2024-12-17ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410957730.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-12-17
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

The existing transient stability prevention and control methods for power systems are difficult to ensure the calculation efficiency and accuracy of large-scale power systems, resulting in low efficiency in optimization and solution of prevention and control strategies and difficult to meet the needs of rapid decision-making.

Method used

Using the power system transient stability prevention and control method based on the agent model, the transient stability margin is quickly predicted through the convolutional neural network model, and the power system transient stability prevention and control model is constructed using the genetic algorithm, and iteratively optimizes the generator's active output to generate Preventive control strategies.

Benefits of technology

It significantly improves the solution efficiency of prevention and control strategies, reduces calculation costs, and provides efficient and accurate prevention and control solutions for the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118508535B_ABST
    Figure CN118508535B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for preventing and controlling transient stability of power systems based on an agent model, and belongs to the field of deep learning and stability control of power systems. The present invention first constructs an agent model for characterizing transient stability characteristics of power systems based on massive simulation data, and realizes rapid fitting of the mapping relationship between multi-source input information such as system operating status and disturbance type and transient stability margin; then, a transient stability prevention and control model of the power system is constructed based on a genetic algorithm, and the agent model is embedded in the prevention and control model to replace complex and time-consuming transient stability constraint calculations, thereby efficiently realizing the iterative evolution of the prevention and control strategy to obtain the optimal solution. This method can effectively improve the optimization and solution efficiency of the transient stability prevention and control strategy, and meet the needs of rapid decision-making of the power system prevention and control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of deep learning and power system stability control, and specifically relates to a power system transient stability preventive control method based on an agent model. Background Art

[0002] With the increasing scale and complexity of power systems, the transient stability problem of power systems has become an important factor affecting the safe and stable operation of the system. As a key means to ensure the safe and stable operation of power systems, transient stability preventive control, its computational efficiency and accuracy are directly related to the operation quality of power systems. However, traditional transient stability preventive control methods usually rely on complex and time-consuming time-domain simulations, which makes it particularly difficult to achieve fast and accurate preventive control in large-scale power systems. At present, although some methods have tried to improve the computational efficiency of preventive control by simplifying models or using heuristic algorithms, these methods often find it difficult to simultaneously ensure computational accuracy and real-time performance. For example, preventive control methods based on simplified models may not accurately reflect the complex dynamic characteristics of power systems, resulting in the failure of control strategies; while methods based on heuristic algorithms can improve computational efficiency to a certain extent, but their optimization effects are often limited by the convergence performance and parameter settings of the algorithm. In addition, with the rapid development of big data and artificial intelligence technologies, the application of data-driven agent models in power systems has gradually attracted attention. The proxy model can quickly fit the mapping relationship between multi-source input information such as system operating status and disturbance type and system transient stability margin by learning massive simulation data, thereby realizing efficient characterization of transient stability characteristics of power systems. However, how to combine the proxy model with the preventive control algorithm to achieve rapid calculation and optimization of transient stability constraints is still a difficult and hot topic in current research. Summary of the invention

[0003] The purpose of the present invention is to solve the problem of low optimization solution efficiency of power system transient stability preventive control strategy, and proposes a power system transient stability preventive control method based on an agent model, which significantly improves the optimization solution efficiency of the preventive control strategy while ensuring calculation accuracy and real-time performance, so as to meet the needs of rapid decision-making of power system preventive control.

[0004] In order to achieve the above-mentioned invention object, the technical solution specifically adopted by the present invention is as follows:

[0005] A method for preventing and controlling transient stability of a power system based on an agent model, the steps of which are as follows:

[0006] S1. Obtain a convolutional neural network model trained by a training sample set obtained by transient stability simulation, wherein the convolutional neural network model takes system fault information, system steady-state operation information, and generator power angle trajectory change information after a fault as input, and takes the transient stability margin of the power system as output;

[0007] S2. Using the convolutional neural network model as a proxy model for judging the transient stability of the power system, and constructing a power system transient stability prevention and control model based on the proxy model with the goal of minimizing the active control cost of the generator and with the system transient stability and power flow convergence as constraints, solving the power system transient stability prevention and control model using a genetic algorithm, iteratively optimizing the active output of each generator in the power system after adjustment, and generating a power system transient stability prevention and control strategy according to the optimal solution.

[0008] Preferably, the method for constructing the training sample set is as follows: for the target power system, the initial operating point of the target power system under different load levels is determined based on Latin hypercube sampling, transient stability simulation is performed in combination with different system fault information, and the transient stability margin of the power system is calculated according to the simulation results, thereby generating simulation data samples consisting of system fault information, system steady-state operation information, generator power angle trajectory change information after the fault, and transient stability margin, and each simulation data sample is processed through data to form a training sample set that conforms to the input of the neural network model.

[0009] Furthermore, the transient stability margin TSI is based on the maximum power angle difference Δ between all generators. max The conversion formula is TSI = 100* (360-Δ max ) / (360+Δ max ); The value range of transient stability margin is -100 to 100. A transient stability margin of 0 indicates that the power system is in a critical stability state.

[0010] Preferably, the system fault information includes the load level value ki, the fault line fl, the fault duration ft, the fault location fp and the fault type; the system steady-state operation information includes the generator active power PG, the generator reactive power QG, the machine-end bus voltage amplitude V, the machine-end bus voltage phase angle θ, the generator power angle δ, the generator online status Ol, the machine-end line active load PL and the machine-end line reactive load QL corresponding to each generator in the power system; the post-fault generator power angle trajectory change information is the trajectory change information of the generator power angle δ of each generator in the power system after the fault occurs.

[0011] Preferably, the convolutional neural network model consists of three feature extraction branches and a fully connected network. The system fault information, the system steady-state operation information, and the generator power angle trajectory change information after the fault are each extracted through a feature extraction branch, and each feature extraction branch is composed of alternating convolutional layers and pooling layers cascaded together; after the feature information extracted by the three feature extraction branches passes through the fully connected network, the transient stability margin prediction value of the target power system is output.

[0012] Preferably, the generator active power control cost is the sum of the control costs of all generators in the power system, and the control cost of each generator is calculated by the active power output regulation of the generator through a consumption characteristic curve.

[0013] Preferably, when using a genetic algorithm to solve the power system transient stability preventive control model, for any set of feasible solutions, it is necessary to determine whether they simultaneously satisfy the two constraints of system transient stability and power flow convergence, wherein the system transient stability constraint is that the transient stability margin TSI of the power system is greater than 0, and the power flow convergence constraint is composed of a node power balance equation constraint, upper and lower limit constraints on the active output of the power source, upper and lower limit constraints on the reactive output of the reactive source, upper and lower limit constraints on the node voltage, and line power flow constraints.

[0014] Preferably, when using a genetic algorithm to solve the power system transient stability preventive control model, for any set of feasible solutions, the system fault information, system steady-state operation information, and post-fault generator power angle trajectory change information corresponding to this set of solutions need to be input into the proxy model to calculate the transient stability margin TSI of the power system, and then determine whether this set of solutions meets the system transient stability constraints.

[0015] Preferably, in the proxy model, the post-fault generator power angle trajectory change information is the trajectory change information of the generator power angle δ 1 second after the fault occurs, and the maximum power angle difference is the maximum power angle difference between all generators within 10 seconds after the start of the simulation.

[0016] Preferably, when using a genetic algorithm to solve the transient stability preventive control model of the power system, the fitness value of each group of feasible solutions is calculated based on the fitness function, and the optimal solution is searched according to the fitness value of the feasible solution; the fitness function is obtained by summing the active control cost of the generator, the power flow constraint penalty term and the transient stability penalty term. When the power flow convergence constraint is met, the power flow constraint penalty term is 0, and when it is not met, the power flow constraint penalty term is a positive hyperparameter, and the transient stability penalty term is a negative value of the transient stability margin TSI.

[0017] Compared with the prior art, the present invention has the following beneficial effects:

[0018] The present invention trains the convolutional neural network model through simulation samples, so that it can quickly predict the transient stability margin corresponding to the power system by inputting the fault information, steady-state characteristics and trajectory characteristics of the system, and then introduces the model as a proxy model into the transient stability preventive control model of the power system, effectively avoiding the complex and time-consuming transient stability time-domain simulation, and further optimizing the convergence effect of the preventive control algorithm, meeting the needs of rapid decision-making of preventive control of the power system. The results show that this method significantly improves the solution efficiency of the preventive control strategy, greatly reduces the calculation cost, and provides an efficient and accurate solution for the preventive control of the power system. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of the steps of the transient stability preventive control method of the power system based on the agent model;

[0020] Figure 2 It is a flowchart of a transient stability preventive control process of a power system based on an agent model in an embodiment of the present invention;

[0021] Figure 3 is a comparison diagram of transient stability prevention control effects based on the agent model in an embodiment of the present invention;

[0022] Figure 4 It is a comparison diagram of the convergence effect of further optimizing the algorithm based on the transient stability margin information in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings.

[0024] On the contrary, the present invention covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present invention as defined by the claims. Further, in order to make the public have a better understanding of the present invention, some specific details are described in detail in the detailed description of the present invention below. Those skilled in the art can fully understand the present invention without the description of these details.

[0025] In a preferred embodiment of the present invention, a method for preventing and controlling transient stability of a power system based on an agent model is provided. By constructing an agent model that can accurately reflect the transient stability characteristics of the power system and embedding it into the preventive control model, the complex and time-consuming transient stability constraint calculation is replaced and optimized, so as to significantly improve the optimization solution efficiency of the preventive control strategy and meet the needs of rapid decision-making for preventive control of the power system. Figure 1 As shown, the specific steps of the agent model-based power system transient stability preventive control method are described in detail.

[0026] S1. Obtain a convolutional neural network model trained by a training sample set obtained by transient stability simulation, wherein the convolutional neural network model takes system fault information, system steady-state operation information, and generator power angle trajectory change information after a fault as input, and takes the transient stability margin of the power system as output.

[0027] It should be noted that the acquisition of the convolutional neural network model mentioned above can be to obtain the convolutional neural network model through online training, or it can be to read the convolutional neural network model that has been trained in advance and maintained offline, and there is no limitation on this. However, whether it is online training or offline reading, the above-mentioned convolutional neural network model needs to be trained with the training sample set obtained by transient stability simulation before it can be used for actual reasoning. In an embodiment of the present invention, the above-mentioned training sample set can be constructed by the following method: for the target power system, the initial operating point of the target power system under different load levels is determined based on Latin hypercube sampling, transient stability simulation is performed in combination with different system fault information, and the transient stability margin of the power system is calculated according to the simulation results, thereby generating a simulation data sample composed of system fault information, system steady-state operation information, generator power angle trajectory change information after the fault, and transient stability margin, and each simulation data sample is processed to form a training sample set that meets the input of the neural network model.

[0028] In an embodiment of the present invention, the above-mentioned system fault information includes the load level value ki, the fault line fl, the fault duration ft, the fault location fp and the fault type; the above-mentioned system steady-state operation information includes the generator active power PG, the generator reactive power QG, the machine-end bus voltage amplitude V, the machine-end bus voltage phase angle θ, the generator power angle δ, the generator online status Ol, the machine-end line active load PL and the machine-end line reactive load QL corresponding to each generator in the power system; the above-mentioned generator power angle trajectory change information after the fault is the trajectory change information of the generator power angle δ of each generator in the power system after the fault occurs.

[0029] It should also be noted that the number of generators contained in the power system that needs to perform transient stability judgment in the present invention and the corresponding system steady-state operation information may be different. Therefore, during the simulation process, it is necessary to determine the parameters of each system according to the actual power system situation, and then perform targeted simulation, and then train to obtain a proxy model suitable for the power system. The specific simulation process can be implemented through the PSAT transient stability simulation software. The operation of the simulation software belongs to the prior art and will not be repeated here. The system fault information and system steady-state operation information required for transient stability simulation need to be determined through sampling or according to the actual system situation. The method for generating simulation data samples is specifically introduced below, and the process is shown in S11 and S12:

[0030] S11. Uniformly sample multiple central load levels k within the load level range of the target power system; for each central load level k, obtain the fault line fl, fault duration ft, fault location fp, and fault type required for simulation through random sampling without replacement, and randomly sample load level values ​​ki within the neighborhood of the central load level k through Latin hypercube sampling, so that the sampled values ​​​​compose the system fault information.

[0031] In an embodiment of the present invention, the load level range of the sampled central load level k is preferably 80%~130%, and the central load level k is preferably sampled at equal intervals with a step size of 5%; the sampling range of the fault duration is preferably 0.1~0.2s, the sampling range of the fault position is preferably 20%~80%, the fault type is only sampled as a three-phase short circuit fault, the neighborhood range of each central load level k is preferably a ±2.5% range centered on itself, and the trajectory change information is preferably the trajectory change information of the generator power angle δ 1s after the fault occurs; the maximum power angle difference is the maximum power angle difference between all generators within 10s after the start of the simulation. Under such a setting, it is only necessary to simulate the trajectory change information 1s after the fault occurs, combined with other system fault information and system steady-state operation information, to predict the TSI after 10s, and directly judge whether the transient stability constraint is satisfied, so as to avoid the subsequent transient stability simulator from performing complex and time-consuming simulations on the process within 1~10s.

[0032] S12. For each group of system fault information composed of sampling values, the load level value ki is used as the initial operating point of the target power system, and the corresponding fault line fl, fault duration ft, fault location fp and fault type are set in the simulated target power system. At the same time, the system steady-state operation information of each generator in the target power system is set. The above-mentioned system steady-state operation information includes the generator active power PG, the generator reactive power QG, the machine-end bus voltage amplitude V, the machine-end bus voltage phase angle θ, the generator power angle δ, the generator online status Ol, the machine-end line active load PL and the machine-end line reactive load QL. Then, the target power system is subjected to transient stability simulation to obtain the trajectory change information of the generator power angle δ of each generator after the fault occurs and the maximum power angle difference between all generators. Finally, the maximum power angle difference between all generators is converted into the transient stability margin TSI as the sample label value.

[0033] In an embodiment of the present invention, the transient stability margin TSI is based on the maximum power angle difference Δ between all generators in the power system. max The conversion formula is TSI = 100* (360-Δ max ) / (360+Δ max). The TSI value range is from -100 to 100, representing the system stability from severe instability to complete stability. When TSI is 0, it means that the system is in a critical stability state.

[0034] After completing the transient stability simulation of all groups of system fault information, a simulation data sample corresponding to each group of system fault information can be obtained. When all simulation data samples are constructed as corresponding neural network training data sets, they also need to be processed to meet the input requirements and training requirements of subsequent neural networks. Generally speaking, when processing simulation data samples, the data needs to be Z-Score normalized and sample balanced (control so that the number of stable samples and the number of unstable samples reach a reasonable level).

[0035] In addition, the above-mentioned convolutional neural network model can adopt a conventional convolutional neural network (CNN) architecture built based on deep learning technology, that is, feature extraction and activation output are achieved through a combination of convolutional layers, pooling layers, fully connected layers and activation layers.

[0036] In an embodiment of the present invention, the convolutional neural network model is composed of three feature extraction branches and a fully connected network. The system fault information, the system steady-state operation information, and the generator power angle trajectory change information after the fault are each extracted through a feature extraction branch. Each feature extraction branch is composed of three groups of alternating convolution layers (with ReLU function activation output) and pooling layers cascaded, that is, each feature extraction branch adopts a cascade structure of convolution layer 1, ReLU function layer 1, pooling layer 1, convolution layer 2, ReLU function layer 2, pooling layer 2, convolution layer 3, ReLU function layer 3, and pooling layer 3. In addition, the pooling layer can adopt a maximum pooling operation. After the feature information extracted by the three feature extraction branches passes through the fully connected network, the transient stability margin prediction value of the target power system is output. The fully connected network is composed of three cascaded fully connected layers, of which the first two fully connected layers are output through the ReLU activation function, and the last fully connected layer is output through the tanh activation function, that is, the fully connected network is composed of fully connected layer 1, ReLU function layer 4, fully connected layer 2, ReLU function layer 5, fully connected layer 3 and tanh activation function layer cascaded. The output of the final tanh activation function layer is the predicted value of the transient stability margin TSI.

[0037] It should be noted that the training of the convolutional neural network model belongs to the prior art, and the network parameters can be iteratively optimized in an alternating manner of forward propagation and backward propagation, and a reasonable loss function can be set according to the output parameters. In an embodiment of the present invention, during the training process of the convolutional neural network model, the Adam optimization algorithm is selected to optimize the model parameters, and Smooth L1 Loss is used as the loss function. After the training is completed, the model that reaches the prediction accuracy can be put into the reasoning application of the actual scene. Therefore, through the above steps, using a large amount of simulation sample data, after constructing a convolutional neural network model for characterizing the transient stability characteristics of the power system based on deep learning technology, it is possible to achieve rapid fitting of the mapping relationship between multi-source input information such as system operating status and disturbance type and the system transient stability margin.

[0038] S2. Use the above convolutional neural network model as a proxy model for judging the transient stability of the power system, and build a power system transient stability prevention and control model based on the proxy model with the goal of minimizing the active control cost of the generator and with the system transient stability and power flow convergence as constraints. Use a genetic algorithm to solve the power system transient stability prevention and control model, iteratively optimize the active output of each generator in the power system after adjustment, and generate a power system transient stability prevention and control strategy according to the optimal solution.

[0039] It should be noted that the genetic algorithm (GA) used to solve the power system transient stability preventive control model belongs to the prior art. It is an optimization search method that simulates the biological evolution process in nature. It is based on fitness functions, selection, crossover and mutation operations, and continuously screens high-fitness solutions to achieve iterative evolution of preventive control strategies until the optimal solution is reached. The basic framework of the genetic algorithm in the present invention is consistent with the prior art, and the power system transient stability preventive control model needs to be specially designed for the application scenario.

[0040] The transient stability preventive control model of the power system in the present invention is composed of a fitness function and a solution constraint. Among them, before designing the fitness function, it is necessary to design the objective function first. The objective function is used to calculate the active power control cost of the generator, which is the sum of the control costs of all generators in the power system. The control cost of each generator can be calculated by the active power output regulation of the generator through the consumption characteristic curve, which represents the product of the active power output regulation of the corresponding generator and the corresponding unit regulation cost. The core goal of the genetic algorithm solution is to minimize the objective function value, that is, to minimize the active power control cost of the generator. In the process of solving the feasible solution that minimizes the objective function value, in theory, each set of feasible solutions needs to meet the set constraints, otherwise it cannot be used as a feasible solution. In the present invention, the solution constraints include two constraints: system transient stability and power flow convergence. Therefore, when using genetic algorithms to solve the transient stability preventive control model of the power system, for any set of feasible solutions, it is necessary to judge whether it satisfies both the system transient stability and power flow convergence constraints. The system transient stability constraint is that the transient stability margin TSI of the power system is greater than 0, and the power flow convergence constraint is composed of the node power balance equation constraint, the upper and lower limit constraints of the active output of the power source, the upper and lower limit constraints of the reactive output of the reactive source, the upper and lower limit constraints of the node voltage, and the line power flow constraint.

[0041] It should be noted that when judging whether a set of feasible solutions meets the system transient stability constraints, it is necessary to calculate the transient stability margin TSI of the power system. However, long-term transient stability simulation consumes a large amount of computing resources and takes a long time, which is not conducive to quickly obtaining the judgment result. The present invention has already obtained a convolutional neural network model as a proxy model for judging the transient stability of the power system. Therefore, when solving the transient stability prevention and control model of the power system using a genetic algorithm, for any set of feasible solutions, the system fault information, system steady-state operation information, and post-fault generator power angle trajectory change information corresponding to this set of solutions can be input into the proxy model to calculate the transient stability margin TSI of the power system, and then judge whether this set of solutions meets the system transient stability constraints. As mentioned above, in this proxy model, the post-fault generator power angle trajectory change information required to be input is the trajectory change information of the generator power angle δ 1s after the fault occurs, and the output transient stability margin TSI is determined based on the maximum power angle difference between all generators within 10s after the start of the simulation, which is equivalent to the proxy model being able to predict the output of the transient stability margin TSI 10s later based on the input information. Therefore, when the proxy model is actually applied to the genetic algorithm solution, it is only necessary to obtain the trajectory change information 1s after the fault occurs through simulation, and input it into the proxy model with other system fault information and system steady-state operation information, so as to obtain the transient stability margin TSI 10s after the start of the power system simulation, without simulating the generator power angle δ between 1 and 10s. The present invention embeds the proxy model into the preventive control model to replace the complex and time-consuming transient stability constraint calculation, and further optimizes the algorithm convergence effect based on the transient stability margin information obtained by the proxy model, which can greatly improve the timeliness of the generation of the transient stability preventive control strategy of the power system.

[0042] Theoretically, the system transient stability and power flow convergence constraints are two hard constraints, and a death penalty will be imposed if either one fails. However, based on actual solution considerations, the two are converted into soft constraints after using the proxy model, and the death penalty is no longer directly imposed. Therefore, after determining the above objective function and solution constraints, the penalty terms of the two solution constraints can be added to the objective function to form a corresponding fitness function. In an embodiment of the present invention, the fitness function is obtained by summing the active control cost of the generator, the power flow constraint penalty term, and the transient stability penalty term. When the power flow convergence constraint is met, the power flow constraint penalty term is 0, and when the power flow convergence constraint is not met, the power flow constraint penalty term is a positive hyperparameter (the hyperparameter can be selected according to actual needs), and the transient stability penalty term is a negative value of the transient stability margin TSI. Therefore, after obtaining a set of new solutions, the agent model predicts the transient stability margin TSI of the system 10s after the solution based on the system fault information, system steady-state operation information and the trajectory change information 1s after the fault occurs obtained by simulation, and imposes a penalty on the individual solution according to the TSI value. The smaller the TSI value, the more serious the system instability, and the greater the penalty; conversely, the smaller the penalty. Therefore, in the iterative process, excellent individuals are easier to be retained because of the small penalty imposed, and the algorithm convergence effect is better.

[0043] It should be noted that when using genetic algorithms to solve the transient stability preventive control model of power systems, the fitness value of each group of feasible solutions is calculated based on the fitness function, and the optimal solution is searched according to the fitness value of the feasible solution. The specific process of searching for the optimal solution according to the fitness value of the feasible solution belongs to the conventional practice of genetic algorithms and will not be repeated.

[0044] In order to better demonstrate the specific implementation method and technical effect of the present invention, a specific embodiment is used below to demonstrate the application of the power system transient stability preventive control method based on the agent model shown in S1~S2 in actual scenarios, and to demonstrate the performance that can be achieved.

[0045] Example

[0046] In this embodiment, a method for preventing and controlling transient stability of a power system based on an agent model is provided, which includes the following three stages:

[0047] Phase 1: Construction of transient stability proxy model

[0048] According to the scale and structure of the required proxy power system, an agent model for transient stability margin assessment is constructed based on deep learning technology. By inputting system fault information, steady-state operation information and trajectory feature information within 1s of transient stability simulation, the agent model can directly predict and output the transient stability margin TSI representing the transient stability degree of the system after 10s, so as to replace the complex and time-consuming transient stability time domain simulation calculation in preventive control. The power system of this embodiment includes 34 lines and a total of 10 generators. The construction method of the agent model is described in detail below.

[0049] Step 1: Data generation and sample construction:

[0050] In order to construct a comprehensive power system transient stability data set, the PSAT transient stability simulation software is used to perform time domain simulations in a variety of key fault scenarios, capture the state changes of the system after the disturbance, and calculate TSI as a transient stability margin index to generate simulation data samples. On this basis, the input features and corresponding labels that best reflect the transient characteristics are selected, and the data is normalized and preprocessed. At the same time, the sample ratio is controlled to maintain a balance between stable and unstable samples to ensure the validity of the data set.

[0051] Key fault scenario settings:

[0052] The system load level k is set to increase gradually in the range of 80% to 130% with a step size of 5%, and a total of 11 central load levels are sampled, namely k=80%, 85%, 90%, 95%, 100%, 105%, 110%, 115%, 120%, 125%, and 130%. Around each central load level k, the fault line fl, fault duration ft, fault location fp, and fault type required for simulation are obtained by random sampling without replacement, where: the fault line fl is randomly selected from 34 lines; the fault duration ft is randomly selected from 0.1s, 0.15s, and 0.2s; the fault location fp is randomly selected from 20%, 50%, and 80%; the fault type is uniformly set to three-phase short circuit fault, and the load level value ki is randomly sampled in the neighborhood range (k-2.5%, k+2.5%) of the central load level k by Latin hypercube sampling, so that each group of sampled values ​​constitutes a system fault information, which can be used as a steady-state operation sample for subsequent simulation. Therefore, each central load level k can generate (34*3*3) steady-state operation samples for all fault combinations. And for 11 central load levels k, a total of (11*34*3*3) steady-state operation samples can be obtained.

[0053] Extraction of key features and determination of input and output data structure: Before transient stability simulation, the fault removal time ft, fault location percentage fp, fault line fl and load level ki are first screened out from the system fault information. These key parameters together constitute the fault information matrix; then focus on the system steady-state operation information, extract the core parameters such as the generator active power PG, generator reactive power QG, machine-end bus voltage amplitude V, machine-end bus voltage phase angle θ, generator power angle δ and generator online status Ol, and integrate the active and reactive loads PL and QL of the machine-end line to construct a steady-state feature matrix. During the transient stability simulation process, each sample is set up in the PSAT transient stability simulation software according to the above system fault information and system steady-state operation information. The target power system is simulated with load level ki as the initial operating point, and the dynamic changes of the generator power angle δ are focused on during the simulation. By extracting the power angle trajectory change information within 1 second after the fault occurs, the trajectory feature matrix is ​​constructed. This matrix records the change trajectory of the generator power angle in the transient process in detail, which is of great significance for analyzing the transient stability of the system. After the transient stability simulation, the system transient stability margin result TSI is retained as the sample label information for convolutional neural network model training. TSI reflects the maximum power angle difference Δ between all generators in the power system during the transient process. max , then TSI = (360-Δ max ) / (360+Δ max )*100, where the maximum power angle difference is the maximum power angle difference between all generators within 10 seconds after the start of the simulation. After extracting the above key features, a simulation data sample is formed by the system fault information, system steady-state operation information, post-fault generator power angle trajectory change information and transient stability margin corresponding to each set of simulation results.

[0054] Each simulation data sample is processed to form a training sample set that meets the neural network model input. The specific processing includes Z-Score normalization, and the need to classify the samples into stable samples and unstable samples according to the transient stability margin TSI, and then perform sample balancing to control the proportion of the training sample set so that the number of stable samples and the number of unstable samples reach a reasonable level. It is particularly important to note that the above-mentioned system fault information, system steady-state operation information, and generator power angle trajectory change information after the fault all need to be constructed in matrix form before they can be input into the neural network, that is, they need to be converted into fault information matrix, steady-state feature matrix, and trajectory feature matrix.

[0055] Step 2: Proxy model network construction:

[0056] By utilizing deep learning technology, a transient stability agent model based on CNN is constructed. The model first gradually extracts key dynamic features from the preprocessed multi-source data through convolution and pooling operations. Subsequently, these features are fused with fault information and steady-state features, and input into the fully connected layer for deep learning to capture the complex behavior of the power system in the transient process. Finally, the model uses the Tanh activation function to ensure that the output value is within a reasonable range and further improves the ability to express nonlinear features. In this embodiment, the specific network structure of the CNN convolutional neural network model consists of three feature extraction branches and a fully connected network. The system fault information, the system steady-state operation information, and the generator power angle trajectory change information after the fault are each extracted through a feature extraction branch. Each feature extraction branch is composed of alternating convolutional layers and pooling layers cascaded. After each convolutional layer, the ReLU function can be used for output, and the pooling layer can use the maximum pooling MaxPool, that is, each feature extraction branch uses convolutional layer 1, ReLU function layer 1, pooling layer 1, convolutional layer 2, The cascade structure is composed of ReLU function layer 2, pooling layer 2, convolution layer 3, ReLU function layer 3, and pooling layer 3; the feature information extracted by the three feature extraction branches is fully connected and activated through a fully connected network. The fully connected network is composed of three cascaded fully connected layers, in which the first two fully connected layers are output through the ReLU activation function, and the last fully connected layer is output through the tanh activation function, that is, the fully connected layer 1, ReLU function layer 4, fully connected layer 2, ReLU function layer 5, fully connected layer 3 and tanh activation function layer are cascaded. The tanh activation function layer finally outputs the transient stability margin prediction value of the target power system. In this network model, after preprocessing, the fault information and steady-state feature information can be directly spliced ​​together with the trajectory feature information after the convolution pooling operation, and jointly input into the fully connected layer and fused in the fully connected layer to effectively combine the system state information before and after the fault occurs and the dynamic trajectory information after the fault occurs, so that it can more accurately capture and analyze the complex characteristics of the transient stability process of the power system.

[0057] Step 3: Proxy model training and optimization:

[0058] Before model training, the preprocessed sample data is grouped to construct training sets and test sets, and then randomly shuffled and loaded according to the batch size. Then, Smooth L1 Loss is used as the loss function to balance the loss calculation under outliers and normal conditions, and the Adam optimizer is used to update the model parameters to minimize the loss and quickly and stably find the optimal solution. By continuously using training sets and test sets to monitor and adjust the model, it is ensured that it can adapt to various data distributions and scenario changes, and its effectiveness and wide applicability are guaranteed. At the same time, strategies such as early stopping are also used in the training process to effectively prevent overfitting and improve model performance.

[0059] Phase II: Construction of transient stability prevention and control model

[0060] In order to compare with the transient stability preventive control model after the introduction of the agent model, a transient stability preventive control model without the introduction of the agent model was first constructed in this stage. The specific approach is to use the genetic algorithm as the external optimization algorithm to construct a power system transient stability preventive control model with the goal of minimizing the control cost and the system transient stability and power flow convergence as constraints. The genetic algorithm is used to continuously select high-fitness solutions to achieve iterative evolution of the preventive control strategy until the optimal solution is reached.

[0061] Step 1: Determine the genetic algorithm framework:

[0062] According to the transient stability control requirements of the power system, the basic framework of the genetic algorithm is determined. Specifically, it includes defining the key elements of the genetic algorithm's fitness function, selection operation, crossover operation, mutation operation, and termination conditions to ensure that the algorithm can effectively search and optimize for transient stability issues. Among them, the fitness function is the preventive control cost of the system, which is composed of the objective function value and the flow constraint penalty. The objective function is the generator consumption characteristic curve, which represents the accumulation of the active output regulation of all generators in the system and the corresponding unit regulation cost. The formula form of the fitness function is as follows;

[0063]

[0064] In the formula, represents the fitness function, is the objective function, To control the action, It is a sign of whether the power flow and temporary stability constraints are met. 0 means both constraints are met, otherwise it is 1.

[0065] The objective function is formulated as follows:

[0066]

[0067] in, represents the active output of the i-th generator, is the consumption characteristic curve parameter of the i-th generator, Represents the set of all generators.

[0068] The formula form of the power flow constraint is as follows:

[0069]

[0070]

[0071] The above models represent the node power balance equation constraint, the upper and lower limit constraints of the active power output of the power source, the upper and lower limit constraints of the reactive power output of the reactive source, the upper and lower limit constraints of the node voltage, and the line flow constraint from top to bottom. Among them: , , , They represent the system node set, generator set, reactive source set and all branch sets respectively; , represents the active and reactive output of the i-th generator, , Represents the active and reactive loads of the ith node; , represents the voltage amplitude and phase angle of the i-th node, ; , represents the real and imaginary parts of the elements in the i-th row and j-th column of the node admittance matrix; For Line The underline represents the lower threshold and the overline represents the upper threshold.

[0072] It should be noted that the system node set of the present invention refers to all nodes in the power system including load nodes and generator nodes.

[0073] The transient stability constraint is expressed as follows:

[0074] − δ ¯ ≤ δ i ( t ) − δ COI ( t ) ≤ δ ¯ t ∈ [ 0 , T ]

[0075]

[0076] in is the center of moment of inertia, represents the power angle of the i-th generator at time t, represents the moment of inertia of the i-th generator, is the number of synchronous generators.

[0077] In this embodiment, the selection, crossover, and mutation in the genetic algorithm respectively adopt tournament selection, simulated binary crossover, and Gaussian mutation schemes; in addition, the maximum number of iterations of the genetic algorithm needs to be set as a termination condition.

[0078] Step 2: Integrate transient stability constraints with power flow constraints:

[0079] In the framework of the genetic algorithm, transient stability constraints and power flow convergence conditions are integrated and converted into part of the fitness function. In this way, the genetic algorithm can automatically consider transient stability and power flow convergence constraints during the search process to avoid generating solutions that do not meet the stability conditions. Specifically,

[0080] The power flow convergence constraint is expressed as:

[0081]

[0082]

[0083] From top to bottom, they are the node power balance equation, the upper and lower bounds of the active output of the power source, the upper and lower bounds of the reactive output of the reactive source, the upper and lower bounds of the node voltage, and the line flow constraints.

[0084] The system transient stability constraint is expressed as:

[0085] − δ ¯ ≤ δ i ( t ) − δ COI ( t ) ≤ δ ¯ t ∈ [ 0 , T ]

[0086]

[0087] That is, using the generator rotor power angle Relative moment of inertia The absolute deviation is less than As a transient stability constraint, since the proxy model has not yet been introduced, whether the system transient stability constraint is met needs to be determined by simulating the system from 0 to 10 seconds through a stability simulator.

[0088] The individual solution is verified according to the above two constraints. If the power flow exceeds the limit or transient instability occurs, the individual fitness FIT value is directly set to 200 to quickly eliminate it in subsequent iterations.

[0089] Step 3: Build and optimize the genetic algorithm control model:

[0090] Based on the determined genetic algorithm framework and integrated transient stability and power flow convergence constraints, a complete power system transient stability prevention and control model is built. By continuously adjusting the parameters of the genetic algorithm, including population size, crossover probability, mutation probability, etc., the search efficiency and accuracy of the model are improved. At the same time, combined with the actual operation data of the power system, the model is verified and debugged to ensure its reliability and effectiveness in practical applications.

[0091] Phase 3: Preventive Control and Optimization Embedded in Agent Models

[0092] For the system transient stability constraint integrated in the power system transient stability prevention and control model, the constructed proxy model is embedded to realize the fast calculation of the constraint. The specific approach is to use the convolutional neural network model as a proxy model for judging the transient stability of the power system, and based on the proxy model, to build a power system transient stability prevention and control model with the goal of minimizing the active control cost of the generator and the system transient stability and power flow convergence as constraints. The power system transient stability prevention and control model is solved by genetic algorithm, and the active output of each generator in the power system after adjustment is iteratively optimized. The power system transient stability prevention and control strategy is generated according to the optimal solution. Compared with the power system transient stability prevention and control model without the embedded proxy model, after the proxy model is embedded, for any set of feasible solutions, the system fault information, system steady-state operation information, and the internal generator power angle trajectory change information corresponding to this set of solutions can be input into the proxy model to directly calculate the transient stability margin TSI of the power system. Therefore, there is no need to conduct a long simulation. The transient stability simulator only needs to conduct a simulation within 0~1s to obtain the power angle trajectory change information within 1 second after the fault occurs. By inputting the system fault information, steady-state operation information and the simulation trajectory information within 0~1s of the transient stability simulator into the proxy model, the proxy model predicts and outputs the transient stability margin TSI 10s later based on the input information, and directly judges whether the transient stability constraints are met, thereby avoiding the subsequent complex and time-consuming simulation within 1~10s of the transient stability simulator.

[0093] In the transient stability preventive control model in the second stage before the introduction of the agent model, the original transient stability constraint is:

[0094] − δ ¯ ≤ δ i ( t ) − δ COI ( t ) ≤ δ ¯ t ∈ [ 0 , T ]

[0095] set up is the maximum power angle difference during the simulation time period:

[0096] Δ max = | δ i ( t ) − δ COI ( t )| max t ∈ [ 0 , T ]

[0097] Then the above inequality constraints can be transformed into:

[0098]

[0099] Pick =360°, the transient stability factor TSI is expressed as follows:

[0100]

[0101] Therefore, after the introduction of the proxy model in this stage, the transient stability constraint can be calculated based on TSI, that is, the transient stability constraint is converted into:

[0102]

[0103] Furthermore, based on the original control cost-oriented fitness function, a penalty function is added to improve the convergence of the algorithm. The corresponding penalty is imposed according to the TSI value output by the proxy model. The smaller the TSI value, the more serious the instability of the system, and the greater the penalty; conversely, the smaller the penalty. Therefore, in the iterative process, excellent individuals are more likely to be retained due to the small penalty, and the algorithm convergence effect is better. Therefore, the fitness function actually used in this stage is as follows:

[0104]

[0105] In the formula, represents the fitness function, is the objective function, To control the action, It is a sign of whether the power flow constraint is satisfied. 0 means that all power flow constraints are satisfied, otherwise it is 1. The transient stability penalty term is introduced in the fitness function, which is determined by the negative of the transient stability margin TSI. TSI represents the transient stability coefficient, which reflects the transient stability of the system. The larger the TSI value, the more stable the system, and the smaller the calculated fitness value, indicating that the obtained solution is better.

[0106] In this embodiment, after the agent model is embedded in the power system transient stability preventive control model, the generation process of its transient stability preventive control strategy is as follows: Figure 2 The final transient stability prevention control effect is shown as Figure 3 As shown, Figure 3 (a) and (b) represent the 10s time domain simulation results of the generator power angle trajectory without and after the system takes control. It can be seen in the figure that (a) the power angle loses synchronization, and (b) the power angle recovers to synchronization after a short disturbance, indicating that the preventive control measures taken effectively maintain the stability of the system. In addition, the transient stability margin information obtained based on the surrogate model further optimizes the convergence effect of the genetic algorithm. Figure 4 As shown in the figure, (a) is the convergence effect directly through the iteration of the aforementioned preventive control model, and (b) is the effect of population iterative convergence after further using TSI information to impose penalties. By comparing the two, it can be clearly seen that using TSI information to impose penalties significantly improves the convergence efficiency of the genetic algorithm and can converge to the optimal solution faster.

[0107] In summary, it can be seen that the present invention can significantly improve the solution efficiency of the preventive control strategy, greatly reduce the calculation cost, and provide an efficient and accurate solution for the preventive control of the power system.

[0108] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A method for preventing and controlling transient stability of power systems based on an agent model, characterized in that: Here are the steps: S1. Obtain a convolutional neural network model trained by a training sample set obtained by transient stability simulation, wherein the convolutional neural network model takes system fault information, system steady-state operation information, and generator power angle trajectory change information after a fault as input, and takes the transient stability margin of the power system as output; S2. Using the convolutional neural network model as a proxy model for judging the transient stability of the power system, and constructing a power system transient stability prevention and control model based on the proxy model with the goal of minimizing the active control cost of the generator and with the system transient stability and power flow convergence as constraints, solving the power system transient stability prevention and control model using a genetic algorithm, iteratively optimizing the active output of each generator in the power system after adjustment, and generating a power system transient stability prevention and control strategy according to the optimal solution; The system fault information includes load level value, fault line, fault duration, fault location and fault type; the system steady-state operation information includes generator active power, generator reactive power, machine-end bus voltage amplitude, machine-end bus voltage phase angle, generator power angle, generator online status, machine-end line active load and machine-end line reactive load corresponding to each generator in the power system; the post-fault generator power angle trajectory change information is the trajectory change information of the generator power angle of each generator in the power system after the fault occurs; The convolutional neural network model consists of three feature extraction branches and a fully connected network. The system fault information, the system steady-state operation information, and the generator power angle trajectory change information after the fault are each extracted through a feature extraction branch. Each feature extraction branch is composed of alternating convolutional layers and pooling layers cascaded. The feature information extracted by the three feature extraction branches passes through the fully connected network and outputs the transient stability margin prediction value of the target power system; When solving the power system transient stability prevention control model by using a genetic algorithm, for any set of feasible solutions, it is necessary to determine whether it satisfies both system transient stability and power flow convergence constraints, wherein the system transient stability constraint is that the transient stability margin of the power system is greater than 0, and the power flow convergence constraint is composed of a node power balance equation constraint, a power source active output upper and lower limit constraint, a reactive source reactive output upper and lower limit constraint, a node voltage upper and lower limit constraint, and a line power flow constraint; When solving the power system transient stability prevention control model using a genetic algorithm, for any set of feasible solutions, the system fault information, system steady-state operation information, and post-fault generator power angle trajectory change information corresponding to this set of solutions need to be input into the proxy model to calculate the transient stability margin of the power system, and then determine whether this set of solutions meets the system transient stability constraints; When solving the transient stability preventive control model of the power system by using a genetic algorithm, the fitness value of each group of feasible solutions is calculated based on a fitness function, and the optimal solution is searched according to the fitness value of the feasible solution; the fitness function is obtained by summing the active power control cost of the generator, the power flow constraint penalty term and the transient stability penalty term, the power flow constraint penalty term is 0 when the power flow convergence constraint is met, and is a positive hyperparameter when it is not met, and the transient stability penalty term is a negative value of the transient stability margin.

2. The method for preventing and controlling transient stability of power systems based on an agent model according to claim 1, characterized in that: The method for constructing the training sample set is as follows: for the target power system, the initial operating point of the target power system under different load levels is determined based on Latin hypercube sampling, transient stability simulation is performed in combination with different system fault information, and the transient stability margin of the power system is calculated according to the simulation results, thereby generating simulation data samples consisting of system fault information, system steady-state operation information, generator power angle trajectory change information after the fault, and transient stability margin, and each simulation data sample is processed to form a training sample set that meets the input of the neural network model.

3. The method for preventing and controlling transient stability of power systems based on agent model according to claim 2, characterized in that: The transient stability margin is based on the maximum power angle difference Δ between all generators. max The conversion formula is 100*(360-Δ max ) / (360+Δ max ); The value range of transient stability margin is -100 to 100. A transient stability margin of 0 indicates that the power system is in a critical stability state.

4. The method for preventing and controlling transient stability of power systems based on agent model according to claim 1, characterized in that: The generator active power control cost is the sum of the control costs of all generators in the power system. The control cost of each generator is calculated by the active power output regulation of the generator through the consumption characteristic curve.

5. The method for preventing and controlling transient stability of power systems based on agent model according to claim 3, characterized in that: In the proxy model, the post-fault generator power angle trajectory change information is the trajectory change information of the generator power angle 1 second after the fault occurs, and the maximum power angle difference is the maximum power angle difference between all generators within 10 seconds after the start of the simulation.