Power system AC optimal power flow calculation method, system, equipment and storage medium
By introducing the KKT condition of the best AC current in the neural network model, the dependence of training data is reduced, the accuracy and efficiency of the calculation of the best AC current in the power system are improved, and the problem of insufficient calculation accuracy of machine learning methods in the power system is solved.
Patent Information
- Application Number
- CN202111606040.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-25
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-12-25
AI Technical Summary
The existing machine learning methods have high requirements for the quantity and quality of training data when calculating the optimal trend of communication, and lack the support of mathematical formulas of universality and rigor, which leads to insufficient calculation accuracy under complex and variable operating conditions of the actual system, hindering its promotion and application in the power system.
The physical information neural network model is adopted to introduce the KKT condition of the communication optimal current into the loss function of the neural network model. The load distribution data of the power system is obtained through pre-training, and the loss function containing the KKT condition is constructed, which reduces the dependence on the training data samples and improves prediction accuracy.
It effectively reduces the quantity and quality dependence of training data samples, improves the accuracy and calculation efficiency of the best AC current prediction, and adapts to the complex and variable working conditions of the power system.
Smart Images

Figure CN114421481B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power system automation and relates to a power system AC optimal power flow calculation method, system, equipment and storage medium. Background Art
[0002] In the calculation of optimal power flow (OPF), the exact formula for the alternating current-optimal power flow (AC-OPF) equation is nonlinear and nonconvex, making it a typical nonlinear optimization problem. The complexity of the constraints makes the calculation complex and challenging. Although many methods have been proposed and applied in some cases, many challenges remain before large-scale practical application. In particular, with the increasing penetration of renewable energy, the increasing complexity of power grids, the increasing flexibility and variability of source-load resources, and the emergence of electricity markets, OPFs must develop towards large-scale systems, real-time control, and online computing, requiring faster computational speeds, better convergence, and greater robustness.
[0003] Currently, there is a resurgence in the use of machine learning methods to calculate AC-OPF. Compared with traditional methods, machine learning methods can increase the calculation speed of AC-OPF by 100-1000 times. However, these machine learning algorithms have high requirements for the quantity and quality of training data. In order to train the neural network with high accuracy, it is often necessary to cover a large number of OPF results of normal and abnormal operating points, but such data sets are usually difficult to generate or do not exist. Moreover, in application, although the trained neural network can obtain good prediction results in a small sample validation set, it lacks universal and rigorous mathematical formulas to support it. How to ensure its calculation accuracy under the complex and changing working conditions of the actual system is an issue that must be considered. These problems will lead to significant obstacles to its promotion and application in actual production. Summary of the Invention
[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, system, device and storage medium for calculating AC optimal power flow in a power system.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect of the present invention, a method for calculating an AC optimal power flow in a power system includes:
[0007] Obtain load distribution data of the power system;
[0008] Input the load distribution data of the power system into the preset physical information neural network model to obtain the AC optimal power flow distribution data of the power system;
[0009] Among them, the physical information neural network model is obtained by introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model and then pre-training the AC optimal power flow prediction.
[0010] Optionally, also include:
[0011] According to the preset AC optimal power flow model, the KKT condition of the AC optimal power flow is obtained;
[0012] Introducing the KKT condition of AC optimal power flow into the loss function of the preset neural network model;
[0013] Acquire training data samples; wherein the training data samples include load distribution data of the power system and pre-calculated AC optimal power flow distribution data reference values of the power system;
[0014] The load distribution data of the power system is used as the input of the neural network model, the AC optimal power flow distribution data of the power system is used as the output of the neural network model, and the neural network model is trained through training data samples to obtain a physical information neural network model.
[0015] Optionally, also include:
[0016] An AC optimal power flow model is constructed with the minimization of power generation cost as the objective function and the power network constraints, power flow equation constraints, active power generation constraints, reactive power generation constraints, voltage constraints and line current constraints of the power system as constraints.
[0017] Optionally, the neural network model includes an input layer, an output side and three hidden layers, and the three hidden layers are used to predict the AC optimal power flow distribution data, voltage distribution data and dual variable distribution data of the power system respectively; the loss function of the preset neural network model is constructed to minimize the prediction error of the AC optimal power flow distribution data, voltage distribution data and dual variable distribution data of the power system.
[0018] Optionally, the specific method of introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model is:
[0019] According to the KKT condition of AC optimal power flow, the difference expression of KKT condition is obtained, and according to the difference expression of KKT condition, the difference of KKT condition is obtained;
[0020] The loss function of the preset neural network model is reconstructed by minimizing the difference between the prediction error of the AC optimal power flow distribution data, the voltage distribution data prediction error, the dual variable distribution data prediction error and the KKT condition of the power system.
[0021] Optionally, when training the neural network model using training data samples, a back propagation algorithm is used to correct the model weights and model bias of the neural network model.
[0022] A second aspect of the present invention provides a power system AC optimal power flow calculation system, comprising:
[0023] A data acquisition module, used to obtain load distribution data of the power system;
[0024] The power flow calculation module is used to input the load distribution data of the power system into the preset physical information neural network model to obtain the AC optimal power flow distribution data of the power system;
[0025] Among them, the physical information neural network model is obtained by introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model and then pre-training the AC optimal power flow prediction.
[0026] Optionally, it also includes a model construction module, which is used to obtain the KKT condition of the AC optimal power flow based on a preset AC optimal power flow model; introduce the KKT condition of the AC optimal power flow into the loss function of a preset neural network model; obtain training data samples; wherein the training data samples include the load distribution data of the power system and the pre-calculated reference value of the AC optimal power flow distribution data of the power system; use the load distribution data of the power system as the input of the neural network model, use the AC optimal power flow distribution data of the power system as the output of the neural network model, train the neural network model through the training data samples, and obtain a physical information neural network model.
[0027] A third aspect of the present invention is a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for calculating the AC optimal power flow of an electric power system when executing the computer program.
[0028] A fourth aspect of the present invention is a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned method for calculating the AC optimal power flow of an electric power system.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] The method for calculating the AC optimal power flow of an electric power system of the present invention inputs the acquired load distribution data of the electric power system into a preset physical information neural network model, predicts the AC optimal power flow distribution data of the electric power system through the preset physical information neural network model, and realizes efficient calculation of the AC optimal power flow distribution data of the electric power system through a machine learning method. At the same time, the physical information neural network model is obtained by introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model, and then undergoing AC optimal power flow prediction pre-training. The physical equation is successfully introduced into the neural network model in the form of the KKT condition of the AC optimal power flow, thereby effectively reducing its dependence on the quantity and quality of the training data samples, and effectively reducing the difficulty and time of training. Moreover, it can determine its optimal parameters based on the actual physical equation to be simulated, greatly improving the accuracy of the AC optimal power flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is a flow chart of the method for calculating the AC optimal power flow in a power system according to the present invention;
[0032] Figure 2 Schematic diagram of the traditional neural network model structure of the present invention;
[0033] Figure 3 Schematic diagram of the neural network model structure of the present invention;
[0034] Figure 4 This is a structural block diagram of the power system AC optimal power flow calculation system of the present invention. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0036] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] The present invention is described in further detail below with reference to the accompanying drawings:
[0038] See also Figure 1 In one embodiment of the present invention, a method for calculating AC optimal power flow in a power system is provided, which realizes AC optimal power flow calculation based on a physical information neural network model. It is a method for calculating AC-OPF (AC optimal power flow) based on a machine learning method.
[0039] Specifically, the power system AC optimal power flow calculation method includes the following steps:
[0040] S1: Obtain load distribution data of the power system.
[0041] Specifically, the load distribution data of the power system includes active load data and reactive load data of each node in the power system, which can be obtained through the load forecasting system of the power system.
[0042] S2: Input the load distribution data of the power system into a preset physical information neural network model to obtain the AC optimal power flow distribution data of the power system; wherein, the physical information neural network model is obtained by pre-training the AC optimal power flow prediction after introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model.
[0043] Specifically, based on a preset physical information neural network model, the load distribution data of the power system is input into it, and the physical information neural network model is used to predict the AC optimal power flow distribution data of the power system. The AC optimal power flow distribution data of the power system includes the active power generation data and reactive power generation data of each node in the power system. Based on the AC optimal power flow distribution data of the power system, the operation of the generators at each node in the power system can be guided to achieve the AC optimal power flow solution goal of the entire power system, such as minimizing the power generation cost of the entire power system.
[0044] At the same time, the preset physical information neural network model is obtained by introducing the KKT conditions of the AC optimal power flow into the loss function of the preset neural network model. That is, after embedding physical information into the preset neural network model, it is then pre-trained for AC optimal power flow prediction. This approach reduces the dependence of the neural network model on the quantity and quality of training data samples during AC optimal power flow prediction pre-training, effectively reducing the required number of training data samples, the difficulty of obtaining them, and the time required to obtain them. Moreover, the optimal parameters can be determined based on the actual physical equations to be simulated, greatly improving the accuracy of the prediction.
[0045] In summary, the method for calculating the AC optimal power flow of an electric power system of the present invention inputs the acquired load distribution data of the electric power system into a preset physical information neural network model, predicts the AC optimal power flow distribution data of the electric power system through the preset physical information neural network model, and realizes efficient calculation of the AC optimal power flow distribution data of the electric power system through a machine learning method. At the same time, the physical information neural network model is obtained by pre-training the AC optimal power flow prediction after introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model. The physical equation is successfully introduced into the neural network model in the form of the KKT condition of the AC optimal power flow, thereby effectively reducing its dependence on the quantity and quality of the training data samples, and effectively reducing the difficulty and time of training. Moreover, it can determine its optimal parameters according to the actual physical equation to be simulated, which greatly improves the accuracy of the AC optimal power flow prediction.
[0046] In one possible implementation, the method for calculating AC optimal power flow in a power system according to an embodiment of the present invention further includes the following steps:
[0047] S0: According to a preset AC optimal power flow model, the KKT condition of the AC optimal power flow is obtained; the KKT condition of the AC optimal power flow is introduced into the loss function of the preset neural network model; a training data sample is obtained; wherein the training data sample includes the load distribution data of the power system and the pre-calculated reference value of the AC optimal power flow distribution data of the power system; the load distribution data of the power system is used as the input of the neural network model, and the AC optimal power flow distribution data of the power system is used as the output of the neural network model, and the neural network model is trained through the training data samples to obtain a physical information neural network model.
[0048] Optionally, before obtaining the KKT conditions for the AC optimal power flow based on the preset AC optimal power flow model, a process of constructing the AC optimal power flow model may be performed. In this embodiment, the AC optimal power flow model is constructed with minimizing the power generation cost as the objective function and with the power network constraints, power flow equation constraints, active power generation constraints, reactive power generation constraints, voltage constraints, and line current constraints of the power system as constraints.
[0049] Specifically, the AC-OPF problem of minimizing power generation cost is a quadratic programming problem with quadratic constraints. Assume that the system has N b Busbars, N g generators and N d load, the objective function of minimizing power generation cost can be written as shown in formula (1):
[0050]
[0051] Among them, the vector and They refer to active power generation P g and reactive power generation Q g The optimal power generation depends on the active and reactive loads (denoted by P and d and Q d Power network constraints: For a given demand, at each node n∈N b The active and reactive injection amounts can be expressed using equations (2) and (3):
[0052]
[0053]
[0054] Among them, p n and q n denote the active power and reactive power injected at node n, respectively. and They refer to the active power generation, reactive power generation, active load and reactive load at node n respectively. The power flow equation constraints of the power system can be expressed as Equations (4) and (5):
[0055]
[0056]
[0057] Among them, the real part and imaginary part of the voltage at bus n are respectively and The conductance and susceptance of line nk are represented by G nk and B nk If the real and imaginary parts of the voltage are combined into a shape of 2N b ×1 vector V=[(V r ) T ,(V i ) T ] T , then the power flow equation constraints can be simplified to equations (6) and (7):
[0058]
[0059]
[0060] in, Among them, e n It is of shape 2N b ×1 unit vector, which is 1 at position n and 0 at all other positions; Y is the node admittance matrix, Y conj is the conjugate matrix of Y.
[0061] In addition to the power flow equation, the optimal power generation must also satisfy the active power generation constraint of formula (8) and the reactive power generation constraint of formula (9):
[0062]
[0063]
[0064] in, are the upper and lower limits of the generator active power, are the upper and lower limits of the generator reactive power respectively.
[0065] Similarly, the voltage constraint and line current constraint of the power system can be expressed using the inequalities of Equations (10) and (11):
[0066]
[0067]
[0068] in, where y mn is the admittance of branch mn, and v n are the squares of the upper and lower voltage limits, l mn is the square of the line current amplitude, It is the square of the upper limit amplitude of the line current.
[0069] Assume that the relaxed busbar N sb As the reference angle of voltage, we can get formula (12):
[0070]
[0071] in,
[0072] The objective function and constraints of the AC-OPF problem are simplified to Equations (13a), (13b), and (13c), completing the construction of the AC optimal power flow model:
[0073]
[0074]
[0075] v T M m v≤f m ,m=1:M (13c)
[0076] in, c T is the combined linear cost term of active and reactive power generation. Equations (6)-(7) and (12) can be expressed by 2N in Equation (13b) b +1 equation shows that L l The M matrix representing the lth equality constraint, Equations (8)-(11) can be expressed by the 4N equation (13c) g +2N b +N l The inequality shows that M m M matrix representing the mth inequality constraint, Represent the coefficient matrix, f m represents the upper or lower bound of the mth inequality.
[0077] Wherein, in the step S0, according to the preset AC optimal power flow model, the specific position of the KKT condition of the AC optimal power flow is obtained as follows:
[0078] First, the Lagrangian function L of the AC-OPF problem can be expressed as formula (14):
[0079]
[0080] Where x = {G, v}.
[0081] Therefore, the KKT conditions of AC-OPF can be expressed using Equations (15) to (18):
[0082]
[0083]
[0084] μ m (v T M m vf m )=0 (17)
[0085] μ m ≥0 (18)
[0086] Among them, Equations (15) and (16) are stationarity conditions, Equation (17) is the complementary relaxation condition, and Equation (18) is the dual feasibility condition. For the AC-OPF problem, these KKT conditions are necessary conditions for the existence of an optimal solution.
[0087] In step S0, the neural network model includes an input layer, an output side and three hidden layers, and the three hidden layers are used to predict the AC optimal power flow distribution data, voltage distribution data and dual variable distribution data of the power system respectively; the loss function of the preset neural network model is constructed to minimize the prediction error of the AC optimal power flow distribution data, voltage distribution data and dual variable distribution data of the power system.
[0088] For details, see Figure 2 , the traditional neural network model (NN) is a set of interconnected nodes that connect the input and output layers. The nodes connecting the input and output layers will be divided into K hidden layers, and there are N hidden layers in k. k Each layer of neurons has a weight w and a bias b associated with it. In addition, each neuron in the traditional neural network model has a nonlinear activation function connected to it.
[0089] The output of each layer in NN can be expressed as formula (19):
[0090] Z k+1 =π(w k+1 Z k +b k+1 ) (19)
[0091] Among them, Z k+1 is the output of the k+1th layer, w k+1 and b k+1 are the weights and biases connecting the k layer and the k+1 layer respectively. π is a nonlinear activation function. ReLU can be selected as the linear activation function. If the input is an integer, the ReLU activation function will output the input. If the input is a negative number or zero, it will output zero.
[0092] The ReLU activation function can be expressed using (20) and (21):
[0093]
[0094]
[0095] In this embodiment, see Figure 3, the traditional neural network model is improved. The neural network model in this embodiment includes an input layer, an output side and three hidden layers. The three hidden layers are used to predict the AC optimal power flow distribution data, voltage distribution data and dual variable distribution data of the power system respectively. It can be understood that three independent hidden layers are set in the traditional neural network. Then, the loss function is constructed to minimize the prediction error of the AC optimal power flow distribution data, the voltage distribution data and the dual variable distribution data of the power system.
[0096] Among them, in step S0, the specific method of introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model is: according to the KKT condition of the AC optimal power flow, a difference expression of the KKT condition is obtained, and according to the difference expression of the KKT condition, the difference of the KKT condition is obtained; in order to minimize the prediction error of the AC optimal power flow distribution data, the voltage distribution data prediction error, the dual variable distribution data prediction error and the difference of the KKT condition of the power system, the loss function of the preset neural network model is reconstructed.
[0097] In addition to comparing the predicted values of the neural network model with the reference values of the AC optimal power flow distribution data of the training data samples, the physical equation that controls the problem, namely the KKT condition of the AC optimal power flow, will also be used for verification during training. Specifically, since the AC optimal power flow should satisfy the KKT conditions of equations (15)-(18), the difference form of the KKT conditions ε, as shown in equations (22a)-(22d), is added to the loss function of the neural network model, as shown in equation (23). During the training process, the weights w and bias b are continuously corrected to make the mean absolute error MAE g , MAE v , MAE l and MAE ε minimize.
[0098] The difference expression of KKT condition is as follows:
[0099]
[0100]
[0101]
[0102]
[0103] in, is the voltage value predicted by the hidden layer V, and is the dual variable predicted by the hidden layer Lm, and the absolute value of the stationary condition error is expressed as ε stat The error of the complementary relaxation condition is expressed as εcomp To represent, use π to represent the activation function. In this embodiment, the activation function used is ReLU, which is used to measure the dual feasible domain crossing. If the predicted value of the neural network model is the optimal value, then these errors will be zero.
[0104] Because the KKT condition is used to measure the accuracy of the neural network model's predictions, configuration samples can be added to the training data samples. As with NN training, the configuration samples are a set of random input values from the input domain. However, unlike NN training, no time and resources are required to determine the optimal power generation power, voltage set point, or reference value of the dual variable before training. Instead, the error factors given in Equations (22a)-(22d) are used to measure the prediction accuracy of the neural network model and train it.
[0105] The loss function shown in formula (23) is used to correct the parameters of the neural network model:
[0106]
[0107] Among them, N t is the number of training data samples, N c is the number of configuration samples, and the mean absolute error between the predicted active and reactive power generation data and the reference value is expressed as MAE g Indicates that MAE v and MAE l Represents the mean absolute error (MAE) between the predicted values of voltage and dual variables and the reference values ε is the average absolute value of the KKT violation given in (22a)-(23d), Λ P , Λ V , Λ L and Λ ε is the weight of each loss amount. The performance of the final physical information neural network model depends largely on these weights. Therefore, they must be selected appropriately to reduce the average error or the maximum constraint violation. Since the three hidden layers are independent of each other, each hidden layer will minimize the corresponding MAE and MAE ε For the configuration sample, the AC optimal power flow reference value of AC-OPF is not calculated in advance. Since the AC optimal power flow reference value G, voltage reference value v and dual variable reference value Lm of the configuration sample are not calculated, MAE g 、MAE v and MAE l If it is 0, only MAE is considered in training ε .
[0108] Optionally, when training the neural network model using training data samples, a back propagation algorithm may be used to correct the model weights and model bias of the neural network model.
[0109] In another embodiment of the present invention, IEEE14 and IEEE39 node networks are selected as examples to illustrate the specific process and effect of the power system AC optimal power flow calculation method according to the embodiment of the present invention:
[0110] Specifically, the network structure of the power system is shown in Table 1 below, where N l Indicates the number of branches. The parameters of the power system are all derived from the MATPOWER case library.
[0111] Table 1 Network structure of power system
[0112]
[0113] In the test system, the active and reactive power of each node are independent of each other, and the load variation range of each node is [0.6D max ,D max ], D max is the maximum active and reactive load of the node. 10,000 sets of random active and reactive load input values are generated using Latin Hypercube sampling. 50% of them are used as configuration data without calculating the optimal operating point of the generator, 20% are used as training data, and the remaining 30% are used as test data.
[0114] MATPOWER is used to calculate the output quantities corresponding to the input data in the training and test sets—the reference values of the optimal active and reactive power generation and voltage set points. The KKT conditions given in equations (15)–(18) are then used to obtain the reference values of the dual variables.
[0115] See Table 2, which shows the structure of the neural network model.
[0116] Table 2 Neural network model structure
[0117]
[0118] In this embodiment, TensorFlow and Python are used to train the neural network model. During training, the number of training times is set to 1000 and the number of batches of training data is set to 200. To test the performance of the physical information neural network model, the present invention defines the following indicators:
[0119]
[0120]
[0121]
[0122]
[0123] Among them, MAE T is the average absolute error percentage between the predicted value and the reference value of the optimal operating power of the generator in the test set, N T is the number of test data samples, G max is the upper limit of the generator operating power, G min is the lower limit of the generator operating power, The predicted average operating power of the generator exceeds the limit. is the average percentage difference between the predicted optimal operating cost of the generator and the reference optimal operating cost, is the average percentage distance between the network's predicted values and the reference optimal value.
[0124] Table 3 Comparison of calculation results between traditional neural network model and physical information neural network model
[0125]
[0126] Referring to Table 3, which shows the calculation results of the traditional neural network model and the physical information neural network model, it can be seen that compared with the prediction results of the traditional neural network, the physical information neural network model can reduce the average absolute prediction error by 20% to 30%, and also has considerable improvements in average constraint violation, average difference in optimal operating cost and distance from the optimal operating point. This shows that the present invention can achieve higher prediction accuracy using the physical information neural network model with the same or less data.
[0127] The proposed method for calculating AC optimal power flow in a power system first derives the KKT condition for the AC optimal power flow problem, a necessary condition for the existence of an optimal solution. A neural network model for solving the AC optimal power flow problem is then designed. Based on this neural network model, the KKT condition is introduced into the neural network model's loss function, forming a physical information neural network model. In tests on an IEEE 14,39-node network, the proposed method demonstrates that, compared to traditional neural network models, the proposed method achieves a 20%-30% improvement in calculation accuracy, even with less than 30% of training data.
[0128] The following are device embodiments of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the device embodiments, please refer to the method embodiments of the present invention.
[0129] See also Figure 4In another embodiment of the present invention, a power system AC optimal power flow calculation system is provided, which can be used to implement the above-mentioned power system AC optimal power flow calculation method. Specifically, the power system AC optimal power flow calculation system includes a data acquisition module and a power flow calculation module. The data acquisition module is used to obtain load distribution data of the power system; the power flow calculation module is used to input the load distribution data of the power system into a preset physical information neural network model to obtain the AC optimal power flow distribution data of the power system; the physical information neural network model is obtained by introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model, and then undergoing AC optimal power flow prediction pre-training.
[0130] In one possible embodiment, the power system AC optimal power flow calculation system also includes a model construction module, which is used to obtain the KKT condition of the AC optimal power flow based on a preset AC optimal power flow model; introduce the KKT condition of the AC optimal power flow into the loss function of a preset neural network model; obtain training data samples; wherein the training data samples include the load distribution data of the power system and the pre-calculated reference value of the AC optimal power flow distribution data of the power system; use the load distribution data of the power system as the input of the neural network model, and use the AC optimal power flow distribution data of the power system as the output of the neural network model, train the neural network model through the training data samples, and obtain a physical information neural network model.
[0131] All relevant contents of each step involved in the embodiment of the aforementioned power system AC optimal power flow calculation method can be referred to the functional description of the functional module corresponding to the power system AC optimal power flow calculation system in the embodiment of the present invention, and will not be repeated here. The division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, the functional modules in various embodiments of the present invention can be integrated into one processor, or they can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules.
[0132] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the power system AC optimal power flow calculation method.
[0133] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the power system AC optimal power flow calculation method in the above embodiment.
[0134] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0135] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0136] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A method for calculating AC optimal power flow in a power system, characterized in that: include: Obtain load distribution data of the power system; Input the load distribution data of the power system into the preset physical information neural network model to obtain the AC optimal power flow distribution data of the power system; Among them, the physical information neural network model is obtained by introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model and then pre-training the AC optimal power flow prediction; Also includes: According to the preset AC optimal power flow model, the KKT condition of the AC optimal power flow is obtained; Introducing the KKT condition of AC optimal power flow into the loss function of the preset neural network model; Acquire training data samples; wherein the training data samples include load distribution data of the power system and pre-calculated AC optimal power flow distribution data reference values of the power system; The load distribution data of the power system is used as the input of the neural network model, the AC optimal power flow distribution data of the power system is used as the output of the neural network model, and the neural network model is trained with training data samples to obtain a physical information neural network model; The specific method of introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model is: According to the KKT condition of AC optimal power flow, the difference expression of KKT condition is obtained, and according to the difference expression of KKT condition, the difference of KKT condition is obtained; The loss function of the preset neural network model is reconstructed by minimizing the difference between the prediction error of the AC optimal power flow distribution data, the voltage distribution data prediction error, the dual variable distribution data prediction error and the KKT condition of the power system.
2. The method for calculating AC optimal power flow in a power system according to claim 1, wherein: Also includes: An AC optimal power flow model is constructed with the minimization of power generation cost as the objective function and the power network constraints, power flow equation constraints, active power generation constraints, reactive power generation constraints, voltage constraints and line current constraints of the power system as constraints.
3. The method for calculating AC optimal power flow in a power system according to claim 1, wherein: The neural network model includes an input layer, an output side and three hidden layers, and the three hidden layers are used to predict the AC optimal power flow distribution data, voltage distribution data and dual variable distribution data of the power system respectively; the loss function of the preset neural network model is constructed to minimize the prediction error of the AC optimal power flow distribution data, voltage distribution data and dual variable distribution data of the power system.
4. The method for calculating AC optimal power flow in a power system according to claim 1, wherein: When the neural network model is trained using the training data samples, a back propagation algorithm is used to correct the model weights and model bias of the neural network model.
5. A power system AC optimal power flow calculation system, characterized in that: include: A data acquisition module, used to obtain load distribution data of the power system; The power flow calculation module is used to input the load distribution data of the power system into the preset physical information neural network model to obtain the AC optimal power flow distribution data of the power system; Among them, the physical information neural network model is obtained by introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model and then pre-training the AC optimal power flow prediction; The system further includes a model building module for obtaining a KKT condition of an AC optimal power flow based on a preset AC optimal power flow model; introducing the KKT condition of the AC optimal power flow into a loss function of a preset neural network model; obtaining training data samples; wherein the training data samples include load distribution data of the power system and a pre-calculated reference value of AC optimal power flow distribution data of the power system; using the load distribution data of the power system as input to the neural network model and using the AC optimal power flow distribution data of the power system as output of the neural network model, training the neural network model using the training data samples to obtain a physical information neural network model; The specific method of introducing the KKT condition of the AC optimal power flow into the loss function of the preset neural network model is: According to the KKT condition of AC optimal power flow, the difference expression of KKT condition is obtained, and according to the difference expression of KKT condition, the difference of KKT condition is obtained; The loss function of the preset neural network model is reconstructed by minimizing the difference between the prediction error of the AC optimal power flow distribution data, the voltage distribution data prediction error, the dual variable distribution data prediction error and the KKT condition of the power system.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for calculating the AC optimal power flow of a power system according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for calculating AC optimal power flow in a power system according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Probabilistic power flow depth learning method based on physical model
CN109995031A