A method and system for predicting power generation based on a digital twin model of a photovoltaic power station
By building a digital twin model of the photovoltaic power station, combining GAN and an improved LSTM algorithm, we generate photovoltaic power station operation data that matches the actual distribution, solving the problem of insufficient accuracy in photovoltaic power station power generation forecasts, achieving more accurate power generation forecasts, and improving the stability and dispatching capabilities of the power system.
Patent Information
- Application Number
- CN202510703214.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-05-29
AI Technical Summary
The existing photovoltaic power station power generation prediction model lacks sufficient processing capabilities for real-time data streams, making it difficult to effectively meet the power generation prediction needs of photovoltaic power stations. This leads to increased spatiotemporal inconsistencies in the power system's supply and demand matching, affecting the stability of the power grid.
A digital twin model of the photovoltaic power station is constructed, and the generative adversarial network (GAN) is combined to generate photovoltaic power station operation data consistent with the actual distribution. The diffusion model is introduced to correct the output of the physical model, and the improved LSTM algorithm is used to build a data-driven model to integrate the prediction results of the physical model and the data-driven model.
The accuracy of photovoltaic power generation prediction has been improved, the model's performance prediction capabilities under various environmental conditions and its adaptability to fluctuations on different time scales have been enhanced, the model's generalization and robustness have been improved, and reliable decision-making support has been provided for power system scheduling.
Smart Images

Figure CN120237637B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of renewable energy, and specifically relates to a method and system for predicting power generation based on a digital twin model of a photovoltaic power station. Background Art
[0002] As a vital component of clean energy, photovoltaic power stations have seen rapid development in both construction and application. However, the intermittent and volatile nature of photovoltaic power generation, combined with the random nature of massive power output, has exacerbated the spatiotemporal inconsistencies in matching supply and demand across the power system, leading to a series of grid stability issues such as voltage overshoot and frequency fluctuations. This, in particular, significantly impacts the efficiency and reliability of photovoltaic power stations under complex weather conditions, further increasing the complexity and management difficulty of power system operation. Existing photovoltaic power generation forecasting models often rely on static or semi-dynamic data analysis and lack the ability to adequately process real-time data streams, making it difficult to effectively address and adapt to the power generation forecasting needs of photovoltaic power stations. Summary of the Invention
[0003] The purpose of the present invention is to address the above-mentioned problems existing in the prior art and to provide a method and system for predicting power generation based on a digital twin model of a photovoltaic power station.
[0004] To achieve the above objectives, the technical solutions of the present invention are as follows:
[0005] In a first aspect, the present invention proposes a method for predicting power generation based on a digital twin model of a photovoltaic power station, comprising:
[0006] S1. Generate PV power plant operating data consistent with actual distribution based on the operating parameters of various core components of the PV power plant, and build a digital twin model that simulates the actual operating conditions of the PV power plant. The digital twin model includes a physical model and a data-driven model.
[0007] S2. Input the generated PV power plant operation data that matches the actual distribution into the PV power plant physical model and the PV power plant data-driven model constructed using the improved LSTM algorithm, respectively, to obtain power generation prediction values for the physical model and the data-driven model;
[0008] S3. Integrate the power generation prediction values of the photovoltaic power station physical model and the data-driven model to obtain the final photovoltaic power generation prediction result.
[0009] In S2, the specific steps of using the improved LSTM algorithm to build a photovoltaic power station data-driven model include:
[0010] A. Pre-process the photovoltaic power station operation data to obtain positive and negative sample pairs that adjust the data feature distribution;
[0011] B. Input the positive and negative sample pairs into the LSTM model, initialize the LSTM model architecture, and calculate the power generation forecast using the following formula:
[0012] ;
[0013] ;
[0014] In the above formula, is the power generation prediction value of the data-driven model, For the The power generation prediction value of hidden units, is the weight matrix of the fully connected layer, is the hidden state, which serves as the input of the fully connected layer. is the bias term of the fully connected layer;
[0015] C. Construct a comprehensive loss function to jointly optimize the future power generation forecast:
[0016] ;
[0017] ;
[0018] ;
[0019] ;
[0020] In the above formula, is the comprehensive loss function, is the mean square error function, is the mean absolute error function, is the contrast loss function, 、 、 is the weight of each function, is the total number of samples for predicting power generation, is the actual power generation value, is a predefined boundary value, is the distance between positive sample pairs, The distance between negative sample pairs.
[0021] The step A comprises:
[0022] A1. Construct features for the photovoltaic power station operation data and use the following formula to convert hours into periodic features of the data:
[0023] ;
[0024] ;
[0025] In the above formula, is a sinusoidal periodic characteristic, is the time step, is the cosine periodic characteristic;
[0026] A2. Decompose and denoise the periodic characteristics of the data and extract the IMF components of the data, including:
[0027] A21. Find the original data signal All local maximum and minimum points of , where is the time index, and the time index set of the maximum point is , the time index set of the minimum point is , and construct the upper envelope through the local maximum points , the local minimum point constructs the lower envelope ;
[0028] A22. Based on the envelope of the local maximum and minimum points, the residual signal is calculated using the following formula:
[0029] ;
[0030] ;
[0031] In the above formula, is the residual signal, is the instantaneous mean;
[0032] A23. Determine whether the residual signal meets the two conditions of the IMF component, that is, in any time period, the number of maximum and minimum points is equal or the difference does not exceed one, and the average value of the upper and lower envelopes is zero. If so, the residual signal is an IMF component, denoted as , and remove the IMF component from the original signal. If not satisfied, return to step B1 and find the remaining signal All local maximum and minimum points of , decompose the residual signal until the residual signal becomes a monotonic function or meets the two conditions of the IMF component, and finally express the original signal of the data as:
[0033] ;
[0034] In the above formula, is the total number of IMF components, is the residual term;
[0035] A3. Based on the IMF components of the data, a multi-scale feature matrix is formed, including:
[0036] A31. Analyze the energy distribution of various IMF components and select the effective characteristic components using the following formula:
[0037] ;
[0038] In the above formula, is the effective characteristic component, that is, the variance contribution rate, is the standard deviation;
[0039] A32. Reassemble the effective feature components after energy analysis into a new input sequence, ensuring that each time step contains all selected IMF components, forming the following multi-scale feature matrix:
[0040] ;
[0041] In the above formula, is a multi-scale feature matrix composed of selected effective feature components, To include time steps The matrix of all selected IMF components;
[0042] A33. Use the following formula to perform feature dimensionality reduction on the multi-scale feature matrix:
[0043] ;
[0044] In the above formula, is the multi-scale feature matrix after feature dimensionality reduction;
[0045] A4. After feature dimensionality reduction, construct the data within the same time period in the multi-scale feature matrix as positive sample pairs, and the data in different time periods as negative sample pairs. Build an optimal transmission problem model and adjust the distribution of the data features of the positive and negative sample pairs:
[0046] ;
[0047] ;
[0048] ;
[0049] ;
[0050] In the above formula, is the optimal transmission problem model, is the transmission cost matrix, is the transmission plan matrix, is a positive sample pair, is a negative sample pair, For the Source distribution samples Hedi target distribution samples The Euclidean distance between is the source distribution, is the target distribution, is the transpose of the transmission plan matrix.
[0051] In S2, the photovoltaic power station physical model includes:
[0052] ;
[0053] ;
[0054] ;
[0055] ;
[0056] ;
[0057] ;
[0058] ;
[0059] ;
[0060] ;
[0061] ;
[0062] ;
[0063] ;
[0064] ;
[0065] ;
[0066] ;
[0067] ;
[0068] In the above formula, is the predicted value of power generation of the physical model, is the corrected load current, is the corrected load voltage, is the corrected photocurrent, is the corrected dark current, is the load voltage, is the output current, is the series resistance, is the corrected parallel resistance, is the load resistance, is the photogenerated current, 、 、 、 、 、 、 These are the nonlinear effects of environmental conditions on photovoltaic module power generation. is the short-circuit current under standard test conditions, is the light intensity, is the temperature coefficient, is the actual temperature, is the temperature under standard test conditions, 、 、 They are the correction values of photocurrent, dark current and parallel resistance respectively, and are the mean functions generated by the diffusion model. 、 、 、 、 are correction coefficients, is the critical value of temperature, is the component running time, is the component life, is the maximum light intensity, is the actual humidity level, is the maximum humidity level, is the nonlinear index describing temperature, is the critical humidity value, is the average wind speed, is the variance of wind speed, is the dark current, is the reverse saturation current, is the electron charge, is the ideal factor, is the number of units connected in series, is the Boltzmann constant, is the parallel resistance, is the parallel resistance under standard test conditions, is the load current correction factor, is the maximum output current, is the nonlinear index describing the load current.
[0069] The specific steps of generating the mean function generated by the diffusion model include:
[0070] a. Forward diffusion process, the following formula is used to obtain the real sample data First, gradually add Gaussian noise to the data to make the data distribution completely random:
[0071] ;
[0072] In the above formula, is the conditional probability distribution from the previous time step to the current time step in the forward diffusion process, is the sample data of the current time step, is a normal distribution, is the diffusion intensity, is the identity matrix;
[0073] b. Reverse generation process, starting from Gaussian noise, generate the mean function by step-by-step denoising using the following formula:
[0074] ;
[0075] In the above formula, is the conditional probability distribution from the current time step to the previous time step in the reverse generation process, is a conditional variable, representing external control information related to the generation process, is the mean function, which represents the correction value at the current time step. is the variance.
[0076] The S3 includes:
[0077] The following formula is used to fuse the power generation prediction values of the PV power station physical model and the data-driven model to obtain the final PV power generation prediction result:
[0078] ;
[0079] ;
[0080] ;
[0081] In the above formula, is the final photovoltaic power station power generation prediction result, is the physical model prediction error, is the prediction error of the data-driven model, is the power generation prediction value of the data-driven model, is the predicted value of power generation of the physical model, is the average power of the actual value of the physical model, is the average power of the physical model prediction value, The actual value of the data-driven model is the average power, The predicted value for the data-driven model is the average power.
[0082] In S1, the specific steps of generating photovoltaic power station operation data consistent with the actual distribution based on the operating parameters of various core components of the photovoltaic power station include:
[0083] S11. Preprocess the operating parameters of various core components of the photovoltaic power station, design the GAN model architecture, and initialize the GAN grid parameters;
[0084] S12. Design the loss function of the GAN model discriminator and generator;
[0085] The loss function of the discriminator is calculated using the following formula:
[0086] ;
[0087] In the above formula, is the loss function of the discriminator, is the output of the discriminator for the conditional features in the real sample, For the generator from noise The generated sample data, is the gradient penalty coefficient, is the gradient of the discriminator to the interpolation point, For the real samples collected, is the conditional feature in the real sample, is a random noise vector, To generate samples, is the interpolation point between the real sample and the generated sample;
[0088] The loss function of the generator is calculated using the following formula:
[0089] ;
[0090] ;
[0091] In the above formula, is the loss function of the generator, is the weight coefficient of the regularization term, is the regularization term, is the number of feature dimensions, For the The mean of the generated sample data, For the The mean of the real sample data, For the The standard deviation of the real sample data, For the Generate sample data, For the Real sample data;
[0092] S13. Calculate the gradient of the GAN model discriminator loss function with respect to the discriminator parameters, and the gradient of the generator loss function with respect to the generator parameters:
[0093] ;
[0094] ;
[0095] In the above formula, is the gradient of the discriminator loss function with respect to the discriminator parameters, Indicates the calculation of the gradient of the discriminator parameters, is the gradient of the generator loss function with respect to the generator parameters, Indicates the calculation of gradients for generator parameters;
[0096] S14. Based on the gradient parameters of the discriminator and generator parameters, the improved Adam algorithm is used to update the discriminator parameters and generator parameters of the GAN model;
[0097] For the discriminator parameters, the following formula is used to update:
[0098] ;
[0099] ;
[0100] ;
[0101] ;
[0102] ;
[0103] In the above formula, are the updated discriminator parameters, is the learning rate, is the momentum term after the discriminator correction, is the second-order moment estimate after correction by the discriminator, is the bias correction term, is the discriminator momentum term, 、 are all hyperparameters, is the second-order moment estimate of the discriminator;
[0104] For the generator parameters, the following formula is used to update:
[0105] ;
[0106] ;
[0107] ;
[0108] ;
[0109] ;
[0110] In the above formula, are the updated generator parameters, is the modified momentum term of the generator, is the modified second-order moment estimate of the generator, is the generator momentum term, is the generator second-order moment estimate;
[0111] S15. Repeat steps S12-S14 until the GAN model converges or reaches the maximum number of iterations. The algorithm ends and generates photovoltaic power station operation data that matches the actual distribution.
[0112] In S14, the method for improving the Adam algorithm is to optimize the Adam optimizer hyperparameters using the PSO algorithm. The specific steps of the improvement include:
[0113] S141. Initialize Adam optimizer hyperparameters, including learning rate , first-order moment estimation decay rate , second-order moment estimation decay rate And the gradient correction parameter ;
[0114] S142, define the Adam optimizer hyperparameter search space, using the position vector of each particle represents a set of hyperparameter values, where For the The position vector of each particle;
[0115] S143, the total number of initialized particle swarm is , the initial position and velocity of each particle are randomly generated within their respective ranges, expressed as:
[0116] ;
[0117] ;
[0118] In the above formula, For the The initial position of a particle, To randomly select values uniformly distributed from the search space, is the minimum value in the search space, is the minimum value in the search space, For the The initial velocity of each particle;
[0119] S144. Use the hyperparameter settings corresponding to each particle to train the PSO optimization model, and use the following formula to calculate the objective function of each particle as the fitness of the particle :
[0120] ;
[0121] ;
[0122] ;
[0123] ;
[0124] In the above formula, For the The objective function of a particle is is the statistical feature matching loss, is the loss during GAN model training, is the physical consistency loss, is the number of feature dimensions, For the The mean of the generated sample data, For the The mean of the real sample data, For the The standard deviation of the real sample data, For the Generate sample data, For the Real sample data, For the The variance of the generated sample data, For the The variance of the real sample data, is the loss function of the discriminator, is the loss function of the generator, is the predicted value of the photocurrent, is the measured photogenerated current, is the standard deviation of the measured photogenerated current;
[0125] S145, determine whether the fitness of each particle meets ,in, is the best position fitness value of each particle. If it is satisfied, update , and record the corresponding ,in, is the best position of each particle. If it is not satisfied, the fitness value of the best position of the particle and its position remain unchanged. After finding the best position fitness value among all particles, the global best particle fitness value is updated. , and record the corresponding position ;
[0126] S146. Based on the particle's optimal position fitness value and its position, the following formula is used to update the speed and position of each particle:
[0127] ;
[0128] ;
[0129] ;
[0130] ;
[0131] In the above formula, for Iteration No. The speed of the particle, is the inertia weight, 、 are acceleration constants, 、 Both Independent and identically distributed random numbers in the interval, for Iteration No. The position of the particle, is the maximum number of iterations, is the initial inertia weight, is the final inertia weight;
[0132] S147. Set the number of times there is no significant improvement in consecutive iterations to , judge the continuous iteration Whether the number of times the condition is established reaches the set threshold or the maximum number of iterations, where is a small positive number used to determine whether there is significant improvement in the iteration. If so, the algorithm terminates and the optimization process ends. If not, it returns to step S144 to recalculate the objective function of each particle.
[0133] In the second aspect, the present invention proposes a power generation prediction system based on a digital twin model of a photovoltaic power station, comprising a photovoltaic power station operation data generation module, a power generation prediction module, and a final power generation prediction result fusion module;
[0134] The photovoltaic power station operation data generation module is used to generate photovoltaic power station operation data consistent with the actual distribution based on the operating parameters of various core components of the photovoltaic power station, and to build a digital twin model that simulates the actual operation status of the photovoltaic power station. The digital twin model includes a physical model and a data-driven model;
[0135] The power generation prediction module is used to input the generated photovoltaic power station operation data that is consistent with the actual distribution into the photovoltaic power station physical model and the photovoltaic power station data-driven model constructed using the improved LSTM algorithm, respectively, to obtain the power generation prediction values of the physical model and the data-driven model;
[0136] The final power generation prediction result fusion module is used to fuse the power generation prediction values of the photovoltaic power station physical model and the data-driven model to obtain the final photovoltaic power generation prediction result.
[0137] In a third aspect, the present invention proposes a power generation prediction device based on a digital twin model of a photovoltaic power station, comprising a processor and a memory;
[0138] The memory is used to store computer program code and transmit the computer program code to the processor;
[0139] The processor is used to execute the aforementioned power generation prediction method based on the digital twin model of a photovoltaic power station according to the instructions in the computer program code.
[0140] Compared with the prior art, the present invention has the following beneficial effects:
[0141] This invention proposes a method and system for predicting power generation based on a digital twin model of a photovoltaic power station. The method first generates photovoltaic power station operating data consistent with the actual distribution based on the operating parameters of various core components of the photovoltaic power station, and constructs a digital twin model that simulates the actual operating conditions of the photovoltaic power station. The digital twin model includes a physical model and a data-driven model. The generated photovoltaic power station operating data consistent with the actual distribution is then input into the photovoltaic power station physical model and the photovoltaic power station data-driven model constructed using an improved LSTM algorithm, respectively, to obtain power generation prediction values from the physical model and the data-driven model. Finally, the power generation prediction values from the photovoltaic power station physical model and the data-driven model are integrated to obtain the final photovoltaic power generation prediction result. On the one hand, by constructing a digital twin model of the photovoltaic power station and integrating real-time data from a sensor network, the method more accurately maps and simulates the actual operating conditions of the photovoltaic power station, significantly improving the accuracy of photovoltaic power generation prediction and addressing the problems of data complexity, environmental uncertainty, and insufficient prediction accuracy encountered in current photovoltaic power station operations. On the other hand, this method inputs the generated photovoltaic power station operation data into the photovoltaic power station physical model, improving the model's performance prediction ability under various environmental conditions, and uses an improved LSTM algorithm to construct a data-driven model of the photovoltaic power station, enhancing the model's adaptability to fluctuations at different time scales, and improving the model's generalization ability and robustness. By integrating the prediction results of the physical model and the data-driven model, a more accurate photovoltaic power generation forecast is obtained, providing reliable decision support for power system scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0142] Figure 1 The figure is an overall flow chart of the method of the present invention.
[0143] Figure 2 This is the overall architecture diagram of the model described in Example 1.
[0144] Figure 3 This is the equivalent circuit diagram of the photovoltaic cell described in Example 1.
[0145] Figure 4 This is a structural diagram of the system described in Example 2.
[0146] Figure 5 This is a structural diagram of the equipment described in Example 3. DETAILED DESCRIPTION
[0147] The present invention will be further described in detail below with reference to specific embodiments and the accompanying drawings.
[0148] The present invention proposes a power generation prediction method and system based on a digital twin model of a photovoltaic power station. The method generates photovoltaic power station operation data that is consistent with the actual distribution based on a generative adversarial network (GAN) combined with an improved Adam algorithm to solve the problems of data missing and anomalies. The diffusion model is introduced to correct the output of the physical model to improve the performance prediction capability under various environmental conditions. At the same time, an improved LSTM algorithm is used to construct a data-driven model for the photovoltaic power station to improve prediction accuracy and build a comprehensive data view. Combining the prediction results of the physical model and the data-driven model, a fusion algorithm is used to achieve a more accurate prediction of the power generation of the photovoltaic power station, providing decision support for the efficient utilization and regulation of distributed resources.
[0149] Example 1:
[0150] like Figure 1 As shown in the figure, a power generation prediction method based on the digital twin model of a photovoltaic power station is carried out in the following steps:
[0151] 1. Design the overall architecture of the digital twin model of the photovoltaic power station, such as Figure 2 As shown, it integrates multi-source real-time data from sensor networks to accurately map and simulate the operating conditions of real-world photovoltaic power plants;
[0152] The design of the digital twin model architecture for photovoltaic power plants is the foundation of the entire system. By accurately simulating the actual operating conditions of photovoltaic power plants in a virtual environment, it supports the efficient operation of photovoltaic power plants, meets the stability requirements of power systems in complex environments, and provides a scientific basis and technical support for peak regulation, frequency regulation, and voltage regulation in power systems.
[0153] The architecture is mainly composed of the following key modules:
[0154] The data acquisition module, as a core component, covers multiple subsystems, including photovoltaic panels, environmental sensing devices, electrical equipment, and transmission networks. It is responsible for collecting various operating parameters of the photovoltaic power station in real time using a unified data acquisition standard. Different types of operating parameter data have different change frequencies and real-time requirements. The data acquisition frequency needs to be intelligently adjusted according to the data type and real-time requirements to ensure that real-time data such as power output, voltage, and current are collected once per second, environmental data such as temperature and humidity are collected once a minute, and event data such as fault alarms and equipment switch status are collected immediately when they occur.
[0155] The data processing and analysis module preprocesses, standardizes, and detects outliers on the collected data to ensure the quality of the modeling data;
[0156] The physical model module modifies the model based on the characteristics of photovoltaic power generation and taking into account the complex reality of photovoltaic power stations;
[0157] The data-driven prediction module considers power fluctuations at different time scales, enabling the model to better adapt to complex and changing photovoltaic power generation scenarios;
[0158] The fusion prediction module combines the advantages of the physical model module and the data-driven prediction module to provide more accurate PV power generation prediction results;
[0159] The user interaction and feedback module realizes the human-computer interaction interface, displays real-time monitoring information, fault alarms, power generation efficiency analysis and other functions, and adjusts the actual power station operation according to the model output to form a closed-loop optimization process.
[0160] 2. Generate PV power station operation data that matches the actual distribution based on the operating parameters of various core components of the PV power station;
[0161] The generative adversarial network (GAN) combined with the improved Adam algorithm generates PV power plant operating data that is more consistent with the actual distribution. This improves the quality and stability of model training, provides strong decision support for participating in power balancing auxiliary services such as peak load regulation and frequency regulation, and solves data missing and anomaly issues.
[0162] Preprocess the operating parameters of various core components of the photovoltaic power station, including environmental characteristic data such as light intensity, humidity, heat, and photovoltaic module surface temperature; equipment characteristic data such as output power, voltage, current, and health index; and historical data such as past power generation and fault records. The following formula is used to standardize all operating parameter data:
[0163] ;
[0164] In the above formula, is the standardized operating parameter data, is the mean value of the operating parameter data, is the standard deviation of the operating parameter data;
[0165] Design GAN model architecture, initialize GAN grid parameters, generator The input layer is a random noise vector and conditional features ,in, 、 All are dimensions, conditional features It contains environmental features and equipment features. The hidden layer is a multi-layer perceptron. The output layer is the generated photovoltaic power station operation data that matches the actual distribution. The discriminator The input layer is real or generated data samples and conditional features , the hidden layer is a multi-layer perceptron, and the output layer is a scalar value , represents the probability that the sample is true;
[0166] Design the loss function of the GAN model discriminator and generator;
[0167] The loss function of the discriminator is calculated using the following formula:
[0168] ;
[0169] In the above formula, is the loss function of the discriminator, is the output of the discriminator for the conditional features in the real sample, For the generator from noise The generated sample data, is the gradient penalty coefficient, is the gradient of the discriminator to the interpolation point, For the real samples collected, is the conditional feature in the real sample, is a random noise vector, To generate samples, is the interpolation point between the real sample and the generated sample;
[0170] The loss function of the generator is calculated by maximizing the output of the discriminator using the following formula:
[0171] ;
[0172] ;
[0173] In the above formula, is the loss function of the generator, is the weight coefficient of the regularization term, is the regularization term, is the number of feature dimensions, For the The mean of the generated sample data, For the The mean of the real sample data, For the The standard deviation of the real sample data, For the Generate sample data, For the Real sample data;
[0174] Calculate the gradient of the GAN model discriminator loss function with respect to the discriminator parameters, and the gradient of the generator loss function with respect to the generator parameters respectively:
[0175] ;
[0176] ;
[0177] In the above formula, is the gradient of the discriminator loss function with respect to the discriminator parameters, Indicates the calculation of the gradient of the discriminator parameters, is the gradient of the generator loss function with respect to the generator parameters, Indicates the calculation of gradients for generator parameters;
[0178] Based on the gradient parameters of the discriminator and generator parameters, the improved Adam algorithm is used to update the discriminator parameters and generator parameters of the GAN model;
[0179] For the discriminator parameters, the following formula is used to update:
[0180] ;
[0181] ;
[0182] ;
[0183] ;
[0184] ;
[0185] In the above formula, are the updated discriminator parameters, is the learning rate, is the momentum term after the discriminator correction, is the second-order moment estimate after correction by the discriminator, is the bias correction term, is the discriminator momentum term, 、 are all hyperparameters, is the second-order moment estimate of the discriminator;
[0186] For the generator parameters, the following formula is used to update:
[0187] ;
[0188] ;
[0189] ;
[0190] ;
[0191] ;
[0192] In the above formula, are the updated generator parameters, is the modified momentum term of the generator, is the generator’s revised second-order moment estimate, is the generator momentum term, is the generator second-order moment estimate;
[0193] Repeat the steps of updating the GAN model discriminator and generator parameters until the GAN model converges or reaches the maximum number of iterations, the algorithm ends, and the PV power plant operation data consistent with the actual distribution is generated;
[0194] Among them, in order to avoid local optimality, enhance global search capabilities, and adaptively adjust parameters, the method of improving the Adam algorithm adopts the PSO algorithm to optimize the Adam optimizer hyperparameters. The specific steps of the improvement include:
[0195] Initialize Adam optimizer hyperparameters, including learning rate Set to 0.001, first-order moment estimation decay rate Set to 0.9, the second-order moment estimation decay rate Set to 0.999 and the gradient correction parameter Set to ;
[0196] Define the Adam optimizer hyperparameter search space, where the learning rate for , first-order moment estimation decay rate for , second-order moment estimation decay rate for , gradient correction parameter for , using the position vector of each particle represents a set of hyperparameter values, where For the The position vector of each particle;
[0197] The total number of initialized particle swarm is , the initial position and velocity of each particle are randomly generated within their respective ranges, expressed as:
[0198] ;
[0199] ;
[0200] In the above formula, For the The initial position of a particle, To randomly select values uniformly distributed from the search space, is the minimum value in the search space, is the minimum value in the search space, For the The initial velocity of each particle;
[0201] Use the hyperparameter settings corresponding to each particle to train the PSO optimization model, and use the following formula to calculate the objective function of each particle as the fitness of the particle :
[0202] ;
[0203] ;
[0204] ;
[0205] ;
[0206] In the above formula, For the The objective function of a particle is is the statistical feature matching loss, is the loss during GAN model training, is the physical consistency loss, is the number of feature dimensions, For the The mean of the generated sample data, For the The mean of the real sample data, For the The standard deviation of the real sample data, For the Generate sample data, For the Real sample data, For the The variance of the generated sample data, For the The variance of the real sample data, is the loss function of the discriminator, is the loss function of the generator, is the predicted value of the photocurrent, is the measured photogenerated current, is the standard deviation of the measured photogenerated current;
[0207] Determine whether the fitness of each particle satisfies ,in, is the best position fitness value of each particle. If it is satisfied, update , and record the corresponding ,in, is the best position of each particle. If it is not satisfied, the fitness value of the best position of the particle and its position remain unchanged. After finding the best position fitness value among all particles, the global best particle fitness value is updated. , and record the corresponding position ;
[0208] Based on the particle's optimal position fitness value and its position, the following formula is used to update the speed and position of each particle:
[0209] ;
[0210] ;
[0211] ;
[0212] ;
[0213] In the above formula, for Iteration No. The speed of the particle, is the inertia weight, 、 are acceleration constants, 、 Both Independent and identically distributed random numbers in the interval, for Iteration No. The position of the particle, is the maximum number of iterations, is the initial inertia weight, is the final inertia weight;
[0214] Set the threshold for the number of consecutive iterations without significant improvement to , judge the continuous iteration Whether the number of times the condition is established reaches the set threshold or the maximum number of iterations, where It is a small positive number used to judge whether there is significant improvement in the iteration. If it is achieved, the algorithm is terminated and the optimization process ends; if it is not achieved, the objective function of each particle is recalculated.
[0215] 3. The generated PV power plant operating data that matches the actual distribution is input into the PV power plant physical model and the PV power plant data-driven model constructed using the improved LSTM algorithm, respectively, to obtain the power generation prediction values of the physical model and the data-driven model;
[0216] In the physical model of photovoltaic power station, based on the characteristics of photovoltaic power generation, the diffusion model is introduced to correct the output of the photovoltaic cell model to make it closer to the actual measurement value. The equivalent circuit of the photovoltaic cell is as follows: Figure 3 Shown, including:
[0217] ;
[0218] ;
[0219] ;
[0220] ;
[0221] ;
[0222] ;
[0223] ;
[0224] ;
[0225] ;
[0226] ;
[0227] ;
[0228] ;
[0229] ;
[0230] ;
[0231] ;
[0232] ;
[0233] In the above formula, is the predicted value of power generation of the physical model, is the corrected load current, is the corrected load voltage, is the corrected photocurrent, is the corrected dark current, is the load voltage, is the output current, is the series resistance, is the corrected parallel resistance, is the load resistance, is the photogenerated current, 、 、 、 、 、 、 These are the nonlinear effects of environmental conditions (such as humidity and wind speed) on photovoltaic module power generation. is the short-circuit current under standard test conditions, is the light intensity, is the temperature coefficient, is the actual temperature, is the temperature under standard test conditions, 、 、 They are the correction values of photocurrent, dark current and parallel resistance respectively, and are the mean functions generated by the diffusion model. 、 、 、 、 are correction coefficients, is the critical temperature, above which the material degrades significantly. For component operation time, the influence of component aging is introduced. is the component life, reflecting the impact of running time on performance, is the maximum light intensity, is the actual humidity level, is the maximum humidity level, It is a nonlinear exponent describing temperature, usually taking a value of 2-3. is the critical humidity value, is the average wind speed, is the variance of wind speed, is the dark current, is the reverse saturation current, is the electron charge, is the ideal factor, is the number of units connected in series, is the Boltzmann constant, is the parallel resistance, is the parallel resistance under standard test conditions, is the load current correction factor, is the maximum output current, is the nonlinear index describing the load current;
[0234] The specific steps of generating the mean function generated by the diffusion model include:
[0235] a. Input environment and component parameters and historical data. The forward diffusion process uses the following formula to obtain the real sample data. First, gradually add Gaussian noise to the data to make the data distribution completely random:
[0236] ;
[0237] In the above formula, is the conditional probability distribution from the previous time step to the current time step in the forward diffusion process, is the sample data of the current time step, is a normal distribution, is the diffusion intensity, which controls the size of the noise added at each step. is the unit matrix, indicating the independence of data dimensions;
[0238] b. Reverse generation process, starting from Gaussian noise, generate the mean function by step-by-step denoising using the following formula:
[0239] ;
[0240] In the above formula, is the conditional probability distribution from the current time step to the previous time step in the reverse generation process, is a conditional variable, representing external control information related to the generation process, is the mean function, which represents the correction value at the current time step. is the variance, which indicates the uncertainty of generation and is used to control the stability of the generated results;
[0241] Taking into account fluctuations on different time scales, in order to make the model better adapt to complex and changing photovoltaic power generation scenarios and enhance the model's generalization and robustness, an improved LSTM algorithm is used to build a photovoltaic power station data-driven model. The specific steps include:
[0242] A. Pre-process the photovoltaic power station operation data to obtain positive and negative sample pairs that adjust the data feature distribution;
[0243] A1. Input real collected data and GAN-generated data, including environmental characteristic data (light intensity, humidity, heat, PV module surface temperature, etc.), equipment characteristic data (output power, voltage, current, health index, etc.), and historical data (past power generation, fault records, etc.). Feature construction is performed on the PV power station operation data. The following formula is used to convert hourly data into periodic features:
[0244] ;
[0245] ;
[0246] In the above formula, is a sinusoidal periodic characteristic, is the time step, is the cosine periodic characteristic;
[0247] A2. Perform ITD decomposition and denoising on the periodic characteristics of the data, such as light intensity, humidity, heat, wind speed, and past power generation data, to extract the IMF components of the data, including:
[0248] A21. Find the original data signal All local maximum and minimum points of , where is the time index, and the time index set of the maximum point is , the time index set of the minimum point is , and construct the upper envelope through the local maximum points , the local minimum point constructs the lower envelope ;
[0249] A22. Based on the envelope of the local maximum and minimum points, the residual signal is calculated using the following formula:
[0250] ;
[0251] ;
[0252] In the above formula, is the residual signal, is the instantaneous mean;
[0253] A23. Determine whether the residual signal meets the two conditions of the IMF component, that is, in any time period, the number of maximum and minimum points is equal or the difference does not exceed one, and the average value of the upper and lower envelopes is zero. If so, the residual signal is an IMF component, denoted as , and remove the IMF component from the original signal. If not satisfied, return to step B1 and find the remaining signal All local maximum and minimum points of , decompose the residual signal until the residual signal becomes a monotonic function or meets the two conditions of the IMF component, and finally express the original signal of the data as:
[0254] ;
[0255] In the above formula, is the total number of IMF components, is the residual term;
[0256] A3. Based on the IMF components of the data, a multi-scale feature matrix is formed, including:
[0257] A31. Analyze the energy distribution of various IMF components and use the following formula to select the effective characteristic components and remove the high-frequency noise distribution:
[0258] ;
[0259] In the above formula, For the effective feature component, that is, the variance contribution rate, the IMF component with an energy ratio exceeding 0.8 is selected as the effective feature. is the standard deviation;
[0260] A32. Reassemble the effective feature components after energy analysis into a new input sequence, ensuring that each time step contains all selected IMF components, forming the following multi-scale feature matrix:
[0261] ;
[0262] In the above formula, is a multi-scale feature matrix composed of selected effective feature components, To include time steps The matrix of all selected IMF components;
[0263] A33. Use the following formula to perform feature dimensionality reduction on the multi-scale feature matrix:
[0264] ;
[0265] In the above formula, is the multi-scale feature matrix after feature dimensionality reduction;
[0266] A4. After feature dimensionality reduction, the data within the same time period in the multi-scale feature matrix is constructed as positive sample pairs, and the data from different time periods is constructed as negative sample pairs. An optimal transmission problem model is constructed to adjust the distribution of the data features of the positive and negative sample pairs. The goal is to minimize the difference between the different distributions and make the source distribution and target distribution as close as possible:
[0267] ;
[0268] ;
[0269] ;
[0270] ;
[0271] In the above formula, is the optimal transmission problem model, is the transmission cost matrix, is the transmission plan matrix, is a positive sample pair, is a negative sample pair, For the Source distribution samples Hedi target distribution samples The Euclidean distance between is the source distribution, is the target distribution, is the transpose of the transmission plan matrix;
[0272] B. Input the positive and negative sample data into the LSTM model and initialize the LSTM model architecture. The input shape of the input layer is ,in, is the batch size, which indicates the number of samples used to calculate model gradients and update model parameters in one training iteration. is the time step, representing the feature sequence of the past 24 hours, is the number of features, including environmental features and historical power generation data after ITD processing. The hidden layer includes a bidirectional LSTM layer and a Dropout layer. The number of hidden units in the first layer of the bidirectional LSTM layer is , the output sequence shape is , the number of hidden units in the second layer , the output sequence shape is The Dropout layer is used to prevent overfitting, and the ratio is set to 0.2. The output layer uses a fully connected layer to map the hidden state to the predicted power generation value for the next day, which is calculated using the following formula:
[0273] ;
[0274] ;
[0275] In the above formula, is the power generation prediction value of the data-driven model, For the The power generation prediction value of hidden units, is the weight matrix of the fully connected layer, is the hidden state, which serves as the input of the fully connected layer. is the bias term of the fully connected layer;
[0276] C. Construct a comprehensive loss function. Use the COOT algorithm to construct the loss function. Comparing the loss function shortens the distance between positive sample pairs and increases the distance between negative sample pairs, thus jointly optimizing the future power generation forecast value.
[0277] ;
[0278] ;
[0279] ;
[0280] ;
[0281] In the above formula, is the comprehensive loss function, is the mean square error function, is the mean absolute error function, is the contrast loss function, 、 、 is the weight of each function, is the total number of samples for predicting power generation, is the actual power generation value, is a predefined boundary value that controls the minimum distance between positive sample pairs. is the distance between positive sample pairs, The distance between negative sample pairs;
[0282] D. Divide the dataset into 70% training set, 20% validation set and 10% test set, and set hyperparameters , , the model is trained with a learning rate of 0.001, and the model is evaluated based on the root mean square error (RMSE) and mean absolute percentage error (MAPE) of the validation set. The learning rate is dynamically adjusted using cosine annealing based on the evaluation results. Training is stopped when there is no improvement in the validation loss for 10 consecutive rounds;
[0283] The root mean square error (RMSE) is:
[0284] ;
[0285] The mean absolute percentage error (MAPE) is:
[0286] ;
[0287] The cosine annealing dynamically adjusts the learning rate to:
[0288] ;
[0289] In the above formula, is the total number of samples in the validation set data, is the learning rate of the current iteration, 、 is the minimum and maximum value of the learning rate, is the current iteration number, is the total number of iterations.
[0290] 4. Integrate the power generation prediction values of the photovoltaic power station physical model and the data-driven model to obtain the final photovoltaic power generation prediction result;
[0291] The following formula is used to fuse the power generation prediction values of the PV power station physical model and the data-driven model to obtain the final PV power generation prediction result:
[0292] ;
[0293] ;
[0294] ;
[0295] In the above formula, is the final photovoltaic power station power generation prediction result, is the physical model prediction error, is the prediction error of the data-driven model, is the power generation prediction value of the data-driven model, is the predicted value of power generation of the physical model, is the average power of the actual value of the physical model, is the average power of the physical model prediction value, The actual value of the data-driven model is the average power, The predicted value for the data-driven model is the average power.
[0296] Example 2:
[0297] like Figure 4 As shown, a power generation prediction system based on a digital twin model of a photovoltaic power station includes a photovoltaic power station operation data generation module, a power generation prediction module, and a final power generation prediction result fusion module;
[0298] The photovoltaic power station operation data generation module is used to generate photovoltaic power station operation data consistent with the actual distribution based on the operating parameters of various core components of the photovoltaic power station, and to build a digital twin model that simulates the actual operation status of the photovoltaic power station. The digital twin model includes a physical model and a data-driven model;
[0299] The power generation prediction module is used to input the generated photovoltaic power station operation data that is consistent with the actual distribution into the photovoltaic power station physical model and the photovoltaic power station data-driven model constructed using the improved LSTM algorithm, respectively, to obtain the power generation prediction values of the physical model and the data-driven model;
[0300] The final power generation prediction result fusion module is used to fuse the power generation prediction values of the photovoltaic power station physical model and the data-driven model to obtain the final photovoltaic power generation prediction result.
[0301] The photovoltaic power station operation data generation module includes a parameter preprocessing unit, a loss function design unit, a parameter gradient calculation unit, a parameter updating unit, and an iterative judgment unit;
[0302] The parameter preprocessing unit is used to preprocess the operating parameters of various core components of the photovoltaic power station, design the GAN model architecture, and initialize the GAN grid parameters;
[0303] The loss function design unit is used to design the loss functions of the GAN model discriminator and generator;
[0304] The loss function of the discriminator is calculated using the following formula:
[0305] ;
[0306] In the above formula, is the loss function of the discriminator, is the output of the discriminator for the conditional features in the real sample, For the generator from noise The generated sample data, is the gradient penalty coefficient, is the gradient of the discriminator to the interpolation point, For the real samples collected, is the conditional feature in the real sample, is a random noise vector, To generate samples, is the interpolation point between the real sample and the generated sample;
[0307] The loss function of the generator is calculated using the following formula:
[0308] ;
[0309] ;
[0310] In the above formula, is the loss function of the generator, is the weight coefficient of the regularization term, is the regularization term, is the number of feature dimensions, For the The mean of the generated sample data, For the The mean of the real sample data, For the The standard deviation of the real sample data, For the Generate sample data, For the Real sample data;
[0311] The parameter gradient calculation unit is used to calculate the gradient of the GAN model discriminator loss function with respect to the discriminator parameters, and the gradient of the generator loss function with respect to the generator parameters:
[0312] ;
[0313] ;
[0314] In the above formula, is the gradient of the discriminator loss function with respect to the discriminator parameters, Indicates the calculation of the gradient of the discriminator parameters, is the gradient of the generator loss function with respect to the generator parameters, Indicates the calculation of gradients for generator parameters;
[0315] The parameter updating unit is used to update the discriminator parameters and generator parameters of the GAN model using the improved Adam algorithm based on the gradient parameters of the discriminator and generator parameters;
[0316] The method for improving the Adam algorithm is shown in step 2 of Example 1;
[0317] For the discriminator parameters, the following formula is used to update:
[0318] ;
[0319] ;
[0320] ;
[0321] ;
[0322] ;
[0323] In the above formula, are the updated discriminator parameters, is the learning rate, is the momentum term after the discriminator correction, is the second-order moment estimate after correction by the discriminator, is the bias correction term, is the discriminator momentum term, 、 are all hyperparameters, is the second-order moment estimate of the discriminator;
[0324] For the generator parameters, the following formula is used to update:
[0325] ;
[0326] ;
[0327] ;
[0328] ;
[0329] ;
[0330] In the above formula, are the updated generator parameters, is the modified momentum term of the generator, is the generator’s revised second-order moment estimate, is the generator momentum term, is the generator second-order moment estimate;
[0331] The iterative judgment unit is used to repeatedly execute the operating steps of the loss function design unit-parameter updating unit until the GAN model converges or reaches the maximum number of iterations, the algorithm ends, and the photovoltaic power station operation data consistent with the actual distribution is generated.
[0332] In the power generation prediction module, the physical model of the photovoltaic power station is as shown in step 3 of Example 1;
[0333] In the power generation prediction module, the specific steps of using the improved LSTM algorithm to construct a photovoltaic power station data-driven model are as shown in step 3 of Example 1;
[0334] The final power generation prediction result fusion module is used to fuse the power generation prediction values of the photovoltaic power station physical model and the data-driven model using the following formula to obtain the final photovoltaic power generation prediction result:
[0335] ;
[0336] ;
[0337] ;
[0338] In the above formula, is the final photovoltaic power station power generation prediction result, is the physical model prediction error, is the prediction error of the data-driven model, is the power generation prediction value of the data-driven model, is the predicted value of power generation of the physical model, is the average power of the actual value of the physical model, is the average power of the physical model prediction value, The actual value of the data-driven model is the average power, The predicted value for the data-driven model is the average power.
[0339] Example 3:
[0340] like Figure 5 As shown, a power generation prediction device based on a digital twin model of a photovoltaic power station includes a processor and a memory;
[0341] The memory is used to store computer program code and transmit the computer program code to the processor;
[0342] The processor is used to execute the power generation prediction method based on the digital twin model of the photovoltaic power station described in Example 1 according to the instructions in the computer program code.
Claims
1. A method for predicting power generation based on a digital twin model of a photovoltaic power station, characterized in that: The method comprises: S1. Generate PV power plant operating data consistent with actual distribution based on the operating parameters of various core components of the PV power plant, and build a digital twin model that simulates the actual operating conditions of the PV power plant. The digital twin model includes a physical model and a data-driven model. The specific steps for generating PV power station operating data that matches the actual distribution based on the operating parameters of various core components of the PV power station include: S11. Preprocess the operating parameters of various core components of the photovoltaic power station, design the GAN model architecture, and initialize the GAN grid parameters; S12. Design the loss function of the GAN model discriminator and generator; S13. Calculate the gradient of the GAN model discriminator loss function with respect to the discriminator parameters, and the gradient of the generator loss function with respect to the generator parameters respectively; S14. Based on the gradient parameters of the discriminator and generator parameters, the improved Adam algorithm is used to update the discriminator parameters and generator parameters of the GAN model; The method for improving the Adam algorithm is to use the PSO algorithm to optimize the Adam optimizer hyperparameters, which includes using the hyperparameter settings corresponding to each particle to train the PSO optimization model and using the following formula to calculate the objective function of each particle as the fitness of the particle i : L loss =(L D +L G ); In the above formula, F(x i ) is the objective function of the i-th particle, L stat is the statistical feature matching loss, L loss is the loss during GAN model training, L phys is the physical consistency loss, d x is the number of feature dimensions, is the mean of the i-th generated sample data, is the mean of the i-th real sample data, is the standard deviation of the i-th real sample data, Generate sample data for the i-th, x i is the i-th real sample data, is the variance of the i-th generated sample data, is the variance of the i-th real sample data, L D is the loss function of the discriminator, L G is the loss function of the generator, I′ ph,t is the predicted value of the photocurrent, I ph,t is the measured photogenerated current, is the standard deviation of the measured photogenerated current; S15. Repeat steps S12-S14 until the GAN model converges or reaches the maximum number of iterations, the algorithm ends, and photovoltaic power station operation data consistent with the actual distribution is generated; S2. Input the generated PV power plant operation data that matches the actual distribution into the PV power plant physical model and the PV power plant data-driven model constructed using the improved LSTM algorithm, respectively, to obtain power generation prediction values for the physical model and the data-driven model; S3. Integrate the power generation prediction values of the photovoltaic power station physical model and the data-driven model to obtain the final photovoltaic power generation prediction result.
2. The method for predicting power generation based on a digital twin model of a photovoltaic power station according to claim 1, characterized in that: In S2, the specific steps of using the improved LSTM algorithm to build a photovoltaic power station data-driven model include: A. Pre-process the photovoltaic power station operation data to obtain positive and negative sample pairs that adjust the data feature distribution; B. Input the positive and negative sample pairs into the LSTM model, initialize the LSTM model architecture, and calculate the power generation forecast using the following formula: In the above formula, p d is the power generation prediction value of the data-driven model, is the power generation prediction value of the nth hidden unit, W y is the weight matrix of the fully connected layer, h t is the hidden state, which serves as the input of the fully connected layer, b y is the bias term of the fully connected layer; C. Construct a comprehensive loss function to jointly optimize the future power generation forecast: In the above formula, L total is the comprehensive loss function, L MSE is the mean square error function, L MAE is the mean absolute error function, L contrastive is the comparison loss function, ξ1, ξ2, ξ3 are the weights of each function, Q is the total number of predicted power generation samples, y i is the actual power generation value, S is the transmission plan matrix, is a positive sample pair, is a negative sample pair, m is a predefined boundary value, is the distance between positive sample pairs, The distance between negative sample pairs.
3. The power generation prediction method based on the digital twin model of a photovoltaic power station according to claim 2 is characterized in that: The step A comprises: A1. Construct features for the photovoltaic power station operation data and use the following formula to convert hours into periodic features of the data: In the above formula, t_sin i is the sinusoidal periodic characteristic, t i is the time step, t_cos i is the cosine periodic characteristic; A2. Decompose and denoise the periodic characteristics of the data and extract the IMF components of the data, including: A21. Find all local maximum and minimum points of the original data signal x(t), where t is the time index and the time index set of the maximum point is {t max }, the time index set of the minimum point is {t min }, and construct the upper envelope u(t) through the local maximum points, and the lower envelope l(t) through the local minimum points; A22. Based on the envelope of the local maximum and minimum points, the residual signal is calculated using the following formula: h(t)=x(t)-m(t); In the above formula, h(t) is the residual signal, m(t) is the instantaneous mean, u(t) is the upper envelope, and l(t) is the lower envelope; A23. Determine whether the residual signal satisfies the two conditions of the IMF component, that is, in any time period, the number of maximum and minimum points is equal or the difference does not exceed one, and the average value of the upper and lower envelopes is zero. If so, the residual signal h(t) is an IMF component, denoted as IMF j (t), and remove the IMF component from the original signal. If it is not satisfied, return to step A21, find all local maximum and minimum points of the residual signal h(t), and decompose the residual signal until the residual signal becomes a monotonic function or meets the two conditions of the IMF component. Finally, the original data signal is expressed as: In the above formula, J is the total number of IMF components, r(t) is the residual term; A3. Based on the IMF components of the data, a multi-scale feature matrix is formed, including: A31. Analyze the energy distribution of various IMF components and select the effective characteristic components using the following formula: In the above formula, ER is the effective characteristic component, that is, the variance contribution rate, and std() is the standard deviation; A32. Reassemble the effective feature components after energy analysis into a new input sequence, ensuring that each time step contains all selected IMF components, forming the following multi-scale feature matrix: X IMF =[IS selected (t1), IS selected (t2),…, IS selected (t n )]; In the above formula, X IMF is a multi-scale feature matrix composed of selected effective feature components, ER selected (t n ) contains the time step t n The matrix of all selected IMF components; A33. Use the following formula to perform feature dimensionality reduction on the multi-scale feature matrix: X reduced =PCA(X IMF ); In the above formula, X reduced is the multi-scale feature matrix after feature dimensionality reduction; A4. After feature dimensionality reduction, construct the data within the same time period in the multi-scale feature matrix as positive sample pairs, and the data in different time periods as negative sample pairs. Build an optimal transmission problem model and adjust the distribution of the data features of the positive and negative sample pairs: s * =arg min{B,S}; In the above formula, s * is the optimal transmission problem model, B is the transmission cost matrix, S is the transmission plan matrix, is a positive sample pair, is a negative sample pair, B ij is the i-th source distribution sample and the jth target distribution sample The Euclidean distance between is the i-th source distribution sample, The jth target distribution sample, e s is the source distribution, e t is the target distribution, s T is the transpose of the transmission plan matrix.
4. The method for predicting power generation based on a digital twin model of a photovoltaic power station according to claim 1, characterized in that: In S2, the photovoltaic power station physical model includes: I ph =μ θ (x t ,t,C,G,H,v)=ΛC+ΛG+ΛH+Λv; I d =μ θ (x t ,t,C,G)=ΛC+ΛG; R sh =R shstc ·(1+x(CC STC )); In the above formula, p p is the predicted value of power generation of the physical model, is the corrected load current, is the corrected load voltage, is the corrected photocurrent, is the corrected dark current, U is the load voltage, I is the output current, R s is the series resistance, is the corrected parallel resistance, R L is the load resistance, I ph is the photocurrent, ΛI ph ,ΛC,ΛG,ΛH,Λv,ΛI d , ΛR sh All of them are nonlinear effects of environmental conditions on photovoltaic module power generation. STC is the short-circuit current under standard test conditions, G is the light intensity, χ is the temperature coefficient, C is the actual temperature, C STC is the temperature under standard test conditions, μ θ (x t ,t,C,G,H,v)、μ θ (x t ,t,C,G),μ θ (x t , t, τ, i) are the correction values of photocurrent, dark current and parallel resistance respectively, and are the mean function generated by the diffusion model, κ C , κ G , κ H 、 κ τ Both are correction coefficients, C crit is the critical value of temperature, τ is the component operation time, τ life is the component life, G max is the maximum light intensity, H is the actual humidity level, and H max is the maximum humidity level, p is the nonlinear index describing the temperature, H crit is the critical humidity value, v w is the average wind speed, is the variance of wind speed, I d is the dark current, I0 is the reverse saturation current, q is the electron charge, n is the ideal factor, N s is the number of units in series, k is the Boltzmann constant, R sh is the parallel resistance, R shstc is the parallel resistance under standard test conditions, is the load current correction factor, I max is the maximum output current, and r is the nonlinear index describing the load current.
5. The method for predicting power generation based on a digital twin model of a photovoltaic power station according to claim 4, characterized in that: The specific steps of generating the mean function generated by the diffusion model include: a. The forward diffusion process uses the following formula to start from the real sample data x0 and gradually add Gaussian noise to the data to make the data distribution completely random: In the above formula, q(x t |x t-1 ) is the conditional probability distribution from the previous time step to the current time step in the forward diffusion process, x t is the sample data of the current time step, N(·) is the normal distribution, δ t is the diffusion intensity, A is the unit matrix; b. In the reverse generation process, we use the following formula to generate the mean function by gradually denoising the Gaussian noise: In the above formula, p θ (x t+1 |x t , y) is the conditional probability distribution from the current time step to the previous time step in the reverse generation process, y is the conditional variable, representing the external control information related to the generation process, μ θ (x t , t, y) is the mean function, which represents the correction value at the current time step. is the variance.
6. The method for predicting power generation based on a digital twin model of a photovoltaic power station according to claim 1, characterized in that: The S3 includes: The following formula is used to fuse the power generation prediction values of the PV power station physical model and the data-driven model to obtain the final PV power generation prediction result: In the above formula, Y is the final prediction result of the photovoltaic power station power generation, θ1 is the physical model prediction error, θ2 is the data-driven model prediction error, and p d is the power generation prediction value of the data-driven model, p p is the predicted value of power generation of the physical model, y p is the average power of the actual value of the physical model, is the average power of the physical model prediction value, y d The actual value of the data-driven model is the average power, The predicted value for the data-driven model is the average power.
7. The method for predicting power generation based on a digital twin model of a photovoltaic power station according to claim 1, characterized in that: In S12, the loss functions of the GAN model discriminator and generator are designed to include: The loss function of the discriminator is calculated using the following formula: In the above formula, L D is the loss function of the discriminator, D(x, c) is the output of the discriminator for the conditional features in the real sample, G(z, c) is the sample data generated by the generator from the noise z, λ is the gradient penalty coefficient, is the gradient of the discriminator to the interpolation point, x is the collected real sample, c is the conditional feature in the real sample, z is the random noise vector, To generate samples, is the interpolation point between the real sample and the generated sample; The loss function of the generator is calculated using the following formula: In the above formula, L G is the loss function of the generator, γ is the weight coefficient of the regularization term, L reg is the regularization term, d x is the number of feature dimensions, is the mean of the i-th generated sample data, is the mean of the i-th real sample data, is the standard deviation of the i-th real sample data, Generate sample data for the i-th, x i is the i-th real sample data; In S13, the gradient of the GAN model discriminator loss function with respect to the discriminator parameters and the gradient of the generator loss function with respect to the generator parameters are calculated using the following formula: In the above formula, g D is the gradient of the discriminator loss function with respect to the discriminator parameters, Indicates the calculation of the gradient of the discriminator parameters, g G is the gradient of the generator loss function with respect to the generator parameters, Indicates the calculation of gradients for generator parameters; In S14, the discriminator parameters are updated using the following formula: In the above formula, is the updated discriminator parameter, α * is the learning rate, is the momentum term after the discriminator correction, is the second-order moment estimate after correction by the discriminator, ∈ * is the bias correction term, is the discriminator momentum term, are all hyperparameters, is the second-order moment estimate of the discriminator; For the generator parameters, the following formula is used to update: In the above formula, are the updated generator parameters, is the modified momentum term of the generator, is the modified second-order moment estimate of the generator, is the generator momentum term, is the second-order moment estimate of the generator.
8. The method for predicting power generation based on a digital twin model of a photovoltaic power station according to claim 1, characterized in that: In S14, the method for improving the Adam algorithm is to optimize the Adam optimizer hyperparameters using the PSO algorithm. The specific steps of the improvement include: S141. Initialize the Adam optimizer hyperparameters. S142, define the Adam optimizer hyperparameter search space, using the position vector X of each particle i =(α i , β 1i , β 2i , ε i ) represents a set of hyperparameter values, where X i is the position vector of the i-th particle, α i is the learning rate of the i-th particle, β 1i is the first-order moment estimated decay rate of the i-th particle, β 2i is the estimated decay rate of the second-order moment of the i-th particle, ε i is the gradient correction parameter of the i-th particle; S143. The total number of initialized particle swarms is N. The initial position and velocity of each particle are randomly generated within their respective ranges, expressed as: X i (0)~U(low i ,high i ); V i (0)~U(-|high i -low i |,|high i -low i |); In the above formula, X i (0) is the initial position of the i-th particle, U(·) is a uniformly distributed random value selected from the search space, low i is the minimum value in the search space, high i is the minimum value in the search space, V i (0) is the initial velocity of the i-th particle; S144, use the hyperparameter settings corresponding to each particle to train the PSO optimization model, and calculate the objective function of each particle as the fitness of the particle i ; S145, determine whether the fitness of each particle meets the fitness i <pBeat i , where pBest i is the best position fitness value of each particle. If it is satisfied, update pBest i =fintness i , and record the corresponding pBestPos i =X i , where pBestPos i is the best position of each particle. If it is not satisfied, the best position fitness value of the particle and its position remain unchanged. After finding the best position fitness value among all particles, the global best particle fitness value gBest=min(pBest i ), and record the corresponding position gBestPos; S146. Based on the particle's optimal position fitness value and its position, the following formula is used to update the speed and position of each particle: V i (t+1)=w(t)·V i (t)+c1·r1(pBestPos i -X i (t))+c2·r2·(gBestPos-X i (t)); X i (t+1)=X i (t)+V i (t+1); In the above formula, V i (t+1) is the velocity of the i-th particle in the t+1 iteration, w(t) is the inertia weight, c1 and c2 are acceleration constants, r1 and r2 are independent and identically distributed random numbers in the interval [0, 1], X i (t) is the position of the i-th particle after the t-th iteration, T is the maximum number of iterations, w max is the initial inertia weight, w min is the final inertia weight; S147. Set the number of times there is no significant improvement in consecutive iterations as a threshold K, and determine whether the number of times |gBest(t)-gBest(t-1)|<δ in consecutive iterations reaches the set threshold K or the maximum number of iterations, where δ is a small positive number used to determine whether there is significant improvement in the iteration. If it is reached, the algorithm terminates and the optimization process ends; if not, return to step S144 and recalculate the objective function of each particle.
9. A power generation prediction system based on a digital twin model of a photovoltaic power station, characterized in that: The system includes a photovoltaic power station operation data generation module, a power generation prediction module, and a final power generation prediction result fusion module; The photovoltaic power station operation data generation module is used to generate photovoltaic power station operation data consistent with the actual distribution based on the operating parameters of various core components of the photovoltaic power station, and to build a digital twin model that simulates the operating conditions of the photovoltaic power station in reality. The digital twin model includes a physical model and a data-driven model, including a parameter preprocessing unit, a loss function design unit, a parameter gradient calculation unit, a parameter update unit, and an iterative judgment unit; The parameter preprocessing unit is used to preprocess the operating parameters of various core components of the photovoltaic power station, design the GAN model architecture, and initialize the GAN grid parameters; The loss function design unit is used to design the loss functions of the GAN model discriminator and generator; The parameter gradient calculation unit is used to respectively calculate the gradient of the GAN model discriminator loss function with respect to the discriminator parameters, and the gradient of the generator loss function with respect to the generator parameters; The parameter updating unit is used to update the discriminator parameters and generator parameters of the GAN model using the improved Adam algorithm based on the gradient parameters of the discriminator and generator parameters; The method for improving the Adam algorithm is to use the PSO algorithm to optimize the Adam optimizer hyperparameters, including using the hyperparameter settings corresponding to each particle to train the PSO optimization model, and using the following formula to calculate the objective function of each particle as the fitness of the particle i : L loss =(L D +I G ); In the above formula, F(x i ) is the objective function of the i-th particle, L stat is the statistical feature matching loss, F loss is the loss during GAN model training, L phys is the physical consistency loss, d x is the number of feature dimensions, is the mean of the i-th generated sample data, is the mean of the i-th real sample data, is the standard deviation of the i-th real sample data, Generate sample data for the i-th, x i is the i-th real sample data, is the variance of the i-th generated sample data, is the variance of the i-th real sample data, L D is the loss function of the discriminator, L G is the loss function of the generator, I′ ph,t is the predicted value of the photocurrent, I ph,t is the measured photogenerated current, is the standard deviation of the measured photogenerated current; The iterative judgment unit is used to repeatedly execute the operating steps of the loss function design unit-parameter updating unit until the GAN model converges or reaches the maximum number of iterations, the algorithm ends, and the photovoltaic power station operation data consistent with the actual distribution is generated; The power generation prediction module is used to input the generated photovoltaic power station operation data that is consistent with the actual distribution into the photovoltaic power station physical model and the photovoltaic power station data-driven model constructed using the improved LSTM algorithm, respectively, to obtain the power generation prediction values of the physical model and the data-driven model; The final power generation prediction result fusion module is used to fuse the power generation prediction values of the photovoltaic power station physical model and the data-driven model to obtain the final photovoltaic power generation prediction result.
10. A power generation prediction device based on a digital twin model of a photovoltaic power station, characterized in that: including a processor and a memory; The memory is used to store computer program code and transmit the computer program code to the processor; The processor is used to execute the power generation prediction method based on the digital twin model of a photovoltaic power station according to any one of claims 1 to 8 according to the instructions in the computer program code.
Citation Information
Patent Citations
Digital twin modeling method, device, equipment and medium
CN117290721A