A power system power flow calculation method, device and electronic equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
- Filing Date
- 2026-05-14
- Publication Date
- 2026-08-07
AI Technical Summary
[0006]本发明提供了一种电力系统潮流计算方法、装置及电子设备,用于解决现有的潮流计算预测结果物理一致性与精度较低的技术问题
Smart Images

Figure CN122532978A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power flow calculation technology, and in particular to a power system power flow calculation method, apparatus and electronic equipment. Background Technology
[0002] With the large-scale integration of new energy sources, the complexity and uncertainty of power system operation have significantly increased. Power flow calculation, as a core tool for power system steady-state analysis, faces increasingly higher demands on its computational speed and convergence rate. Traditional power flow calculation methods mainly rely on numerical iterative algorithms, such as the Newton-Raphson method. While these methods offer high computational accuracy, they often suffer from low computational efficiency, non-convergence, and ill-conditioned power flows when faced with massive amounts of complex and variable operating modes, making them unsuitable for the real-time and rapid decision-making requirements of modern power systems. To overcome these bottlenecks, deep learning technology has been introduced into the field of power system power flow calculation in recent years. Related research attempts to build end-to-end neural network models to learn complex mapping relationships in historical operating or simulation data, thereby achieving rapid prediction of power flow and breaking through the limitations of traditional methods.
[0003] Current deep learning-based power flow calculation methods mostly use the initial values of node voltage, active power injection, and reactive power injection, as well as the system topology, as inputs, and output the voltage of each node and the power of each branch in the entire network, thereby simulating the Newton-Raphson method of solving power flow equations using traditional data.
[0004] In power flow calculations, nodes are classified into three categories based on their known quantities and their functions: PQ nodes, PV nodes, and slack nodes. Slack nodes are special because they balance the power loss in the network. Their active and reactive power injections do not participate in the iterative solution of the power flow equations but are directly calculated based on the power balance after the iterations of the other nodes have converged.
[0005] From the perspective of deep learning modeling, the solution method for the balancing node is different from all other nodes. It is strictly determined directly based on the power balance. For the model, this is equivalent to requiring it to learn a redundant output that is subject to strong physical constraints. This brings additional prediction errors, increases the unnecessary fitting difficulty of the model, and significantly reduces the model's generalization performance and the physical consistency of the prediction results. Summary of the Invention
[0006] This invention provides a power flow calculation method, apparatus, and electronic device for power systems, which addresses the technical problem of low physical consistency and accuracy of existing power flow calculation prediction results.
[0007] This invention provides a power system power flow calculation method, comprising:
[0008] Obtain the topology of the preset power grid and calculate the adjacency matrix of the topology;
[0009] Obtain the initial power flow values of each node in the preset power grid;
[0010] The adjacency matrix and the initial power flow values are input into a pre-trained deep learning model, which outputs the unbalanced node power flow solution and the branch power flow solution. The pre-trained deep learning model is trained using a target loss function, which consists of data-driven loss and physical-driven loss.
[0011] Calculate the balanced node power flow solution based on the non-balanced node power flow solution and the branch power flow solution;
[0012] Output the unbalanced node power flow solution, the branch power flow solution, and the balanced node power flow solution.
[0013] Optionally, the step of obtaining the topology of a preset power grid and calculating the adjacency matrix of the topology includes:
[0014] Obtain the topology of the preset power grid;
[0015] The branches and nodes of the preset power grid are determined based on the topology.
[0016] Obtain the admittance of each branch and the transformation ratio of each branch at each node;
[0017] The adjacency matrix of the topology is generated based on the admittance and the ratio.
[0018] Optionally, the step of obtaining the initial power flow values of each node in the preset power grid includes:
[0019] Obtain the injected active power, injected reactive power, voltage amplitude, parallel admittance, generator reactive power lower limit and generator reactive power upper limit for each node of the preset power grid;
[0020] The injected active power, the injected reactive power, the voltage amplitude, the parallel admittance, the generator reactive power lower limit, and the generator reactive power upper limit are used as the initial power flow values of the node.
[0021] Optionally, the training process of the deep learning model includes:
[0022] Obtain the initial historical power flow values and the actual power flow solution of the preset power grid;
[0023] The initial historical trend values are input into the initial deep learning model to obtain the initial trend prediction data;
[0024] The data-driven loss is calculated based on the initial power flow prediction data of the unbalanced nodes and the actual power flow solution.
[0025] Calculate the physical drive loss based on the initial power flow prediction data;
[0026] The function value of the target loss function is calculated based on the data-driven loss and the physics-driven loss, and the parameters of the initial deep learning model are optimized based on the function value to obtain the optimized deep learning model.
[0027] Determine if the current iteration count is less than the preset iteration count;
[0028] If not, use the optimized deep learning model as the initial deep learning model, and return to the step of inputting the initial historical current value into the initial deep learning model to obtain the initial current prediction data;
[0029] If so, the optimized deep learning model is used as the trained deep learning model.
[0030] Optionally, the data-driven loss includes node data-driven loss and branch data-driven loss, and the functional expression of the node data-driven loss is:
[0031] ;
[0032] in, The loss value is driven by node data. The total number of samples in the training set. Let be the total number of nodes, b be the sample index, i be the node index, and sw be the balanced nodes. For the active power injection predicted by the model at node i, Active power injection for the actual power flow solution of node i. Reactive power injection for node i predicted by the model. Reactive power injection for the actual power flow solution of node i. The voltage magnitude at node i predicted by the model. The actual power flow solution voltage magnitude for node i;
[0033] The functional expression for branch data-driven loss is:
[0034] ;
[0035] Where L is the total number of branches, l is the branch number, and b is the sample number. The active power of branch l predicted by the model. The active power of the branch circuit l is the power flow solution. The reactive power of branch l predicted by the model. The reactive power of the branch circuit l is the power flow solution.
[0036] Optionally, the functional expression for the physical driving loss is:
[0037] ;
[0038] in, For physical driving loss, For the predicted unbalanced active power of sample b, Let b be the predicted unbalanced reactive power.
[0039] Optionally, the unbalanced node power flow solution includes the unbalanced node voltage magnitude; the branch power flow solution includes the branch forward active power, the branch reverse active power, and the unbalanced node active power injection; the balanced node power flow solution includes the balanced node active power injection and the balanced node reactive power injection; the step of calculating the balanced node power flow solution based on the unbalanced node power flow solution and the branch power flow solution includes:
[0040] The active power injection at the balancing node is calculated using the forward active power of the branch, the reverse active power of the branch, and the active power injection at the unbalanced node.
[0041] The mutual admittance and phase angle difference between the balanced node and each unbalanced node are calculated based on the power flow solution of the unbalanced node, the power flow solution of the branch, and the preset admittance of each branch of the power grid.
[0042] The reactive power injection at the balanced node is calculated based on the voltage amplitude of the unbalanced node, the mutual admittance, and the phase angle difference.
[0043] Optionally, the active power injection calculation formula for the balancing node is as follows:
[0044] ;
[0045] in, This indicates active power injection at the balancing node, where l represents the line number. The positive active power of the branch represents the active power flowing from node i to node j in line l. Let be the reverse active power of the branch, representing the active power flowing from node j to node i in line l. This represents the active power injection value of the unbalanced node i;
[0046] The formula for calculating reactive power injection at the balancing node is as follows:
[0047] ;
[0048] in, and To balance the real and imaginary parts of the mutual admittance between node i and node i, This represents the phase angle difference between the balancing node and node i.
[0049] The present invention also provides a power system power flow calculation device, comprising:
[0050] The adjacency matrix calculation module is used to obtain the topology of a preset power grid and calculate the adjacency matrix of the topology.
[0051] The power flow initial value acquisition module is used to acquire the power flow initial value of each node of the preset power grid;
[0052] The power flow solution output module is used to input the adjacency matrix and the initial power flow values into a pre-trained deep learning model and output the power flow solutions for unbalanced nodes and branches; the pre-trained deep learning model is trained using a target loss function, which consists of data-driven loss and physical-driven loss.
[0053] The balanced node power flow solution calculation module is used to calculate the balanced node power flow solution based on the unbalanced node power flow solution and the branch power flow solution.
[0054] The output module is used to output the power flow solutions of the unbalanced nodes, the branch power flow solutions, and the balanced nodes.
[0055] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0056] The memory is used to store program code and transmit the program code to the processor;
[0057] The processor is used to execute the power system power flow calculation method as described above, according to the instructions in the program code.
[0058] As can be seen from the above technical solutions, the present invention has the following advantages: The present invention discloses a power flow calculation method for a power system, and specifically discloses: obtaining the topology of a preset power grid and calculating the adjacency matrix of the topology; obtaining the initial power flow values of each node in the preset power grid; inputting the adjacency matrix and the initial power flow values into a pre-trained deep learning model, and outputting the power flow solutions for unbalanced nodes and branches; the pre-trained deep learning model is trained using a target loss function, which consists of data-driven loss and physical-driven loss; calculating the power flow solutions for balanced nodes based on the power flow solutions for unbalanced nodes and branches; and outputting the power flow solutions for unbalanced nodes, branches, and balanced nodes.
[0059] This invention eliminates the direct prediction of active and reactive power injection at the slack node by constructing a deep learning model trained with data-driven loss and physical-driven loss. Instead, it predicts only the electrical quantities of each node other than the slack node. The power flow equations are then used to inversely deduce the power flow solution at the slack node based on the node and branch power flow solutions predicted by the model. At the same time, to ensure that each node meets the power balance constraints and to avoid the error propagation caused by the slack node, physical-driven loss is introduced to limit the active power injection at the slack node, thereby improving the physical consistency and accuracy of the power flow calculation error results. Attached Figure Description
[0060] 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.
[0061] Figure 1 A flowchart illustrating the steps of a power system power flow calculation method provided in this embodiment of the invention;
[0062] Figure 2 A flowchart illustrating the steps of a power system power flow calculation method provided in another embodiment of the present invention;
[0063] Figure 3 An architecture diagram of a power system power flow calculation method provided in an embodiment of the present invention;
[0064] Figure 4 A schematic diagram of the IEEE 39-node system;
[0065] Figure 5 This is a structural block diagram of a power system power flow calculation device provided in an embodiment of the present invention. Detailed Implementation
[0066] This invention provides a power system power flow calculation method, apparatus, and electronic device to address the technical problem of low physical consistency and accuracy of existing power flow calculation prediction results.
[0067] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0068] Please see Figure 1 , Figure 1 A flowchart illustrating the steps of a power system power flow calculation method provided in an embodiment of the present invention.
[0069] The present invention provides a power system power flow calculation method, which may specifically include the following steps:
[0070] Step 101: Obtain the topology of the preset power grid and calculate the adjacency matrix of the topology;
[0071] The topology of a power grid refers to the connection relationships and arrangement between various nodes in the power grid (such as generators, transformers, transmission lines, switches, etc.).
[0072] An adjacency matrix is a mathematical matrix used to describe the connection relationships between nodes in a power grid (such as substation buses, generator nodes, and load nodes).
[0073] In this embodiment of the invention, a preset power grid topology can be obtained, and an adjacency matrix of the power grid can be constructed based on the topology.
[0074] Step 102: Obtain the initial power flow values for each node of the preset power grid;
[0075] In this embodiment of the invention, the electrical quantities of each node of the preset power grid can be obtained to obtain the initial power flow values of each node of the power grid.
[0076] Step 103: Input the adjacency matrix and initial power flow values into the pre-trained deep learning model, and output the unbalanced node power flow solution and branch power flow solution; the pre-trained deep learning model is trained using a target loss function, which consists of data-driven loss and physical-driven loss.
[0077] Deep learning specifically refers to machine learning based on deep neural network models and methods. It has evolved from statistical machine learning and artificial neural network algorithms, combined with the development of modern big data and high-performance computing. The most important technical characteristic of deep learning is its ability to automatically extract features; these extracted features are also called deep features or deep feature representations. Compared to manually designed features, deep features are more powerful and robust. Therefore, the essence of deep learning is feature representation learning. Deep neural networks are the model foundation for deep learning's ability to automatically extract features; deep neural networks are essentially a series of nested nonlinear transformations.
[0078] Unbalanced nodes refer to nodes other than balanced nodes.
[0079] In this embodiment of the invention, a target loss function can be generated using data-driven loss and physics-driven loss, and then a deep learning model can be trained using the target loss function. By inputting the collected initial power flow values and adjacency matrix into the pre-trained deep learning model, unbalanced node power flow solutions and branch power flow solutions can be obtained.
[0080] Step 104: Calculate the balanced node power flow solution based on the non-equilibrium node power flow solution, branch power flow solution, and branch power flow solution;
[0081] Step 105: Output the unbalanced node power flow solution, branch power flow solution, and balanced node power flow solution.
[0082] After calculating the unbalanced node power flow solutions, branch power flow solutions, and balanced node power flow solutions, the unbalanced node power flow solutions, branch power flow solutions, and balanced node power flow solutions can be output as the predicted power flow solutions for the preset power grid.
[0083] This invention eliminates the direct prediction of active and reactive power injection at the slack node by constructing a deep learning model trained with data-driven loss and physical-driven loss. Instead, it predicts only the electrical quantities of each node other than the slack node. At the same time, to ensure that each node meets the power balance constraint and to avoid the error propagation caused by the slack node, physical-driven loss is introduced to limit the active power injection at the slack node, thereby improving the physical consistency and accuracy of the power flow calculation error results.
[0084] Please see Figure 2 , Figure 2 A flowchart illustrating the steps of a power system power flow calculation method according to another embodiment of the present invention. Specifically, it may include the following steps:
[0085] Step 201: Obtain the topology of the preset power grid;
[0086] Step 202: Determine the branches and nodes of the preset power grid based on the topology;
[0087] Step 203: Obtain the admittance of each branch and the transformation ratio of each branch at each node;
[0088] Step 204: Generate the adjacency matrix of the topology based on admittance and ratio;
[0089] In this embodiment of the invention, the power flow solutions for each node and branch can be output using the complete topology of the actual power grid and the initial power flow values of each node. Specifically, for a power grid with N nodes and L branches, the topology is represented by an adjacency matrix. express:
[0090] ;
[0091] Admittance includes conductivity and susceptance. For the conductance of branch l, The susceptance of branch l; and Let be the turns ratios of branch l at nodes i and j, respectively. For a transmission line, , This indicates that nodes i and j are directly connected by a branch; otherwise, it indicates that they are not directly connected.
[0092] Step 205: Obtain the initial power flow values for each node of the preset power grid;
[0093] In this embodiment of the invention, the electrical quantities of each node of the preset power grid can be obtained to obtain the initial power flow values of each node of the power grid.
[0094] In one example, step 205 may include the following sub-steps:
[0095] S51, obtain the injected active power, injected reactive power, voltage amplitude, parallel admittance, generator reactive power lower limit and generator reactive power upper limit of each node in the preset power grid;
[0096] S52 uses injected active power, injected reactive power, voltage amplitude, parallel admittance, generator reactive power lower limit, and generator reactive power upper limit as the initial power flow values of the node.
[0097] In practical implementation, the initial power flow values of each node in the power grid can be preset using a matrix. express:
[0098] ;
[0099] in, , , These represent the injected active power, injected reactive power, and voltage amplitude at node i, respectively. and Let i be the parallel admittance of node i. and These are the lower and upper limits of generator reactive power for node i, respectively. For non-generator nodes, these two quantities are 0.
[0100] Step 206: Input the adjacency matrix and initial power flow values into the pre-trained deep learning model, and output the unbalanced node power flow solution and branch power flow solution; the pre-trained deep learning model is trained using a target loss function, which consists of data-driven loss and physical-driven loss.
[0101] In this embodiment of the invention, the adjacency matrix and initial power flow values can be input into a pre-trained deep learning model to output the unbalanced node power flow solution. and branch tidal flow solution ;
[0102] ;
[0103] ;
[0104] in, Let i be the unbalanced node power flow solution. To inject active power flow solution. To inject reactive power flow solution, This represents the voltage amplitude at the unbalanced node. For the branch power flow solution of branch l, Let L be the active power of branch l. Let be the reactive power of branch l.
[0105] In one example, the training process of a pre-trained deep learning model may include:
[0106] S61, obtain the historical initial values of power flow and the actual power flow solution of the preset power grid;
[0107] S62, input the initial historical tidal current values into the initial deep learning model to obtain the initial tidal current prediction data;
[0108] In the specific implementation, during the training of the deep learning model, the initial values of historical power flow and the actual power flow solution of the preset power grid are first obtained. The initial values of historical power flow are then input into the initial deep learning model to obtain the initial power flow prediction data.
[0109] S63, calculates data-driven losses based on the initial power flow prediction data and actual power flow solutions of the non-equilibrium nodes;
[0110] Next, the data-driven loss can be calculated based on the initial power flow prediction data and the actual power flow solution of the unbalanced nodes.
[0111] Data-driven loss The numerical error between the predicted and actual values of the model is directly constrained by the MSE, which includes two parts: node and branch. The data-driven loss of the nodes is also included. as follows:
[0112] ;
[0113] in, The loss value is driven by node data. The total number of samples in the training set. Let be the total number of nodes, b be the sample index, i be the node index, and sw be the balanced nodes. For the active power injection predicted by the model at node i, Active power injection for the actual power flow solution of node i. Reactive power injection for node i predicted by the model. Reactive power injection for the actual power flow solution of node i. The voltage magnitude at node i predicted by the model. Let be the voltage amplitude of the actual power flow solution at node i.
[0114] Data-driven loss of branch as follows:
[0115] ;
[0116] Where L is the total number of branches, l is the branch number, and b is the sample number. The active power of branch l predicted by the model. The active power of the branch circuit l is the power flow solution. The reactive power of branch l predicted by the model. reactive power of branch circuit l
[0117] MSE (Mean Squared Error Loss) is used in regression tasks to measure the average squared error between predicted and true values.
[0118] S64, calculate the physical drive loss based on the initial power flow prediction data;
[0119] Initial power flow prediction data can include the predicted unbalanced active power and predicted unbalanced reactive power of the samples.
[0120] Physical driving loss The unbalanced active and reactive power at each node is calculated using Kirchhoff's laws, and the specific formula is as follows:
[0121] ;
[0122] in, For physical driving loss, For the predicted unbalanced active power of sample b, For the predicted unbalanced reactive power of sample b, the reactive power injection at the balancing node is not subject to KCL constraints.
[0123] S65, calculate the function value of the target loss function based on the data-driven loss and the physics-driven loss, optimize the parameters of the initial deep learning model based on the function value, and obtain the optimized deep learning model;
[0124] After determining the functional expressions for the data-driven loss and the physical-driven loss of the deep learning model, the optimization objective can be to solve for the objective loss function (the objective loss function is...). ,in ~ These are training hyperparameters manually set based on engineering experience, thus obtaining optimized model parameters. By optimizing the initial deep learning model through optimizing the model parameters, an optimized deep learning model can be obtained.
[0125] S66, determine whether the current iteration number is less than the preset iteration number;
[0126] S67, If not, use the optimized deep learning model as the initial deep learning model, and return to the step of inputting the initial historical tidal current values into the initial deep learning model to obtain the initial tidal current prediction data;
[0127] S68, if so, use the optimized deep learning model as the trained deep learning model.
[0128] In this embodiment of the invention, the number of iterations of the deep learning model can be set (e.g., 1000). When the current iteration number is less than the preset iteration number, the optimized deep learning model is used as the initial deep learning model, and the process returns to the step of inputting the initial historical power flow values into the initial deep learning model to obtain the initial power flow prediction data. If the current iteration number is equal to the preset iteration number, the optimized deep learning model is used as the trained deep learning model.
[0129] In another example, the AdamW optimizer and cosine annealing can be used for training, with 1000 training epochs. The completion of deep learning model training is determined by whether the training curve converges, i.e., whether the objective loss function is minimized. The specific training process can refer to the conventional training workflow based on the AdamW optimizer and cosine annealing, which will not be elaborated here.
[0130] Step 207: Calculate the balanced node power flow solution based on the non-equilibrium node power flow solution and the branch power flow solution;
[0131] In this embodiment of the invention, the power flow solution at the balanced node can be calculated based on the power flow solution at the unbalanced node and the power flow solution at the branch.
[0132] In one example, the unbalanced node power flow solution includes the unbalanced node voltage magnitude; the branch power flow solution includes the branch forward active power, the branch reverse active power, the unbalanced node active power injection, the branch forward reactive power, and the branch reverse reactive power; the balanced node power flow solution includes the balanced node active power injection and the balanced node reactive power injection; step 207 may include the following sub-steps:
[0133] S71, the active power injection at the balancing node is calculated using the branch forward active power, the branch reverse active power, and the active power injection at the unbalanced node.
[0134] S72, calculate the mutual admittance and phase angle difference between the balanced node and each unbalanced node based on the power flow solution of the unbalanced node, the power flow solution of the branch and the preset admittance of each branch of the power grid;
[0135] S73 calculates the reactive power injection at the balancing node based on the voltage amplitude, mutual admittance, and phase angle difference of the unbalanced node.
[0136] In the specific implementation, the active power injection calculation formula for the balancing node is as follows:
[0137] ;
[0138] in, This indicates active power injection at the balancing node, where l represents the line number. This represents the active power (branch forward active power) flowing from node i to node j in line l. This represents the active power flowing from node j to node i in line l (reverse active power of the branch). This represents the active power injection value of the unbalanced node i. The formula is used to calculate the active power injection value of the balanced node by balancing the network loss and the injected active power.
[0139] The formula for calculating reactive power injection at the balancing node is as follows:
[0140] ;
[0141] in, and To balance the real and imaginary parts of the mutual admittance between node i and node i, This represents the phase angle difference between the balancing node and node i.
[0142] Step 208: Output the unbalanced node power flow solution, branch power flow solution, and balanced node power flow solution.
[0143] After calculating the unbalanced node power flow solutions, branch power flow solutions, and balanced node power flow solutions, the unbalanced node power flow solutions, branch power flow solutions, and balanced node power flow solutions can be output as the predicted power flow solutions for the preset power grid.
[0144] This invention eliminates the direct prediction of active and reactive power injection at the slack node by constructing a deep learning model trained with data-driven loss and physical-driven loss. Instead, it predicts only the electrical quantities of each node other than the slack node. At the same time, to ensure that each node meets the power balance constraint and to avoid the error propagation caused by the slack node, physical-driven loss is introduced to limit the active power injection at the slack node, thereby improving the physical consistency and accuracy of the power flow calculation error results.
[0145] Please see Figure 3 , Figure 3This is an architecture diagram of a power system power flow calculation method provided in an embodiment of the present invention. First, the adjacency matrix A of the complete topology of the actual power grid and the initial power flow values X of each node are used as inputs to a deep learning model (including an encoder and a decoder), and the outputs are node power flow solutions (P, Q, V) and branch power flow solutions (P...). L Q L Then, based on the node power flow solution and the branch power flow solution, the power of the slack node is restored to obtain the active power injection and reactive power injection of the slack node.
[0146] The power flow solution output by the deep learning model can be used to optimize the deep learning model through backpropagation, thereby improving the accuracy of the deep learning model's predictions.
[0147] For ease of understanding, the embodiments of the present invention will be described below through specific examples:
[0148] by Figure 4 Taking the IEEE 39-node system shown as an example, the system includes 39 nodes and 46 transmission lines, of which node 3 is the balancing node.
[0149] The predicted and actual values of node power flow output by the deep learning model are shown in Table 1, and the predicted and actual values of branch power flow are shown in Table 2.
[0150] Table 1. Predicted and Actual Nodal Power Flow Values
[0151]
[0152] Table 2. Forecast and Actual Values of Branch Power Flow
[0153]
[0154] Substituting the predicted values into the calculation formulas for active and reactive power injection at the balancing node, we obtain an active power injection value of 548.568 MW (actual value 550.3 MW) and a reactive power injection value of -255.317 Mvar (actual value -257.1 Mvar). It can be seen that the balancing node restoration results of this invention are very accurate.
[0155] Please see Figure 5 , Figure 5 This is a structural block diagram of a power system power flow calculation device provided in an embodiment of the present invention.
[0156] This invention provides a power system power flow calculation device, comprising:
[0157] The adjacency matrix calculation module 501 is used to obtain the topology of the preset power grid and calculate the adjacency matrix of the topology.
[0158] The power flow initial value acquisition module 502 is used to acquire the power flow initial values of each node in the preset power grid;
[0159] The power flow solution output module 503 is used to input the adjacency matrix and initial power flow values into the pre-trained deep learning model and output the power flow solutions for non-equilibrium nodes and branches. The pre-trained deep learning model is trained using a target loss function, which consists of data-driven loss and physical-driven loss.
[0160] The balanced node power flow solution calculation module 504 is used to calculate the balanced node power flow solution based on the unbalanced node power flow solution and the branch power flow solution.
[0161] Output module 505 is used to output unbalanced node power flow solutions, branch power flow solutions, and balanced node power flow solutions.
[0162] In this embodiment of the invention, the adjacency matrix calculation module 501 includes:
[0163] The topology acquisition submodule is used to acquire the topology of a preset power grid;
[0164] The branch and node determination submodule is used to determine the branches and nodes of the preset power grid based on the topology.
[0165] The transformer ratio acquisition submodule is used to obtain the admittance of each branch and the transformer ratio of each branch at each node;
[0166] The adjacency matrix generation submodule is used to generate the adjacency matrix of the topology based on admittance and ratio.
[0167] In this embodiment of the invention, the power flow initial value acquisition module 502 includes:
[0168] The submodule for obtaining injected active power, injected reactive power, voltage amplitude, parallel admittance, generator reactive power lower limit and generator reactive power upper limit is used to obtain the injected active power, injected reactive power, voltage amplitude, parallel admittance, generator reactive power lower limit and generator reactive power upper limit of each node in the preset power grid.
[0169] The power flow initial value generation submodule is used to take injected active power, injected reactive power, voltage amplitude, parallel admittance, generator reactive power lower limit and generator reactive power upper limit as the power flow initial values of the nodes.
[0170] In this embodiment of the invention, the training process of the deep learning model includes:
[0171] The historical power flow initial value and actual power flow solution acquisition unit is used to acquire the historical power flow initial value and the actual power flow solution of the preset power grid.
[0172] The initial tidal current prediction data generation unit is used to input historical tidal current initial values into the initial deep learning model to obtain initial tidal current prediction data.
[0173] The data-driven loss calculation unit is used to calculate the data-driven loss based on the initial power flow prediction data and the actual power flow solution of the non-equilibrium node.
[0174] The physical drive loss calculation unit is used to calculate the physical drive loss based on the initial power flow prediction data.
[0175] The optimization unit is used to calculate the function value of the target loss function based on the data-driven loss and the physics-driven loss, and optimize the parameters of the initial deep learning model based on the function value to obtain the optimized deep learning model.
[0176] The judgment unit is used to determine whether the current iteration number is less than the preset iteration number;
[0177] The return unit is used to, if not, use the optimized deep learning model as the initial deep learning model and return the steps of inputting the initial historical tidal current values into the initial deep learning model to obtain the initial tidal current prediction data;
[0178] The model output unit is used, if so, to take the optimized deep learning model as the trained deep learning model.
[0179] In this embodiment of the invention, the data-driven loss includes node data-driven loss and branch data-driven loss, and the functional expression of the node data-driven loss is:
[0180] ;
[0181] in, The loss value is driven by node data. The total number of samples in the training set. Let be the total number of nodes, b be the sample index, i be the node index, and sw be the balanced nodes. For the active power injection predicted by the model at node i, Active power injection for the actual power flow solution of node i. Reactive power injection for node i predicted by the model. Reactive power injection for the actual power flow solution of node i. The voltage magnitude at node i predicted by the model. Let be the voltage amplitude of the actual power flow solution at node i.
[0182] The functional expression for branch data-driven loss is:
[0183] ;
[0184] Where L is the total number of branches, l is the branch number, and b is the sample number. The active power of branch l predicted by the model. The active power of the branch circuit l is the power flow solution. The reactive power of branch l predicted by the model. The reactive power of the branch circuit l is the power flow solution.
[0185] In this embodiment of the invention, the functional expression for the physical driving loss is:
[0186] ;
[0187] in, For physical driving loss, For the predicted unbalanced active power of sample b, Let b be the predicted unbalanced reactive power.
[0188] In this embodiment of the invention, the unbalanced node power flow solution includes the unbalanced node voltage amplitude; the branch power flow solution includes the branch forward active power, the branch reverse active power, and the unbalanced node active power injection; the balanced node power flow solution includes the balanced node active power injection and the balanced node reactive power injection; the balanced node power flow solution calculation module 504 includes:
[0189] The active power injection calculation submodule for balancing nodes is used to calculate the active power injection of balancing nodes by using the forward active power of branches, the reverse active power of branches, and the active power injection of unbalanced nodes.
[0190] The mutual admittance and phase angle difference calculation submodule is used to calculate the mutual admittance and phase angle difference between the balanced node and each unbalanced node based on the power flow solution of the unbalanced node, the power flow solution of the branch and the preset power grid branch admittance.
[0191] The reactive power injection calculation submodule for balanced nodes is used to calculate the reactive power injection at balanced nodes based on voltage amplitude, voltage amplitude at unbalanced nodes, mutual admittance, and phase angle difference.
[0192] In this embodiment of the invention, the active power injection calculation formula for the balancing node is as follows:
[0193] ;
[0194] in, This indicates active power injection at the balancing node, where l represents the line number. The positive active power of the branch represents the active power flowing from node i to node j in line l. Let be the reverse active power of the branch, representing the active power flowing from node j to node i in line l. This represents the active power injection value of the unbalanced node i;
[0195] The formula for calculating reactive power injection at the balancing node is as follows:
[0196] ;
[0197] in, and To balance the real and imaginary parts of the mutual admittance between node i and node i, This represents the phase angle difference between the balancing node and node i.
[0198] This invention also provides an electronic device, which includes a processor and a memory:
[0199] The memory is used to store program code and transfer the program code to the processor;
[0200] The processor is used to execute the power system power flow calculation method of this invention according to the instructions in the program code.
[0201] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0202] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0203] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0204] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0205] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0206] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0207] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0208] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0209] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0210] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A power flow calculation method for a power system, characterized in that, include: Obtain the topology of the preset power grid and calculate the adjacency matrix of the topology; Obtain the initial power flow values of each node in the preset power grid; The adjacency matrix and the initial power flow values are input into a pre-trained deep learning model, which outputs the unbalanced node power flow solution and the branch power flow solution. The pre-trained deep learning model is trained using a target loss function, which consists of data-driven loss and physical-driven loss. Calculate the balanced node power flow solution based on the non-balanced node power flow solution and the branch power flow solution; Output the unbalanced node power flow solution, the branch power flow solution, and the balanced node power flow solution.
2. The method according to claim 1, characterized in that, The steps of obtaining the topology of the preset power grid and calculating the adjacency matrix of the topology include: Obtain the topology of the preset power grid; The branches and nodes of the preset power grid are determined based on the topology. Obtain the admittance of each branch and the transformation ratio of each branch at each node; The adjacency matrix of the topology is generated based on the admittance and the ratio.
3. The method according to claim 1, characterized in that, The step of obtaining the initial power flow values of each node in the preset power grid includes: Obtain the injected active power, injected reactive power, voltage amplitude, parallel admittance, generator reactive power lower limit and generator reactive power upper limit for each node of the preset power grid; The injected active power, the injected reactive power, the voltage amplitude, the parallel admittance, the generator reactive power lower limit, and the generator reactive power upper limit are used as the initial power flow values of the node.
4. The method according to claim 1, characterized in that, The training process of the deep learning model includes: Obtain the initial historical power flow values and the actual power flow solution of the preset power grid; The initial historical trend values are input into the initial deep learning model to obtain the initial trend prediction data; The data-driven loss is calculated based on the initial power flow prediction data of the unbalanced nodes and the actual power flow solution. Calculate the physical drive loss based on the initial power flow prediction data; The function value of the target loss function is calculated based on the data-driven loss and the physics-driven loss, and the parameters of the initial deep learning model are optimized based on the function value to obtain the optimized deep learning model. Determine if the current iteration count is less than the preset iteration count; If not, use the optimized deep learning model as the initial deep learning model, and return to the step of inputting the initial historical current value into the initial deep learning model to obtain the initial current prediction data; If so, the optimized deep learning model is used as the trained deep learning model.
5. The method according to claim 4, characterized in that, The data-driven loss includes node data-driven loss and branch data-driven loss, and the functional expression of the node data-driven loss is: ; in, The loss value is driven by node data. The total number of samples in the training set. Let be the total number of nodes, b be the sample index, i be the node index, and sw be the balanced nodes. For the active power injection predicted by the model at node i, Active power injection for the actual power flow solution of node i. Reactive power injection for node i predicted by the model. Reactive power injection for the actual power flow solution of node i. The voltage magnitude at node i predicted by the model. The actual power flow solution voltage magnitude for node i; The functional expression for the branch data-driven loss is: ; Where L is the total number of branches, l is the branch number, and b is the sample number. The active power of branch l predicted by the model. The active power of the branch circuit l is the power flow solution. The reactive power of branch l predicted by the model. The reactive power of the branch circuit l is the power flow solution.
6. The method according to claim 4, characterized in that, The functional expression for the physical driving loss is: ; in, For physical driving loss, For the predicted unbalanced active power of sample b, Let b be the predicted unbalanced reactive power.
7. The method according to claim 3, characterized in that, The unbalanced node power flow solution includes the unbalanced node voltage amplitude; the branch power flow solution includes the branch forward active power, the branch reverse active power, and the unbalanced node active power injection; the balanced node power flow solution includes the balanced node active power injection and the balanced node reactive power injection. The step of calculating the balanced node power flow solution based on the non-balanced node power flow solution and the branch power flow solution includes: The active power injection at the balancing node is calculated using the forward active power of the branch, the reverse active power of the branch, and the active power injection at the unbalanced node. The mutual admittance and phase angle difference between the balanced node and each unbalanced node are calculated based on the power flow solution of the unbalanced node, the power flow solution of the branch, and the preset admittance of each branch of the power grid. The reactive power injection at the balanced node is calculated based on the voltage amplitude of the unbalanced node, the mutual admittance, and the phase angle difference.
8. The method according to claim 7, characterized in that, The active power injection calculation formula for the balancing node is as follows: ; in, This indicates active power injection at the balancing node, where l represents the line number. The positive active power of the branch represents the active power flowing from node i to node j in line l. Let be the reverse active power of the branch, representing the active power flowing from node j to node i in line l. This represents the active power injection value of the unbalanced node i; The formula for calculating reactive power injection at the balancing node is as follows: ; in, and To balance the real and imaginary parts of the mutual admittance between node i and node i, This represents the phase angle difference between the balancing node and node i.
9. A power flow calculation device for a power system, characterized in that, include: The adjacency matrix calculation module is used to obtain the topology of a preset power grid and calculate the adjacency matrix of the topology. The power flow initial value acquisition module is used to acquire the power flow initial value of each node of the preset power grid; The power flow solution output module is used to input the adjacency matrix and the initial power flow values into a pre-trained deep learning model and output the power flow solutions for unbalanced nodes and branches; the pre-trained deep learning model is trained using a target loss function, which consists of data-driven loss and physical-driven loss. The balanced node power flow solution calculation module is used to calculate the balanced node power flow solution based on the unbalanced node power flow solution and the branch power flow solution. The output module is used to output the power flow solutions of the unbalanced nodes, the branch power flow solutions, and the balanced nodes.
10. An electronic device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the power system power flow calculation method according to any one of claims 1-8 according to the instructions in the program code.