A deep neural network probabilistic power flow calculation method and system
By combining a multi-head self-attention mechanism and a semi-invariant-guided deep neural network model, and embedding physical information, the problem of low efficiency and insufficient accuracy of traditional methods in power system probabilistic power flow calculation is solved, and accurate quantitative assessment and improved transparency of probabilistic power flow are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-03-20
AI Technical Summary
Existing probabilistic power flow calculation methods are insufficient in terms of computational efficiency and accuracy, especially when dealing with complex power systems. The traditional Newton-Raphson method is inefficient in calculating the Jacobian matrix, and deep neural networks are insufficient in terms of accuracy and efficiency in complex situations. Furthermore, existing methods fail to accurately quantify the uncertainty of probabilistic power flow.
A novel probabilistic power flow calculation model is constructed by employing a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, combined with physical information embedded branch admittance, dynamically quantifying parameter contribution through adaptive weight allocation, and introducing chance constraints for quantitative analysis.
It significantly improves computational complexity, enhances the model's representational ability and prediction accuracy, accurately identifies the mutual influence between nodes with long electrical distances, enables quantitative assessment of probabilistic power flow, improves the transparency and interpretability of analysis results, and provides a reliable basis for decision-making for the safe operation of the system.
Smart Images

Figure CN120999637B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of power system analysis, and relates to a deep neural network probabilistic power flow calculation method and system. BACKGROUND
[0002] The large-scale grid connection of renewable energy represented by wind energy and solar energy has accelerated the transformation of modern power systems. Due to the strong randomness and intermittency of renewable energy, it brings great uncertainty to the operation of new power systems. In the new power system dominated by renewable energy, it is of great significance for the safe and reliable operation of the system to accurately analyze the probability distribution of power flow and quantify the influence of renewable energy uncertainty on power flow through probabilistic power flow calculation.
[0003] The current probabilistic power flow calculation methods are mainly divided into simulation method, approximation method and analytical method. The probabilistic power flow calculation based on Monte Carlo simulation (MCS) is a representative of the simulation method, which needs to use a large number of samples for simulation calculation and consumes a large amount of time, with high time cost. The probabilistic power flow calculation based on point estimation method (PEM) can be regarded as a representative of the approximation method. PEM quickly obtains the probability information of state variables by constructing a representative sample from a small number of samples, so it needs less time than MCS, but the selection of sample points has a great influence on the accuracy of the calculation result. The probabilistic power flow calculation based on cumulants method (CM) is a representative of the analytical method. CM can obtain the result with less number of operations under the premise of ensuring accuracy by simplifying convolution operation, and its calculation accuracy is better than PEM and its calculation efficiency is better than MCS. However, in CM, the Jacobian matrix is usually obtained by the cumbersome Newton-Raphson method, and a large number of loop iterations are required in the calculation process, so there is still a problem of low efficiency.
[0004] With the vigorous development of machine learning, neural networks have made great achievements in power flow calculation, optimal power flow and probabilistic power flow, etc. Deep neural network (DNN) has been applied to power flow calculation, and well-trained DNN model can completely replace traditional methods in some places to obtain higher efficiency. However, although DNN model can extract more abstract and complex features from data by deepening the number of neural network layers, its calculation accuracy and efficiency will be greatly insufficient in complex situations. At this time, the underlying physical model of the system also needs to be considered, and thus the physically guided deep neural network model (PGDNN) is developed, which can encode the structural characteristics of power flow equations, system topology and other physical knowledge in the neural network so that the feature transmission in the neural network follows the physical law, thereby improving the performance of the neural network. SUMMARY
[0005] In order to realize more rapid and accurate probability power flow calculation, the application provides a deep neural network probability power flow calculation method and system, which embeds branch-to-branch admittance as physical knowledge into a deep neural network containing a multi-head self-attention mechanism, dynamically quantifies the contribution of different branch parameters to the output variable through adaptive weight distribution. On this basis, the neural network is combined with the semi-invariant method to construct a new deep neural network model based on the multi-head self-attention mechanism and semi-invariant guidance for probability power flow calculation, so as to solve the problems of low efficiency and poor performance of traditional Newton-Raphson method and ordinary deep neural network model applied to probability power flow calculation. In addition, since the existing probability power flow methods cannot accurately quantify the uncertainty interval of probability power flow, the application further introduces the chance constraint into the semi-invariant method probability power flow calculation model to describe the uncertainty of state variables in the confidence interval, so that the probability power flow can be quantitatively evaluated to improve the transparency and interpretability of the probability power flow analysis results.
[0006] In the first aspect, the application provides a deep neural network probability power flow calculation method, comprising the following steps:
[0007] Step one: obtaining the node type, branch admittance, and probability distribution parameters and confidence level of wind power and photovoltaic output and load of the power system; determining the state variable in the rectangular coordinate system, and setting the highest order number of the Cornish-Fisher series expansion and the semi-invariant;
[0008] Step two: establishing a nonlinear power flow equation of injected power and node voltage vector in the rectangular coordinate system, and linearizing the nonlinear power flow equation to obtain a linearized power flow equation and a corresponding Jacobian matrix;
[0009] Step three: taking the node voltage vector as input, embedding the branch admittance as physical information into the deep neural network model based on the multi-head self-attention mechanism and semi-invariant guidance, and solving the Jacobian matrix;
[0010] Step four: calculating the inverse matrix of the Jacobian matrix to obtain a sensitivity matrix;
[0011] Step five: according to the probability density functions of photovoltaic active output, wind turbine active output and load active power, the moments and semi-invariants of each order are calculated respectively, and the semi-invariants of each order of node injected power are aggregated by using the additivity of semi-invariants;
[0012] Step six: using the sensitivity matrix to transfer the semi-invariants of each order of node injected power to the state variable to obtain the semi-invariants corresponding to the voltage amplitude and phase angle;
[0013] Step seven: standardize the semi-invariant of the state variable, approximate its quantile function by six-order Cornish-Fisher series expansion, and obtain the cumulative distribution function and probability density function through inversion operation;
[0014] Step eight: given the confidence level Below, under the opportunity constraint, the fluctuation interval of the state variable is calculated based on the quantile function; by setting the confidence level in layers, the quantitative evaluation of the probability power flow is realized.
[0015] Specifically, the deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance includes:
[0016] The input layer receives the node voltage vector;
[0017] The physical information embedding layer embeds the branch admittance As prior knowledge into network parameters; The conductance between each node, The susceptance between each node;
[0018] Using a multilayer perceptron, the mapping of the input node voltage vector To the output Jacobian matrix is learned through a nonlinear activation function and physical information embedding; the features output by the normalization layer are then processed; then the output of the normalization layer is feature-embedded and multi-split to construct the query matrix Q, key matrix K and value matrix V in the multi-head self-attention mechanism, then the scaled dot product attention is performed, the attention of each attention head is calculated, and then feature fusion and residual connection are performed, and finally the Jacobian matrix is generated through the output layer.
[0019] Specifically, in step five, the photovoltaic active power output is based on the Beta distribution, and the moments of each order are calculated through the shape parameter and the gamma function;
[0020] The active power output of the wind turbine is based on the Weibull distribution, combined with the wind speed-power segmented function, and the moments of each order are derived through the characteristic function of the three-parameter Weibull distribution;
[0021] The active power of the load is based on the normal distribution, and the central moments of each order are directly calculated;
[0022] Through the conversion relationship between moments and semi-invariants, the semi-invariants of each random variable are obtained.
[0023] Specifically, the fluctuation interval of the state variable is represented as:
[0024] ;
[0025] In the formula: is the state variable, The fluctuation range of the state variable; The expected value of the state variable; and These are the upper and lower limits of the confidence interval, respectively.
[0026] Secondly, the present invention provides a deep neural network probabilistic power flow calculation system, comprising:
[0027] The data acquisition module is used to acquire the node types, branch admittances, and probability distribution parameters and confidence levels of wind power, photovoltaic output and load of the power system; and to determine the state variables in the rectangular coordinate system.
[0028] The power flow equation modeling module is used to establish nonlinear power flow equations of injected power and node voltage vectors in a rectangular coordinate system, and to linearize the nonlinear power flow equations to obtain linearized power flow equations and corresponding Jacobian matrices.
[0029] The neural network computation module is used to take the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, and solve the Jacobian matrix.
[0030] The semi-invariant calculation module is used to calculate the moments and semi-invariants of photovoltaic active power output, wind turbine active power output, and load active power respectively based on the probability density functions. It then aggregates the semi-invariants using the additivity of the semi-invariants to obtain the semi-invariants of the node-injected power. Based on the Jacobian matrix, its inverse matrix is calculated to obtain the sensitivity matrix. The sensitivity matrix is used to transfer the semi-invariants of the node-injected power to the state variables, obtaining the semi-invariants corresponding to the voltage amplitude and phase angle. The semi-invariants of the state variables are standardized, and their quantile functions are approximated using a sixth-order Cornish-Fisher series expansion. Finally, the cumulative distribution function and probability density function are obtained through an inversion operation.
[0031] The chance constraint analysis module is used to set the highest order of the semi-invariants and Cornish-Fisher series expansion at a given confidence level. Below, the fluctuation range of state variables is calculated based on the quantile function.
[0032] Specifically, the neural network computing module is trained using the mean squared error loss function and the Adam optimizer, and the learning rate is dynamically adjusted using an equal-interval learning rate scheduler.
[0033] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the deep neural network probabilistic power flow calculation method.
[0034] In a fourth aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor implements the deep neural network probabilistic power flow calculation method when executing the computer program.
[0035] Compared with the prior art, the present application has the following remarkable advantages and beneficial effects:
[0036] The traditional semi-invariant method relies on the iterative solution of the Jacobian matrix by the Newton-Raphson method, which requires a large number of loop iterations in the calculation process, and the efficiency is low. The present application replaces the traditional iterative process with a one-time forward inference by constructing a deep neural network model based on the multi-head self-attention mechanism and semi-invariant guidance, which greatly reduces the computational complexity.
[0037] The present application embeds physical information such as branch admittance into the deep neural network model, and combines the multi-head self-attention mechanism to dynamically quantify the contribution of different branch parameters to the output variables, significantly improving the representation ability and prediction accuracy of the model.
[0038] The multi-head self-attention mechanism introduced in the present application assigns adaptive weights, giving the model a strong global view and dynamic feature focusing ability, which can accurately identify the mutual influence between nodes with long electrical distances, and solves the limitations of traditional methods in dealing with network topology complexity.
[0039] The present application innovatively introduces the chance constraint into the semi-invariant method probabilistic power flow calculation model, describes the uncertainty of state variables through the confidence interval, and for the first time realizes the quantitative evaluation of probabilistic power flow. This breakthrough greatly improves the transparency and interpretability of the analysis results, and provides a more reliable decision basis for system safe operation. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 Schematic diagram of the deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance. DETAILED DESCRIPTION
[0041] In order to facilitate a complete understanding of the technical concept of the present application, the present application is further explained in detail as follows.
[0042] Firstly, the present embodiment explains the semi-invariant method with chance constraint probabilistic power flow calculation model from three aspects: semi-invariant method, random model of node injection power, and state variable probability distribution calculation and chance constraint analysis.
[0043] The probabilistic power flow calculation based on the semi-invariant method (CM) first needs to linearize the power flow equation, then express the system state variables as the linear sum of node injection power through the sensitivity matrix, and finally calculate the probability density function of the state variables by using the additivity of semi-invariant instead of convolution operation.
[0044] In the existing research, the flow equation can be expressed by two different coordinate systems. The present application adopts the expression form of the rectangular coordinate system:
[0045] (1);
[0046] In the formula: and are the active power injection and the reactive power injection at the node , respectively; is the voltage vector of the node , and are the real part and the imaginary part of the voltage vector of the node , respectively; and are the conductance and the susceptance between the node and the node , respectively; represents the total number of system nodes.
[0047] The flow equation is linearized as:
[0048] (2);
[0049] In the formula: is the node injection power random variable; is the Jacobian matrix; is the node state variable.
[0050] The Jacobian matrix can be expressed in the form of Jacobian block , wherein the Jacobian block elements corresponding to different node types are different:
[0051] (3);
[0052] (4);
[0053] In the formula, is the deviation amount of the active power injection at the node i, is the deviation amount of the reactive power injection at the node i, is the deviation amount of the voltage amplitude at the node i, refers to the node whose active power P and reactive power Q are given, and the voltage amplitude and the phase angle are unknown, which is usually a load node, refers to the node whose active power P and voltage amplitude V are given, and the reactive power Q and the phase angle are unknown, which is usually a generator node.
[0054] Existing CMs usually rely on the more complex Newton-Raphson method to calculate the Jacobian matrix. However, this method significantly consumes computational resources in high-dimensional problems, which can lead to problems such as insufficient memory, low efficiency, and excessive storage costs.
[0055] Further transformation of equation (2) can be obtained as follows:
[0056] (5);
[0057] In the formula: sensitivity matrix is the inverse matrix of the Jacobian matrix , is the node injection power random variable.
[0058] Node injection power random variable Mainly composed of node generator injection power and load injection power random variables, as follows:
[0059] (6);
[0060] In the formula: is the generator injection power random variable; is the load injection power random variable; symbol denotes convolution operation.
[0061] Assuming that the random variables of each node injection power are independent of each other, the additivity of semi-invariant can be used to change the complex convolution operation into simple addition and subtraction operation, that is:
[0062] (7);
[0063] In the formula: , and are the order semi-invariant of node injection power, generator injection power and load injection power respectively.
[0064] Combined with equation (7), equation (5) can be further transformed into:
[0065] (8);
[0066] In the formula: denotes the order semi-invariant of node state variable; is the power matrix composed of the elements of the sensitivity matrix in the order.
[0067] To calculate The moment is then calculated from the relationship between the semi-invariants and the moment. Therefore, it is first necessary to establish a corresponding stochastic model for the injected power and load, and then calculate the moment using the parameters in the model.
[0068] The stochastic models for node injected power include photovoltaic power generation models, wind power generation models, and load stochastic models.
[0069] Photovoltaic power generation model: Since the intensity of sunlight is random, the output power is also random. Within a certain time period, the intensity of sunlight can be regarded as a Beta distribution. Then, the probability density function of photovoltaic active power output can be expressed as follows:
[0070] (9);
[0071] In the formula: Let be the probability density function of the photovoltaic active power output at time t. for Photovoltaics are constantly generating power; Rated power of photovoltaic power; and for The shape parameters of the time-varying Beta distribution; This is a gamma function.
[0072] Wind power generation model: Wind speed often follows a Weibull distribution over a certain period of time, and its probability density function can be expressed as:
[0073] (10);
[0074] In the formula: Let be the probability density function of the wind speed at time t. and They are respectively The shape and scale parameters of the Weibull distribution at time step; for The wind speed at any given moment.
[0075] The relationship between the active power output of a wind turbine and wind speed can be described by the following piecewise function:
[0076] (11);
[0077] (12);
[0078] (13);
[0079] In the formula: Let t be the active power output of the wind turbine. This represents the slope of the segment showing the linear relationship between wind turbine output and wind speed. The intercept of the linear relationship between wind turbine output and wind speed is determined by both the cut-in wind speed and the slope. This refers to the rated power of the wind turbine generator set; Rated wind speed; and These are the cut-in and cut-out wind speeds, respectively. When the wind speed is lower than the cut-in wind speed... At that time, the system was in a shutdown state, but when the wind speed exceeded... Entering the effective working area At that time, the output power showed a significant positive correlation with the wind speed, and when the wind speed reached the rated value... Afterwards, the wind turbine enters constant power operation mode. It is worth noting that when the wind speed exceeds the cut-out wind speed... In order to avoid damage to critical components due to overload, the wind turbine will execute a safety shutdown procedure, at which point the output power will return to zero.
[0080] Statistical analysis shows that wind speed remains within the effective operating range most of the time. Combining the wind speed probability density function with the relationship between wind turbine generators and wind speed, the probability density function of the active power output of the wind turbine generators can be calculated as follows:
[0081] (14);
[0082] in, Let be the probability density function of the active power output of the wind turbine at time t.
[0083] Load stochastic model: The load can be considered to approximately follow a normal distribution, and the probability density function of the load's active power is:
[0084] (15);
[0085] In the formula: Let be the probability density function of the system load active power at time t. for Active power of system load at any given time; and They are respectively The expected value and standard deviation of the active power of the load at any given time.
[0086] The methods for calculating the moments of various models are as follows:
[0087] When the probability distribution of a random variable is known, its moments and central moments can be calculated. For continuous random variables... Let its probability density function be... Then its Step Moment It can be obtained from the following formula:
[0088] (16);
[0089] when When, a random variable can be obtained. First moment That is, its expected value.
[0090] It can be calculated from the expected value. center distances of each order :
[0091] (17);
[0092] For photovoltaic power generation models, according to Average light intensity at time and variance The relevant parameters of the Beta distribution can be obtained, and the formula is as follows:
[0093] (18);
[0094] (19);
[0095] After obtaining the shape parameters of the Beta distribution, the moments of the Beta distribution can be obtained by combining them with equation (16). The order moments are as follows:
[0096] (20);
[0097] in, Let k be the k-th order moment of the photovoltaic active power output at time t;
[0098] For wind power generation models, let Then we can obtain a standard three-parameter Weibull distribution, as shown in the following equation:
[0099] (twenty one);
[0100] Where a, b, and c are the location parameter, scale parameter, and shape parameter of the three-parameter Weibull distribution, respectively;
[0101] The characteristic function of the three-parameter Weibull distribution can be obtained by integration:
[0102] (twenty two);
[0103] In the formula: The characteristic function of the three-parameter Weibull distribution is... represents an imaginary number; Indicates from Take from different elements The number of combinations of elements.
[0104] The moments of wind turbine active power can be derived from the characteristic function as:
[0105] (23);
[0106] where, is the k-th moment of wind turbine active power at time t;
[0107] For the load model, since it can be approximated as a normal distribution, its moments can be obtained according to equation (17) as:
[0108] (24);
[0109] where, is the k-th moment of system load active power at time t; denotes double factorial;
[0110] After obtaining the k-th moment or the central moment of injected power, the corresponding semi-invariant of each order can be obtained according to the following formula:
[0111] (25);
[0112] (26);
[0113] where, is the k-th semi-invariant of node injected power, is the k-th semi-invariant of node injected power, is the k+1-th moment of a random variable, is the k+1-th central moment of a random variable, denotes the number of combinations of taking elements from different elements. State variable probability distribution and opportunity constraint analysis: After calculating, the k-th semi-invariant of node state variable can be obtained according to equation (8) as:
[0114]
[0115] , and then through Cornish-Fisher series expansion, the inverse cumulative distribution function of the state variable can be obtained. Further, the inverse of the cumulative distribution function CDF (Cumulative Distribution Function) can be obtained. For non-normal distribution random variables, the series fitting probability distribution has higher accuracy than Gram-Charlier series, and the application adopts six-order Cornish-Fisher series for fitting, and the calculation formula is as follows:
[0116] (27);
[0117] In the formula: is the quantile function of the state variable at the probability quantile ; is the inverse function of the standard normal distribution function; is the normalized order semi-invariant, when is the normalized 2-order semi-invariant, and the others are the same, .
[0118] According to the formula , the distribution function of the state variable can be solved ,
[0119] In addition, in order to realize accurate quantitative analysis on the uncertain interval of probability power flow, the application introduces opportunity constraints into the model, and uses confidence level and confidence interval to describe the uncertainty of the state variable. If the given confidence level , wherein indicates the significance level, according to the opportunity constraint, the fluctuation interval of the state variable can be described as follows:
[0120] (28);
[0121] In the formula: is the fluctuation interval of the state variable (such as voltage amplitude, angle); is the expected value of the state variable; and are the upper and lower limits of the confidence interval respectively.
[0122] CGDNN is a hybrid modeling framework that combines PGDNN and CM. The core idea is to embed the physical laws (such as circuit principles, electromagnetism, etc.) as prior knowledge into the traditional data-driven neural network architecture. This framework aims to overcome the problems of pure data-driven models, such as lack of interpretability and limited generalization ability. By synergistically utilizing physical mechanisms, CGDNN significantly enhances the modeling capability of complex systems, thereby achieving systematic improvements in prediction accuracy, training efficiency, and model interpretability.
[0123] According to the semi-invariant method with chance constraint probability power flow calculation model, it can be found that the elements in the Jacobian matrix are composed of the node voltage vector and the branch admittance between nodes , is the real part of the voltage vector of the node, is the imaginary part of the voltage vector of the node, is the conductance between nodes, is the susceptance between nodes. Since the branch admittance remains unchanged in each iteration process, the input feature vector of the CGDNN model is selected as , and the physical information is embedded into the CGDNN model as . Finally, the Jacobian matrix is taken as the output feature vector of the CGDNN model.
[0124] Based on the above framework, the present application adopts a multi-layer perceptron (MLP) to construct a simple CGDNN model. In the simple CGDNN model, each linear layer contains a number of neurons, and the neurons are connected through learnable weight parameters to realize the full connection from the previous layer to the current layer. In addition, except for the output layer, the output of each layer of neurons is usually transformed through a nonlinear activation function to enhance the representation ability of the model, and the calculation formula is as follows:
[0125] (29);
[0126] In the formula, is the output feature of the linear layer; is the output feature of the linear layer; and are the weights and biases between the linear layer and the linear layer; is the activation function.
[0127] Although basic MLPs can learn the input node voltage vector through nonlinear activation functions and physical information embedding The mapping to the output Jacobian matrix is possible, but its inherent layer-by-layer feedforward and static weighting characteristics have fundamental limitations. Power system networks are essentially complex graph structures where highly nonlinear interactions exist between node voltage states; these interactions depend not only on branch admittance. It is more dependent on the global operating state of the system. A small voltage fluctuation at one node can have a significant impact on nodes that are electrically distant through complex network topology, and traditional MLP models have limited ability to handle such nonlocal, high-dimensional nonlinear coupling relationships.
[0128] The introduction of multi-head self-attention mechanism is precisely to overcome the aforementioned bottlenecks, endowing the model with a powerful global perspective and dynamic feature focusing capability. Unlike the fixed connection weights of MLP, attention weights are calculated and generated in real time based on the information of the current input. This dynamic weight allocation mechanism enables the model to adaptively identify the inter-node coupling relationships and their degree of influence that are crucial to the prediction of the current Jacobian matrix.
[0129] It is important to note that self-attention mechanisms do not replace branch admittance. It does not embed physical information, but works in conjunction with it. Branch admittance The basic topology of physical connections between nodes is defined, and the multi-head self-attention mechanism further learns how these physical connections dynamically modulate the sensitivity of mutual influence between node voltages in the global state.
[0130] The structure of a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance is as follows: Figure 1 As shown, in the deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, the calculation formula for the first n linear layers is consistent with that of the simplified CGDNN model. The features output by the linear layers are then fed into the normalization layer for processing. This layer can significantly improve the training efficiency and generalization performance of the model and stabilize the output of the multi-head self-attention mechanism. Its calculation formula is as follows:
[0131] (30);
[0132] In the formula: This is the output of the normalization layer; This represents the mean of the input data; Indicates the variance of the input data; It is a small constant to avoid division by zero; and The scaling and translation parameters are learned during training, which give the network more flexibility.
[0133] The output of the normalization layer is then feature-embedded and multi-headed split to construct three core matrices in the multi-head self-attention mechanism: the query matrix Q, the key matrix K, and the value matrix V.
[0134] (31);
[0135] wherein: represents the number of heads into which the attention layer is split, represents the query matrix of the hth attention head, represents the key matrix of the hth attention head, represents the value matrix of the hth attention head, represents the weight matrix of the query matrix in the hth attention head, represents the weight matrix of the key matrix in the hth attention head, represents the weight matrix of the value matrix in the hth attention head, represents the bias term of the query matrix in the hth attention head, represents the bias term of the key matrix in the hth attention head, represents the bias term of the value matrix in the hth attention head.
[0136] After calculating the Q, K, and V corresponding to each attention head, the scaled dot-product attention is performed, and the formula is as follows:
[0137] (32);
[0138] wherein: is the calculation result of the hth attention head; is the dimension of K in the hth attention head, which prevents the gradient from vanishing due to the excessively large dot-product result; represents the transpose of the key matrix of the hth attention head.
[0139] After calculating the attention of each attention head, the feature fusion and residual connection are performed. The residual connection prevents the attention layer from excessively modifying the existing features by retaining the original input features, and the calculation formula is as follows:
[0140] (33);
[0141] wherein: is the result of the residual connection; Concat represents the concatenation operation, is the output projection matrix, which linearly combines the outputs of multiple attention heads to ensure that the dimension of the attention output result is consistent with .
[0142] The specification of the input feature vector is set to , the output feature vector is set as . The variable represents the amount of data trained in each batch, and various forms of mini-batch gradient descent algorithm are often used for optimization in neural networks. By selecting an appropriate batch size, the available computing resources can be best utilized for fast model training.
[0143] The ReLU function is used as the activation function in the model, and the derivative of the forward part is a constant value. Therefore, using ReLU can effectively avoid the problem of gradient disappearance. However, in the last layer of the neural network, a linear activation function is usually used instead of ReLU, because the non-negativity of ReLU may limit the output range of the neural network and cannot generate the required results. This approach has also been widely used in other machine learning problems, providing a wider range of values for the output.
[0144] In the selection of optimizers and loss functions, the mean square error loss function MSELoss is used as the loss function of the model, which achieves global constraints on the model output by minimizing the squared deviation between the predicted value and the true value. In order to solve the problem of gradient sparsity and non-stationary target in parameter optimization, the Adam optimizer inherits the ability of AdaGrad to handle sparse gradients and the characteristics of RMSProp to deal with non-stationary targets, achieving a balance between the two. The core mechanism is to dynamically estimate the first and second moments of the gradient through exponential moving average.
[0145] The traditional training paradigm of neural networks generally uses a constant learning rate configuration strategy. Although this strategy has obvious advantages in reducing algorithm implementation complexity and simplifying the debugging process, it has some limitations when dealing with high-dimensional output problems: constant learning rate often causes the neural network to fall into a local optimal solution or saddle point during optimization, especially in complex high-dimensional space; using a constant learning rate can cause the model to still update with a relatively large step size when approaching the optimal solution, missing the opportunity for fine tuning.
[0146] In order to solve the above problems, the present application uses the equal interval learning rate scheduler StepLR, which dynamically adjusts the learning rate according to the current iteration number, thereby effectively improving the model performance during optimization. In the early stages of training, a larger learning rate is used for more aggressive parameter updates to cross local extreme value obstacles; when the model gradually approaches the optimal solution, the learning rate is gradually reduced to narrow the parameter search range, thereby achieving fine tuning.
[0147] The adjustment formula of the equal interval learning rate scheduler StepLR is:
[0148] (34);
[0149] wherein: is the learning rate; is the decay factor; is the current iteration number; is the adjustment interval, i.e., the learning rate is adjusted once every adjustment interval.
[0150] On the basis of the above theory, the embodiment proposes a deep neural network probabilistic power flow calculation method, and the steps are as follows:
[0151] Step one: obtain the node type, branch admittance , and the probability distribution parameters and confidence level of wind power, photovoltaic output and load of the power system ; determine the state variable in the rectangular coordinate system, and set the highest order number of the Cornish-Fisher series expansion ;
[0152] Step two: establish the nonlinear power flow equation of the injected power and the node voltage vector in the rectangular coordinate system by formula (1), and linearize the nonlinear power flow equation to obtain the linearized power flow equation (formula (2)). The Jacobian matrix J formed in the linearization process is composed of small blocks corresponding to different node types according to formulas (3)-(4). This step approximates the nonlinear power flow problem to local linear mapping, which provides a basis for the derivation of the sensitivity matrix in the subsequent steps;
[0153] Step three: take the node voltage vector as the input, embed the branch admittance as the physical information into the deep neural network model based on the multi-head self-attention mechanism and the semi-invariant guided deep neural network model, normalize the output of the CGDNN model, and perform feature embedding and multi-head splitting to construct the query Q, key K and value V. The scaling dot product attention mechanism is used to model the global coupling and non-local interaction between nodes, and then the multi-head combination and residual connection are used to output the Jacobian matrix J. The one-time forward inference is used to replace the iterative process of the traditional Newton-Raphson to obtain the Jacobian matrix J, which takes into account the efficiency and accuracy.
[0154] Step four: obtain the sensitivity matrix based on the Jacobian matrix J obtained in step three. The sensitivity matrix S represents the linear sensitivity relationship of the injected power to the state variable, and is used as the core operation operator to transfer the uncertainty at the injected side to the state side.
[0155] Step five: model the light as a Beta distribution, derive the shape parameters from equations (18)-(19) based on the mean and variance, and use equations (16) and (20) to obtain the moments of photovoltaic active power output; model the wind speed as a Weibull distribution and combine the power curve, derive the moments of wind turbine active power output through three-parameter transformation and characteristic function; the active power of the load approximately obeys a normal distribution, and the center distance is obtained from equation (24). The moments or central moments of each random variable are converted into semi-invariants according to equations (25)-(26), and aggregation is performed using the additivity of semi-invariants to obtain the order semi-invariant ;
[0156] Step six: use the sensitivity matrix to transfer the semi-invariants of the injected power to the state variables to obtain the semi-invariants corresponding to the voltage amplitude and phase angle of the state variables;
[0157] Step seven: standardize the semi-invariants of the state variables, approximate the quantile function using the sixth-order Cornish-Fisher series expansion, and obtain the cumulative distribution function through inversion operation, and further derivation to obtain the probability density function;
[0158] Step eight: under the given confidence level , calculate the fluctuation interval of the state variables under the chance constraint based on the quantile function; by setting the confidence level in layers, the system operation boundary under different safety requirements is effectively quantified, and the quantitative evaluation of the probabilistic power flow is realized.
[0159] Another embodiment of the application provides a deep neural network probabilistic power flow calculation system, comprising:
[0160] A data acquisition module is configured to acquire the node type, branch admittance, and probability distribution parameters and confidence level of wind power, photovoltaic output, and load of a power system; and determine the state variables in the rectangular coordinate system.
[0161] A power flow equation modeling module is configured to establish a nonlinear power flow equation of injected power and node voltage vector in the rectangular coordinate system, and perform linearization processing on the nonlinear power flow equation to obtain a linearized power flow equation and a corresponding Jacobian matrix.
[0162] A neural network calculation module is configured to take the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on a multi-head self-attention mechanism and semi-invariant guidance, and solve the Jacobian matrix. The neural network calculation module is trained using a mean square error loss function and an Adam optimizer, and uses an equal interval learning rate scheduling strategy to dynamically adjust the learning rate.
[0163] The semi-invariant calculation module is configured to calculate the moments and semi-invariants of each order of the photovoltaic active output, the wind turbine active output and the load active power according to the probability density functions of the photovoltaic active output, the wind turbine active output and the load active power, and aggregate the semi-invariants to obtain the semi-invariants of each order of the node injection power; the inverse matrix of the Jacobian matrix is calculated to obtain the sensitivity matrix; the semi-invariants of each order of the node injection power are transmitted to the state variables by using the sensitivity matrix to obtain the semi-invariants corresponding to the voltage amplitude and phase angle; the semi-invariants of the state variables are normalized, the Cornish-Fisher series expansion is used to approximate the quantile function, and the cumulative distribution function and the probability density function are obtained through the inversion operation;
[0164] The chance constraint analysis module is configured to set the semi-invariant and the highest order of the Cornish-Fisher series expansion, calculate the fluctuation interval of the state variables based on the quantile function at a given confidence level
[0165] Another embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the deep neural network probabilistic power flow calculation method.
[0166] Another embodiment of the present application provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the deep neural network probabilistic power flow calculation method.
[0167] The above description only expresses the preferred embodiments of the present application, and does not limit the other forms of the present application, and any skilled person in the art can change or modify the above disclosed content to equivalent embodiments. However, any simple modification, equivalent change and modification made to the above embodiments without departing from the technical solution of the present application, and according to the technical essence of the present application, still belong to the protection scope of the present application.
Claims
1. A deep neural network probabilistic power flow calculation method, characterized in that, Includes the following steps: Step 1: Obtain the node types, branch admittances, and probability distribution parameters and confidence levels of wind power, photovoltaic output, and load of the power system; determine the state variables in the rectangular coordinate system, and set the highest order of the semi-invariants and Cornish-Fisher series expansion; Step 2: Establish the nonlinear power flow equations of injected power and node voltage vectors in a rectangular coordinate system, and linearize the nonlinear power flow equations to obtain the linearized power flow equations and the corresponding Jacobian matrix. Step 3: Using the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, and solve for the Jacobian matrix; The deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance includes: Input layer receives node voltage vectors; The physical information embedding layer will include branch admittance. Embedded as prior knowledge in network parameters; For the electrical conductance between nodes, The susceptance between each node; Using a multilayer perceptron, the input node voltage vector is learned through nonlinear activation functions and physical information embedding. The mapping to the output Jacobian matrix is then performed, and the output features are fed into the normalization layer for processing. Next, the output of the normalization layer is subjected to feature embedding and multi-head splitting to construct the query matrix, key matrix, and value matrix in the multi-head self-attention mechanism. Then, scaling dot product attention is performed, and the attention of each attention head is calculated before feature fusion and residual connection are performed. Finally, the Jacobian matrix is generated through the output layer. Step 4: Calculate the inverse matrix of the Jacobian matrix obtained in Step 3 to obtain the sensitivity matrix; Step 5: Based on the probability density functions of photovoltaic active power output, wind turbine active power output and load active power, calculate the moments and semi-invariants of each order respectively, and use the additivity of the semi-invariants to aggregate the semi-invariants to obtain the semi-invariants of the node injection power. Step 6: Use the sensitivity matrix to transfer the semi-invariants of the nodal injected power to the state variables, and obtain the semi-invariants corresponding to the voltage amplitude and phase angle; Step 7: Standardize the semi-invariants of the state variables, approximate their quantile functions using a sixth-order Cornish-Fisher series expansion, and obtain the cumulative distribution function and probability density function through inversion operations; Step 8: At a given confidence level Under chance constraints, the fluctuation range of state variables is calculated based on quantile functions; by setting confidence levels in a stratified manner, a quantitative assessment of probabilistic power flow is achieved.
2. The method according to claim 1, characterized in that, Photovoltaic active power output is based on a Beta distribution, and moments of each order are calculated using shape parameters and gamma functions. The active power output of wind turbines is based on the Weibull distribution, combined with the wind speed-power piecewise function, and the moments of each order are derived through the characteristic function of the three-parameter Weibull distribution. The active power of the load is based on a normal distribution, and its central moments of each order are calculated directly. By using the transformation relationship between moments and semi-invariants, the semi-invariants of each random variable can be obtained.
3. The method according to claim 1, characterized in that, The fluctuation range of the state variable is represented as follows: ; In the formula: For state variables, The fluctuation range of the state variable; The expected value of the state variable; and These are the upper and lower limits of the confidence interval, respectively.
4. The method according to claim 1, characterized in that, Using a multilayer perceptron, the input node voltage vector is learned through nonlinear activation functions and physical information embedding. The mapping to the output Jacobian matrix is then performed, and the output features are subsequently fed into a normalization layer for processing. The specific process is as follows: ; ; In the formula: For the first Output features of linear layers; For the first Output features of linear layers; and For the first Layer linear layer to the first Weights and biases between linear layers; For activation functions; This is the output of the normalization layer; This represents the mean of the input data; Indicates the variance of the input data; It is a constant; and The scaling and translation parameters are learned during the training process.
5. The method according to claim 1, characterized in that, The deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance is trained using mean squared error loss function and Adam optimizer, and the learning rate is dynamically adjusted using an equal-interval learning rate scheduler.
6. A deep neural network probabilistic power flow calculation system, characterized in that, include: The data acquisition module is used to acquire the node type, branch admittance, and probability distribution parameters and confidence levels of wind power, photovoltaic output and load of the power system. Determine the state variables in a Cartesian coordinate system; The power flow equation modeling module is used to establish nonlinear power flow equations of injected power and node voltage vectors in a rectangular coordinate system, and to linearize the nonlinear power flow equations to obtain linearized power flow equations and corresponding Jacobian matrices. The neural network computation module is used to take the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, and solve the Jacobian matrix. The deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance includes: Input layer receives node voltage vectors; The physical information embedding layer will include branch admittance. Embedded as prior knowledge in network parameters; For the electrical conductance between nodes, The susceptance between each node; Using a multilayer perceptron, the input node voltage vector is learned through nonlinear activation functions and physical information embedding. The mapping to the output Jacobian matrix is then performed, and the output features are fed into the normalization layer for processing. Next, the output of the normalization layer is subjected to feature embedding and multi-head splitting to construct the query matrix, key matrix, and value matrix in the multi-head self-attention mechanism. Then, scaling dot product attention is performed, and the attention of each attention head is calculated before feature fusion and residual connection are performed. Finally, the Jacobian matrix is generated through the output layer. The semi-invariant calculation module is used to calculate the moments and semi-invariants of photovoltaic active power output, wind turbine active power output, and load active power respectively based on the probability density functions. It then aggregates the semi-invariants of node injected power using the additivity of the semi-invariants to obtain the semi-invariants of each order. Based on the Jacobian matrix obtained by the neural network calculation module, its inverse matrix is calculated to obtain the sensitivity matrix. The semi-invariants of node injected power are then transferred to the state variables using the sensitivity matrix to obtain the semi-invariants corresponding to voltage amplitude and phase angle. The semi-invariants of the state variables are standardized, and their quantile functions are approximated using a sixth-order Cornish-Fisher series expansion. Finally, the cumulative distribution function and probability density function are obtained through inversion operations. The chance constraint analysis module is used to set the highest order of the semi-invariants and Cornish-Fisher series expansion at a given confidence level. Below, the fluctuation range of state variables is calculated based on the quantile function.
7. The system according to claim 6, characterized in that, The neural network computing module is trained using the mean squared error loss function and the Adam optimizer, and the learning rate is dynamically adjusted using an equal-interval learning rate scheduler.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Method for calculating multimachine balance probability power flow
CN104268435A
Comprehensive energy system rapid energy flow analysis method based on physical mechanism guidance and multi-head map attention mechanism
CN119830130A