Power system load flow calculation method based on virtual graph intelligent learning
By introducing a virtual graph constraint message passing neural network into the power system power flow calculation and embedding the mathematical constraints of the power flow equation, the problem of the gap between the prediction results and the physical constraints, transparency and lack of adaptability of the deep learning method in the power system power flow calculation is solved. It achieves higher physical consistency and interpretability, and is suitable for power system analysis and dispatch decision-making.
Patent Information
- Application Number
- CN202411082203.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-08-08
AI Technical Summary
Existing deep learning methods have problems such as gaps between prediction results and physical constraints, lack of transparency in the decision-making process, and poor adaptability in power system power flow calculations. It is difficult to meet the needs of strict compliance with physical constraints, high transparency, and strong adaptability.
A virtual graph is used to constrain the message passing neural network, and the mathematical constraints of the power flow equation are embedded in the neural network feedforward process. Through virtual graph construction and unsupervised learning, the physical consistency and interpretability of the calculation results are ensured.
It improves the model's adaptability to changes in power grid topology, ensures the physical consistency of calculation results, enhances model transparency and environmental adaptability, and guides power system analysis and dispatch decisions.
Smart Images

Figure CN118780319A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system flow calculation, and in particular to a power system flow calculation method based on virtual graph intelligent learning. Background Art
[0002] With the penetration of large-scale, real-time distributed energy resources in power systems, traditional power flow (PF) calculation methods (such as Newton-Raphson method and Gauss-Seidel method) face huge computational burdens and are difficult to meet the needs of online security assessment. In recent years, deep learning (DL) technology has become an effective tool to improve the efficiency and accuracy of power flow calculation due to its powerful nonlinear approximation ability and fast feedforward characteristics.
[0003] However, in practical applications, existing deep learning methods face some challenges. First, traditional learning methods mainly focus on minimizing the statistical error between the predicted value and the label value when optimizing the model, which may lead to a certain gap between the model's prediction results and the actual physical constraints of the power system. In addition, deep learning models are usually regarded as "black boxes" and their decision-making process lacks transparency, which limits their application in critical analysis. Finally, the training of neural network models is usually carried out in a specific environment. When the power grid topology changes or encounters new operating conditions, the model has poor adaptability and it is difficult to provide accurate prediction results. These shortcomings limit the widespread application of existing deep learning methods in power system analysis and decision-making that require strict compliance with physical constraints, high transparency and strong adaptability. Summary of the invention
[0004] In view of the above problems, the present invention aims to provide a method for calculating power system flow based on virtual graph intelligent learning.
[0005] The technical solution of the present invention is as follows:
[0006] A method for calculating power system flow based on virtual graph intelligent learning includes the following steps:
[0007] S1: Use variable V sin 、V squ and V cos Respectively represent the quadratic sine term, the quadratic term and the quadratic cosine term of the voltage, and establish a power flow calculation formula considering the voltage based on the variables;
[0008] S2: solving the power flow calculation formula considering voltage to obtain a general solution form of the power flow calculation formula considering voltage;
[0009] S3: Constructing a virtual graph-constrained message passing neural network;
[0010] S4: Prepare free variables w and specific solution parameters b, and formulate free variables Then, the general solution of the power flow calculation formula considering voltage is used to calculate
[0011] S5: Standardize the data to obtain
[0012] S6: Using the virtual graph constrained message passing neural network to Train to gain
[0013] If the If the physical loss function of the virtual graph constraint message passing neural network is not satisfied, then Denormalize and repeat steps S4-S6;
[0014] If the Satisfying the physical loss function of the virtual graph constraint message passing neural network, then Perform denormalization and proceed to step S7;
[0015] S7: Calculate the denormalized data using the general solution of the power flow calculation formula considering voltage to obtain
[0016] S8: Using the activation function of the virtual graph constrained message passing neural network to Processing to obtain the power flow calculation results
[0017] Preferably, in step S1, the power flow calculation formula considering voltage includes an underdetermined linear equation group and numerical nonlinear constraints, and the underdetermined linear equation group is:
[0018]
[0019]
[0020]
[0021] G Λ =diag(G), BΛ=-diag(B) (4)
[0022] Where: P = (P i ) n×1 ,Q=(Q i ) n×1 , respectively represent the injection matrix of node real-time active power and reactive power; P i is the real-time active power of node i; Q iis the real-time reactive power of node i; n is the total number of nodes; B p ,G Λ ,G p ,G Q ,B Λ ,B Q All are based on the traditional association matrix A=(A ik ) n×m The obtained segmentation matrix; A ik is an element of the traditional correlation matrix; m is the total number of lines; B ij is the imaginary part of the line admittance; G ij is the real part of the line admittance; e(i,j) is the line with i and j as the starting and ending nodes; e k is the kth line; E is the set of line components; G is the real part of the line node admittance matrix; B is the imaginary part of the line node admittance matrix;
[0023] The numerical nonlinear constraints are:
[0024]
[0025]
[0026] Where: V i is the voltage of node i; V j is the voltage at node j; θ ij is the phase angle difference between the voltages at node i and node j; N is the set of nodes.
[0027] Preferably, in step S2, the general solution form of the power flow calculation formula considering voltage is:
[0028]
[0029] Where: is a free variable A specific solution; w 1,1 is the element in the first row and first column of the free variable w matrix; w 1,2m+n is the element in the first row and 2m+n column of the free variable w matrix; b1 is the element in the first row of the specific solution parameter b matrix; b 2m+n is the element of the 2m+nth row of the particular solution parameter b matrix;
[0030] Since the numerical nonlinear constraint satisfies the triangle replacement constraint, at this time, the numerical nonlinear constraint is expressed by the following formula:
[0031]
[0032] Where: C1, C2, C3, C4 are linear transformation matrices related to line identifiers; · is the element-wise product operator.
[0033] Preferably, the linear transformation matrices related to the line identifier are:
[0034]
[0035]
[0036]
[0037] C1=[0 m×n 0 m×n I m×n ],C2=[I m×n 0 m×n 0 m×n ] (12)
[0038] C3=[0 m×n (I k,i ) m×n 0 m×n ],C4=[0 m×n (I k,j ) m×n 0 m×n ] (13)
[0039] Where: I m×n represents the m×n dimensional identity matrix, I k,i and I k,j are binary variables. When node i is the starting node of line k, I k,i =1, otherwise I k,i =0; Similarly, when node j is the end node of line k, I k,j =1, otherwise I k,j =0.
[0040] Preferably, in step S3, when constructing the virtual graph constrained message passing neural network, the virtual graph is defined by the following formula:
[0041]
[0042]
[0043] Where: X, W r They are virtual graphs G r =(N r ,E r )’s node features and edge features; N r is the node set in the virtual graph; E r is the edge set in the virtual graph; x u is the feature vector of virtual node u; is a virtual node; u and v are both node identifiers, indicating a node in the virtual graph; w u,v is the connection weight from node u to node v in the virtual graph; w is a free variable;
[0044] At each layer of the virtual graph, node information is aggregated and updated by the following formula:
[0045]
[0046]
[0047] Where: is the message passing value of node v at time t+1; is the eigenvalue of node u at time t; is the connection weight from node u to node v at time t in the virtual graph; b v is the bias vector used to adjust the eigenvalue of node v; is the eigenvalue of node v at time t+1;
[0048] The activation function used in the output layer of the virtual graph constrained message passing neural network is:
[0049]
[0050] Where: t-ReLU is the truncated ReLU activation function; x is the voltage;
[0051] The virtual graph constrained message passing neural network adopts unsupervised learning and uses the following formula as the physical loss function:
[0052] L=MAPE(C1(X·X)+C2(X·X),(C3X)·(C4X)) (19)
[0053] Where: L is the physical loss function.
[0054] The beneficial effects of the present invention are:
[0055] The present invention directly embeds the mathematical constraints of the power flow equation into the feedforward process of the neural network by introducing a virtual graph constraint information transfer neural network, thereby ensuring the physical consistency and interpretability of the calculation results and improving the model's adaptability to changes in power grid topology. The present invention is an intelligent power flow calculation method that can ensure the physical consistency of the calculation results, improve the model's transparency, and enhance environmental adaptability, thereby better guiding power system analysis and scheduling decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0057] Figure 1 Schematic diagram of the architecture of the virtual graph constrained message passing neural network of the present invention. DETAILED DESCRIPTION
[0058] The present invention is further described below in conjunction with the accompanying drawings and embodiments. It should be noted that, in the absence of conflict, the embodiments in this application and the technical features in the embodiments can be combined with each other. It should be noted that, unless otherwise specified, all technical and scientific terms used in this application have the same meanings as those generally understood by those of ordinary skill in the art to which this application belongs. The words "including" or "comprising" and the like used in the disclosure of the present invention mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0059] like Figure 1 As shown, the present invention provides a method for calculating power system flow based on virtual graph intelligent learning, comprising the following steps:
[0060] S1: Use variable V sin 、V squ and V cos The quadratic sine term, the quadratic term and the quadratic cosine term of the voltage are respectively represented, and a power flow calculation formula considering the voltage is established based on the variables.
[0061] In a specific embodiment, the power flow calculation formula considering voltage includes an underdetermined linear equation group and a numerical nonlinear constraint, and the underdetermined linear equation group is:
[0062]
[0063]
[0064]
[0065] G Λ =diag(G),B Λ =-diag(B) (4)
[0066] Where: P = (P i ) n×1 ,Q=(Q i ) n×1, respectively represent the injection matrix of node real-time active power and reactive power; P i is the real-time active power of node i; Q i is the real-time reactive power of node i; n is the total number of nodes; B p ,G Λ ,G p ,G Q ,B Λ ,B Q All are based on the traditional association matrix A=(A ik ) n×m The obtained segmentation matrix; A ik is an element of the traditional incidence matrix (if A ik =1, it means that branch k starts from node i; if A ik = -1, it means that branch k ends at node i; if A ik = 0, it means that branch k has no direct connection with node i); m is the total number of lines; B ij is the imaginary part of the line admittance; G ij is the real part of the line admittance; e(i,j) is the line with i and j as the starting and ending nodes; e k is the kth line; E is the set of line components; G is the real part of the line node admittance matrix; B is the imaginary part of the line node admittance matrix;
[0067] The numerical nonlinear constraints are:
[0068]
[0069]
[0070] Where: V i is the voltage of node i; V j is the voltage at node j; θ ij is the phase angle difference between the voltages at node i and node j; N is the set of nodes.
[0071] In the above embodiment, the present invention takes into account that the nonlinear factors of power flow calculation come from the quadratic term of voltage, so the power flow calculation equation is converted into an underdetermined linear equation group, and a set of numerical nonlinear constraints are introduced. In this way, a more accurate power flow calculation result can be obtained than the power flow calculation formula in the prior art that does not consider the quadratic term of voltage.
[0072] S2: Solving the power flow calculation formula considering voltage to obtain a general solution form of the power flow calculation formula considering voltage.
[0073] In a specific embodiment, the general solution obtained by solving the power flow calculation formula considering voltage shown in equations (1)-(6) is:
[0074]
[0075] Where: is a free variable A specific solution; w 1,1 is the element in the first row and first column of the free variable w matrix; w 1,2m+n is the element in the first row and 2m+n column of the free variable w matrix; b1 is the element in the first row of the specific solution parameter b matrix; b 2m+n is the element of the 2m+nth row of the particular solution parameter b matrix;
[0076] Since the numerical nonlinear constraint satisfies the triangular substitution constraint (i.e. At this time, the numerical nonlinear constraint is expressed as follows:
[0077]
[0078] Where: C1, C2, C3, C4 are linear transformation matrices related to the line identifier; · is the element-wise product operator (i.e., two matrices of the same dimension are multiplied element-wise to obtain a new matrix).
[0079] In a specific embodiment, the linear transformation matrices related to the line identifier are:
[0080]
[0081]
[0082]
[0083] C1=[0 m×n 0 m×n I m×n ],C2=[I m×n 0 m×n 0 m×n ] (12)
[0084] C3=[0 m×n (I k,i ) m×n 0 m×n ],C4=[0 m×n (I k,j ) m×n 0 m×n ] (13)
[0085] Where: I m×n represents the m×n dimensional identity matrix, I k,i and I k,j are binary variables. When node i is the starting node of line k, Ik,i =1, otherwise I k,i =0; Similarly, when node j is the end node of line k, I k,j =1, otherwise I k,j =0.
[0086] In the above embodiment, the general solution is obtained by solving the following steps: Since the number of equations is less than the number of unknowns when solving the underdetermined linear equation, the system of equations may have infinite solutions. Therefore, the present invention introduces the free variable By using the Gauss-Jordan elimination method, the linear equations are simplified into a form that is easy to solve, thereby obtaining the general solution form shown in equation (7). In addition, the numerical nonlinear constraints shown in equation (8) can ensure that the triangular replacement expression retains its original physical meaning during the transformation process.
[0087] S3: Constructing a virtual graph-constrained message passing neural network.
[0088] In a specific embodiment, when constructing the virtual graph constrained message passing neural network, the virtual graph is defined by the following formula:
[0089]
[0090]
[0091] Where: X, W r They are virtual graphs G r =(N r ,E r )’s node features and edge features; N r is the node set in the virtual graph; E r is the edge set in the virtual graph; x u is the feature vector of virtual node u; is a virtual node; u and v are both node identifiers, indicating a node in the virtual graph; w u,v is the connection weight from node u to node v in the virtual graph; w is a free variable;
[0092] At each layer of the virtual graph, node information is aggregated and updated by the following formula:
[0093]
[0094]
[0095] Where: is the message passing value of node v at time t+1; is the eigenvalue of node u at time t; is the connection weight from node u to node v at time t in the virtual graph; bv is the bias vector used to adjust the eigenvalue of node v (its value is equal to the special solution described above); is the eigenvalue of node v at time t+1;
[0096] The activation function used in the output layer of the virtual graph constrained message passing neural network is:
[0097]
[0098] Where: t-ReLU is the truncated ReLU activation function; x is the voltage;
[0099] The virtual graph constrained message passing neural network adopts unsupervised learning and uses the following formula as the physical loss function:
[0100] L=MAPE(C1(X·X)+C2(X·X),(C3X)·(C4X)) (19)
[0101] Where: L is the physical loss function.
[0102] In the above embodiment, the constructed virtual graph constrained message passing neural network can ensure physical consistency and improve interpretability in power flow calculation. The virtual graph defined by equations (14)-(15) can be associated with w and b through the general solution form shown in equation (7), ensuring that the physical constraints are naturally embedded in the feedforward process of the neural network. The aggregation and update functions of equations (16)-(17) can ensure that the physical consistency constraints are maintained through the message passing process. The activation function shown in equation (18) can ensure that the output results are within a reasonable range and maintain the correlation between variables. Under the constraints of the virtual graph, unsupervised learning is adopted, and the model learning is guided by the physical loss function shown in equation (19), that is, the mean absolute percentage error (MAPE) of the numerical nonlinear constraints, which can make the output results physically consistent.
[0103] S4: free variables w and specific solution parameters b, and propose free variables Then, the general solution of the power flow calculation formula considering voltage is used to calculate
[0104] S5: Standardize the data to obtain
[0105] S6: Using the virtual graph constrained message passing neural network to Train to gain
[0106] If the If the physical loss function of the virtual graph constraint message passing neural network is not satisfied, then Denormalize and repeat steps S4-S6;
[0107] If the Satisfying the physical loss function of the virtual graph constraint message passing neural network, then Perform denormalization and proceed to step S7.
[0108] S7: Calculate the denormalized data using the general solution of the power flow calculation formula considering voltage to obtain
[0109] S8: Using the activation function of the virtual graph constrained message passing neural network to Processing to obtain the power flow calculation results
[0110] In a specific embodiment, taking IEEE 33, 69, 118 and PEGASE 1354, 2869 systems as examples, the power system flow calculation method based on virtual graph intelligent learning of the present invention is used to calculate the power system flow, and compared with the more traditional deep neural network (DNN) and graph convolutional network (GCN) methods, using physical consistency error (CE) and prediction error (PE) as evaluation indicators, the prediction solution is Substitute it into the power flow calculation formula without considering the voltage quadratic term and calculate the reconstructed The mean absolute percentage error between the actual P and Q is taken as the consistency error.
[0111] The power flow calculation formula without considering the voltage quadratic term is:
[0112]
[0113] The comparison results are shown in Table 1:
[0114] Table 1 Comparison results of power flow calculation
[0115]
[0116]
[0117] From Table 1 we can see that:
[0118] 1. The present invention can improve physical consistency: The present invention directly embeds the mathematical constraints of the power flow equation into the neural network to ensure the consistency of the voltage and phase angle output by the model with the actual power flow equation. Numerical analysis shows that the physical consistency error (CE) of the present invention in the IEEE69 node system is as low as 5.47×10 -10, which is much better than the CE 0.49 of the traditional DNN method.
[0119] 2. The present invention can enhance interpretability: The present invention makes the decision-making process of the neural network more transparent and interpretable through virtual graph constraints, thereby improving the credibility of power system analysis.
[0120] 3. The present invention can improve adaptability: under different topological structures and operating conditions, the present invention can provide high-precision prediction results. For example, under different topological changes, the average prediction error (PE) of the present invention is as low as 1.84×10 -3 , which is significantly better than the 1.42×10 PE of the traditional GCN method. -2 .
[0121] 4. The present invention can improve computing efficiency: By utilizing the fast feedforward characteristics of neural networks, the present invention can achieve higher efficiency in processing real-time computing tasks in power systems, and improve efficiency by 20 to 2,000 times in networks of different sizes.
[0122] The above description is only a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with the profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.
Claims
1. A method for calculating power system flow based on virtual graph intelligent learning, characterized in that: The following steps are involved: S1: Use variable V sin 、V squ and V cos Respectively represent the quadratic sine term, the quadratic term and the quadratic cosine term of the voltage, and establish a power flow calculation formula considering the voltage based on the variables; S2: solving the power flow calculation formula considering voltage to obtain a general solution form of the power flow calculation formula considering voltage; S3: Constructing a virtual graph-constrained message passing neural network; S4: Prepare free variables w and specific solution parameters b, and formulate free variables Then, the general solution of the power flow calculation formula considering voltage is used to calculate S5: Standardize the data to obtain S6: Using the virtual graph constrained message passing neural network to Train to gain If the If the physical loss function of the virtual graph constraint message passing neural network is not satisfied, then Denormalize and repeat steps S4-S6; If the Satisfying the physical loss function of the virtual graph constraint message passing neural network, then Perform denormalization and proceed to step S7; S7: Calculate the denormalized data using the general solution of the power flow calculation formula considering voltage to obtain S8: Using the activation function of the virtual graph constrained message passing neural network to Processing to obtain the power flow calculation results 2. The method for calculating power system flow based on virtual graph intelligent learning according to claim 1 is characterized in that: In step S1, the power flow calculation formula considering voltage includes an underdetermined linear equation group and numerical nonlinear constraints, and the underdetermined linear equation group is: G Λ =diag(G),B Λ =-diag(B) (4) Where: P = (P i ) n×1 ,Q=(Q i ) n×1 , respectively represent the injection matrix of node real-time active power and reactive power; P i is the real-time active power of node i; Q i is the real-time reactive power of node i; n is the total number of nodes; B p ,G Λ ,G p ,G Q ,B Λ ,B Q All are based on the traditional association matrix A=(A ik ) n×m The obtained segmentation matrix; A ik is an element of the traditional correlation matrix; m is the total number of lines; B ij is the imaginary part of the line admittance; G ij is the real part of the line admittance; e(i,j) is the line with i and j as the starting and ending nodes; e k is the kth line; E is the set of line components; G is the real part of the line node admittance matrix; B is the imaginary part of the line node admittance matrix; The numerical nonlinear constraints are: Where: V i is the voltage of node i; V j is the voltage at node j; θ ij is the phase angle difference between the voltages at node i and node j; N is the set of nodes.
3. The method for calculating power system flow based on virtual graph intelligent learning according to claim 2 is characterized in that: In step S2, the general solution form of the power flow calculation formula considering voltage is: Where: is a free variable A specific solution; w 1,1 is the element in the first row and first column of the free variable w matrix; w 1,2m+n is the element in the first row and 2m+n column of the free variable w matrix; b1 is the element in the first row of the specific solution parameter b matrix; b 2m+n is the element of the 2m+nth row of the particular solution parameter b matrix; Since the numerical nonlinear constraint satisfies the triangle replacement constraint, at this time, the numerical nonlinear constraint is expressed by the following formula: Where: C1, C2, C3, C4 are linear transformation matrices related to line identifiers; · is the element-wise product operator.
4. The method for calculating power system flow based on virtual graph intelligent learning according to claim 3 is characterized in that: The linear transformation matrices related to the line identifier are: C1=[0 m×n 0 m×n I m×n ],C2=[I m×n 0 m×n 0 m×n ] (12) C3=[0 m×n (I k,i ) m×n 0 m×n ],C4=[0 m×n (I k,j ) m×n 0 m×n ] (13) Where: I m×n represents the m×n dimensional identity matrix, I k,i and I k,j are binary variables. When node i is the starting node of line k, I k,i =1, otherwise I k,i =0; Similarly, when node j is the end node of line k, I k,j =1, otherwise I k,j =0.
5. The method for calculating power system flow based on virtual graph intelligent learning according to claim 1 is characterized in that: In step S3, when constructing the virtual graph constrained message passing neural network, the virtual graph is defined by the following formula: Where: X, W r They are virtual graphs G r =(N r ,E r )’s node features and edge features; N r is the node set in the virtual graph; E r is the edge set in the virtual graph; x u is the feature vector of virtual node u; is a virtual node; u and v are both node identifiers, indicating a node in the virtual graph; w u,v is the connection weight from node u to node v in the virtual graph; w is a free variable; At each layer of the virtual graph, node information is aggregated and updated by the following formula: Where: is the message passing value of node v at time t+1; is the eigenvalue of node u at time t; is the connection weight from node u to node v at time t in the virtual graph; b v is the bias vector used to adjust the eigenvalue of node v; is the eigenvalue of node v at time t+1; The activation function used in the output layer of the virtual graph constrained message passing neural network is: Where: t-ReLU is the truncated ReLU activation function; x is the voltage; The virtual graph constrained message passing neural network adopts unsupervised learning and uses the following formula as the physical loss function: L=MAPE(C1(X·X)+C2(X·X),(C3X)·(C4X)) (19) Where: L is the physical loss function.
Citation Information
Patent Citations
Data-driven optimal power flow calculation method considering topological feature learning
CN116316629A
Intelligent power distribution room voltage reactive real-time optimization method and system based on privacy calculation
CN117375007A
Medium voltage distribution network line parameter identification method based on physical information neural network
CN118133656A
Over-all wiring method for standard units based on optimized time delay and key network techniques
CN1360268A
Optimization method and apparatus for power management system
WO2023051101A1
Cited By
Antibody coupled drug activity prediction method and system based on virtual graph and multi-scale characteristics
CN120148681A
An antibody-drug conjugate activity prediction method and system based on virtual graphs and multi-scale features
CN120148681B
Power distribution network topology and parameter identification method under unobservable condition of partial nodes
CN122112542A
