Power system power flow calculation method based on virtual graph intelligent learning
By introducing a virtual graph constraint message passing neural network into power flow calculation, the problems of large discrepancies between prediction results and physical constraints and insufficient transparency of deep learning methods in power systems are solved. This enables efficient and transparent power flow calculation, adapts to changes in grid topology, and improves calculation accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN UNIV
- Filing Date
- 2024-08-08
- Publication Date
- 2026-07-21
AI Technical Summary
Existing deep learning methods suffer from problems such as large discrepancies between model predictions and actual physical constraints, insufficient transparency, and poor adaptability in power system power flow calculations, making it difficult to meet the needs of online security assessment.
The variables Vsin, Vsqu, and Vcos represent the second-order sine and second-order cosine terms of voltage, respectively. A virtual graph constraint message passing neural network is constructed, and the physical constraints of the power flow calculation formula are embedded through unsupervised learning. The virtual graph constraint message passing neural network is trained to ensure the physical consistency and transparency of the calculation results.
It improves the physical consistency and transparency of power flow calculation, enhances the model's adaptability to changes in grid topology, and improves computational efficiency and accuracy, thus better guiding power system analysis and dispatch decisions.
Smart Images

Figure CN118780319B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system power flow calculation technology, and in particular to a power system power flow calculation method based on virtual graph intelligent learning. Background Technology
[0002] With the increasing penetration of large-scale, real-time distributed energy resources in power systems, traditional power flow (PF) calculation methods (such as the Newton-Raphson method and the Gauss-Seidel method) face enormous computational burdens and struggle to meet the needs of online security assessments. In recent years, deep learning (DL) technology, due to its powerful nonlinear approximation capabilities and fast feedforward characteristics, has become an effective tool for improving the efficiency and accuracy of power flow calculations.
[0003] However, existing deep learning methods face several challenges in practical applications. First, traditional learning methods primarily focus on minimizing the statistical error between predicted and labeled values when optimizing models, which can lead to discrepancies between the model's predictions and the actual physical constraints of the power system. Furthermore, deep learning models are often considered "black boxes," lacking transparency in their decision-making process, limiting their application in critical analyses. Finally, neural network models are typically trained in specific environments; when the grid topology changes or new operating conditions arise, the models exhibit poor adaptability and struggle to provide accurate predictions. These drawbacks limit the widespread application of existing deep learning methods in power system analysis and decision-making that requires strict adherence to physical constraints, high transparency, and strong adaptability. Summary of the Invention
[0004] To address the aforementioned problems, this invention aims to provide a power flow calculation method for power systems based on virtual graph intelligent learning.
[0005] The technical solution of the present invention is as follows:
[0006] A power flow calculation method for power systems based on virtual graph intelligent learning includes the following steps:
[0007] S1: Using variable V sin V squ and V cos These represent the second-order sine, second-order, and second-order cosine terms of voltage, respectively, and a power flow calculation formula considering voltage is established based on these variables.
[0008] S2: Solve the power flow calculation formula considering voltage to obtain the general solution form of the power flow calculation formula considering voltage;
[0009] S3: Construct a virtual graph-constrained message-passing neural network;
[0010] S4: Prepare the free variable w and the particular solution parameter b, and define the free variable. Then, the general solution of the power flow calculation formula considering voltage is used to calculate and obtain...
[0011] S5: Regarding the above Standardize the data to obtain
[0012] S6: The virtual graph constraint message passing neural network is used to process the... To train and obtain
[0013] If the above If the physical loss function of the virtual graph-constrained message-passing neural network is not satisfied, then for the... Perform denormalization and repeat steps S4-S6;
[0014] If the above If the physical loss function of the virtual graph-constrained message-passing neural network satisfies the given virtual graph constraint, then for the... Perform denormalization and proceed to step S7;
[0015] S7: Calculate the denormalized data using the general solution form of the power flow calculation formula considering voltage, and obtain...
[0016] S8: Apply the activation function of the virtual graph-constrained message-passing neural network to the... Processing is performed to obtain power flow calculation results.
[0017] Preferably, in step S1, the power flow calculation formula considering voltage includes an underdetermined linear equation set and numerical nonlinear constraints, wherein the underdetermined linear equation set is:
[0018]
[0019]
[0020]
[0021] G Λ =diag(G),BΛ=-diag(B) (4)
[0022] In the formula: P = (P i ) n×1 Q = (Q i ) n×1 , representing the injection matrices for the real-time active and reactive power of the nodes, respectively; P i Q represents the real-time active power of node i; iB represents the real-time reactive power of node i; n represents the total number of nodes; p G Λ G p G Q B Λ B Q All are based on the traditional association matrix A = (A ik ) n×m The resulting segmentation matrix; A ik A single element of a traditional correlation matrix; m is the total number of lines; B ij G is the imaginary part of the line admittance; ij e is the real part of the line admittance; e(i,j) represents the line with i and j as the starting and ending nodes; e k Let be the k-th line; E be the set of lines; G be the real part of the line node admittance matrix; and B be the imaginary part of the line node admittance matrix.
[0023] The numerical nonlinear constraint is:
[0024]
[0025]
[0026] In the formula: V i V is the voltage at node i; j Let θ be the voltage at node j; ij Let be the phase angle difference between the voltages of 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] In the formula: free variables Specific solution; w 1,1 The element in the first row and first column of the matrix containing the free variables w; w 1,2m+n b1 is the element in the first row and 2m+n column of the free variable matrix w; b1 is the element in the first row of the particular solution parameter matrix b; b 2m+n Let b be the element in the (2m+n)th row of the particular solution parameter matrix;
[0030] Since the numerical nonlinear constraint satisfies the triangular substitution constraint, the numerical nonlinear constraint can be expressed by the following formula:
[0031]
[0032] In the formula: C1, C2, C3, C4 are linear transformation matrices related to the line identifier; · is the element-product operator.
[0033] Preferably, the linear transformation matrices associated with the line identifier are as follows:
[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] In the formula: I m×n I represents an m×n dimensional identity matrix. k,i and I k,j All 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] In the formula: X, W r They are virtual graphs G r =(N r E r ) node features and edge features; N r E is the set of nodes in the virtual graph. r x is the edge set in the virtual graph; u The feature vector of virtual node u; For virtual nodes; u and v are both node identifiers, representing a node in the virtual graph; w u,v Let be 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 using the following formula:
[0045]
[0046]
[0047] In the formula: This represents the message passing value of node v at time t+1. Let u be the eigenvalue of node u at time t; Let b be the connection weight from node u to node v in the virtual graph at time t; v This is the bias vector used to adjust the eigenvalues of node v; Let v be 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] In the formula: t-ReLU is the truncated ReLU activation function; x is the voltage;
[0051] The virtual graph-constrained message-passing neural network employs 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] In the formula: L is the physical loss function.
[0054] The beneficial effects of this invention are:
[0055] This invention introduces a virtual graph constraint information transmission neural network, directly embedding the mathematical constraints of the power flow equations into the feedforward process of the neural network. This ensures the physical consistency and interpretability of the calculation results and enhances the model's adaptability to changes in the power grid topology. This invention provides an intelligent power flow calculation method that ensures physical consistency of calculation results, improves model transparency, and enhances environmental adaptability, thereby better guiding power system analysis and dispatch decisions. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is a schematic diagram of the architecture of the virtual graph-constrained message-passing neural network of the present invention. Detailed Implementation
[0058] The present invention will be further described below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and technical features described in this application can be combined with each other. It should also be pointed out that, unless otherwise indicated, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terms "comprising" or "including" and similar words used in this invention refer to elements or objects preceding the word that encompass the elements or objects listed following the word and their equivalents, without excluding other elements or objects.
[0059] like Figure 1 As shown, this invention provides a power system power flow calculation method based on virtual graph intelligent learning, comprising the following steps:
[0060] S1: Using variable V sin V squ and V cos These represent the second-order sine, second-order, and second-order cosine terms of voltage, respectively, and a power flow calculation formula considering voltage is established based on these variables.
[0061] In one specific embodiment, the power flow calculation formula considering voltage includes an underdetermined linear equation set and numerical nonlinear constraints, wherein the underdetermined linear equation set is:
[0062]
[0063]
[0064]
[0065] G Λ =diag(G),B Λ =-diag(B) (4)
[0066] In the formula: P = (P i ) n×1 Q = (Q i ) n×1, representing the injection matrices for the real-time active and reactive power of the nodes, respectively; P i Q represents the real-time active power of node i; i B represents the real-time reactive power of node i; n represents the total number of nodes; p G Λ G p G Q B Λ B Q All are based on the traditional association matrix A = (A ik ) n×m The resulting segmentation matrix; A ik An element of a traditional correlation matrix (if A) ik =1, which means that branch k starts from node i; if A ik =-1, which means that branch k terminates at node i; if A ik =0, which means that branch k has no direct connection with node i; m is the total number of lines; B ij G is the imaginary part of the line admittance; ij e is the real part of the line admittance; e(i,j) represents the line with i and j as the starting and ending nodes; e k Let be the k-th line; E be the set of lines; G be the real part of the line node admittance matrix; and B be the imaginary part of the line node admittance matrix.
[0067] The numerical nonlinear constraint is:
[0068]
[0069]
[0070] In the formula: V i V is the voltage at node i; j Let θ be the voltage at node j; ij Let be the phase angle difference between the voltages of node i and node j; N is the set of nodes.
[0071] In the above embodiments, the present invention takes into account that the nonlinearity of power flow calculation comes from the quadratic term of voltage. Therefore, the power flow calculation equation is converted into an underdetermined linear equation system and a set of numerical nonlinear constraints are introduced. This can obtain more accurate power flow calculation results than the power flow calculation formula of the prior art that does not consider the quadratic term of voltage.
[0072] S2: Solve the power flow calculation formula considering voltage to obtain the 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 formulas considering voltage shown in equations (1)-(6) is as follows:
[0074]
[0075] In the formula: free variables Specific solution; w 1,1 The element in the first row and first column of the matrix containing the free variables w; w 1,2m+n b1 is the element in the first row and 2m+n column of the free variable matrix w; b1 is the element in the first row of the particular solution parameter matrix b; b 2m+n Let b be the element in the (2m+n)th row of the particular solution parameter matrix;
[0076] Because the numerical nonlinear constraint satisfies the triangular substitution constraint (i.e. At this point, the numerical nonlinear constraint is expressed by the following formula:
[0077]
[0078] In the formula: C1, C2, C3, C4 are linear transformation matrices related to the line identifier; · is the element-wise multiplication operator (i.e., multiplying two matrices of the same dimension element by element to obtain a new matrix).
[0079] In one specific embodiment, the linear transformation matrices associated with the line identifier are as follows:
[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] In the formula: I m×n I represents an m×n dimensional identity matrix. k,i and I k,j All 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 embodiments, the general solution form is obtained through the following steps: Since the number of equations is less than the number of unknowns when solving the underdetermined linear equations, the system of equations may have infinitely many solutions. Therefore, this invention introduces free variables. By using the Gauss-Jordan elimination method, the linear equation system is simplified into a form that is easy to solve, thus obtaining the general solution form shown in equation (7). In addition, the numerical nonlinear constraint shown in equation (8) ensures that the triangular substitution expression retains its original physical meaning during the transformation process.
[0087] S3: Construct 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] In the formula: X, W r They are virtual graphs G r =(N r E r ) node features and edge features; N r E is the set of nodes in the virtual graph. r x is the edge set in the virtual graph; u The feature vector of virtual node u; For virtual nodes; u and v are both node identifiers, representing a node in the virtual graph; w u,v Let be 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 using the following formula:
[0093]
[0094]
[0095] In the formula: This represents the message passing value of node v at time t+1. Let u be the eigenvalue of node u at time t; Let b be the connection weight from node u to node v in the virtual graph at time t;v This is the bias vector used to adjust the eigenvalues of node v (its value is equal to the particular solution described above); Let v be 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] In the formula: t-ReLU is the truncated ReLU activation function; x is the voltage;
[0099] The virtual graph-constrained message-passing neural network employs 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] In the formula: L is the physical loss function.
[0102] In the above embodiments, the virtual graph-constrained message-passing neural network constructed 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 physical constraints are naturally embedded in the feedforward process of the neural network. The aggregation and update functions of equations (16)-(17) ensure that physical consistency constraints are maintained through the message-passing process. The activation function shown in equation (18) ensures that the output results are within a reasonable range and maintains the correlation between variables. Under the constraints of the virtual graph, unsupervised learning is adopted, and the physical loss function shown in equation (19) guides model learning, i.e., the mean absolute percentage error (MAPE) of the numerical nonlinear constraints, enabling physically consistent output results.
[0103] S4: Free variables w and particular solution parameter b, and specify the free variables. Then, the general solution of the power flow calculation formula considering voltage is used to calculate and obtain...
[0104] S5: Regarding the above Standardize the data to obtain
[0105] S6: The virtual graph constraint message passing neural network is used to process the... To train and obtain
[0106] If the above If the physical loss function of the virtual graph-constrained message-passing neural network is not satisfied, then for the... Perform denormalization and repeat steps S4-S6;
[0107] If the above If the physical loss function of the virtual graph-constrained message-passing neural network satisfies the given virtual graph constraint, then for the... Perform denormalization and proceed to step S7.
[0108] S7: Calculate the denormalized data using the general solution form of the power flow calculation formula considering voltage, and obtain...
[0109] S8: Apply the activation function of the virtual graph-constrained message-passing neural network to the... Processing is performed to obtain power flow calculation results.
[0110] In a specific embodiment, taking the IEEE 33, 69, 118 and PEGASE 1354, 2869 systems as examples, the power system power flow calculation method based on virtual graph intelligent learning described in this invention is used to calculate the power system power flow, and compared with more traditional deep neural network (DNN) and graph convolutional network (GCN) methods. Physical consistency error (CE) and prediction error (PE) are used as evaluation metrics to compare the predicted solutions. Substituting into the power flow calculation formula that does not consider the voltage secondary term, the reconfigured power flow is calculated. The average absolute percentage error between the actual P and Q is taken as the consistency error.
[0111] The power flow calculation formula that does not consider the voltage quadratic term is as follows:
[0112]
[0113] The comparison results are shown in Table 1:
[0114] Table 1 Comparison Results of Power Flow Calculation
[0115]
[0116]
[0117] As can be seen from Table 1:
[0118] 1. This invention improves physical consistency: By directly embedding the mathematical constraints of the power flow equations into a neural network, this invention ensures the consistency between the voltage and phase angles output by the model and the actual power flow equations. Numerical analysis shows that the physical consistency error (CE) of this invention in the IEEE 69-bus system is as low as 5.47 × 10⁻⁶. -10It is far superior to the CE of traditional DNN methods (0.49).
[0119] 2. This invention enhances interpretability: By using virtual graph constraints, this invention makes the decision-making process of neural networks more transparent and interpretable, thereby improving the credibility of power system analysis.
[0120] 3. This invention improves adaptability: It provides high-precision prediction results under different topologies and operating conditions. For example, under different topology changes, the average prediction error (PE) of this invention is as low as 1.84 × 10⁻⁶. -3 It significantly outperforms the traditional GCN method's PE of 1.42 × 10⁻⁶. -2 .
[0121] 4. This invention improves computational efficiency: Utilizing the fast feedforward characteristic of neural networks, this invention exhibits higher efficiency when processing real-time computing tasks in power systems. Efficiency is improved by 20 to 2000 times in networks of different sizes.
[0122] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A power flow calculation method for power systems based on virtual graph intelligent learning, characterized in that, Includes the following steps: S1: Using variables , as well as These represent the second-order sine, second-order, and second-order cosine terms of voltage, respectively, and a power flow calculation formula considering voltage is established based on these variables. S2: Solve the power flow calculation formula considering voltage to obtain the general solution form of the power flow calculation formula considering voltage; S3: Construct a virtual graph-constrained message-passing neural network; when constructing the virtual graph-constrained message-passing neural network, the virtual graph is defined by the following formula: (14) (15) In the formula: Virtual graphs Node features and edge features; For the set of nodes in the virtual graph; Let the set of edges be the set of edges in the virtual graph. The feature vector of virtual node u; For virtual nodes; and Both are node identifiers, representing a node in the virtual graph; The connection weights from node u to node v in the virtual graph; They are free variables; At each layer of the virtual graph, node information is aggregated and updated using the following formula: (16) (17) In the formula: This represents the message passing value of node v at time t+1. Let be the eigenvalue of node u at time t; Let be the connection weight from node u to node v in the virtual graph at time t; This is the bias vector used to adjust the eigenvalues of node v; Let v be 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: (18) In the formula: The ReLU activation function is truncated. Voltage; The virtual graph-constrained message-passing neural network employs unsupervised learning and uses the following formula as the physical loss function: (19) In the formula: For physical loss function; S4: Prepare the free variable w and the particular solution parameter b, and define the free variable. Then, the general solution of the power flow calculation formula considering voltage is used to calculate and obtain the result. ; S5: Regarding the above Standardize the data to obtain ; S6: The virtual graph constraint message passing neural network is used to process the... To train and obtain ; If the above If the physical loss function of the virtual graph-constrained message-passing neural network is not satisfied, then for the... Perform denormalization and repeat steps S4-S6; If the above If the physical loss function of the virtual graph-constrained message-passing neural network satisfies the given virtual graph constraint, then for the... Perform denormalization and proceed to step S7; S7: Calculate the denormalized data using the general solution form of the power flow calculation formula considering voltage, and obtain... ; S8: Apply the activation function of the virtual graph-constrained message-passing neural network to the... Processing is performed to obtain power flow calculation results. .
2. The power system power flow calculation method based on virtual graph intelligent learning according to claim 1, characterized in that, In step S1, the power flow calculation formula considering voltage includes an underdetermined linear equation set and numerical nonlinear constraints. The underdetermined linear equation set is as follows: (1) (2) (3) (4) In the formula: , representing the injection matrices for the real-time active power and reactive power of the nodes, respectively; The real-time active power of node i; Real-time reactive power of node i; The total number of nodes; All are based on traditional association matrices The resulting segmentation matrix; It is an element of a traditional correlation matrix; Total number of lines; This represents the imaginary part of the line admittance. This is the real part of the line admittance; For the line As the start node and the end node; For the first One line; A set of lines; Let be the real part of the admittance matrix of the line node; This represents the imaginary part of the admittance matrix at the line nodes; The numerical nonlinear constraint is: (5) (6) In the formula: Let be the voltage at node i; Let be the voltage at node j; Let be the phase angle difference between the voltages at node i and node j; It is a set of nodes.
3. The power system power flow calculation method based on virtual graph intelligent learning according to claim 2, characterized in that, In step S2, the general solution of the power flow calculation formula considering voltage is as follows: (7) In the formula: Free variables Specific solutions; The elements in the first row and first column of the free variable matrix w; The element in the first row and the (2m+n)th column of the free variable matrix w; These are the elements in the first row of the particular solution parameter matrix b; Let b be the element in the (2m+n)th row of the particular solution parameter matrix; Since the numerical nonlinear constraint satisfies the triangular substitution constraint, the numerical nonlinear constraint can be expressed by the following formula: (8) In the formula: This is the linear transformation matrix associated with the line identifier; This is the element-wise multiplication operator.
4. The power system power flow calculation method based on virtual graph intelligent learning according to claim 3, characterized in that, The linear transformation matrices associated with the line identifier are as follows: (9) (10) (11) (12) (13) In the formula: express An identity matrix of dimension 1 and All are binary variables, when the node For the line When the starting node is, ,otherwise Similarly, when the node For the line When the end node is, ,otherwise .