This section covers the experimental part, including data preprocessing, introduction of evaluation metrics, and presentation of experimental results.
4.1 Data Set
This subsection sequentially introduces the data source, handling of outliers, missing values, and invalid values, normalization method, data set division, and variable analysis.
4.1.1 Data Source
The data used in this study are from the solar energy data of the renewable energy generation prediction competition held by the State Grid Corporation of China. The data set contains 7 variables, namely, total solar irradiance, direct normal irradiance, global horizontal irradiance, air temperature, atmospheric relative humidity, and photovoltaic power generation. The data collection period spans from January 1, 2019, 0:00 to December 31, 2020, 24:00, with data points collected at 15-minute intervals, totaling 70,176 data points. Each data point consists of measurements of 7 variables at a single time step.
4.1.2 Handling of Outliers, Missing Values, and Invalid Values
Outliers in the data set, such as negative power generation or positive irradiance during nighttime, are identified based on environmental and time criteria and subsequently removed. The removed outliers are treated as missing values along with any existing missing values in the data set.
Missing values are filled using linear interpolation, considering the low and nearly discontinuous missing rate in the data set and the continuous and small-scale trends in the data, as per Equation. (2).
$$y={y_0}+\left( {x - {x_0}} \right)\frac{{{y_1} - {y_0}}}{{{x_1} - {x_0}}}$$
2
Since photovoltaic power generation relies primarily on daylight, nighttime data where power generation is consistently zero are considered invalid and thus removed, while daytime data are retained.
4.1.3 Normalization
The data are normalized to the [0,1] interval using the min-max normalization method. Normalization accelerates model speed, increases model stability, and enhances model accuracy, as described by Equation. (3).
The data in which x is any data from dataset, \({x_{\hbox{max} }}\) is the maximum value in the dataset, \({x_{\hbox{min} }}\)is the minimum value in the dataset, and x' is the normalized value.
4.1.4 Data Set Division
After the aforementioned steps, the new data set consists of 30,881 data points. The data set is divided into training, validation, and testing sets in a ratio of 7:2:1. The training set, comprising 70% of the data, is used to train the model, with a time span from January 1, 2019, 9:15 to June 4, 2020, 20:45. The validation set, comprising 20% of the data, is used for model adjustment and parameter optimization, with a time span from June 5, 2020, 6:15 to October 11, 2020, 12:15. The testing set, comprising 10% of the data, is used to evaluate model performance, with a time span from October 11, 2020, 12:30 to December 31, 2020, 18:15.
4.1.5 Variable Analysis
Total solar irradiance: Represents the energy intensity of solar radiation reaching the Earth's surface in watts per square meter (W/m²). Higher total solar irradiance leads to increased stability in photovoltaic power output, while lower irradiance results in decreased output power.
Direct normal irradiance: Refers to the radiation intensity of sunlight perpendicular to the Earth's surface in W/m². It directly affects the amount of solar energy received by photovoltaic panels. Increasing direct normal irradiance enhances photovoltaic power output, ensuring the stability of the system.
Global horizontal irradiance: Represents the total irradiance of the sun on the Earth's horizontal plane in W/m². It determines the amount of solar radiation energy received by photovoltaic panels. Higher global horizontal irradiance leads to increased output power of photovoltaic systems.
Air temperature: Affects photovoltaic power generation by influencing the operating temperature and efficiency of photovoltaic panels in degrees Celsius (°C). Beyond a certain range, temperature increase can decrease photovoltaic conversion efficiency, leading to panel aging and increased failure rates, thus reducing photovoltaic power output.
Atmospheric pressure: Measured in hPa. Factors such as atmospheric clarity, cloud thickness, and weather conditions affect the intensity of sunlight reaching the ground and solar radiation. Particles and pollutants in the atmosphere absorb and scatter solar radiation, reducing the intensity of radiation received by photovoltaic components.
Relative humidity: High humidity may cause surface water or condensation on photovoltaic components, reducing light transmittance and thus lowering photovoltaic conversion efficiency. Humidity also affects the heat dissipation of photovoltaic systems and exacerbates corrosion and aging of photovoltaic components.
Historical data subseries of photovoltaic power generation: Data subseries at different frequencies reflect the operating characteristics of photovoltaic power stations at different time scales. High-frequency data capture instantaneous power fluctuations of photovoltaic power stations, suitable for real-time and short-term predictions, while low-frequency data reflect long-term operating trends, suitable for long-term predictions and trend analysis. Different frequency data subseries complement each other and can be used for mutual verification and supplementation.
Table 1
Descriptive Information of Variables
Variables
|
Mean
|
Maximum
|
Minimum
|
Std
|
Skewness
|
Kurtosis
|
Total solar irradiance
|
560.64
|
1359.00
|
1.00
|
349.45
|
-0.05
|
1.66
|
Direct normal irradiance
|
209.33
|
980.00
|
1.00
|
257.25
|
1.11
|
2.94
|
Global horizontal irradiance
|
137.68
|
989.00
|
1.00
|
120.81
|
2.25
|
10.00
|
Air temperature
|
16.51
|
40.90
|
-17.20
|
14.30
|
-0.81
|
5.73
|
Atmosphere
|
911.56
|
936.30
|
894.00
|
32.12
|
-29.24
|
920.32
|
Relative humidity
|
1055.19
|
6553.50
|
0.00
|
2386.70
|
1.87
|
4.49
|
Power
|
20.46
|
48.32
|
0.00
|
13.41
|
0.07
|
1.75
|
Table 1 presents descriptive information for 7 variables. After data preprocessing, the minimum value of irradiance is 1, while the minimum values for relative humidity and photovoltaic power generation are 0. Due to the significant variation in irradiance throughout the day, following a timeline from 0 at sunrise, reaching a maximum, then decreasing back to 0 at sunset, the standard deviation of irradiance is large. Air temperature, atmospheric pressure, and relative humidity remain relatively stable.
4.2 Evaluation Metrics
Evaluation of model predictive performance is conducted using Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), and the coefficient of determination (\({R^2}\)). MAE measures the average absolute difference between predicted and actual values, intuitively reflecting the size of prediction errors and the precision of the model's predictions. MSE measures the average squared difference between predicted and actual values, reflecting the stability of the model's prediction results. A smaller RMSE indicates a stronger predictive ability of the model. The coefficient of determination measures the proportion of the variance in the output variable explained by the model, reflecting the degree to which the model fits the data. Its value ranges from 0 to 1, with a value closer to 1 indicating a better fit of the model to the data. The formulas for evaluation metrics are as follows:
$$MAE=\frac{1}{n}\sum\limits_{{t=1}}^{n} {\left| {{{\hat {y}}_t} - {y_t}} \right|}$$
4
$$MSE=\frac{1}{n}\sum\limits_{{t=1}}^{n} {{{\left( {{{\hat {y}}_t} - {y_t}} \right)}^2}}$$
5
$$RMSE=\sqrt {\frac{1}{n}\sum\limits_{{t=1}}^{n} {{{\left( {{{\hat {y}}_t} - {y_t}} \right)}^2}} }$$
6
$${R^2}=1 - \frac{{\sum\limits_{{t=1}}^{n} {{{\left( {{y_t} - {{\hat {y}}_t}} \right)}^2}} }}{{\sum\limits_{{t=1}}^{n} {{{\left( {{y_t} - {{\bar {y}}_t}} \right)}^2}} }}$$
7
4.4 Attention Mechanism
Through the attention mechanism, correlations between 15 factors were calculated, including total solar irradiance, direct normal irradiance, global horizontal irradiance, air temperature, atmospheric relative humidity, 7 subsequences after decomposition of photovoltaic power generation historical data, and photovoltaic power generation. The first 14 are input variables, and the last one is the output variable. The correlation heat map between variables is illustrated in Fig. 8.
Figure 8 indicates that most variables exhibit weak positive correlations, with correlation coefficients around [0,0.4]. However, there are a few variables that show strong associations, such as total solar irradiance and the output variable, as well as the IMF7 and the output variable. This is because total solar irradiance represents sunlight intensity, and the frequency of the IMF7 occupies a significant proportion in the historical data of photovoltaic power generation, resulting in a strong positive correlation between them. Additionally, there are a few variables that show weak negative correlations, such as the IMF8 and temperature, and the direct normal irradiance and global horizontal irradiance, with correlation coefficients falling within the [-0.2,0] range.
Table 2
Variable
|
Correlation coefficient with output variable
|
Output
|
1
|
Total Solar Irradiance
|
0.880215
|
IMF7
|
0.744364
|
IMF6
|
0.606838
|
RES
|
0.416276
|
Direct Normal Irradiance
|
0.401422
|
Global Horizontal Irradiance
|
0.357829
|
IMF5
|
0.32927
|
IMF4
|
0.196439
|
IMF3
|
0.12812
|
IMF2
|
0.095738
|
IMF1
|
0.075753
|
Relative Humidity
|
0.073687
|
Atmosphere
|
0.05432
|
Air Temperature
|
0.044742
|
Table 2 presents the correlation coefficients between each input variable and the photovoltaic power output variable, with variables sorted from top to bottom based on their correlation coefficients with the photovoltaic power output variable. From the data, it can be observed that the output variable has strong positive correlations with total solar irradiance, the IMF7, and the IMF6, with correlation coefficients of 0.880215, 0.744364, and 0.606838, respectively. This indicates that a surge in irradiance promotes a larger energy pool for photovoltaic cells to convert into electricity, thus increasing the power output. As the frequency decreases from IMF1 to IMF7, the correlation coefficients with the photovoltaic power output variable gradually decrease from 0.744364 to 0.075753. Higher-frequency subsequences, which have a higher proportion in the original sequence, exhibit larger correlation coefficients. Relative humidity, atmospheric pressure, and temperature show weak positive correlations with photovoltaic power generation, with coefficients of 0.073687, 0.05432, and 0.044742, respectively, all below 0.1. These nonlinear relationships among variables suggest that they do not directly impact photovoltaic power generation but rather indirectly influence electricity output by affecting other meteorological factors.
4.5 Ablation Experiment
The ablation study is a scientific research method used to determine the impact of key components of a condition, parameter, or system on overall performance. This method involves systematically controlling or modifying specific parts of a system one by one to observe how these changes affect the system's functionality, performance, or behavior. Ablation experiments can enhance model transparency, optimize model performance, validate the effectiveness of specific functions or components, and enhance the integrity and credibility of research.
This subsection sets up ablation experiments to explore the roles of various modules in the composite model and their contributions to improving model accuracy. The ablation experiment groups include four experimental groups: VMD-Attention-BiLSTM model, Attention-BiLSTM model, VMD-BiLSTM model, and VMD-Attention-LSTM model.
In Fig. 9, there are five solid lines representing the predicted results of the ablation experiment. They correspond to the true values of 50 samples taken throughout the day and the results under different models. The black solid line representing the true values appears relatively smooth and natural. However, the other four prediction curves exhibit varying degrees of fluctuation and curvature, indicating differences in the performance of these models at different time points. The samples are taken from 0 to 25 during the period from sunrise to midday. As the sunlight intensifies, the power generation increases. During this period, the predicted values of the four models are relatively close to each other, but deviate significantly from the true values. Among them, the VMD-Attention-LSTM experimental group and the VMD-BiLSTM experimental group have slightly higher accuracy compared to the other two groups. The samples taken from 25 to 50 are from midday to sunset, during which the solar irradiance decreases and the power generation decreases. During this period, the results of the four prediction experiments fluctuate in line with the changing trend of the true values, intertwining with each other. The true values are closest to the VMD-Attention-BiLSTM model.
Table 3
Errors in ablation experiments
Ablation experiments
|
MAE
|
MSE
|
RMSE
|
\({R^2}\)
|
VMD-Attention-BiLSTM
|
0.1123
|
0.0207
|
0.1438
|
0.8835
|
Attention-BiLSTM
|
0.1516
|
0.0339
|
0.1840
|
0.7956
|
VMD-BiLSTM
|
0.1208
|
0.0238
|
0.1544
|
0.8641
|
VMD-Attention-LSTM
|
0.1132
|
0.0214
|
0.1464
|
0.8862
|
Table 3 presents the prediction results of the four experimental groups in the ablation experiment, comparing model performance using four evaluation metrics. Among them, the VMD-Attention-BiLSTM model has the lowest MAE, MSE, and RMSE, which are 0.1123, 0.0207, and 0.1438 respectively. The VMD-Attention-LSTM group has the highest \({R^2}\)of 0.8862. Arranging the metrics from lowest to highest, the sequence for MAE, MSE, and RMSE is: VMD-Attention-BiLSTM experimental group, VMD-Attention-LSTM experimental group, VMD-BiLSTM experimental group, and Attention-BiLSTM experimental group. This indicates that decomposing the sequence has the greatest impact on improving prediction accuracy, followed by allocating weights using attention mechanism, while the least impactful is the bidirectional structure of the LSTM model. Regarding \({R^2}\), arranged from highest to lowest, the sequence is: VMD-Attention-LSTM experimental group, VMD-Attention-BiLSTM experimental group, VMD-BiLSTM experimental group, and Attention-BiLSTM experimental group. Moreover, the difference in\({R^2}\)between the VMD-Attention-LSTM experimental group and the VMD-Attention-BiLSTM experimental group is only 0.0027, suggesting that the bidirectional structure of the LSTM model has a minimal impact on data fitting in the combined model.
4.6 Comparative experiments
This section establishes four sets of comparative experiments: day and night, seasons, step length, and models. Visualization graphs of prediction results and error tables of evaluation metrics are utilized to compare the performance of different datasets or models, exploring the effects of different variables, data processing methods, and environments on photovoltaic power prediction.
4.6.1 Day and night comparison
The dataset is divided into daytime and full-day datasets based on sunlight hours. The full-day dataset includes data for all 24 hours of the day, including nighttime data when photovoltaic power is zero. The daytime dataset, on the other hand, is derived from the full-day dataset by removing all data points where photovoltaic power is zero. Both datasets undergo the same data preprocessing steps and are used for combined model predictions to investigate the impact of nighttime values on prediction.
Figure 10 illustrates the comparison between the prediction results of the daytime dataset and the full-day dataset. The horizontal axis represents a time span of one week (7 days), with the black solid line indicating the trend of real values. Subplot (a) presents the comparison between the prediction results and real values of the daytime dataset, with 320 samples. The predicted values are depicted by the green solid line. Subplot (b) illustrates the comparison for the full-day dataset, containing 680 samples, with the predicted values shown by the red solid line. In subplot (a), the 3rd day is rainy, and the 7th day is cloudy, while the remaining 5 days are sunny. During sunny and cloudy days, the predicted values exhibit a significant deviation below the real values in the morning hours, but align closely with the real values in the afternoon, indicating good prediction accuracy. However, on rainy days, due to rapid power fluctuations caused by cloud cover, the prediction accuracy is slightly lower. In subplot (b), the 1st day is cloudy, and the remaining 6 days are sunny. The prediction for the cloudy day fails to capture the extreme peak in real values, while on sunny days, there is a lag between the predicted and real values, resulting in misalignment of the two curves. Additionally, the predicted values fail to simulate the peak in photovoltaic power generation during the strongest sunlight hours around noon, and they also lag behind in reaching zero at sunset compared to the real values.
Table 4
Errors for the daytime dataset and the all-day dataset
Dataset
|
MAE
|
MSE
|
RMSE
|
\({R^2}\)
|
Daytime dataset
|
0.1123
|
0.0207
|
0.1438
|
0.8835
|
All-day dataset
|
0.1436
|
0.0325
|
0.1804
|
0.8386
|
Table 4 presents the errors for both the daytime and full-day datasets. From the table, it can be observed that the MAE, MSE, RMSE and\({R^2}\)of the daytime dataset are all better than those of the full-day dataset. This indicates that the prediction accuracy, stability, capability, and fitting degree are higher when using the daytime dataset, further suggesting that removing nighttime values can reduce data redundancy and make the dataset more refined and effective.
4.6.2 Seasonal comparisons
The dataset is divided into spring, summer, autumn, and winter datasets based on seasonal variations, covering the periods from March to May, June to August, September to November, and December to February for the years 2019 and 2020, respectively. These four datasets undergo the same data preprocessing and combined model prediction to investigate the impact of seasonal changes on predictions.
Figure 11 depicts the comparative forecast results of the seasonal dataset, comprising four subplots, each representing the prediction results for one week in the corresponding seasonal dataset. Subplot (a) shows that the trend of the predicted values is close to the actual values, but the predicted values fail to simulate peak changes when abrupt changes occur in the actual values. Subplot (b) illustrates that the variation in predicted values is synchronized with the actual values, with the two curves overlapping closely most of the time; however, the predicted values can only roughly simulate the numerical range when abrupt changes occur in the actual values, failing to accurately capture every short-term extreme change. In subplot (c), there are several peaks in the actual values on overcast days, while the predicted values can roughly simulate one peak. Subplot (d) shows that the predicted values almost coincide with the actual values, with slight discrepancies in numerical simulation when there are short-term abrupt changes in the actual values, indicating the best prediction performance.
Table 5
Season
|
MAE
|
MSE
|
RMSE
|
\({R^2}\)
|
Spring
|
0.2656
|
0.1153
|
0.3396
|
0.8375
|
Summer
|
0.2864
|
0.1310
|
0.3619
|
0.8468
|
Autumn
|
0.2673
|
0.1147
|
0.3386
|
0.8486
|
Winter
|
0.2477
|
0.1038
|
0.3222
|
0.8334
|
Table 5 presents the numerical values of four evaluation metrics corresponding to the four seasons. The MAE, MSE, and RMSE of the winter dataset are the lowest, at 0.2477, 0.1038, and 0.3222, respectively, while the\({R^2}\)of the autumn dataset is the highest, at 0.8486. The numerical values of MAE, MSE, and RMSE indicate that the overall prediction accuracy from highest to lowest is in the order of winter, autumn, spring, and summer. Winter experiences fewer cloudy days, relatively stable weather patterns, and abundant and stable sunlight. Conversely, summer exhibits significant weather fluctuations, more rainy days, and difficulties in accurately predicting cloud cover changes, which may lead to decreased output power of photovoltaic panels due to extremely high temperatures.
4.6.3 Comparison of step lengths
By categorizing according to time step lengths, the four datasets can be divided into predicting the next time point value every 4, 8, 12, or 16 time steps. Since the data are collected every 15 minutes in the dataset, these four datasets use data from the previous 1, 2, 3, or 4 hours to predict the next time point data.
Figure 12 presents a comparison of the prediction results for datasets with different time steps. Subplot (a) exhibits the highest overlap between actual values and predicted values, while subplots (b), (c), and (d) show varying degrees of deviation around the midday peak values.
Table 6
Errors in the step size dataset
Step size
|
MAE
|
MSE
|
RMSE
|
\({R^2}\)
|
4
|
0.1962
|
0.0616
|
0.2483
|
0.9297
|
8
|
0.2441
|
0.0976
|
0.3125
|
0.8598
|
12
|
0.2801
|
0.1212
|
0.3481
|
0.9097
|
16
|
0.2455
|
0.0942
|
0.3069
|
0.9272
|
Table 6 displays the error indicator data corresponding to different step lengths. Overall, when using data from the previous 4 time steps to predict the next time step, the MAE, MSE, RMSE, and\({R^2}\)are optimal, followed by using data from the previous 8 time steps, then 16 time steps, and finally 12 time steps. This is because in photovoltaic power generation forecasting, the operation of photovoltaic systems and weather conditions change minimally over short periods of time, and shorter time steps can more accurately capture the temporal correlation of the data. Longer time step models need to deal with more variables and uncertainties, which may lead to a decrease in prediction accuracy. As the prediction time step increases, errors may gradually accumulate, potentially significantly affecting the final prediction accuracy.
4.6.4 Comparison of models
In this subsection, various prediction models, including the proposed VMD-Attention-BiLSTM composite model, and baseline models such as the LSTM model, CNN model, and RNN model, for forecasting the daytime dataset. The time step is uniformly set to 8, while the remaining model hyperparameters are set to their respective optimal configurations.
Figure 13 illustrates the comparison of all models used in this section for predicting photovoltaic power generation on the dataset, which spans three consecutive days. Due to significant performance variations of the models at different time intervals, certain weather factors affect prediction accuracy. From the Fig., it can be observed that on the first day (samples 0–50), the CNN and RNN models predict values close to the ground truth in the morning, with none of the models predicting the peak value that appears at noon. In the afternoon, the prediction of each model is relatively close to the ground truth. On the second day (samples 51–110), overcast conditions in the midday result in insufficient sunlight and a decrease in power generation. The trend predicted by the proposed model in this paper is similar to the ground truth, while the other models still show clear weather predictions based on the morning trends of the second day. On the third day (samples 111–170), the predicted trends of all models are consistent, with slight numerical deviations.
Table 7
Model
|
MAE
|
MSE
|
RMSE
|
\({R^2}\)
|
Proposed
|
0.1123
|
0.0207
|
0.1438
|
0.8835
|
LSTM
|
0.2867
|
0.1274
|
0.3569
|
0.7910
|
CNN
|
0.1579
|
0.0520
|
0.2280
|
0.9258
|
RNN
|
0.2142
|
0.0787
|
0.2805
|
0.8956
|
Table 7 displays the performance metrics of prediction errors for each model. The proposed model exhibits the lowest MAE, MSE, and RMSE, with values of 0.1123, 0.0207, and 0.1438, respectively, while the CNN model shows the highest values, with an\({R^2}\)of 0.9258. From the perspective of MAE, MSE, and RMSE, the prediction accuracy decreases from our proposed model to the CNN model, RNN model, and LSTM model sequentially. The proposed model, which incorporates subsequence decomposition and weight allocation, effectively reduces prediction errors. In terms of fitting ability, the models rank from highest to lowest as CNN model, RNN model, our proposed model, and LSTM model. This indicates that the CNN model and RNN model exhibit higher short-term prediction fitting but lower long-term trend prediction ability compared to our proposed model.