A data-driven optimal power flow calculation method considering topological feature learning

Through graph convolutional neural network and feature construction methods, the topological characteristics and physical characteristics of the power system are extracted, which solves the accuracy and computational burden problems of optimal power flow calculation under topology changes in the existing technology, and realizes the optimization of power flow under multiple topologies. Computationally efficient and adaptable.

CN116316629BActive Publication Date: 2024-09-03HANGZHOU ELECTRIC EQUIP MFG +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211690444.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2024-09-03
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

Existing data-driven optimal power flow calculation methods are difficult to ensure accuracy when topology changes, and suffer from feature loss and topology combination explosion caused by feature engineering, which limits its applicability in practical applications.

Method used

Using graph convolutional neural network, by constructing a graph convolutional neural network based on the optimal power flow model, we train the optimal power flow calculation model under various topologies, combine the feature construction and correlation learning methods, extract topological features and physical features, and adapt to topology changes and reduce computational burden.

Benefits of technology

It achieves good adaptability and approximate numerical calculation results under a variety of topologies, significantly improves the accuracy and efficiency of data-driven optimal power flow calculations, alleviates the computational burden, and enhances the applicability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116316629B
    Figure CN116316629B
Patent Text Reader

Abstract

The present invention discloses a data-driven optimal power flow calculation method considering topological feature learning, comprising the following steps: 1) establishing an optimal power flow model for an electric power system; 2) constructing a graph convolutional neural network based on the optimal power flow model, and training the graph convolutional neural network to obtain a neural network model for optimal power flow calculation; 3) constructing input features of the neural network model based on the optimal power flow model for the electric power system; 4) inputting the input features of the neural network model into the neural network model for optimal power flow calculation to obtain an optimal power flow calculation result. The present invention can train graph convolutional neural networks for optimal power flow calculation under a variety of topologies, and has good adaptability to a variety of topologies. The present invention can train graph convolutional neural networks for optimal power flow calculation under a variety of topologies, and has good adaptability to a variety of topologies, and at the same time, the optimal power flow results calculated by the present invention approximate the numerical calculation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power systems and automation thereof, and in particular to a data-driven optimal power flow calculation method considering topological feature learning. Background Art

[0002] Optimal power flow (OPF) calculation is an important method for power system analysis. It is widely used in power system planning, market clearing, economic dispatch, etc. OPF solution is basically a non-convex optimization problem with NP-hard computational complexity. For application scenarios such as probability analysis, OPF calculations are required for a large number of randomly generated samples and statistics are performed to obtain probability statistical results. However, the huge computational burden makes it difficult to apply it in actual power grids, and there is an urgent need to improve the OPF calculation method.

[0003] Existing research mainly focuses on how to speed up the single solution of OPF to reduce the cumulative computational burden of a large number of randomly generated samples. By simplifying the OPF model, the nonlinear model is linearized. Or heuristic algorithms and advanced numerical calculation methods are used. However, the cumulative computational burden of a large number of randomly generated samples in probability analysis is still very high. With the development of artificial intelligence, using data-driven methods to solve OPF is an effective way to solve the cumulative computational burden.

[0004] At present, stacked extreme learning machines, deep neural networks (DNNs), convolutional neural networks (CNNs) and GCNNs are used by many scholars for OPF calculations. These data-driven methods reduce the cumulative computational burden of OPF calculations of a large number of randomly generated samples from two aspects: direct solution methods and indirect acceleration methods. The direct solution method trains a neural network to fit the mapping relationship from load to optimal power flow solution through a large number of optimal power flow samples. This method can be 20-100 times faster than traditional numerical calculation methods. In addition to using neural network fitting, some scholars also use other machine learning methods to fit the mapping relationship of optimal power flow, such as Gaussian processes. In order to ensure that the control variables of the unit output obtained by the final mapping do not violate the actual constraints of the power grid, the constraints are embedded or added to the optimization objectives while the machine learning method is trained. The indirect acceleration method predicts the constraints that work in the OPF model through machine learning or neural networks, and reduces the ineffective constraints to reduce the complexity of the model, thereby accelerating the solution of OPF.

[0005] However, in the above data-driven accelerated OPF solution method, whether the model obtained by training can ensure the accuracy of the solution when the working conditions change directly affects whether the data-driven method can be applied to the actual analysis of OPF. Topological changes lead to the discreteness of the projection between OPF load and unit output. Existing studies can calculate the OPF solution under topological structure changes through topological feature engineering and meta-learning methods, but there are still some shortcomings, such as feature loss caused by feature engineering. In addition, the combinatorial explosion of topology still exists, and only a few topologies can be considered in practical applications. Therefore, embedding the system topology in the neural network and using the graph convolution kernel based on the adjacent matrix to extract the topological features can effectively solve the problem of topological combinatorial explosion. When the system topology changes, the GCNN topology can be directly adjusted to adapt to the new scenario. However, the connections between different nodes in the system are not the same, and their conductance and admittance physical quantities are different. How to extract topological features under different line physical quantities has become the main topic of topological embedded graph convolution.

[0006] In summary, there is an urgent need to study a graph convolution optimal power flow calculation method that considers topological feature learning to alleviate the cumulative computational burden in a large number of random scenarios. Summary of the invention

[0007] In order to solve the defects and shortcomings in the above-mentioned prior art, the present invention provides a data-driven optimal power flow calculation method that considers topological feature learning and can be trained for an optimal power flow calculation graph convolutional neural network under a variety of topologies. The method has good adaptability to a variety of topologies and the optimal power flow results calculated are approximate to the numerical calculation results.

[0008] The technical solution of the present invention is as follows: A data-driven optimal power flow calculation method considering topological feature learning comprises the following steps:

[0009] 1) Establish the optimal power flow model of the power system;

[0010] 2) Construct a graph convolutional neural network based on the optimal power flow model and train the graph convolutional neural network to obtain a neural network model for optimal power flow calculation;

[0011] 3) Based on the optimal power flow model of the power system, construct the input characteristics of the neural network model;

[0012] 4) Input the input features of the neural network model into the neural network model of the optimal power flow calculation to obtain the optimal power flow calculation results.

[0013] Furthermore, the optimal power flow model of the power system is as follows:

[0014]

[0015]

[0016]

[0017]

[0018]

[0019] In the formula, a i , b i , c i is the cost coefficient of the i-th unit; PG i , QG i , are the active and reactive outputs of the i-th unit; PG i , QG i , is the upper and lower limits of the active and reactive output of the i-th unit; S G , S B , S K They are the sets of unit, node and line numbers; PD i , QD i is the active and reactive load of the ith node; Γ(·), Ψ(·) are the calculation expressions of active and reactive injection power of the node, respectively; z(·) is the function of topology change; V i , is the upper and lower limits of the voltage at the i-th node; G ij , B ij are the i-th row and j-th column elements in the conductance matrix and the susceptance matrix respectively; PL k is the active power flow of the kth line; PL k , are the upper and lower limits of the active power flow of the kth line.

[0020] Further, in step 2), the step of constructing a graph convolutional neural network based on the optimal power flow model includes:

[0021] 2.1) The nodes and lines in the power system are respectively the nodes and edges in GCNN, and the graph structure of GCNN is constructed in and is the set of vertices and edges;

[0022] Among them, each graph convolution layer Y is as follows:

[0023] Y=f(φ(X,A)W+B) (6)

[0024] Where φ(·) is the aggregation function of node features in the graph neural network; X and Y are the input and output features of the graph convolution layer, respectively; A represents the topological connection relationship of the graph; W and B are the trainable parameters of the graph convolution layer.

[0025] 2.2) Formula (3) is expressed as a power flow equation in a rectangular coordinate system, and z(·) is used to represent the change in system topology, resulting in:

[0026]

[0027]

[0028] In the formula, e i 、f i Input features for graph convolution;

[0029] 2.3) Replace the equations (7)-(8) with All terms of are moved to the left side of the equation, and then the variable α is introduced i , β i , δ i ,λ i , and obtain a new power flow expression, namely:

[0030] δ i =e i α i +f i β i (9)

[0031] λ i =f i α i -e i β i (10)

[0032] Among them, the parameter α i , β i , δ i ,λ i They are as follows:

[0033]

[0034]

[0035]

[0036]

[0037] 2.4) Establish the graph convolution neighborhood aggregation expression under a given topology, namely:

[0038]

[0039]

[0040] 2.5) Substituting formulas (15)-(16) into formula (6), we can obtain the graph convolution function for extracting topological features and physical features, namely:

[0041]

[0042] Further, in step 3), based on the optimal power flow model of the power system, the step of constructing the input features of the neural network model includes:

[0043] 3.1) Set the number of iterations i, given the initial values ​​of the graph convolution input feature e and the graph convolution input feature f, that is:

[0044] e=1,f=0 (18)

[0045] 3.2) Substitute formula (18) and the node load into formula (7) and formula (8) to calculate the active and reactive output of the computer group.

[0046] 3.3) According to the upper and lower limits of the active and reactive output of the unit, the PG i , QG i By limiting, we get:

[0047]

[0048]

[0049] 3.4) Substitute the limited active and reactive output of the unit into the domain aggregation expressions (15) and (16), update the graph convolution input features e and f, and normalize the updated graph convolution input features e and f to obtain:

[0050]

[0051] 3.5) Determine whether the number of iterations i≤0 holds. If so, output the input features of the neural network model. Otherwise, set i=i-1 and return to step 3.2).

[0052] Furthermore, the loss function during graph convolutional neural network training is as follows:

[0053] L=L supervised +L Δ,PG (twenty two)

[0054] Among them, there is a supervised loss function L supervised , associated learning loss function L Δ,PG They are as follows:

[0055] L Δ,PG =E[(PG out -f PG (Vout )) 2 ] (twenty three)

[0056] L supervised =E[(y out -y label ) 2 ] (twenty four)

[0057] Furthermore, the optimal power flow calculation results include node voltage amplitude, phase angle, node active and reactive load, unit active and reactive output, conductance and susceptance.

[0058] The technical effect of the present invention is unquestionable. The present invention can train the optimal power flow calculation graph convolutional neural network under various topologies and has good adaptability to various topologies. At the same time, the optimal power flow result calculated by the present invention approximates the numerical calculation result. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is the graph convolutional neural network structure;

[0060] Figure 2 Flowchart of the feature construction strategy, where i is the number of iterations;

[0061] Figure 3 Schematic diagram of supervised learning and association learning;

[0062] Figure 4 is the loss function of the three methods in the training process;

[0063] Figure 5 is the error distribution of different methods in the test set;

[0064] Figure 6 It is the test error of different neural networks in the test set. T1-T5 represent 5 different topologies. DETAILED DESCRIPTION

[0065] The present invention is further described below in conjunction with the embodiments, but it should not be understood that the above subject matter of the present invention is limited to the following embodiments. Without departing from the above technical ideas of the present invention, various substitutions and changes are made according to the common technical knowledge and customary means in the art, which should all be included in the protection scope of the present invention.

[0066] Embodiment 1:

[0067] See also Figures 1 to 6 , a data-driven optimal power flow calculation method considering topological feature learning, comprising the following steps:

[0068] 1) Establish the optimal power flow model of the power system;

[0069] 2) Construct a graph convolutional neural network based on the optimal power flow model and train the graph convolutional neural network to obtain a neural network model for optimal power flow calculation;

[0070] 3) Based on the optimal power flow model of the power system, construct the input characteristics of the neural network model;

[0071] 4) Input the input features of the neural network model into the neural network model of the optimal power flow calculation to obtain the optimal power flow calculation results.

[0072] The optimal power flow model of the power system is as follows:

[0073]

[0074]

[0075]

[0076]

[0077]

[0078] In the formula, a i , b i , c i is the cost coefficient of the i-th unit; PG i , QG i , are the active and reactive outputs of the i-th unit; PG i , QG i , is the upper and lower limits of the active and reactive output of the i-th unit; S G , S B , S K They are the sets of unit, node and line numbers; PD i , QD i is the active and reactive load of the ith node; Γ(·), Ψ(·) are the calculation expressions of active and reactive injection power of the node, respectively; z(·) is the function of topology change; V i , is the upper and lower limits of the voltage at the i-th node; G ij , B ij are the i-th row and j-th column elements in the conductance matrix and the susceptance matrix respectively; PL k is the active power flow of the kth line; PL k , are the upper and lower limits of the active power flow of the kth line.

[0079] In step 2), the steps of constructing a graph convolutional neural network based on the optimal power flow model include:

[0080] 2.1) The nodes and lines in the power system are respectively the nodes and edges in GCNN, and the graph structure of GCNN is constructed in and is the set of vertices and edges;

[0081] Among them, each graph convolution layer Y is as follows:

[0082] Y=f(φ(X,A)W+B) (6)

[0083] Where φ(·) is the aggregation function of node features in the graph neural network; X and Y are the input and output features of the graph convolution layer, respectively; A represents the topological connection relationship of the graph; W and B are the trainable parameters of the graph convolution layer.

[0084] 2.2) Formula (3) is expressed as a power flow equation in a rectangular coordinate system, and z(·) is used to represent the change in system topology, resulting in:

[0085]

[0086]

[0087] In the formula, e i 、f i Input features for graph convolution;

[0088] 2.3) Replace the equations (7)-(8) with All terms of are moved to the left side of the equation, and then the variable α is introduced i , β i , δ i ,λ i , and obtain a new power flow expression, namely:

[0089] δ i =e i α i +f i β i (9)

[0090] λ i =f i α i -e i β i (10)

[0091] Among them, the parameter α i , β i , δ i ,λ i They are as follows:

[0092]

[0093]

[0094]

[0095]

[0096] 2.4) Establish the graph convolution neighborhood aggregation expression under a given topology, namely:

[0097]

[0098]

[0099] 2.5) Substituting formulas (15)-(16) into formula (6), we can obtain the graph convolution function for extracting topological features and physical features, namely:

[0100]

[0101] In step 3), based on the optimal power flow model of the power system, the steps of constructing the input features of the neural network model include:

[0102] 3.1) Set the number of iterations i, given the initial values ​​of the graph convolution input feature e and the graph convolution input feature f, that is:

[0103] e=1,f=0 (18)

[0104] 3.2) Substitute formula (18) and the node load into formula (7) and formula (8) to calculate the active and reactive output of the computer group.

[0105] 3.3) According to the upper and lower limits of the active and reactive output of the unit, the PG i , QG i By limiting, we get:

[0106]

[0107]

[0108] 3.4) Substitute the limited active and reactive output of the unit into the domain aggregation expressions (15) and (16), update the graph convolution input features e and f, and normalize the updated graph convolution input features e and f to obtain:

[0109]

[0110] 3.5) Determine whether the number of iterations i≤0 holds. If so, output the input features of the neural network model. Otherwise, set i=i-1 and return to step 3.2).

[0111] The loss function during graph convolutional neural network training is as follows:

[0112] L=L supervised +L Δ,PG (twenty two)

[0113] Among them, there is a supervised loss function L supervised , associated learning loss function L Δ,PG They are as follows:

[0114] L Δ,PG =E[(PG out -f PG (V out )) 2 ] (twenty three)

[0115] L supervised =E[(y out -y label ) 2 ] (twenty four)

[0116] The optimal power flow calculation results include node voltage amplitude, phase angle, node active and reactive load, unit active and reactive output, conductance and susceptance.

[0117] Embodiment 2:

[0118] A data-driven optimal power flow calculation method considering topological feature learning includes the following steps:

[0119] 1) Establishment of the optimal power flow model of the power system

[0120] The optimal power flow model of the power system is as follows:

[0121]

[0122]

[0123]

[0124]

[0125]

[0126] In the formula, a i , b i , c i is the cost coefficient of the i-th unit; PG i , QG i is the active and reactive output of the i-th unit; PG i , QG i , The upper and lower limits of the active and reactive output of the i-th unit; SG ,S B ,S K They are the sets of unit, node and line numbers; PD i ,QD i is the active and reactive load of the ith node; Γ(·), Ψ(·) are the calculation expressions of active and reactive injection power of the node, respectively; z(·) is the function of topology change; V i , is the upper and lower limits of the voltage at the i-th node; G ij , B ij are the i-th row and j-th column elements in the conductance matrix and the susceptance matrix respectively; PL k is the active power flow of the kth line; PL k , are the upper and lower limits of the active power flow of the kth line.

[0127] 2) Constructing a graph convolutional neural network based on the optimal power flow model

[0128] The nodes and lines in the power system are the nodes and edges in GCNN respectively. Construct the graph structure of GCNN in and is the vertex set and edge set. And φ(·) is the aggregation function of node features in the graph neural network, then each graph convolution layer can be expressed as:

[0129] Y=f(φ(X,A)W+B) (6)

[0130] Among them, X and Y are the input and output features of the graph convolution layer respectively; A represents the topological connection relationship of the graph; W and B are the trainable parameters of the graph convolution layer.

[0131] Derived from the node feature aggregation function in the convolutional layer of the optimal power flow model:

[0132] 2.1) Express equation (3) as a power flow equation in a rectangular coordinate system, and use z(.) to represent the change in system topology.

[0133]

[0134]

[0135] 2.2) will include All terms of are moved to the left side of the equation, and then the variable α is introduced i , β i , δ i ,λ i , the new power flow expression is as follows:

[0136] δ i =ei α i +f i β i (9)

[0137] λ i =f i α i -e i β i (10)

[0138] in:

[0139]

[0140]

[0141]

[0142]

[0143] Assume α i , β i , δ i ,λ i All e i , f i is the input feature of graph convolution. In equations (9) and (10), e i , f i is the updated node feature after neighborhood aggregation in the graph convolution layer. Then α i , β i , δ i ,λ i is the intermediate eigenvalue of neighborhood aggregation. By solving the linear equation to simplify the coupling relationship between equation (9) and equation (10), we finally obtain the expression of graph convolution neighborhood aggregation under a given topology:

[0144]

[0145]

[0146] 2.3) Substitute (15) and (16) into (6) to obtain the graph convolution function of the model:

[0147]

[0148] In (17), the power flow equation containing nonlinear and topological features is embedded in the forward propagation of the graph convolutional layer, which can fully extract the topological and physical features.

[0149] By sequentially connecting multiple convolutional layers, stretching layers, and fully connected layers, a graph convolutional neural network based on the optimal power flow model is formed. The graph convolutional neural network structure is as follows: Figure 1 shown.

[0150] 3) Constructing GCNN input features based on the optimal power flow model

[0151] The optimal power flow problem is an optimization problem, which not only needs to consider the state characteristics, but also needs to encode the constraint characteristics. The steps of the feature construction method are as follows:

[0152] 3.1) Given the initial values ​​of e and f.

[0153] e=1,f=0 (18)

[0154] 3.2) Calculate the active and reactive output of the computer group according to the power flow equation, that is, substitute equation (18) and the node load into equations (7) and (8).

[0155] 3.3) According to the upper and lower limits of the active and reactive output of the unit, the PG i , QG i Limiting is performed, such as:

[0156]

[0157]

[0158] 3.4) Substitute the limited active and reactive output of the unit into the domain aggregation expressions (15) and (16), calculate the updated e and f, and normalize them to avoid the divergence of node features in subsequent iterations.

[0159]

[0160] 3.5) According to Figure 2 Input feature construction iteration strategy to build node input features.

[0161] 4) Establish a learning method based on the correlation of neural network output

[0162] The output of the optimal power flow calculation results includes node voltage, phase angle, line power flow and unit active and reactive output. All physical quantities satisfy the basic AC power flow equation. Therefore, the association learning loss function is added on the basis of the general supervised loss function. The back propagation diagram of the supervised error and the association relationship error is as follows: Figure 3 As shown. And because the influence on the unit output is particularly prominent in the power flow equation, the correlation learning between the unit active output and the node voltage is added to the association learning loss function, and the loss function is as follows:

[0163] L=L supervised +L Δ,PG (twenty two)

[0164] in:

[0165] L Δ,PG =E[(PG out -f PG (V out )) 2 ] (twenty three)

[0166] L supervised =E[(y out -y label ) 2 ] (twenty four)

[0167] 5) Obtain the optimal power flow data of the power system and input it into the model-driven graph convolutional neural network for training, and finally obtain the neural network model for optimal power flow calculation.

[0168] The optimal power flow data of the power system include node voltage amplitude, phase angle, node active and reactive load, unit active and reactive output, conductance and susceptance.

[0169] Embodiment 3:

[0170] A verification experiment of a data-driven optimal power flow calculation method considering topological feature learning is as follows:

[0171] This embodiment uses a fixed topology for testing in an IEEE 57 node system. Wind farms and photovoltaic systems are integrated in the IEEE57 node system to simulate the uncertainty of renewable energy. The wind speed follows a Weibull distribution with λ=5.089 and k=2.016. The solar irradiance follows a Beta distribution with α=2.06 and β=2.5. Wind farms and PV are randomly connected to different nodes, so that the renewable energy penetration rate of the system reaches 35.77%.

[0172] It is assumed that the load fluctuation follows a normal distribution, the mean value is equal to the default value of the system, and the standard deviation is 0.1. In this embodiment, the PYPOWER library is used to generate training and test data on a PC with an Intel Core i7-10700K CPU @ 3.80GHz, 3.80GHz, 16GB RAM, and NIVIDIA GeForceRTX 2080Ti, and neural network training is performed. 10,000 sets of training samples and 2,000 sets of test samples are collected.

[0173] The z-normalization method was used in all test cases:

[0174]

[0175] where y mean ,y std are the mean and standard deviation respectively.

[0176] In this embodiment, four different neural networks are built. M1 is a classic graph convolutional neural network, and its convolution kernel is mainly derived according to the node connection matrix. The convolution kernel of the convolutional neural network of M2 is a convolution kernel obtained according to the Gaussian transformation of the impedance matrix. The convolution kernel of M3 is the convolution kernel of the proposed method. M4 is a method composed of the proposed model-driven graph convolution and feature construction method. M5 adds an association learning strategy based on M4. All neural networks are built under the Tensorflow2.0 deep learning framework, and the adam optimizer is used to train the neural network.

[0177] In this embodiment, the absolute value of the average absolute error between the unit output and voltage during the training process is as follows: Figure 4 As shown in Figure 2. M5 is trained on the basis of M4, so the error during its training is not shown. In the test set, the error of all samples is as follows Figure 5 As shown. Finally, the probability accuracy of different methods in the test set is counted. The threshold of unit output is set to 5MW, and the threshold of unit voltage is set to 0.001.

[0178] Table 1 Probabilistic accuracy of different methods on unit active output and voltage

[0179]

[0180] 1 P VG,0.001 The probability accuracy indicates the probability that the error is less than 0.001pu

[0181] 2 P PG,1 is the probability accuracy indicating the probability that the error is less than 1MW

[0182] Compared with M1, M3 converges faster during training and can achieve a smaller error. In terms of the accuracy of the test set, M3 is 5.48% higher than M1. This shows that the use of the proposed model to drive graph convolution can better extract topological features in the power system than the classic convolutional neural network. On the contrary, the graph convolution kernel obtained by directly using the impedance matrix Gaussian transformation converges more slowly. Purely using the impedance matrix in the power system to design the convolution kernel ignores the physical characteristics between the physical quantities in the power system, resulting in its effect not being as good as directly using the connection matrix. In the examples of M3 and M4, M4 is slightly faster than M3 in training. This shows that the proposed feature construction method can improve the test accuracy, but the improvement in convergence is not significant. Finally, M4 is compared with M5. The two are very similar in test accuracy. From the test sample error distribution diagram, it can be seen that the proposed association learning method can have stronger adaptability to individual abnormal points.

[0183] In summary, the proposed model-driven graph convolution, feature construction method and association learning method can effectively improve the prediction accuracy of neural networks under fixed topology.

[0184] Embodiment 4:

[0185] A verification experiment of a data-driven optimal power flow calculation method considering topological feature learning is as follows:

[0186] This embodiment uses multiple topologies for testing in IEEE 39-node, 57-node, 118-node and 300-node systems. Wind farms and photovoltaic systems are integrated in each system to simulate the uncertainty of renewable energy. The wind speed obeys the Weibull distribution, where λ=5.089, k=2.016. The solar irradiance obeys the Beta distribution, where α=2.06, β=2.5. The wind farm and PV are randomly connected to different nodes so that the renewable energy penetration rate of the system reaches as shown in Table 2. It is assumed that the load fluctuation obeys a normal distribution, the mean value is equal to the default value of the system, and the standard deviation is 0.1. This embodiment uses the PYPOWER library to generate training and test data on a PC with an Intel Core i7-10700K CPU@3.80GHz, 3.80GHz, 16GB RAM and NIVIDIA GeForce RTX 2080Ti, and performs neural network training. And when collecting training samples, line faults are set to achieve different topological considerations, and a total of 10,000 training samples and 2,000 test samples are collected.

[0187] Table 2 Renewable energy penetration in different systems

[0188]

[0189] The z-normalization method was used in all test cases:

[0190]

[0191] where y mean ,y std are the mean and standard deviation respectively.

[0192] In this embodiment, on the basis of embodiment one, two fully connected neural networks and convolutional neural networks are built. The fully connected neural network consists of three fully connected layers, with 1000 neurons in each layer, denoted as M8 and M9 respectively. The input topological feature of M8 is the deviation of the node voltage after the topology changes. The topological feature of M9 uses the diagonal elements of the susceptance matrix. The convolutional neural network consists of four convolutional layers and three fully connected layers, and the two networks are denoted as M6 and M7 respectively. The convolution kernel size of the convolutional layer is 3x3, and the convolution depth of different layers is [64,128,256,256]. There are 1000 neurons in each layer of the fully connected layer. The activation function of all the above neural network hidden layers uses Relu. All neural networks are built under the Tensorflow2.0 deep learning framework, and the adam optimizer is used to train the neural network.

[0193] Finally, the five neural networks were trained using the collected samples and tested in the test set. The test accuracy is shown in Table 3.

[0194] Table 3 Test accuracy under different system topologies

[0195]

[0196] It can be found in Table 3 that M5 has a higher test accuracy than other methods, reaching 99% in the IEEE57-node system, and the test accuracy in other systems is almost greater than 90%. In the IEEE 118-node system and the IEEE 300-node system, the accuracy of the unit voltage is only 93.49% and 92.72%. It is still significantly higher than other methods. Overall, the average improvement accuracy of the proposed method on different systems is 13.30%, and the maximum can reach 32.63%. And by comparing between different systems, it can be found that with the increase of system scale, the test accuracy of the neural network gradually decreases under 10,000 samples. For large systems, 10,000 samples still cannot meet the accuracy requirements.

[0197] To further analyze the test accuracy of the neural network under different topologies, the average error of each sample unit voltage and unit output under the IEEE 300-node system is used as the x-axis and y-axis data of the two-dimensional graph. All sample errors in the test set are visualized. The results are shown in Figure 2. Figure 6 shown.

[0198] From the test results, we can see that the error of the proposed method in T1 is larger than that of the other four topologies. An abnormal data appears in T2. ​​In other methods, almost all of them only conduct targeted learning on one topology, and the error of this topology is significantly smaller than that of other topologies. For example, the error of M6, M7 and M9 for T3 is very low, while the error of the other four topologies is very high. Therefore, through the error analysis of different topologies, it can be seen that the adaptability of the proposed method to topology is significantly higher than that of the existing methods.

[0199] The present invention discloses a graph convolutional neural network optimal power flow calculation algorithm with stronger topological adaptability. In view of the fact that data-driven methods lack the consideration of topological features and physical characteristics in the design and training of graph convolutional neural networks, a graph convolution design, feature construction and association learning method based on the optimal power flow model is proposed, which greatly improves the adaptability of graph convolutional neural networks to different topologies.

Claims

1. A data-driven optimal power flow calculation method considering topological feature learning, characterized in that: The following steps are involved: 1) Establish the optimal power flow model of the power system; 2) Construct a graph convolutional neural network based on the optimal power flow model and train the graph convolutional neural network to obtain a neural network model for optimal power flow calculation; 3) Based on the optimal power flow model of the power system, construct the input characteristics of the neural network model; 4) Inputting the input features of the neural network model into the neural network model of the optimal power flow calculation to obtain the optimal power flow calculation results; The optimal power flow model of the power system is as follows: In the formula, a i , b i , c i is the cost coefficient of the i-th unit; PG i , QG i is the active and reactive output of the i-th unit; is the upper and lower limits of the active and reactive output of the i-th unit; S G , S B , S K They are the sets of unit, node and line numbers; PD i , QD i is the active and reactive load of the ith node; Γ(·), Ψ(·) are the calculation expressions of active and reactive injection power of the node, respectively; z(·) is the function of topology change; is the upper and lower limits of the voltage at the i-th node; G ij , B ij are the i-th row and j-th column elements in the conductance matrix and susceptance matrix respectively; PL k is the active power flow of the kth line; are the upper and lower limits of the active power flow of the kth line; In step 2), the steps of constructing a graph convolutional neural network based on the optimal power flow model include: 2.1) The nodes and lines in the power system are respectively the nodes and edges in GCNN, and the graph structure of GCNN is constructed in and is the set of vertices and edges; Among them, each graph convolution layer Y is as follows: Y=f(φ(X,A)W+B) (6) Where φ(·) is the aggregation function of node features in the graph neural network; X and Y are the input and output features of the graph convolution layer, respectively; A represents the topological connection relationship of the graph; W and B are the trainable parameters of the graph convolution layer; 2.2) Formula (3) is expressed as a power flow equation in a rectangular coordinate system, and z(·) is used to represent the change in system topology, resulting in: In the formula, e i 、f i Input features for graph convolution; 2.3) Replace the equations (7)-(8) with All terms of are moved to the left side of the equation, and then the variable α is introduced i , β i , δ i ,λ i , and obtain a new power flow expression, namely: d i =e i a i +f i b i (9) l i =f i a i -e i b i (10) Among them, the parameter α i , β i , δ i ,λ i They are as follows: 2.4) Establish the graph convolution neighborhood aggregation expression under a given topology, namely: 2.5) Substituting formulas (15)-(16) into formula (6), we can obtain the graph convolution function for extracting topological features and physical features, namely: In step 3), based on the optimal power flow model of the power system, the steps of constructing the input features of the neural network model include: 3.1) Set the number of iterations m, and give the initial values ​​of the graph convolution input feature e and the graph convolution input feature f, that is: e=1,f=0;(18) 3.2) Substitute formula (18) and the node load into formula (7) and formula (8) to calculate the active and reactive output of the computer group; 3.3) According to the upper and lower limits of the active and reactive output of the unit, the PG i , QG i By limiting, we get: 3.4) Substitute the limited active and reactive output of the unit into the domain aggregation expressions (15) and (16), update the graph convolution input features e and f, and normalize the updated graph convolution input features e and f to obtain: 3.5) Determine whether the number of iterations m≤0 is true. If so, output the input features of the neural network model. Otherwise, set m=m-1 and return to step 3.2); The loss function during graph convolutional neural network training is as follows: L=L supervised +L Δ,PG (twenty two) in, Supervised loss function L supervised , associated learning loss function L Δ,PG They are as follows: L Δ,PG =E[(PG out -f PG (V out )) 2 ] (23) L supervised =E[(and out -and label ) 2 ]。 (24) 2. A data-driven optimal power flow calculation method considering topological feature learning according to claim 1, characterized in that: The optimal power flow calculation results include node voltage amplitude, phase angle, node active and reactive load, unit active and reactive output, conductance and susceptance.