Optimal power flow computation method based on multi-task deep learning
11436494 · 2022-09-06
Assignee
Inventors
Cpc classification
G06F18/214
PHYSICS
H02J3/00
ELECTRICITY
Y04S10/50
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
H02J2203/20
ELECTRICITY
H02J2203/10
ELECTRICITY
H02J4/00
ELECTRICITY
International classification
H02J13/00
ELECTRICITY
H02J4/00
ELECTRICITY
Abstract
An optimal power flow computation method based on multi-task deep learning is provided, which is related to the field of smart power grids. The optimal power flow computation method based on multi-task deep learning includes: acquiring state data of a power grid at a certain dispatching moment, and amplifying collected data samples by means of sampling to acquire training data; applying an optimization method to acquire dispatching solutions of the power grid in different sampling states, and acquiring labels; designing a deep learning neural network model, learning feasibility and an optimal solution of an optimal power flow computation problem separately, and outputting a feasibility determination and an optimal solution prediction; simultaneously training, tasks of the feasibility determination and the optimal solution prediction in the optimal power flow computation problem; and determining whether there is a feasible dispatching solution, and outputting an optimal dispatching solution or an early warning.
Claims
1. An optimal power flow computation method based on a multi-task deep learning, comprising: step 1, acquiring state data of a power grid at a certain dispatching moment, and amplifying collected data samples by a sampling method to acquire training data; step 2, applying an optimization method to acquire dispatching solutions of the power grid in different sampling states, and acquiring labels of the training data; step 3, designing a deep learning neural network model, learning a feasibility and an optimal solution of an optimal power flow computation problem separately, and outputting a feasibility determination and an optimal solution prediction; step 4, simultaneously training, based on a multi-task learning framework, tasks of the feasibility determination and the optimal solution prediction in the optimal power flow computation problem to acquire a multi-task deep learning model, which is trained; and step 5, determining whether there is a feasible dispatching solution of the power grid according to an output result of the multi-task deep learning model, and outputting an optimal dispatching solution or an early warning of the power grid; wherein step 1 specifically comprises: in step 1.1, collecting the state data of the power grid at the certain dispatching moment, the state data including the number N.sub.bus of nodes, the number N.sub.gem of generators, the number N.sub.branch of lines, and a reactance x.sub.ij and a load power P.sub.D=[P.sub.d1, Pd.sub.2, . . . P.sub.dNbus] between a node i and a node j in a system, p.sub.di, being a load power of a corresponding node i; in step 1.2, performing sampling and amplification on a node load powers p.sub.di, of nodes, which are collected, to acquire a sample {circumflex over (P)}.sub.D=[{circumflex over (P)}.sub.d1, {circumflex over (P)}.sub.d2, . . . , {circumflex over (P)}.sub.dNbus] and repeating the sampling and amplification for n times to acquire a training sample
P.sub.D=[{circumflex over (P)}.sub.d1,{circumflex over (P)}.sub.d2, . . . ,{circumflex over (P)}.sub.dNbus] the sampling method being used for uniform sampling with the node load powers p.sub.di, as a center as shown below:
{circumflex over (P)}.sub.di∈[(1−r.sub.di)×p.sub.di,(1+r.sub.di)×p.sub.di] wherein r.sub.di, is a sampling parameter of the node i; and step 2 specifically comprises: taking the training sample {circumflex over (p)}.sub.di, as an input, outputting a corresponding feasibility sign {circumflex over (f)}.sub.G1; and a dispatching solution {circumflex over (P)}.sub.Gi=[{circumflex over (P)}.sub.g1, {circumflex over (P)}.sub.g2, . . . , {circumflex over (P)}.sub.gNgen] by means of a traditional optimal power flow solver based on the optimization method; repeating the above process for each of the training sample to acquire corresponding labels {circumflex over (P)}.sub.G=[{circumflex over (P)}.sub.G1, {circumflex over (P)}.sub.G2, . . . , {circumflex over (P)}.sub.Gn] and {circumflex over (F)}.sub.G=[{circumflex over (f)}.sub.G1, {circumflex over (f)}.sub.G2, . . . , {circumflex over (f)}.sub.Gn] of all of the training data; preprocessing the input {circumflex over (P)}.sub.D and an output {circumflex over (P)}.sub.G, of the training data to acquire a preprocessed input {circumflex over (P)}.sub.D and an output {tilde over (P)}.sub.G of the training data; inputting the preprocessed input {tilde over (P)}.sub.D, into the following deep learning neural network:
h.sub.0={tilde over (P)}.sub.D
H.sub.i=ϕ(W.sub.ihi-1+b.sub.i) wherein h.sub.0 represents an original input of a neural network model, h.sub.i represents an output of a i hidden layer of a model, W.sub.i; represents a weight of the i hidden layer, b.sub.i represents a deviation of the i hidden layer and ϕ(⋅) represents an activation function; designing, aiming at the feasibility of the optimal power flow computation problem, the following output layer for learning:
F.sub.G=ψ.sup.cls(W.sub.l.sup.clsh.sub.i-1+b.sub.l.sup.cls)) wherein ψ.sup.cls represents the activation function, F.sub.g represents a predicted value of a feasibility sign, h.sub.i-1, represents an output of a last hidden layer, W.sub.l.sup.cls represents an output layer weight of a classification problem and b.sub.l.sup.cls represents an output layer deviation of the classification problem; and designing, aiming at the optimal solution of the optimal power flow computation problem, the following output layer for learning:
P.sub.G=ψ.sup.reg(W.sub.l.sup.regh.sub.i-1+b.sub.l.sup.reg)) wherein ψ.sup.reg represents the activation function, P.sub.g represents a predicted value of the dispatching solution, h.sub.i-1, represents the output of the last hidden layer, W.sub.l.sup.reg represents an output layer weight of a regression problem and b.sub.l.sup.reg represents an output layer deviation of the regression problem.
2. The optimal power flow computation method based on the multi-task deep learning according to claim 1, wherein the step 4 specifically comprises: setting a classification task, and measuring a difference between the predicted value F.sub.G and a true value {circumflex over (F)}.sub.G of the feasibility sign by means of a loss function:
loss.sub.cls=L.sup.cls(F.sub.G,{circumflex over (F)}.sub.G) wherein L.sup.cls represents the loss function of the classification task; setting a regression task, and measuring a difference between the predicted value P.sub.G and a true value {tilde over (P)}.sub.G of the dispatching solution by means of the loss function:
loss.sub.reg=L.sup.reg(P.sub.G,{tilde over (P)}.sub.G) wherein L.sup.reg represents the loss function of the classification task; acquiring a training loss of the multi-task deep learning model by means of a weighted summation:
loss=ω.sub.cls.Math.loss.sub.cls+ω.sub.reg.Math.loss.sub.reg wherein ω.sub.cls and ω.sub.reg represent a weight of a classification task loss and a weight of a regression task loss respectively.
3. The optimal power flow computation method based on the multi-task deep learning according to claim 2, wherein the step 5 specifically comprises: for given the state data of the power grid at any dispatching moment, outputting, by the multi-task deep learning model, the predicted value f.sub.G of the feasibility sign and a predicted value p.sub.G of the optimal solution; determining whether the predicted value p.sub.G is effective on the basis of the predicted value f.sub.G; if so, taking the predicted value p.sub.G of the optimal solution, which is outputted, as the optimal dispatching solution to guide a dispatching operation of the power grid; and otherwise, abandoning the predicted value p.sub.G, and outputting the early warning about the fact that the power grid cannot operate normally in a current system state.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) FIGURE is a flowchart of an optimal power flow computation method based on multi-task deep learning in an embodiment of the present disclosure.
DESCRIPTION OF THE EMBODIMENTS
(2) The present disclosure will be described in details below with reference to accompanying drawings and in conjunction with embodiments. It should be understood that the described embodiments are merely some rather than all of embodiments, the present disclosure should not be limited by the illustrated embodiments when implemented, but the essence of contents of the present disclosure should be further understood by means of these embodiments, so as to better serve those of ordinary skill in the art.
(3) As shown in FIGURE, the optimal power flow computation method based on multi-task deep learning of the present disclosure includes:
(4) Step 1, state data of a power grid are acquired at a certain dispatching moment, and collected data samples are amplified by means of sampling to acquire training data.
(5) In step 1.1, the state data of the power grid are collected at a certain dispatching moment, the state data including the number N.sub.bus of nodes, the number N.sub.gen of generators, the number N.sub.branch of lines, a reactance x.sub.ij and load power p.sub.D=[p.sub.d.sub.
(6)
between node i and node j in a system, and p.sub.d.sub.
{circumflex over (p)}.sub.d.sub.
(7) where r.sub.d.sub.
(8) In this embodiment, dispatching data of an IEEE 30-bus power grid at a certain moment are collected and specifically include the number N.sub.bus=30 of nodes, the number N.sub.gen=6 of generators, the number N.sub.branch=41 of lines, and a reactance x.sub.ij and load power p.sub.D[p.sub.d.sub.
(9) in step 1.2, performing sampling and amplification on the collected node load power p.sub.di to acquire a sample {circumflex over (p)}.sub.D=[{circumflex over (p)}.sub.d.sub.
(10)
and repeating the sampling and amplification for n times to acquire a training sample {circumflex over (P)}.sub.D=[{circumflex over (p)}.sub.D.sub.
(11) In this embodiment, uniform sampling is used for sample amplification on collected state data of the IEEE 30-bus power grid. In this embodiment, the sample {circumflex over (p)}.sub.D=[{circumflex over (p)}.sub.d.sub.
(12) step 2, an optimization method is applied to acquire dispatching solutions of the power grid in different sampling states, and labels of the training data are acquired. Specifically, the training sample value {circumflex over (p)}.sub.D.sub.
(13)
are output by means of a traditional optimal power flow solver based on the optimization method. The above process is repeated for each training sample to acquire corresponding labels {circumflex over (P)}.sub.G=[{circumflex over (p)}.sub.G.sub.
(14) In this embodiment, the above solving process is repeated for each training sample to acquire corresponding labels {circumflex over (P)}.sub.G [{circumflex over (p)}.sub.G.sub.
(15) Step 3, a deep learning neural network model is designed, learning feasibility and an optimal solution of an optimal power flow computation problem are performed separately, and a feasibility determination and an optimal solution prediction are output.
(16) Firstly, the input {circumflex over (P)}.sub.D and output {circumflex over (P)}.sub.G of the training data are preprocessed to acquire preprocessed input {tilde over (P)}.sub.D and output {tilde over (P)}.sub.G of the training data.
(17) Then {tilde over (P)}.sub.D is input into the following deep learning neural network:
h.sub.0={tilde over (P)}.sub.D
h.sub.i=Φ(W.sub.ih.sub.i-1+b.sub.i),
(18) where h.sub.0 represents an original input of the neural network model, h.sub.i represents an output of a ith hidden layer of the model, W.sub.i represents a weight of the ith hidden layer, b.sub.i represents a deviation of the ith hidden layer and Φ(⋅) represents an activation function.
(19) Aiming at the feasibility of the optimal power flow computation problem, the following output layer is designed for learning:
F.sub.G=Ψ.sup.cls(W.sub.l.sup.clsh.sub.l-1+b.sub.l.sup.cls)),
(20) where Ψ.sup.cls represents an activation function, F.sub.G represents a predicted value of the feasibility sign, h.sub.l-1 represents an output of a last hidden layer, W.sub.l.sup.cls represents an output layer weight of a classification problem and b.sub.l.sup.cls represents an output layer deviation of the classification problem.
(21) Aiming at the optimal solution of the optimal power flow computation problem, the following output layer is designed for learning:
P.sub.G=Ψ.sup.reg(W.sub.l.sup.regh.sub.l-1+b.sub.l.sup.reg),
(22) where Ψ.sup.reg represents an activation function, P.sub.G represents a predicted value of the dispatching solution, h.sub.l-1 represents an output of the last hidden layer, W.sub.l.sup.reg represents an output layer weight of a regression problem and b.sub.l.sup.reg represents an output layer deviation of the regression problem.
(23) In this embodiment, in order to reduce influence of an amplitude range of the training data on results, the input {circumflex over (P)}.sub.D and the output {circumflex over (P)}.sub.G of the training data are normalized such that the amplitude thereof is between 0 and 1, and the normalized input and the normalized output of the training data are {tilde over (P)}.sub.D and {tilde over (P)}.sub.G respectively.
(24) Then {tilde over (P)}.sub.D is input into the deep learning neural network model, and the model structure is shown below:
h.sub.0={tilde over (P)}.sub.D
h.sub.i=ReLU(W.sub.ih.sub.i-1+b.sub.i),
(25) where h.sub.0 represents an original input of the neural network model, h.sub.i represents an output of a ith hidden layer of the model, W.sub.i represents a weight of the ith hidden layer, b.sub.i represents a deviation of the ith hidden layer and ReLU(⋅) represents an activation function. The number of layers of neural networks used in this embodiment is 4.
(26) Aiming at the feasibility of the optimal power flow computation problem, an output layer of the neural network model outputs the predicted value F.sub.G of the feasibility sign:
F.sub.G=argmax(Softmax(W.sub.l.sup.clsh.sub.l-1+b.sub.l.sup.cls)),
(27) where Softmax outputs a probability value of feasibility/infeasibility of the problem, and argmax returns the predicted value F.sub.G, with a value being 0 or 1, of the feasibility label based on the probability value.
(28) Aiming at the optimal solution of the optimal power flow computation problem, the output layer of the neural network model outputs a prediction result P.sub.G:
P.sub.G=Sigmoid(W.sub.l.sup.regh.sub.l-1+b.sub.l.sup.reg),
(29) where P.sub.G is a numerical value within (0,1), that is, the predicted value of the optimal solution {tilde over (P)}.sub.G.
(30) Step 4, based on a multi-task learning framework, tasks of the feasibility determination and the optimal solution prediction in the optimal power flow computation problem are simultaneously trained to acquire a trained multi-task deep learning model. Specifically,
(31) a classification task is set, and a difference between the predicted value F.sub.G and a true value {circumflex over (F)}.sub.G of the feasibility sign is measured by means of a loss function as shown below:
loss.sub.cls=L.sup.cls(F.sub.G,{circumflex over (F)}.sub.G)
(32) where L.sup.cls represents the loss function of the classification task.
(33) A regression task is set, and a difference between the predicted value P.sub.G and a true value {tilde over (P)}.sub.G of the dispatching solution is measured by means of the loss function as show below:
loss.sub.reg=L.sup.reg(P.sub.G,{tilde over (P)}.sub.G)
(34) where L.sup.reg represents the loss function of the classification task.
(35) A training loss of the multi-task deep learning model is acquired by means of weighted summation as shown below:
loss=ω.sub.cls.Math.loss.sub.cls+ω.sub.reg.Math.loss.sub.reg
(36) where ω.sub.cls and ω.sub.reg represent a weight of a classification task loss and a weight of a regression task loss respectively. The multi-task deep learning model achieves simultaneous learning of the feasibility determination and the optimal solution prediction by continuously optimizing the above loss function value.
(37) In this embodiment, two training tasks are set to train the neural network model in step 3.
(38) The classification task is set, and classification involves 2 categories, where category 0 represents infeasibility and category 1 represents feasibility. The difference between the predicted value F.sub.G and the true value {circumflex over (F)}.sub.G of the model feasibility label is minimized by using a cross entropy loss function as shown below:
loss.sub.cls=CrossEntropyLoss(F.sub.G,{circumflex over (F)}.sub.G)
(39) The regression task is set, and a mean square error loss function is used to minimize a difference between the predicted optimal solution P.sub.G and a true value {tilde over (P)}.sub.G of the model as shown below:
loss.sub.reg=MSELoss(P.sub.G,{tilde over (P)}.sub.G)
(40) A training loss of the multi-task deep learning model is acquired by means of weighted summation as shown below:
loss=ω.sub.cls.Math.loss.sub.cls+ω.sub.reg.Math.loss.sub.reg
(41) where ω.sub.cls and ω.sub.reg represent a weight of a classification task loss and a weight of a regression task loss respectively, and ω.sub.cls is 0.1 and ω.sub.reg is 1 in this embodiment. The neural network model achieves simultaneous learning of the feasibility determination and the optimal solution prediction by continuously optimizing the above loss function value.
(42) The neural network model uses the multi-task learning framework above to train on the training set {tilde over (P)}.sub.D and its corresponding labels {tilde over (P)}.sub.G and {circumflex over (F)}.sub.G, and sets batch size to 128, a learning rate to 0.001, and the number of iterations to 200.
(43) Step 5, whether there is a feasible dispatching solution depends on an output result of the multi-task deep learning model, and an optimal dispatching solution or an early warning is outputted. The trained multi-task deep learning model is acquired in step 4 and is deployed and used. During the use of the model, for given state data of the power grid at any dispatching moment, the multi-task deep learning model outputs the predicted value f.sub.G of the feasibility sign and a predicted value p.sub.G of the optimal solution. Whether the predicted value p.sub.G is effective is determined on the basis of the predicted value f.sub.G, if so, the output predicted value p.sub.G of the optimal solution is taken as an optimal dispatching solution to guide dispatching operation of the power grid; otherwise, the predicted value p.sub.G is abandoned, and the early warning about the fact that power grid may not operate normally in a current system state is outputted.
(44) In this embodiment, when f.sub.G=1, the output predicted value p.sub.G of the optimal solution is the optimal dispatching solution, which may guide the dispatching operation of the power grid. When f.sub.G=0, the output predicted value p.sub.G of the optimal solution has no practical significance, and f.sub.G=0 is deemed as the early warning that the power grid may not operate normally in the current system state.