CN116992779B - Simulation method and system of photovoltaic energy storage system based on digital twin model - Google Patents
Simulation method and system of photovoltaic energy storage system based on digital twin model Download PDFInfo
- Publication number
- CN116992779B CN116992779B CN202311226758.2A CN202311226758A CN116992779B CN 116992779 B CN116992779 B CN 116992779B CN 202311226758 A CN202311226758 A CN 202311226758A CN 116992779 B CN116992779 B CN 116992779B
- Authority
- CN
- China
- Prior art keywords
- wolf
- energy storage
- storage system
- wolves
- algorithm
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000004146 energy storage Methods 0.000 title claims abstract description 75
- 238000004088 simulation Methods 0.000 title claims abstract description 42
- 238000000034 method Methods 0.000 title claims abstract description 30
- 241000282461 Canis lupus Species 0.000 claims abstract description 99
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 76
- 238000013528 artificial neural network Methods 0.000 claims abstract description 33
- 238000013527 convolutional neural network Methods 0.000 claims abstract description 27
- 238000005457 optimization Methods 0.000 claims abstract description 22
- 238000012937 correction Methods 0.000 claims abstract description 13
- 241000282421 Canidae Species 0.000 claims description 62
- 230000006870 function Effects 0.000 claims description 29
- 210000002569 neuron Anatomy 0.000 claims description 16
- 238000012952 Resampling Methods 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000005286 illumination Methods 0.000 claims description 4
- 238000013507 mapping Methods 0.000 claims description 3
- 230000000276 sedentary effect Effects 0.000 claims description 3
- 238000011161 development Methods 0.000 abstract description 4
- 238000012549 training Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000013178 mathematical model Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0499—Feedforward networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Computing Systems (AREA)
- Molecular Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Geometry (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Medical Informatics (AREA)
- Computer Hardware Design (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Supply And Distribution Of Alternating Current (AREA)
Abstract
The invention relates to the technical field of system simulation, in particular to a photovoltaic energy storage system simulation method and system based on a digital twin model, comprising the following steps: s1: collecting historical data of each energy source device of the photovoltaic energy storage system; s2: building a numerical twin model of the photovoltaic energy storage system based on the improved CNN-BP neural network; s3: inputting updated data of each energy device of the photovoltaic energy storage system into a numerical twin model for simulation; s4: and correcting the numerical twin model based on the simulation result. According to the invention, the historical data of the photovoltaic energy storage system is acquired through the CNN algorithm improved by the improved gray wolf optimization algorithm, so that the balance between global search and local development of the algorithm can be maintained, the dynamic adjustment capability of the algorithm is improved, and the high-dimensional and complex multi-modal problems of the photovoltaic energy storage system can be satisfied; and then the BP neural network is used for carrying out fitting correction on the output of the CNN algorithm, so that the precision of the digital twin model can be improved, and the prediction error of the model can be reduced.
Description
Technical Field
The invention relates to the technical field of system simulation, in particular to a photovoltaic energy storage system simulation method and system based on a digital twin model.
Background
The comprehensive energy system taking the electric power as the core comprises various energy production, transmission, storage and consumption networks, has complex structure, various devices and complex technology, and has typical nonlinear random characteristics and multi-scale dynamic characteristics. However, the conventional mathematical model has difficulty in meeting the requirements of planning design, monitoring analysis and operation optimization in the prior art, and further improvement of the modeling accuracy of the energy equipment in the mathematical model is required; the mass system data is analyzed through an artificial intelligent algorithm, so that high-precision modeling of the photovoltaic energy storage system energy equipment can be realized, and the simulation model can be continuously optimized through collecting real-time data of the physical equipment. The artificial intelligence algorithm is an important supporting technology for constructing a digital twin model of the photovoltaic energy storage system, and provides a digital and intelligent foundation for accurately constructing the digital twin simulation model of the energy equipment of the photovoltaic energy storage system.
In the prior art, training and modeling of energy equipment data are performed based on a CNN-BP neural network, the prediction effect of a deep network combination prediction model based on CNN is high in prediction accuracy, but the weight training of CNN influences the prediction effect of the model, and the improper weight training easily causes over fitting of the model, reduces the accuracy of the model and increases the prediction error of the model.
Disclosure of Invention
The invention aims to solve the defects in the background technology by providing a photovoltaic energy storage system simulation method and system based on a digital twin model.
The technical scheme adopted by the invention is as follows:
the photovoltaic energy storage system simulation method based on the digital twin model comprises the following steps:
s1: collecting historical data of each energy source device of the photovoltaic energy storage system;
s2: building a numerical twin model of the photovoltaic energy storage system based on the improved CNN-BP neural network;
s3: inputting updated data of each energy device of the photovoltaic energy storage system into a numerical twin model for simulation;
s4: correcting the numerical twin model based on the simulation result;
mapping historical data entities to an improved CNN-BP neural network to build a numerical twin model; in the improved CNN-BP neural network, in a CNN algorithm, self-coding acquisition of historical data of each energy source device of the photovoltaic energy storage system is carried out based on a resampling algorithm with a self-adjusting function.
As a preferred technical scheme of the invention: the historical data comprise illumination intensity and temperature corresponding to the photovoltaic equipment, and energy storage state and energy storage capacity corresponding to the energy storage equipment.
As a preferred technical scheme of the invention: the resampling algorithm is specifically as follows:
w 0 =w 1 ·γ e +w 2 (1-γ e )
wherein w is 2 For obtaining historical data weight value, w of each energy source device of the photovoltaic energy storage system 1 Is weight balance value, w 0 As final weight, γ e And e is the index number of the weight factors.
As a preferred technical scheme of the invention: in the resampling algorithm, the final weight w of each data in the historical data 0 And introducing a time step t for updating to obtain the real-time weight of each data.
As a preferred technical scheme of the invention: the updating of the introduction time step t is specifically as follows:
calculating the gradient:
updating the first moment estimate and the second moment estimate:
calculating a bias corrected first moment estimate and second moment estimate:
updating weights:
wherein g t As a gradient of time step t, w t Is the actual weight at time t, f t As a weight gradient function at the time t, beta 1 An exponential decay rate, beta, estimated for the first moment 2 Exponential decay rate, m, for second moment estimation t Estimating the value at time t for the first moment, m t-1 Estimating the value at time t-1 for the first moment, v t Estimating the value at time t for the second moment, v t-1 Estimating the value at time t-1 for the second moment, w t+1 For the updated weight at time t +1,estimating the value at time t, v for the bias corrected first moment t The value at time t is estimated for the second moment after the deviation correction, and α is the learning rate.
As a preferred technical scheme of the invention: in the S2, in the improved CNN-BP neural network, the CNN algorithm is specifically as follows:
let the loss function L of the sample at the network output layer be:
wherein m is the number of neurons of a network output layer, o j For output on the jth neuron, y j Ideal output for the objective function;
outputting the loss function L to the j-th neuron to output o j Deviation guide is calculated:
the loss function is biased to the feature layer:
wherein p is k Omega, the last feature layer kj Weights input for hidden layers;
the adjustment operator Δbias is:
wherein p is i To output corresponding layer, bias i Bias for the corresponding layer;
the calculation of the convolution kernel is essentially a process of multiplying and summing weights, and the adjustment operator Δbias' of the convolution kernel in the convolution layer is:
wherein p is i-1 Is the output of the upper layer.
As a preferred technical scheme of the invention: in the CNN algorithm, weight optimization is performed based on an improved gray wolf optimization algorithm.
As a preferred technical scheme of the invention: the improved gray wolf optimization algorithm is specifically as follows:
setting the output error of the CNN network as an fitness function, setting alpha wolf as a top wolf, beta wolf as any successor under the wolf group as a second grade, listening to the top wolf, and gamma wolf as a third grade when the error is minimum, and setting the alpha wolf as an optimal candidate solution; the hunting of wolves around the hunting object under the belt of alpha wolves, beta wolves and gamma wolves is performed by the sedentary wolves searching for hunting object during predation as follows:
D=|2r 1 X p (h)-X(h)|
X(h+1)=X p (h)-AD
wherein D is the distance of the prey, X p (h) X (h) and X (h+1) are respectively the h algorithm iteration and the h+1 algorithm iteration, namely the position of the gray wolf, and h is the algorithm iteration number; r is (r) 1 Is a random vector between (0, 1), A is a coefficient vector;
A=2ar 2 -a
wherein r is 2 Is a random vector between (0, 1), a is a convergence factor, and T is the maximum iteration number;
when the position of the prey is found, the beta wolf and the gamma wolf gradually surround the prey under the lead of the alpha wolf, and for each wolf, the position update direction is calculated according to the following formula:
D α =|C 1 X α -X|
D β =|C 2 X β -X|
D γ =|C 3 X γ -X|
X 1 =X α -AD α
X 2 =X β -AD β
X 3 =X γ -AD γ
wherein D is α 、D β 、D γ The distances among alpha wolves, beta wolves, gamma wolves and other individuals are respectively; c (C) 1 、C 2 、C 3 As random variable, X α 、X β 、X γ The current positions of alpha wolf, beta wolf and gamma wolf are respectively, X is a position vector, X 1 、X 2 、X 3 Respectively compensating the forward directions of alpha wolves, beta wolves and gamma wolves;
dynamically updating the position proportion weights of alpha wolves, beta wolves and gamma wolves according to the above formula and the next position:
wherein W is 1 、W 2 、W 3 The position proportion weights of alpha wolf, beta wolf and gamma wolf are respectively, X g (h+1) is the updated position of the individual gray wolves during the h+1st algorithm iteration in the surrounding hunting process;
and updating the positions of other wolves according to the formula, judging whether the termination condition is met, if not, continuing iteration until the termination condition is met, outputting the position of the optimal alpha wolf of the wolf individual, and outputting a corresponding weight value.
As a preferred technical scheme of the invention: in the improved CNN-BP neural network, the output of the CNN algorithm optimized by the improved gray-wolf optimization algorithm is input into the BP neural network, all layers of neurons form full interconnection connection through weights and thresholds, the weights and the thresholds are adjusted based on the improved gray-wolf optimization algorithm, so that the error between the output value and the expected value of the improved CNN-BP neural network is minimum, and the final result is output through a regression layer for correction.
The photovoltaic energy storage system simulation system based on the digital twin model comprises the following steps:
and a data acquisition module: the system is used for collecting historical data of each energy device of the photovoltaic energy storage system;
model building module: the numerical twin model is used for building a photovoltaic energy storage system based on the improved CNN-BP neural network;
and a system simulation module: the simulation method comprises the steps of inputting updated data of each energy device of the photovoltaic energy storage system into a numerical twin model for simulation;
model correction module: and the numerical twin model is used for correcting the numerical twin model based on the simulation result.
Compared with the prior art, the simulation method and system for the photovoltaic energy storage system based on the digital twin model provided by the invention have the beneficial effects that:
the invention builds a digital twin model of the photovoltaic energy storage system based on the improved CNN-BP neural network, wherein, the CNN algorithm improved by the improved gray wolf optimization algorithm is used for collecting the historical data of each energy source device of the photovoltaic energy storage system, so that the balance of global search and local development of the algorithm can be maintained, the dynamic adjustment capability of the algorithm is improved, and the high-dimensional and complex multi-modal problems of the photovoltaic energy storage system can be satisfied; and then the BP neural network is used for carrying out fitting correction on the output of the CNN algorithm, so that the precision of the digital twin model can be improved, and the prediction error of the model can be reduced.
Drawings
FIG. 1 is a flow chart of a method of a preferred embodiment of the present invention;
fig. 2 is a block diagram of a system in a preferred embodiment of the present invention.
The meaning of each label in the figure is: 100. a data acquisition module; 200. a model building module; 300. a system simulation module; 400. and a model correction module.
Detailed Description
It should be noted that, under the condition of no conflict, the embodiments of the present embodiments and features in the embodiments may be combined with each other, and in the following, a technical solution in the embodiments of the present invention will be clearly and completely described with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a preferred embodiment of the present invention provides a photovoltaic energy storage system simulation method based on a digital twin model, comprising the steps of:
s1: collecting historical data of each energy source device of the photovoltaic energy storage system;
s2: building a numerical twin model of the photovoltaic energy storage system based on the improved CNN-BP neural network;
s3: inputting updated data of each energy device of the photovoltaic energy storage system into a numerical twin model for simulation;
s4: and correcting the numerical twin model based on the simulation result.
The historical data comprise illumination intensity and temperature corresponding to the photovoltaic equipment, and energy storage state and energy storage capacity corresponding to the energy storage equipment.
And in the step S2, mapping the historical data entity to the improved CNN-BP neural network to build a numerical twin model.
In the improved CNN-BP neural network, in a CNN algorithm, self-coding acquisition of historical data of each energy source device of the photovoltaic energy storage system is carried out based on a resampling algorithm with a self-adjusting function.
The resampling algorithm is specifically as follows:
w 0 =w 1 ·γ e +w 2 (1-γ e )
wherein w is 2 For obtaining historical data weight value, w of each energy source device of the photovoltaic energy storage system 1 Is weight balance value, w 0 As final weight, γ e And e is the index number of the weight factors.
In the resampling algorithm, the final weight w of each data in the historical data 0 And introducing a time step t for updating to obtain the real-time weight of each data.
Further, the update performed by introducing the time step t is specifically as follows:
calculating the gradient:
updating the first moment estimate and the second moment estimate:
calculating a bias corrected first moment estimate and second moment estimate:
updating weights:
wherein g t As a gradient of time step t, w t Is the actual weight at time t, f t As a weight gradient function at the time t, beta 1 An exponential decay rate, beta, estimated for the first moment 2 Exponential decay rate, m, for second moment estimation t Estimating the value at time t for the first moment, m t-1 Estimating the value at time t-1 for the first moment, v t Estimating the value at time t for the second moment, v t-1 Is two (two)Moment estimation at time t-1, w t+1 For the updated weight at time t +1,estimating the value at time t for the deviation corrected first moment, < >>The value at time t is estimated for the second moment after the deviation correction, and α is the learning rate.
In the S2, in the improved CNN-BP neural network, the CNN algorithm is specifically as follows:
let the loss function L of the sample at the network output layer be:
wherein m is the number of neurons of a network output layer, o j For output on the jth neuron, y j Ideal output for the objective function;
outputting the loss function L to the j-th neuron to output o j Deviation guide is calculated:
the loss function is biased to the feature layer:
wherein p is k Omega, the last feature layer kj Weights input for hidden layers;
the adjustment operator Δbias is:
wherein p is i To pair(s)Should layer output, bias i Biased for the corresponding layer.
The calculation of the convolution kernel is essentially a process of multiplying and summing weights, and the adjustment operator Δbias' of the convolution kernel in the convolution layer is:
wherein p is i-1 Is the output of the upper layer.
In the CNN algorithm, weight optimization is performed based on an improved gray wolf optimization algorithm.
The improved gray wolf optimization algorithm is specifically as follows:
setting the output error of the CNN network as an fitness function, setting alpha wolf as a top wolf, beta wolf as any successor under the wolf group as a second grade, listening to the top wolf, and gamma wolf as a third grade when the error is minimum, and setting the alpha wolf as an optimal candidate solution; the hunting of wolves around the hunting object under the belt of alpha wolves, beta wolves and gamma wolves is performed by the sedentary wolves searching for hunting object during predation as follows:
D=|2r i X p (h)-X(h)|
X(h+1)=X p (h)-AD
wherein D is the distance of the prey, X p (h) X (h) and X (h+1) are respectively the h algorithm iteration and the h+1 algorithm iteration, namely the position of the gray wolf, and h is the algorithm iteration number; r is (r) 1 Is a random vector between (0, 1), A is a coefficient vector;
A=2ar 2 -a
wherein r is 2 Is a random vector between (0, 1), a is a convergence factor, and T is the maximum iteration number;
when the position of the prey is found, the beta wolf and the gamma wolf gradually surround the prey under the lead of the alpha wolf, and for each wolf, the position update direction is calculated according to the following formula:
D α =|C 1 X α -X|
D β =|C 2 X β -X|
D γ =|C 3 X γ -X|
X 1 =X α -AD α
X 2 =X β -AD β
X 3 =X γ -AD γ
wherein D is α 、D β 、D γ The distances among alpha wolves, beta wolves, gamma wolves and other individuals are respectively; c (C) 1 、C 2 、C 3 As random variable, X α 、X β 、X γ The current positions of alpha wolf, beta wolf and gamma wolf are respectively, X is a position vector, X 1 、X 2 、X 3 Respectively compensating the forward directions of alpha wolves, beta wolves and gamma wolves;
dynamically updating the position proportion weights of alpha wolves, beta wolves and gamma wolves according to the above formula and the next position:
wherein W is 1 、W 2 、W 3 The position proportion weights of alpha wolf, beta wolf and gamma wolf are respectively, X g (h+1) is the updated position of the individual gray wolves during the h+1st algorithm iteration in the surrounding hunting process;
and updating the positions of other wolves according to the formula, judging whether the termination condition is met, if not, continuing iteration until the termination condition is met, outputting the position of the optimal alpha wolf of the wolf individual, and outputting a corresponding weight value.
In the improved CNN-BP neural network, the output of the CNN algorithm optimized by the improved gray-wolf optimization algorithm is input into the BP neural network, all layers of neurons form full interconnection connection through weights and thresholds, the weights and the thresholds are adjusted based on the improved gray-wolf optimization algorithm, so that the error between the output value and the expected value of the improved CNN-BP neural network is minimum, and the final result is output through a regression layer for correction.
Referring to fig. 2, a photovoltaic energy storage system simulation system based on a digital twin model is provided, and a photovoltaic energy storage system simulation method based on the digital twin model includes:
the data acquisition module 100: the system is used for collecting historical data of each energy device of the photovoltaic energy storage system;
model building module 200: the numerical twin model is used for building a photovoltaic energy storage system based on the improved CNN-BP neural network;
system simulation module 300: the simulation method comprises the steps of inputting updated data of each energy device of the photovoltaic energy storage system into a numerical twin model for simulation;
model modification module 400: and the numerical twin model is used for correcting the numerical twin model based on the simulation result.
In this embodiment, the data acquisition module 100 acquires historical data of each energy device of the photovoltaic energy storage system, including illumination intensity and temperature corresponding to the photovoltaic device, and energy storage state and energy storage capacity corresponding to the energy storage device. The model building module 200 maps the collected historical data entities to a built numerical twin model in the modified CNN-BP neural network. In the improved CNN-BP neural network, in a CNN algorithm, self-coding acquisition of historical data of each energy source device of the photovoltaic energy storage system is carried out based on a resampling algorithm with a self-adjusting function:
w 0 =w 1 ·γ e +w 2 (1-γ e )
wherein w is 2 For obtaining historical data weight value, w of each energy source device of the photovoltaic energy storage system 1 Is weight balance value, w 0 As final weight, γ e And e is the index number of the weight factors.
The CNN algorithm model is also added with a resampling algorithm with a self-adjusting function, so that the received historical data of each energy device of the photovoltaic energy storage system can be processed more accurately. By adding the self-coding neural model, different weighting values are given to different data packets, so that the historical data of each energy device of the photovoltaic energy storage system is more accurate, and the analysis capability of the historical data of each energy device of the photovoltaic energy storage system is improved. The self-adaptive system is used for detecting historical data of each energy device of the photovoltaic energy storage system, and when the self-adjusting sampling algorithm model is adopted, various data information can be balanced properly, and the requirements of each energy device of the photovoltaic energy storage system are balanced.
Since it is considered that the data is the history data of each energy device, if the time concept is not introduced, the change in the history data is difficult to update, and thus the final weight w of each data in the history data is calculated in the resampling algorithm 0 And introducing a time step t for updating to obtain the real-time weight of each data.
As a preferred technical scheme of the invention: the updating of the introduction time step t is specifically as follows:
calculating the gradient:
updating the first moment estimate and the second moment estimate:
calculating a bias corrected first moment estimate and second moment estimate:
updating weights:
wherein g t As a gradient of time step t, w t Is the actual weight at time t, f t As a weight gradient function at the time t, beta 1 The exponential decay rate estimated for the first moment,β 2 exponential decay rate, m, for second moment estimation t Estimating the value at time t for the first moment, m t-1 Estimating the value at time t-1 for the first moment, v t Estimating the value at time t for the second moment, v t-1 Estimating the value at time t-1 for the second moment, w t+1 For the updated weight at time t +1,estimating the value at time t for the deviation corrected first moment, < >>The value at time t is estimated for the second moment after the deviation correction, and α is the learning rate.
In this way, the actual weights can be dynamically adjusted according to the magnitude of the gradient and the noise level. This helps to improve the training speed and convergence performance of the CNN model. When the first moment estimation and the second moment estimation of the gradient are calculated, an exponential decay average method is adopted, so that the variance of the gradient estimation can be reduced, and the convergence rate of the model is increased.
The CNN algorithm is specifically as follows:
let the loss function L of the sample at the network output layer be:
wherein m is the number of neurons of a network output layer, o j For output on the jth neuron, y j Ideal output for the objective function;
outputting the loss function L to the j-th neuron to output o j Deviation guide is calculated:
the loss function is biased to the feature layer:
wherein p is k Omega, the last feature layer kj Weights input for hidden layers;
the adjustment operator Δbias is:
wherein p is i To output corresponding layer, bias i Biased for the corresponding layer.
The calculation of the convolution kernel is essentially a process of multiplying and summing weights, and the adjustment operator Δbias' of the convolution kernel in the convolution layer is:
wherein p is i-1 Is the output of the upper layer.
Weight optimization is performed based on an improved gray wolf optimization algorithm:
setting the output error of the CNN network as an fitness function, setting alpha wolf as a top wolf, beta wolf as any successor under the wolf group as a second grade, listening to the top wolf, and gamma wolf as a third grade when the error is minimum, and setting the alpha wolf as an optimal candidate solution; the behavior of the wolf searching for hunting around hunting in the course of predation is shown below, taking iteration 3 as an example:
D=|2r 1 X p (3)-X(3)|
X(4)=X p (3)-AD
wherein D is the distance of the prey, X p (3) X (3) and X (4) are respectively the positions of the prey in the 3 rd algorithm iteration and the position of the gray wolf in the 4 th algorithm iteration; r is (r) 1 Is a random vector between (0, 1), A is a coefficient vector;
A=2ar 2 -a
wherein r is 2 Is a random vector between (0, 1), a is a convergence factor, and T is the maximum iteration number;
when the position of the prey is found, the beta wolf and the gamma wolf gradually surround the prey under the lead of the alpha wolf, and for each wolf, the position update direction is calculated according to the following formula:
D α =|C 1 X α -X|
D β =|C 2 X β -X|
D γ =|C 3 X γ -X|
X 1 =X α -AD α
X 2 =X β -AD β
X 3 =X γ -AD γ
wherein D is α 、D β 、D γ The distances among alpha wolves, beta wolves, gamma wolves and other individuals are respectively; c (C) 1 、C 2 、C 3 As random variable, X α 、X β 、X γ The current positions of alpha wolf, beta wolf and gamma wolf are respectively, X is a position vector, X 1 、X 2 、X 3 Respectively compensating the forward directions of alpha wolves, beta wolves and gamma wolves;
dynamically updating the position proportion weights of alpha wolves, beta wolves and gamma wolves according to the above formula and the next position:
wherein W is 1 、W 2 、W 3 The position proportion weights of alpha wolf, beta wolf and gamma wolf are respectively, X g (4) To surround hunting objectThe updated position of the individual gray wolves during the 4 th algorithm iteration in the journey;
and updating the positions of other wolves according to the formula, judging whether the termination condition is met, if not, continuing iteration until the termination condition is met, outputting the position of the optimal alpha wolf of the wolf individual, and outputting a corresponding weight value.
The improved gray wolf algorithm improves the convergence factor a, and the convergence factor a is reduced more slowly in the initial stage of iteration, so that the time for which A can keep a larger value is long, and the global searching capability of the algorithm is enhanced; and the algorithm is reduced quickly in the later iteration stage, so that A can be reduced quickly, and the local development capability of the algorithm is enhanced. The balance of global search and local development of the algorithm is improved by improving the convergence factor a. The positions of the alpha wolves, the beta wolves and the gamma wolves are dynamically adjusted based on the proportion weights, so that the high-dimensional and complex multi-modal problems of the photovoltaic energy storage system can be met.
The system simulation module 300 inputs the output of the CNN algorithm optimized by the improved gray-wolf optimization algorithm into the BP neural network, the neurons of each layer form full interconnection connection through the weight and the threshold value, the weight and the threshold value are adjusted based on the improved gray-wolf optimization algorithm, so that the error between the output value and the expected value of the improved CNN-BP neural network is minimum, and the model correction module 400 corrects the output final result through the regression layer.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present disclosure describes embodiments, not every embodiment is provided with a separate embodiment, and that this description is provided for clarity only, and that the disclosure is not limited to the embodiments described in detail below, and that the embodiments described in the examples may be combined as appropriate to form other embodiments that will be apparent to those skilled in the art.
Claims (7)
1. The simulation method of the photovoltaic energy storage system based on the digital twin model is characterized by comprising the following steps of:
s1: collecting historical data of each energy source device of the photovoltaic energy storage system;
s2: building a numerical twin model of the photovoltaic energy storage system based on the improved CNN-BP neural network;
s3: inputting updated data of each energy device of the photovoltaic energy storage system into a numerical twin model for simulation;
s4: correcting the numerical twin model based on the simulation result;
mapping historical data entities to an improved CNN-BP neural network to build a numerical twin model; in the improved CNN-BP neural network, in a CNN algorithm, self-coding acquisition of historical data of each energy source device of the photovoltaic energy storage system is carried out based on a resampling algorithm with a self-adjusting function;
the resampling algorithm is specifically as follows:
w 0 =w 1 ·γ e +w 2 (1-γ e )
wherein w is 2 For obtaining historical data weight value, w of each energy source device of the photovoltaic energy storage system 1 Is weight balance value, w 0 As final weight, γ e E is the index number of the weight factors;
in the resampling algorithm, the final weight w of each data in the historical data 0 Introducing a time step t for updating to obtain real-time weight of each data;
the updating of the introduction time step t is specifically as follows:
calculating the gradient:
updating the first moment estimate and the second moment estimate: m is m t =β 1 m t-1 +(1-β 1 )g t ,
Calculating a bias corrected first moment estimate and second moment estimate:
updating weights:
wherein g t As a gradient of time step t, w t Is the actual weight at time t, f t As a weight gradient function at the time t, beta 1 An exponential decay rate, beta, estimated for the first moment 2 Exponential decay rate, m, for second moment estimation t Estimating the value at time t for the first moment, m t-1 Estimating the value at time t-1 for the first moment, v t Estimating the value at time t for the second moment, v t-1 Estimating the value at time t-1 for the second moment, w t+1 For the updated weight at time t +1,estimating the value at time t for the deviation corrected first moment, < >>The value at time t is estimated for the second moment after the deviation correction, and α is the learning rate.
2. The digital twin model-based photovoltaic energy storage system simulation method as claimed in claim 1, wherein: the historical data comprise illumination intensity and temperature corresponding to the photovoltaic equipment, and energy storage state and energy storage capacity corresponding to the energy storage equipment.
3. The digital twin model-based photovoltaic energy storage system simulation method as claimed in claim 2, wherein: in the S2, in the improved CNN-BP neural network, the CNN algorithm is specifically as follows:
let the loss function L of the sample at the network output layer be:
wherein m is the number of neurons of a network output layer, o j For output on the jth neuron, y j Ideal output for the objective function;
outputting the loss function L to the j-th neuron to output o j Deviation guide is calculated:
the loss function is biased to the feature layer:
wherein p is k Omega, the last feature layer kj Weights input for hidden layers;
the adjustment operator Δbias is:
wherein p is i To output corresponding layer, bias i Bias for the corresponding layer;
the calculation of the convolution kernel is essentially a process of multiplying and summing weights, and the adjustment operator Δbias' of the convolution kernel in the convolution layer is:
wherein p is i-1 Is the output of the upper layer.
4. A method for simulating a photovoltaic energy storage system based on a digital twin model as defined in claim 3, wherein: in the CNN algorithm, weight optimization is performed based on an improved gray wolf optimization algorithm.
5. The method for simulating a photovoltaic energy storage system based on a digital twin model according to claim 4, wherein the method comprises the steps of: the improved gray wolf optimization algorithm is specifically as follows:
setting the output error of the CNN network as an fitness function, setting alpha wolf as a top wolf, beta wolf as any successor under the wolf group as a second grade, listening to the top wolf, and gamma wolf as a third grade when the error is minimum, and setting the alpha wolf as an optimal candidate solution; the hunting of wolves around the hunting object under the belt of alpha wolves, beta wolves and gamma wolves is performed by the sedentary wolves searching for hunting object during predation as follows:
D=|2r 1 X p (h)-X(h)|
X(h+1)=X p (h)-AD
wherein D is the distance of the prey, X p (h) X (th) and X (h+1) are respectively the h algorithm iteration and the h+1 algorithm iteration, namely the position of the gray wolf, and h is the algorithm iteration number; r is (r) 1 Is a random vector between (0, 1), A is a coefficient vector;
A=2ar 2 -a
wherein r is 2 Is a random vector between (0, 1), a is a convergence factor, and T is the maximum iteration number;
when the position of the prey is found, the beta wolf and the gamma wolf gradually surround the prey under the lead of the alpha wolf, and for each wolf, the position update direction is calculated according to the following formula:
D α =|C 1 X α -X|
D β =|C 2 X β -X|
D γ =|C 3 X γ -X|
X 1 =X α -AD α
X 2 =X β -AD β
X 3 =X γ -AD γ
wherein D is α 、D β 、D γ The distances among alpha wolves, beta wolves, gamma wolves and other individuals are respectively; c (C) 1 、C 2 、C 3 As random variable, X α 、X β 、X γ The current positions of alpha wolf, beta wolf and gamma wolf are respectively, X is a position vector, X 1 、X 2 、X 3 Respectively compensating the forward directions of alpha wolves, beta wolves and gamma wolves;
dynamically updating the position proportion weights of alpha wolves, beta wolves and gamma wolves according to the above formula and the next position:
wherein W is 1 、W 2 、W 3 The position proportion weights of alpha wolf, beta wolf and gamma wolf are respectively, X g (h+1) is the updated position of the individual gray wolves during the h+1st algorithm iteration in the surrounding hunting process;
and updating the positions of other wolves according to the formula, judging whether the termination condition is met, if not, continuing iteration until the termination condition is met, outputting the position of the optimal alpha wolf of the wolf individual, and outputting a corresponding weight value.
6. The method for simulating a photovoltaic energy storage system based on a digital twin model according to claim 5, wherein the method comprises the steps of: in the improved CNN-BP neural network, the output of the CNN algorithm optimized by the improved gray-wolf optimization algorithm is input into the BP neural network, all layers of neurons form full interconnection connection through weights and thresholds, the weights and the thresholds are adjusted based on the improved gray-wolf optimization algorithm, so that the error between the output value and the expected value of the improved CNN-BP neural network is minimum, and the final result is output through a regression layer for correction.
7. A photovoltaic energy storage system simulation system based on a digital twin model, and a photovoltaic energy storage system simulation method based on a digital twin model as claimed in any one of claims 1-6, comprising:
data acquisition module (100): the system is used for collecting historical data of each energy device of the photovoltaic energy storage system;
model building module (200): the numerical twin model is used for building a photovoltaic energy storage system based on the improved CNN-BP neural network;
system simulation module (300): the simulation method comprises the steps of inputting updated data of each energy device of the photovoltaic energy storage system into a numerical twin model for simulation;
model correction module (400): and the numerical twin model is used for correcting the numerical twin model based on the simulation result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311226758.2A CN116992779B (en) | 2023-09-22 | 2023-09-22 | Simulation method and system of photovoltaic energy storage system based on digital twin model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311226758.2A CN116992779B (en) | 2023-09-22 | 2023-09-22 | Simulation method and system of photovoltaic energy storage system based on digital twin model |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116992779A CN116992779A (en) | 2023-11-03 |
CN116992779B true CN116992779B (en) | 2024-01-05 |
Family
ID=88525046
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311226758.2A Active CN116992779B (en) | 2023-09-22 | 2023-09-22 | Simulation method and system of photovoltaic energy storage system based on digital twin model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116992779B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117314128B (en) * | 2023-11-29 | 2024-02-02 | 河北友蓝科技有限公司 | Smart city energy management method and system based on digital twin technology |
CN117852849A (en) * | 2024-03-08 | 2024-04-09 | 华能山东发电有限公司众泰电厂 | Large-scale agricultural light complementary photovoltaic park safety management system based on digital twin technology |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20210144415A (en) * | 2020-05-22 | 2021-11-30 | 라온프렌즈 주식회사 | Method for making digital twin of solar cell |
WO2022257243A1 (en) * | 2021-06-07 | 2022-12-15 | 西安邮电大学 | Water quality early-warning method and system |
CN115587329A (en) * | 2022-09-28 | 2023-01-10 | 山东大学 | Power distribution network fault classification method and system based on convolutional neural network extraction features |
CN115689008A (en) * | 2022-10-27 | 2023-02-03 | 国网安徽省电力有限公司六安供电公司 | CNN-BilSTM short-term photovoltaic power prediction method and system based on ensemble empirical mode decomposition |
CN115693757A (en) * | 2022-09-14 | 2023-02-03 | 国网浙江省电力有限公司嘉善县供电公司 | Photovoltaic energy optimization regulation and control method based on digital twinning technology |
CN116050628A (en) * | 2023-02-07 | 2023-05-02 | 浙江大学 | Reservoir flood control optimization scheduling method considering forecast uncertainty based on digital twinning |
CN116128094A (en) * | 2022-11-18 | 2023-05-16 | 国网辽宁省电力有限公司电力科学研究院 | Industrial park energy management system and method based on digital twinning |
CN116451826A (en) * | 2023-01-20 | 2023-07-18 | 西北工业大学 | Photovoltaic power generation prediction method based on improved long-term and short-term memory neural network |
CN116506307A (en) * | 2023-06-21 | 2023-07-28 | 大有期货有限公司 | Network delay condition analysis system of full link |
CN116522795A (en) * | 2023-05-18 | 2023-08-01 | 国网山东综合能源服务有限公司 | Comprehensive energy system simulation method and system based on digital twin model |
-
2023
- 2023-09-22 CN CN202311226758.2A patent/CN116992779B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20210144415A (en) * | 2020-05-22 | 2021-11-30 | 라온프렌즈 주식회사 | Method for making digital twin of solar cell |
WO2022257243A1 (en) * | 2021-06-07 | 2022-12-15 | 西安邮电大学 | Water quality early-warning method and system |
CN115693757A (en) * | 2022-09-14 | 2023-02-03 | 国网浙江省电力有限公司嘉善县供电公司 | Photovoltaic energy optimization regulation and control method based on digital twinning technology |
CN115587329A (en) * | 2022-09-28 | 2023-01-10 | 山东大学 | Power distribution network fault classification method and system based on convolutional neural network extraction features |
CN115689008A (en) * | 2022-10-27 | 2023-02-03 | 国网安徽省电力有限公司六安供电公司 | CNN-BilSTM short-term photovoltaic power prediction method and system based on ensemble empirical mode decomposition |
CN116128094A (en) * | 2022-11-18 | 2023-05-16 | 国网辽宁省电力有限公司电力科学研究院 | Industrial park energy management system and method based on digital twinning |
CN116451826A (en) * | 2023-01-20 | 2023-07-18 | 西北工业大学 | Photovoltaic power generation prediction method based on improved long-term and short-term memory neural network |
CN116050628A (en) * | 2023-02-07 | 2023-05-02 | 浙江大学 | Reservoir flood control optimization scheduling method considering forecast uncertainty based on digital twinning |
CN116522795A (en) * | 2023-05-18 | 2023-08-01 | 国网山东综合能源服务有限公司 | Comprehensive energy system simulation method and system based on digital twin model |
CN116506307A (en) * | 2023-06-21 | 2023-07-28 | 大有期货有限公司 | Network delay condition analysis system of full link |
Non-Patent Citations (2)
Title |
---|
基于模拟退火优化BP算法的指纹地图构建方法;王存华;王伟;;国外电子测量技术(03);全文 * |
能源互联网数字孪生及其应用;沈沉;贾孟硕;陈颖;黄少伟;向月;;全球能源互联网(第01期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN116992779A (en) | 2023-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116992779B (en) | Simulation method and system of photovoltaic energy storage system based on digital twin model | |
Liang et al. | A novel wind speed prediction strategy based on Bi-LSTM, MOOFADA and transfer learning for centralized control centers | |
CN111047085B (en) | Hybrid vehicle working condition prediction method based on meta-learning | |
CN111563706A (en) | Multivariable logistics freight volume prediction method based on LSTM network | |
CN110751318B (en) | Ultra-short-term power load prediction method based on IPSO-LSTM | |
CN108596327B (en) | Seismic velocity spectrum artificial intelligence picking method based on deep learning | |
CN108764568B (en) | Data prediction model tuning method and device based on LSTM network | |
CN112130086A (en) | Method and system for predicting residual life of power battery | |
CN112861982A (en) | Long-tail target detection method based on gradient average | |
CN112686376A (en) | Node representation method based on timing diagram neural network and incremental learning method | |
CN111859264A (en) | Time sequence prediction method and device based on Bayes optimization and wavelet decomposition | |
CN114912077B (en) | Sea wave forecasting method integrating random search and mixed decomposition error correction | |
CN112215412B (en) | Dissolved oxygen prediction method and device | |
CN111355633A (en) | Mobile phone internet traffic prediction method in competition venue based on PSO-DELM algorithm | |
CN112465160A (en) | VR-based vehicle maintenance auxiliary system | |
CN111210089A (en) | Stock price prediction method of gated cyclic unit neural network based on Kalman filtering | |
WO2024113782A1 (en) | Image instance segmentation method and system, device and nonvolatile readable storage medium | |
CN114964313A (en) | RVM-based fiber optic gyroscope temperature compensation method | |
CN116432037A (en) | Online migration learning method, device, equipment and storage medium | |
CN114638358A (en) | Extinction coefficient-to-particulate matter concentration method, device and computer storage medium | |
CN112651499A (en) | Structural model pruning method based on ant colony optimization algorithm and interlayer information | |
CN117113086A (en) | Energy storage unit load prediction method, system, electronic equipment and medium | |
CN111476402A (en) | Wind power generation capacity prediction method coupling meteorological information and EMD technology | |
CN110826614A (en) | Method for constructing inverse label and loss function thereof | |
CN116304587A (en) | Rolling bearing degradation trend prediction method based on CAE and AGRU |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |