A method and system for predicting optimal power flow in power system considering topology changes
By using convolutional neural network and attention mechanism in the power system to extract features and combining the loss function of topological changes, the problem of fast accuracy of optimal current prediction of complex node networks is solved, and efficient prediction of topologically changed power node networks is achieved.
Patent Information
- Application Number
- CN202411796423.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The prior art is difficult to quickly predict the optimal trend of complex node networks while ensuring accuracy, especially in the case of topological changes, with high computational complexity.
The data set is characterized by using convolutional neural network and attention mechanism to learn the relationship between the active power, node voltage and phase angle of the generator node, combined with the loss function based on topological changes, the predicted active power of the generator node is obtained, and the solution to the optimal active power is obtained through fitting.
Fast and accurate prediction of topologically changed power node networks is achieved, reducing computational complexity and improving prediction accuracy.
Smart Images

Figure CN119275839B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power systems, and in particular to a method and system for predicting optimal power flow in power systems taking into account topology changes. Background Art
[0002] As an important means of power system analysis, the rapid solution of AC OPF (AC Optimal Power Flow) has always been the focus of attention. Traditional algorithms take a lot of time to process node networks, and although existing neural network algorithms can speed up the solution, they often only focus on fixed node networks. Since OPF itself is a non-convex nonlinear problem, and topology changes will bring greater computational complexity to the solution of OPF. How to achieve rapid prediction of complex node networks while ensuring accuracy has become a key issue that needs to be solved urgently. Summary of the invention
[0003] In order to solve the deficiencies of the prior art, this application adopts the following technical solutions:
[0004] In a first aspect, the present application provides a method for predicting optimal power flow in a power system considering topology changes, the method comprising the following steps:
[0005] Step S11, obtaining a data set, wherein the data set includes the active load, reactive load, amplitude and phase angle of the self-admittance matrix of each generator node in different power node network topologies when the power system node network topology changes;
[0006] Step S12, using a convolutional neural network and an attention mechanism to extract features from the data set;
[0007] Step S13, based on the extracted features, using a convolutional neural network to directly predict to obtain a first predicted active power of the corresponding generator node; and based on the extracted features, using a power equation to calculate a second predicted active power of the corresponding generator node;
[0008] Step S14: Fitting the first predicted active power and the second predicted active power to obtain a third predicted active power, and using the third predicted active power as a solution to the optimal active power achieved by the optimal power flow of the power system.
[0009] The present application discloses a method for predicting the optimal power flow of an electric power system taking into account topological changes. The method uses a convolutional neural network and an attention mechanism to extract features from a data set and maps a node network in the convolutional neural network. The method learns the relationship between the three physical quantities of the electric power system, namely, the active power, node voltage and phase angle of the generator node. The attention mechanism is introduced to capture the coupling relationship between different generator nodes. The method combines the loss function based on topological changes to obtain the first / second predicted active power of the generator node, and fits the first predicted active power and the second predicted active power, thereby obtaining a solution for the optimal active power achieved by the optimal power flow of the electric power system and realizing fast and accurate prediction of the electric power node network with topological changes.
[0010] Further, in step S14, fitting the first predicted active power and the second predicted active power to obtain a third predicted active power includes:
[0011] Step S141, using the first predicted active power and the second predicted active power as a training set;
[0012] Step S142, providing a deep neural network model, and using the training set to train the deep neural network model;
[0013] Step S143: Based on the trained deep neural network model, the first predicted active power and the second predicted active power are fitted to obtain the third predicted active power.
[0014] Furthermore, the deep neural network model includes a fully connected layer, and the fully connected layer of the deep neural network model is configured to receive the first predicted active power and the second predicted active power, and use an activation function to perform output prediction to obtain the third predicted active power.
[0015] Furthermore, an attention convolutional neural network model is provided, wherein the attention convolutional neural network model includes a convolutional layer, an attention mechanism and a fully connected layer.
[0016] The convolutional layer is configured to perform local feature extraction based on the data set;
[0017] The attention mechanism is configured to perform global feature extraction through a multi-head attention mechanism based on the extracted local features;
[0018] The fully connected layer is configured to predict and output the target variable based on the global features extracted by the attention mechanism, and the target variable includes one or more of the following variables: active power, node voltage and phase angle of the generator node.
[0019] Further, a first attention convolutional neural network model is provided, and the first attention convolutional neural network model is used to predict and output a first target variable, where the first target variable is the active power of the generator node, so as to obtain a first predicted active power of the corresponding generator node;
[0020] Providing a second attention convolutional neural network model, using the second attention convolutional neural network model to predict and output a second target variable, the second target variable consisting of node voltage and phase angle prediction, using the node voltage predicted and output by the second attention convolutional neural network model as a solution to the optimal node voltage achieved by the optimal power flow of the power system, and based on the second target variable, using the power equation to calculate a second predicted active power of the corresponding generator node;
[0021] Among them, the parameter settings of the attention mechanism in the first attention convolutional neural network model and the second attention convolutional neural network model are different.
[0022] Furthermore, a first loss function calculation model is provided, and the first predicted active power is obtained by minimizing the first loss function. The first loss function calculation model is expressed by the following formula:
[0023] ;
[0024] In the formula, L 1 represents the first loss function, N s Indicates the number of samples represents the first predicted active power, P G is the actual active power of the corresponding generator node.
[0025] Furthermore, a second loss function calculation model is provided, and the second predicted active power is obtained by minimizing the second loss function. The second loss function calculation model is expressed by the following formula:
[0026] ;
[0027] ;
[0028] ;
[0029] In the formula, represents the power equation corresponding to the generator node, represents the predicted generator node voltage, represents the actual generator node voltage, represents the predicted generator node phase angle, represents the actual generator node phase angle, N s Indicates the number of samples
[0030] Furthermore, in the first attention convolutional neural network model, the attention mechanism uses 4 attention heads, the key dimension of each attention head is configured to 256, and the dimension of the fully connected layer is configured to [1024, 512].
[0031] Furthermore, in the second attention convolutional neural network model, the attention mechanism uses 16 attention heads, the key dimension of each attention head is 512, and the dimension of the fully connected layer is configured as [3072, 1024].
[0032] In a second aspect, a system for realizing optimal power flow of an electric power system considering topology changes is provided, wherein the system applies the above-mentioned method for predicting optimal power flow of an electric power system considering topology changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A flowchart of the steps of a method for predicting optimal power flow in a power system taking into account topology changes provided by an embodiment of the present application;
[0034] Figure 2 A schematic flow chart of step S14 in a method for predicting optimal power flow in a power system taking into account topology changes provided by an embodiment of the present application;
[0035] Figure 3 A schematic diagram of a calculation flow of a method for predicting optimal power flow in a power system taking into account topology changes provided in an embodiment of the present application;
[0036] Figure 4 Schematic diagram of comparison between the optimal power flow prediction method for a power system considering topology changes provided by the present application and four existing algorithms under different test systems. DETAILED DESCRIPTION
[0037] The present application will be described in detail below in conjunction with the specific implementation modes shown in the accompanying drawings, but these implementation modes do not limit the present application. Structural, methodological, or functional changes made by ordinary technicians in the field based on these implementation modes are included in the protection scope of the present application.
[0038] In order to solve the deficiencies of the prior art, in the first aspect, the present application provides a method for predicting the optimal power flow of a power system taking into account topology changes, such as Figure 1 As shown, the method comprises the following steps:
[0039] Step S11, obtaining a data set, the data set including the active load, reactive load, amplitude and phase angle of the self-admittance matrix of each generator node in different power node network topologies when the power system node network topology changes;
[0040] Step S12, using a convolutional neural network and an attention mechanism to extract features from the data set;
[0041] Step S13, based on the extracted features, using a convolutional neural network to directly predict to obtain a first predicted active power of the corresponding generator node; and based on the extracted features, using a power equation to calculate a second predicted active power of the corresponding generator node;
[0042] Step S14: Fitting the first predicted active power and the second predicted active power to obtain a third predicted active power, and using the third predicted active power as a solution for the optimal active power achieved by the optimal power flow of the power system.
[0043] The present application discloses a method for predicting the optimal power flow of an electric power system taking into account topological changes. The method uses a convolutional neural network and an attention mechanism to extract features from a data set and maps a node network in the convolutional neural network. The method learns the relationship between the three physical quantities of the electric power system, namely, the active power, node voltage and phase angle of the generator node. The attention mechanism is introduced to capture the coupling relationship between different generator nodes. The method combines the loss function based on topological changes to obtain the first / second predicted active power of the generator node, and fits the first predicted active power and the second predicted active power, thereby obtaining a solution for the optimal active power achieved by the optimal power flow of the electric power system and realizing fast and accurate prediction of the electric power node network with topological changes.
[0044] The following is a detailed description of a method for predicting optimal power flow in a power system taking into account topology changes in this embodiment.
[0045] As an implementation method, in step S12, the method for optimal power flow prediction of a power system considering topology changes provided in the present application includes: providing an attention convolutional neural network model, which includes a convolutional layer, an attention mechanism and a fully connected layer.
[0046] Specifically, the convolutional layer is configured to extract local features based on the data set, and the input of the convolutional layer is of shape A data tensor of N S represents the number of samples, N B represents the number of samples, and the constant 4 represents the number of features of each node. The input data of the attention convolutional neural network model is converted into in, X1 indicates single channel input. The convolutional layer of this convolutional neural network model uses two two-dimensional convolutional layers, denoted as the first convolutional layer Conv2D(M1,(k h × k w )) and the second convolutional layer Conv2D(M2, (k h × k w ), M1 is the number of channels in the first convolutional layer, M2 is the number of channels in the second convolutional layer, and the filter size of the first convolutional layer is k h1 × k w1 , the filter size of the first convolutional layer is k h2 × k w2 The operation of the convolutional layer of the convolutional neural network model can be expressed as:
[0047] ;
[0048] In the formula, ∗ represents the convolution operation, W (1) represents the convolution kernel of the first convolutional layer, W (2) represents the convolution kernel of the second convolutional layer, b (1) and b (2) represents the bias term, X is the data tensor, H (1) represents the output tensor after the first convolutional layer operation, H (2) Represents the output tensor after the second convolutional layer operation. Among them, the convolution kernel W (1) satisfy , C in Indicates the number of input channels and the number of output channels C in = 1. After the convolution operation of the first convolutional layer, the output tensor H (1) satisfy , where F represents the number of features after convolution in the first convolutional layer. In the second convolutional layer, the convolution kernel W (2) satisfy , which means that the input channel is M1 and the output channel is M2. After the convolution operation of the second convolution layer, the output tensor H (2) satisfy .
[0049] The attention mechanism is introduced into the convolutional neural network model. The attention mechanism is configured to extract global features based on the local features extracted above through a multi-head attention mechanism. Specifically, the attention mechanism uses H attention heads, the dimension of the key is d k Based on the extracted local features, the attention mechanism extracts the global information of the input tensor through a multi-head attention mechanism. The calculation process can be expressed as:
[0050] ;
[0051] In the formula, Q i =XW Q represents the query matrix, K i =XW K represents the bond matrix, V i =XW V represents the value matrix, d k Represents the dimension of the key. The output of the multi-head attention is the concatenation of the outputs of each attention head:
[0052] ;
[0053] In the formula, H Indicates the number of attention heads used. Based on the above attention convolutional neural network model, feature extraction of the data set is achieved.
[0054] Furthermore, the fully connected layer of the attention convolutional neural network model is configured to predict and output the target variable based on the global features extracted by the attention mechanism. The target variable includes one or more of the following variables: active power, node voltage and phase angle of the generator node. For ease of explanation, active power is denoted as P G , let the node voltage be V, and the phase angle be .
[0055] Specifically, the attention convolutional neural network model converts multi-dimensional data tensors Flattened into shape One-dimensional data tensor. The flattened data tensor can be expressed as , the attention convolutional neural network model inputs the flattened data tensor into the fully connected layer to predict the target variable. Specifically, the fully connected layer includes at least three sub-fully connected layers, each of which contains D1D2D3 units. Using the ReLU activation function, the fully connected layer operation can be expressed as:
[0056] ;
[0057] Among them, in the first sub-fully connected layer, is the weight matrix, is the bias term; in the second sub-fully connected layer, is the weight matrix, is the bias term; in the third fully connected sub-layer, W (5) ∈R D2× O is the weight matrix, It is a bias term. Based on three sub-fully connected layers, the fully connected layer completes the prediction output of multiple target variables including the active power, node voltage and phase angle of the generator node.
[0058] As an implementation method, in step S13, a first attention convolutional neural network model is provided, and based on the extracted features, the first attention convolutional neural network model is used to predict and output the first target variable, wherein the first target variable is the active power of the generator node, so as to obtain the first predicted active power of the corresponding generator node.
[0059] Specifically, in this application, by adding the loss term based on the power equation to the loss function, the characteristics of the power flow of the node network can be introduced into the network. During the training process, the network loss term can be defined as:
[0060] ;
[0061] in, N S is the sample size, is the predicted output of the loss function calculation model, is the true value, and the mean square error is used as the evaluation index of the loss function calculation model. In order to increase the penalty for violating physical rules in prediction, this application also proposes a loss function term based on physical rules:
[0062] ;
[0063] in, f PG is the power equation corresponding to the generator node, and the voltage of all nodes is input V , Phase Angle , the active power of the corresponding generator node can be obtained P G . V 1 represents the actual value or prediction of the node voltage, θ 1 indicates the true value or prediction of the phase angle.
[0064] Based on the above description, in the first attention convolutional neural network model, a first loss function calculation model is provided, and the first predicted active power is obtained by minimizing the first loss function. The first loss function calculation model is expressed by the following formula:
[0065] ;
[0066] In the formula, L 1 represents the first loss function, N represents the number of samples, represents the first predicted active power, P G is the actual active power of the corresponding generator node. In the first loss function calculation model, the first attention convolutional neural network model directly predicts the active powerP G , introducing more prediction variables for subsequent model calculations, thereby improving the accuracy of predictions.
[0067] In step S13, a second attention convolutional neural network model is also provided. Based on the extracted features, the second attention convolutional neural network model is used to predict and output the second target variable. The second target variable is composed of the node voltage V and phase angle The prediction composition is constructed, and based on the second target variable, the second predicted active power of the corresponding generator node is calculated using the power equation. In addition, the node voltage predicted and output by the second attention convolutional neural network model is used as the solution of the optimal node voltage for the optimal power flow of the power system.
[0068] Specifically, the second attention convolutional neural network model targets node voltage V and phase angle Make a prediction, and its loss function L 2 is:
[0069] ;
[0070] The second attention convolutional neural network model predicts the voltage and phase angle simultaneously, and obtains the active power of the new generator node through the calculation of the power equation. P 2, and in L 2, physically based losses W The gradient of the 2 terms is:
[0071] ;
[0072] in,
[0073] ;
[0074] Expanding the above formula, we can get:
[0075] ;
[0076] This proves that the convolutional neural network can learn the relationship between active power, voltage and phase angle. Among them, the first and third items guide the second attention convolutional neural network to learn voltage V Obtaining the active power in the power equation P G The performance makes the voltage V In the subsequent calculation of active power P G The second and fourth items will have a better effect. P G With phase angle θThe information of the power equation is input into the neural network to predict the generated phase angle θ It has good performance in the PF algorithm. The entire loss function converts the node voltage V , Phase Angle θ , Active Power P G , the three variables are interconnected, thus forming a correlation loss that reflects the entire node network system. V , the loss function based on physical rules is:
[0077] ;
[0078] in, is the node voltage predicted by the first attention convolutional neural network model, voltage V and phase angle are the voltage and phase angle of the true value. The first term of the loss function is to V When using the power equation to obtain the active power of the corresponding generator node P G This item can put the conductance and susceptance information of the admittance matrix into the neural network for training. The second item is for voltage V The combination of the two enables the network to consider its physical characteristics in the process of mapping voltage. For example, the loss function based on physical rules is:
[0079] ;
[0080] Based on the above description, in the second attention convolutional neural network model, a second loss function calculation model is provided, and the second predicted active power is obtained by minimizing the second loss function. The second loss function calculation model is expressed by the following formula:
[0081] ;
[0082] ;
[0083] ;
[0084] In the formula, represents the power equation corresponding to the generator node, represents the predicted generator node voltage, represents the actual generator node voltage, represents the predicted generator node phase angle, represents the actual generator node phase angle, NRepresents the number of samples. The node voltage is obtained by calculating the model through the second loss function V pred and the phase angle θ , where the node voltage V pred As the solution for the optimal node voltage to achieve the optimal power flow of the power system; and based on the node voltage V pred and the phase angle θ , the second predicted active power of the corresponding generator node is obtained by calculating the power equation. The power equation is expressed as follows:
[0085] ;
[0086] In the formula, P Gi Representation Node i The active output, i, j Represents a node, u(B) represents the susceptance under topology change, u (G) represents the conductance under topological changes, S B Represents a collection of nodes.
[0087] It should be noted that the parameter settings of the attention mechanism in the first attention convolutional neural network model and the second attention convolutional neural network model are different.
[0088] Specifically, in the first attention convolutional neural network model, the attention mechanism uses 4 attention heads, the key dimension of each attention head is configured to 256, and the dimension of the fully connected layer is configured to [1024, 512], so that the first attention convolutional neural network model realizes the prediction output of the first predicted active power; in the second attention convolutional neural network model, the attention mechanism uses 16 attention heads, the key dimension of each attention head is 512, and the dimension of the fully connected layer is configured to [3072, 1024], so that the second attention convolutional neural network model realizes the prediction of node voltage and phase angle, and then realizes the prediction output of the second predicted active power.
[0089] As a way to achieve this, Figure 2 As shown, in step S14, fitting the first predicted active power and the second predicted active power to obtain the third predicted active power includes:
[0090] Step S141, using the first predicted active power and the second predicted active power as a training set;
[0091] Step S142, providing a deep neural network model, and using a training set to train the deep neural network model;
[0092] Step S143: Based on the trained deep neural network model, the first predicted active power and the second predicted active power are fitted to obtain a third predicted active power.
[0093] Specifically, the deep neural network model and the convolutional neural network model form a stack model. The convolutional neural network model outputs a first predicted active power and a second predicted active power. The output of the convolutional neural network model is put into the deep neural network model as a training set for deep neural network model training, so that the deep neural network can capture the relationship between the output results of different convolutional neural network models, thereby obtaining an output result with higher accuracy.
[0094] Further, as an implementation method, in step S143, the deep neural network model includes a fully connected layer, and the fully connected layer of the deep neural network model is configured to receive the first predicted active power and the second predicted active power, and use an activation function to perform output prediction to obtain a third predicted active power.
[0095] Specifically, in step S143, the first predicted active power and the second predicted active power are received by the deep neural network model fully connected layer as training sets of the deep neural network model, and the deep neural network model fully connected layer is configured to input a signal satisfying ,in, N u Represents the number of deep neural network model input data sets, N G Indicates the number of generator nodes, i.e. active power P G The dimension of , the constant 2 represents the prediction of the two base learners of the input. The operation of the deep neural network model can be expressed as:
[0096] ;
[0097] Among them, the ReLU activation function is used, D (1) , D (2) , D (3) , D (4) is the weight matrix, b (1) 、b (2) 、b (3) 、b (4) is the bias term, is the predicted output, i.e. The third predicted active power.
[0098] According to the above description, if Figure 3As shown, a method for predicting the optimal power flow of an electric power system taking into account topological changes in the present application adopts a convolutional neural network and an attention mechanism to extract features from a data set, and maps a node network in a convolutional neural network, learns the relationship between the three physical quantities of the electric power system, namely, the active power, node voltage and phase angle of the generator node, introduces an attention mechanism to capture the coupling relationship between different generator nodes, and combines the loss function based on topological changes to obtain a solution for the optimal node voltage achieved by the optimal power flow of the electric power system, obtain the first / second predicted active power of the generator node, and fit the first predicted active power and the second predicted active power, thereby obtaining a solution for the optimal active power achieved by the optimal power flow of the electric power system, and realizing fast and accurate prediction of the electric power node network with topological changes.
[0099] For further explanation, the optimal power flow prediction method for a power system considering topology changes provided in this application is verified below.
[0100] This application uses four node networks of IEEE-14 bus system, IEEE-30 bus system, IEEE-57 bus system, and IEEE-118 bus system to test the provided power system optimal power flow prediction method considering topology changes.
[0101] To simulate the fluctuation of the node network, this application performs P d , Q d Add a random perturbation coefficient ω to form a new and Among them, the range of the random perturbation coefficient ω is [0.95, 1.05] pu, and it will be randomly sampled by unifrom (uniform sampling or average sampling), and the sampling is as follows:
[0102] ;
[0103] At the same time, a random transmission line in the node network will be disconnected to achieve N-1 topology changes. After that, Matpower software uses the built-in interior point method to solve the newly generated node network, and the solution obtained successfully is used as the true value in the data set.
[0104] In this embodiment, a standard score is used to regularize the data set to avoid the imbalance of weight update of the training convolutional neural network due to the magnitude difference of the active power output and the voltage. The mathematical expression of the standard score is as follows:
[0105] ;
[0106] Among them, x is the original data, µis the mean of the data, is the standard deviation of the data. After being processed by the standard score, the feature data has a distribution with a mean of 0 and a standard deviation of 1, which enables the convolutional neural network model to converge better and helps improve the accuracy and stability of the prediction results.
[0107] In order to verify the limitations of the optimal power flow prediction method for power systems considering topology changes provided in this application in the optimal power flow problem with topology changes, four algorithms, M1 (using deep neural network), M2 (using multi-layer perceptron), M3 (using slightly convolutional neural network), and M4 (using graph convolutional neural network) are used for comparison.
[0108] In the M1 algorithm, the deep neural network uses 1 convolution layer, with 64 channels and a convolution kernel of (4*4). The fully connected layer includes three sub-fully connected layers, and the dimension of the fully connected layer is set to [512,512,512]. The M2 algorithm only uses the fully connected layer, which includes three sub-fully connected layers, and the dimension of the fully connected layer is set to [512,512,512]. The M3 algorithm includes a 3x3 convolution layer with an output of 28 channels and a 2x2 maximum pooling layer to reduce the image size by half, and then connect the fully connected layer for prediction output. The fully connected layer includes two fully connected layers, and the dimension of the fully connected layer is set to [1000, 1000]. The M3 algorithm directly predicts the voltage V and phase angle θ To achieve active power P G The M4 algorithm extracts features through a graph convolutional network and connects to a fully connected layer for prediction output. The fully connected layer includes three sub-fully connected layers, and the dimension of the fully connected layer is set to [1000, 1000, 1000].
[0109] At the same time, two evaluation indicators are set to compare the accuracy of prediction results of different algorithms. The first evaluation indicator is probability accuracy, which is used to indicate the probability that the prediction error is less than a certain threshold. For the sake of convenience, the probability accuracy is recorded as Acc , probability accuracy Acc It can be expressed as follows:
[0110] ;
[0111] Among them, Y represents the true value, Represents the predicted output, and thres represents the given threshold. For the threshold of the solution, the active power P G 1MW, voltage V G It is 0.001pu.
[0112] The second evaluation indicator is the root mean square error, which is used to represent the square root of the mean of the square of the prediction error. For ease of explanation, the root mean square error is RMSE. The root mean square error RMSE can be expressed as follows:
[0113] ;
[0114] Among them, N represents the total number of samples, Y i is the actual value of the i-th sample, is the corresponding predicted value. The smaller the root mean square error RMSE is, the better the prediction effect of the model is.
[0115] When the topology does not change, the IEEE-57 bus system is used to verify the optimal power flow prediction method for the power system considering topology changes provided by this application. The data set used is the solution generated by Matpower, with 8000 training sets, 1600 validation sets, and 2000 test sets. For ease of explanation, in the following table, the optimal power flow prediction method for the power system considering topology changes provided by this application is represented by . The test time comparison of different methods of the IEEE 57 test system is shown in Table 1:
[0116]
[0117] Table 1
[0118] As shown in Table 1, the optimal power flow prediction method for the power system considering topology changes provided by the present application achieves the best in terms of the quantitative indicators of probability accuracy and root mean square error.
[0119] In terms of probability accuracy, for the control variable active power P G and voltage V G , the prediction accuracy of algorithm M1 achieved 100%, while among the other compared algorithms, even the best M1 still could not achieve V G Under the condition of fixed topology, M1-M4 still lacks in prediction accuracy. Through the root mean square error RMSE, we can see that the algorithm provided by this application has good prediction accuracy in active power. P G and voltage V G The value on is 3.645×10 -2 and 1.516×10 -5 , which is better than other algorithms.
[0120] In the case of topology changes, the IEEE-14 bus system, IEEE-30 bus system, IEEE-57 bus system, and IEEE-118 bus system are used to verify the optimal power flow prediction method for the power system considering topology changes provided in this application. The corresponding network model is solved by Matpower, and the successfully solved data sets are collected, and the data sets are divided into training sets, verification sets, and test sets according to the ratio of 6.4:1.6:2. The specific quantity distribution of the data set information of the test system is shown in Table 2:
[0121]
[0122] Table 2
[0123] like Figure 4 As shown, in the four test networks, the active power of the method provided by the present application P G and voltage V G The root mean square error RMSE of the indicator is significantly lower. Compared with the comparison algorithms M1, M2, M3 and M4, the prediction accuracy of the method provided by this application is higher. Figure 4 This shows that the error distribution of the method provided by the present application is smaller and more concentrated, the prediction results are more accurate, and the robustness is stronger. On the contrary, the root mean square error RMSE distribution of the comparison algorithm, especially the M3 model, is wider and higher, which shows that the M3 model has a larger error in the prediction of the node network with topology changes.
[0124] Further, as shown in Table 3 (in Table 3, Obj is the RMSEPE index, and FR is the feasibility rate index):
[0125]
[0126] Table 3
[0127] In the test node network, the feasibility rate of the optimal power flow prediction method for the power system considering topology changes provided by the present application has reached more than 95%, and the feasibility rate is better than the M1-M4 comparison algorithm. In addition, it can be seen from the RMSEPE indicator of the objective function value that in different test networks, the optimal power flow prediction method for the power system considering topology changes provided by the present application has achieved the prediction of the minimum error of the objective function value. On the IEEE-14 bus system, IEEE-30 bus system, and IEEE-118 bus system, an average improvement of 64.49% was achieved compared with other comparison algorithms, and for the IEEE-57 bus system, the optimal power flow prediction method for the power system considering topology changes provided by the present application achieved an improvement of 98.55%.
[0128] The RMSEPE indicator is expressed by the following formula:
[0129] ;
[0130] Where N represents the total number of samples. is the actual value of the i-th sample, is the corresponding predicted value.
[0131] As shown in Table 4, the speed difference between the method provided by the present application and the existing method using the built-in interior point method is as follows. It can be seen that when comparing the speed of processing a single data sample, the method provided by the present application is faster than the existing method using Matpower for solving (i.e., Baseline ) by more than 47 times, and as the size and complexity of the node network increases, the ratio of the time used can reach up to 110 times. It is proved that the method provided by this application can effectively reduce the solution time under different test systems, improve the efficiency of solving large-scale power system problems, and is applicable and effective in solving real-time OPF problems.
[0132]
[0133] Table 4
[0134] Through the above description, the optimal power flow prediction method for the power system considering topology changes provided by the present application is verified to be effective and reliable in quickly solving the OPF problem on an N-1 node network with topology changes.
[0135] In a second aspect, the present application provides a system for realizing optimal power flow in an electric power system taking into account topology changes. The system applies the optimal power flow prediction method for an electric power system taking into account topology changes described above, and is used for rapid and accurate prediction of an electric power node network in the event of topology changes.
[0136] It will be appreciated that the word "exemplary" as used herein means "serving as an example, instance, or illustration". Any embodiment described as "exemplary" is not necessarily preferred or superior to other embodiments and / or does not exclude the combination of features of other embodiments. It will be appreciated that certain features of the present application described in the context of separate embodiments for the sake of clarity may also be provided in a single embodiment by combination. Conversely, various features of the present application described in the context of a single embodiment for the sake of clarity may also be provided individually or in any suitable combination or as any other described embodiment of the present application.
[0137] The above disclosure is only the preferred embodiment of the present application, but it is not intended to limit the scope of rights of the present application. A person of ordinary skill in the art can understand that without departing from the spirit and scope of the present application and the appended claims, changes, modifications, substitutions, combinations, and simplifications should all be equivalent replacement methods and still fall within the scope of the invention.
Claims
1. A method for predicting optimal power flow in a power system considering topology changes, characterized in that: The method comprises: Acquire a data set, wherein the data set includes the active load, reactive load, and amplitude and phase angle of the self-admittance matrix of each generator node in different power node network topologies when the power system node network topology changes; Using convolutional neural network and attention mechanism to extract features from the dataset; Based on the extracted features, a convolutional neural network is used to directly predict to obtain a first predicted active power of the corresponding generator node; and based on the extracted features, a power equation is used to calculate a second predicted active power of the corresponding generator node; Fitting the first predicted active power and the second predicted active power to obtain a third predicted active power, and using the third predicted active power as a solution to the optimal active power achieved by the optimal power flow of the power system; The method further comprises: Providing an attention convolutional neural network model, the attention convolutional neural network model includes a convolutional layer, an attention mechanism and a fully connected layer, The convolutional layer is configured to perform local feature extraction based on the data set; The attention mechanism is configured to perform global feature extraction through a multi-head attention mechanism based on the extracted local features; The fully connected layer is configured to predict and output a target variable based on the global features extracted by the attention mechanism, wherein the target variable includes one or more of the following variables: active power, node voltage, and phase angle of a generator node; The method further comprises: Providing a first attention convolutional neural network model, using the first attention convolutional neural network model to predict and output a first target variable, where the first target variable is the active power of the generator node, to obtain a first predicted active power of the corresponding generator node; Providing a second attention convolutional neural network model, using the second attention convolutional neural network model to predict and output a second target variable, the second target variable consisting of node voltage and phase angle prediction, using the node voltage predicted and output by the second attention convolutional neural network model as a solution to the optimal node voltage achieved by the optimal power flow of the power system, and based on the second target variable, using the power equation to calculate a second predicted active power of the corresponding generator node; Among them, the parameter settings of the attention mechanism in the first attention convolutional neural network model and the second attention convolutional neural network model are different.
2. The method for predicting optimal power flow in a power system considering topology changes according to claim 1, characterized in that: Fitting the first predicted active power and the second predicted active power to obtain a third predicted active power includes: The first predicted active power and the second predicted active power are taken as, Providing a deep neural network model, and training the deep neural network model using a training set; Based on the trained deep neural network model, the first predicted active power and the second predicted active power are fitted to obtain the third predicted active power.
3. The method for predicting optimal power flow of a power system considering topology changes according to claim 2, characterized in that: The deep neural network model includes a fully connected layer, which is configured to receive the first predicted active power and the second predicted active power, and use an activation function to perform output prediction to obtain the third predicted active power.
4. The method for predicting optimal power flow of a power system considering topology changes according to claim 1, characterized in that: The method further comprises: A first loss function calculation model is provided, and the first predicted active power is obtained by minimizing the first loss function. The first loss function calculation model is expressed by the following formula: ; In the formula, L 1 represents the first loss function, N s represents the number of samples, represents the first predicted active power, P G is the actual active power of the corresponding generator node.
5. The method for predicting optimal power flow in a power system considering topology changes according to claim 1, characterized in that: The method further comprises: A second loss function calculation model is provided, and the second predicted active power is obtained by minimizing the second loss function. The second loss function calculation model is expressed by the following formula: ; ; ; In the formula, represents the power equation corresponding to the generator node, represents the predicted generator node voltage, represents the actual generator node voltage, represents the predicted generator node phase angle, represents the actual generator node phase angle, N s Indicates the sample size.
6. The method for predicting optimal power flow in a power system considering topology changes according to claim 1, characterized in that: In the first attention convolutional neural network model, the attention mechanism uses 4 attention heads, the key dimension of each attention head is configured as 256, and the dimension of the fully connected layer is configured as [1024, 512].
7. The method for predicting optimal power flow in a power system considering topology changes according to claim 1, characterized in that: In the second attention convolutional neural network model, the attention mechanism uses 16 attention heads, the key dimension of each attention head is 512, and the dimension of the fully connected layer is configured as [3072, 1024].
8. An optimal power flow prediction system for a power system considering topology changes, characterized in that: The system applies the method for predicting optimal power flow of a power system taking into account topology changes as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Methods of computing steady-state voltage stability margins of power systems
CA2894256A1
Predictive control method and control device for isolated dual-active-bridge direct-current converter
CN114679067A