Research on Hybrid Optimization Prediction Models for Photovoltaic Power Generation Under Extreme Climate Conditions
Abstract
1. Introduction
2. Common Photovoltaic Power Forecasting Methods Under Extreme Climate Conditions
2.1. Photovoltaic Power Forecasting Methods Under Sandstorm Conditions
2.1.1. Multi-Layer Feedforward Neural Network Prediction Model
2.1.2. Advantages and Disadvantages of Multi-Layer Feedforward Neural Network Prediction
2.2. Photovoltaic Power Forecasting Methods Under Rainstorm Conditions
2.2.1. Random Forest Prediction Model
- 1.
- For each training sample , its weight is initially set to , i.e., = . For the current decision tree , after training on all samples, if its prediction differs from the actual outcome, the overall error of the random forest increases. Initially, each sample carries equal error weight, but this weight evolves as the algorithm progresses.
- 2.
- For each decision tree, starting from the first one, repeat the following steps:
- (a)
- Calculate the error function:
- (b)
- Calculate the decision power of this decision tree:
- (c)
- Update Weight:
- 3.
- For each decision tree, a corresponding decision power is obtained, thereby enabling a more rational integration of decision trees into a random forest with superior predictive performance:
2.2.2. Advantages and Disadvantages of Random Forest Prediction
2.3. Photovoltaic Power Forecasting Methods Under Snowstorm Conditions
2.3.1. Long Short-Term Memory Network Prediction Model
2.3.2. Advantages and Disadvantages of Long-Short Term Memory Networks in Prediction
3. K-Means-Based GWO-LSTM Gray Wolf Optimization Prediction Model
3.1. Weather Classification Using the K-Means Clustering Algorithm
- 1.
- Initialize cluster centers by randomly selecting data points as initial cluster centers based on input parameters.
- 2.
- Calculate the Euclidean distance between each data point and the initial cluster centers, then assign each point to the nearest cluster center. The Euclidean distance formula is:Here, represents the data point, is the -th cluster center, is the dimension of the data, and and denote the values of and in the -th dimension, respectively.
- 3.
- For each cluster, recalculate its cluster center. The new cluster center is the mean of all data points within that cluster, calculated as:where is the set of data points in the -th cluster, and is the number of data points in that set.
- 4.
- Repeat the reassignment and update steps until the cluster centers no longer change significantly, meaning the distance between the new cluster centers and the old ones is less than a preset threshold.
3.2. GWO Gray Wolf Optimization Algorithm
- 1.
- Initialization: In GWO, to mathematically simulate the social hierarchy of wolves, the optimal solution is defined as to represent the position of the alpha wolf (first-order wolf). Consequently, the second and third optimal solutions are designated as and to represent the positions of second-order and third-order wolves, respectively. The remaining candidate solutions are designated as to represent the positions of subordinate wolves (fourth-order wolves). In the GWO algorithm, this hierarchical structure is implemented through fitness evaluation. Each iteration retains the top three solutions and , while other individuals update their strategies based on their positions to converge toward the optimal solutions.
- 2.
- Searching for prey: Gray wolves conduct searches based on the positions of alpha, beta, and delta wolves. They separate to locate prey and converge to attack it. To establish a discrete mathematical model, a random value is often used to force individual wolves to deviate from the prey, enabling GWO to perform global search. forces wolves to deviate from prey, aiming to locate stronger targets. Another component of GWO facilitating global exploration is , a random number within the range [0, 2]. This parameter assigns random weights to prey locations, amplifying (when ) or reducing (when ) the influence of prey positions on the wolves’ next movements.
- 3.
- Encircling prey: During the hunt, gray wolves surround their prey. To mathematically model this encircling behavior, the following equation is proposed:where denotes the current iteration count, and are coefficients, represents the prey’s position, and denotes the position of the gray wolf individual in the -th generation. and are calculated as follows:where and are random values in . To simulate prey approach, is a radom value in the interval , where a decreases from 2 to 0 during iteration.
- 4.
- Attacking Prey: Gray wolves possess the ability to identify prey locations and conduct coordinated hunts. These hunts are typically led by alpha wolves, with beta and delta wolves occasionally participating. The mathematical model describing an individual gray wolf’s tracking of prey positions is described as follows:where , and represent the distance between -wolf, -wolf and -wolf and other individuals, respectively; , and represent the current position of -wolf, -wolf and -wolf, respectively; and , and are the random numbers, is the current position of the gray wolf individual.where , and denote the adjusted positions of wolves as affected by wolves, wolves and wolves, respectively. Here the average value is taken, i.e.,The gray wolf’s position update method is shown in Figure 2.
3.3. LSTM Time Series
- 1.
- Memory Cell: As the core structural unit of LSTM, the memory cell realizes the dynamical separation and synergistic control of long and short-term memories through the gating mechanism. Its innovation lies in decoupling the storage and regulation of temporal information into two orthogonal dimensions: the cell state , which serves as a continuous memory channel through the time series and focuses on the long-period feature retention across the time steps; and the hidden state , which serves as a dynamic memory interface and focuses on the short-period feature extraction and contextual interactions in the current time step.
- 2.
- Forget Gate: As the core gating component in LSTM architectures, the forget gate dynamically regulates historical memory through a parameterized decay mechanism. Its mathematical essence involves multiplying the input from the previous time step by a ratio between [0, 1], thereby filtering out some older information. The space occupied by forgotten information is then made available for entirely new information.
- 3.
- Input Gate: The input gate determines how much new information to incorporate into the computational unit of long-term memory . Its mathematical essence involves multiplying all incoming information at the current time step by a ratio between [0, 1], thereby filtering out some new information and integrating the remaining new information into long-term memory .
- 4.
- Output Gate: The output gate is a computational unit that filters short-term information most relevant to the current time step from newly acquired long-term information. Its core function is to multiply pre-computed long-term information by a proportion between [0, 1], thereby selecting the most effective information for the current time step to inform its prediction.

3.4. GWO-LSTM Prediction Model
- 1.
- Data Preprocessing Module: Performs standardization, missing value imputation, and outlier handling on input multivariate time series data to ensure data quality meets LSTM modeling requirements. Through data normalization, all input variables are transformed to the same scale, thereby eliminating model sensitivity to differences in variable scales.
- 2.
- Gray Wolf Optimization Module (GWO): By simulating gray wolf hunting behavior and leveraging the characteristics of swarm intelligence, GWO performs global search and optimization of LSTM hyperparameters (such as learning rate, number of hidden layer units, etc.). GWO can rapidly identify optimal solutions across different parameter combinations, thereby enhancing the predictive performance of LSTM models. In the GWO-LSTM combined model, the fitness function is defined as:In the formula, , where denotes the number of hidden layer neurons, represents the learning rate, indicates the number of hidden layer neurons, signifies the Dropout rate, and denotes the L2 regularization coefficient.
- 3.
- LSTM Model Construction and Training Module: Utilize parameter configurations obtained through GWO optimization to build the LSTM model, establishing fundamental network structures such as input layers, hidden layers, and output layers. Employ the backpropagation algorithm for model training, implementing measures like gradient clipping to prevent gradient explosion or vanishing. The core components of an LSTM unit include the memory cell state and three gating structures. Its operational principle can be summarized as follows: the memory cell state from the previous time step and the hidden layer state are fed into the current time step unit. Combined with the current input sequence , these inputs undergo processing through the three gating structures to control information selection. This process calculates the current memory cell state and hidden layer state . Specifically: The forget gate controls the degree of historical information decay in the memory cell; The input gate determines how current input updates the memory cell state; The output gate modulates the influence of the memory cell state on the current hidden state output. The formulas for calculating the forget gate , input gate , output gate , and candidate memory cell state at time step are as follows:In the formula: , , , , , , , denote the weight matrices; , , , denote the biases.
- 4.
- Prediction and Visualization Module: Utilizes trained models to generate predictions for test data. Visualizes the model’s predictive performance through charts such as actual-versus-predicted value comparisons and error distribution plots, enabling assessment of accuracy and stability.The model flowchart is shown in Figure 4.
4. Case Study Analysis
4.1. Data Acquisition
4.2. Data Preprocessing
4.3. Pearson Correlation Coefficient Analysis
4.4. K-Means Clustering Analysis
4.5. GWO-LSTM Prediction Experiments
- 1.
- Without using clustering algorithms, whether it is BP, LSTM, RF or GWO-LSTM, the prediction performance of the prediction model is not ideal, and the prediction error is relatively large. This is because the actual power generation is also influenced by climate factors in different seasons, and the daylight hours and photovoltaic intensity are different in different seasons of the year, which greatly interferes with the training effect of the model. The introduction of the clustering algorithm significantly reduces the error coefficient, indicating that training the prediction model separately with the four different weather data obtained through clustering can effectively improve the accuracy of the final prediction.
- 2.
- In the case of snowstorms and rainstorms, the RMSE of RF is 0.20, −0.28, 0.49 and 0.43 lower than that of BP and LSTM, respectively, while in the case of normal weather, the RMSE of LSTM is 0.45 lower than that of RF, which indicates that the LSTM model performs better in more stable snowstorm data and performs worse than RF in rainstorm weather data with large fluctuations.
- 3.
- The GWO-LSTM prediction model showed stable performance in all indicators in the prediction experiment of this article, and the prediction effect was relatively ideal. Compared with the basic prediction models of BP, LSTM, and RF, which have fluctuations in RMSE under four different weather types, the experimental results demonstrate the effectiveness of the GWO-LSTM combined model for photovoltaic power prediction, further verifying that the GWO-LSTM model has higher prediction accuracy in extreme weather conditions and can perform photovoltaic power prediction well in different weather types, thus verifying the reliability of this experimental method.
5. Conclusions
- After analyzing and preprocessing the data, Pearson correlation analysis and K-means clustering were used to classify the data into four categories based on weather conditions. Training separate prediction models for each weather type effectively improved the accuracy of the predictions.
- The introduction of the gray wolf optimization algorithm to optimize the hyperparameters in the LSTM neural network automatically determines the optimal hyperparameters, avoiding the impact of hyperparameter setting errors on the experiment and further improving the prediction accuracy and model generalization capability.
- Through comparative experimental analysis with other prediction models, it was verified that the GWO-LSTM model proposed in this paper can effectively improve the accuracy of photovoltaic power generation power prediction under extreme weather conditions, providing a new reference for predicting photovoltaic power generation power.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Wang, L.; Li, C.; Liu, J.; Li, C. Short Term Photovoltaic Power Prediction Based on GRO-SSA-LSTM. J. Sol. Energy 2025, 46, 401–409. [Google Scholar] [CrossRef]
- Wang, S.; Li, H.; Ma, G.; Yuan, Y.; Bu, Q.; Ye, Z. Multistep Prediction Model for Photovoltaic Power Generation Based on Time Convolution and DLinear. Power Constr. 2025, 46, 173–184. [Google Scholar]
- Peng, S.; Chen, H.; Sun, W. Research on Photovoltaic Power Prediction Method Based on Improved LSTM. J. Sol. Energy 2024, 45, 296–302. [Google Scholar] [CrossRef]
- Wang, D.; An, Y.; Liao, C. Research on Photovoltaic Power Generation Prediction Method Based on CNN-LSTM Hybrid Neural Network. J. Xi’an Pet. Univ. (Nat. Sci. Ed.) 2024, 39, 129–134. [Google Scholar]
- Liu, Y.; Chen, Y. Short-Term Photovoltaic Power Forecasting Based on RF Feature Extraction and TCN-BiGRU Model. Chin. J. Sol. Energy 2025, 46, 682–689. [Google Scholar] [CrossRef]
- Liu, D.; Wang, W.; Zhang, H.; Li, G.; Xiao, G.; Zhang, B. Application of Medium- and Long-Term Electricity Forecasting and Dispatch Planning for Photovoltaic Power Based on Hidden Markov Model Correction. High Volt. Eng. 2023, 49, 840–848. [Google Scholar] [CrossRef]
- Wang, R.; Gao, Q.; Lu, J. Short-Term Photovoltaic Power Forecasting Based on the CEEMDAN-LSSVM-ARIMA Model. Sens. Microsyst. 2022, 41, 118–122. [Google Scholar] [CrossRef]
- Wu, Y.; Rong, W.; Guo, Y.; Ye, J. Short-Term Photovoltaic Power Forecasting Based on SVMD-IDBO-KELM. Chin. J. Sol. Energy 2025, 46, 271–279. [Google Scholar] [CrossRef]
- Chen, S.; Jiang, J.; Li, S. Review of Power Prediction Methods for Photovoltaic Systems Under Extreme Weather Conditions. Trans. Chin. Soc. Electr. Eng. 2025, 20, 281–290. [Google Scholar]
- Ye, L.; Pei, M.; Lu, P.; Zhao, J.; He, B. Short-Term Photovoltaic Power Combination Forecasting Method Based on Weather Sub-Types. Autom. Electr. Power Syst. 2021, 45, 44–54. [Google Scholar]
- Dong, B. Analysis of Distributed Photovoltaic Metering Power Prediction and Optimization. Electron. Technol. 2025, 54, 302–303. [Google Scholar]
- Lorenz, E.; Heinemann, D.; Kurz, C. Local and regional photovoltaic power prediction for large scale grid integration: Assessment of a new algorithm for snow detection. Prog. Photovolt. Res. Appl. 2012, 20, 760–769. [Google Scholar] [CrossRef]
- Levent, İ.; Şahin, G.; Işık, G.; van Sark, W.G. Comparative Analysis of Advanced Machine Learning Regression Models with Advanced Artificial Intelligence Techniques to Predict Rooftop PV Solar Power Plant Efficiency Using Indoor Solar Panel Parameters. Appl. Sci. 2025, 15, 3320. [Google Scholar] [CrossRef]
- Liu, J.; Fang, W.; Zhang, X.; Yang, C. An Improved Photovoltaic Power Forecasting Model With the Assistance of Aerosol Index Data. IEEE Trans. Sustain. Energy 2015, 6, 434–442. [Google Scholar] [CrossRef]
- Raman, R.; Mewada, B.; Meenakshi, R.; Jayaseelan, G.M.; Sharmila, K.S.; Taqui, S.N.; Al-Ammar, E.A.; Wabaidur, S.M.; Iqbal, A. Forecasting the PV power utilizing a combined convolutional neural network and long short-term memory model. Electr. Power Compon. Syst. 2024, 52, 233–249. [Google Scholar] [CrossRef]
- Chen, J.; Yang, J.; Zhai, Y.; Li, B.; Zeng, Q. Prediction of Ash Accumulation Degree of Photovoltaic Modules Based on Average Grayscale Value and Random Forest Algorithm. J. Sol. Energy 2024, 45, 107–114. [Google Scholar] [CrossRef]
- Jiang, M.; Ding, K.; Chen, X.; Cui, L.; Zhang, J.; Yang, Z.; Cang, Y.; Cao, S. Research on time-series based and similarity search based methods for PV power prediction. Energy Convers. Manag. 2024, 308, 118391. [Google Scholar] [CrossRef]
- Huang, M.; Xing, F.; Chen, X.; Lu, M. Short-Term Photovoltaic Power Forecasting Based on a Combined Al-gorithm of K-Means Clustering and Extreme Learning Machine. Hydro Power Energy Sci. 2024, 42, 217–220+216. [Google Scholar] [CrossRef]
- Mirjalili, S.; Mirjalili, S.M.; Lewis, A. Grey wolf optimizer. Adv. Eng. Softw. 2014, 69, 46–61. [Google Scholar] [CrossRef]
- Duan, B.; Ma, Y.; Liu, J.; Jin, Y. Nonlinear Grey Wolf Optimization Algorithm based on Chaotic Mapping and Reverse Learning Mechanism. Softw. Eng. 2023, 26, 36–40. [Google Scholar] [CrossRef]
- Li, C.; Yang, Y.; Song, J.; Zhang, X.; Xu, Q. Short Term Photovoltaic Power Generation Prediction based on IMVMD and BILSTM-SARIMA Combination Model in Station Area. J. Sol. Energy 2025, 46, 433–440. [Google Scholar] [CrossRef]
- Li, X.; Cao, L.; Li, Z.; Li, J.; Lv, X. Influence of Leakage from Buried Drainage Pipes on Shallow Soil Settlement and Urban Road Collapse. Nat. Hazards Rev. 2025, 26, 04025017. [Google Scholar] [CrossRef]
- Shi, H.; Guo, L.; Liu, Y.; Wang, C. Short-term forecasting of photovoltaic power based on total irradiance correction of multi-source meteorological forecast. Electr. Power Autom. Equip. 2022, 42, 104–112. [Google Scholar] [CrossRef]













| Season | Weather Type | Number of Days | Season | Weather Type | Number of Days |
|---|---|---|---|---|---|
| Spring | Normal weather | 90 | Autumn | Normal weather | 92 |
| Rainstorm weather | 13 | Rainstorm weather | 15 | ||
| Snowstorm weather | 7 | Snowstorm weather | 0 | ||
| Sandstorm weather | 18 | Sandstorm weather | 24 | ||
| Summer | Normal weather | 91 | Winter | Normal weather | 92 |
| Rainstorm weather | 3 | Rainstorm weather | 14 | ||
| Snowstorm weather | 0 | Snowstorm weather | 14 | ||
| Sandstorm weather | 31 | Sandstorm weather | 17 |
| Weather Type | Model Name | SSE | MAE | MSE | RMSE | MRE | |
|---|---|---|---|---|---|---|---|
| Normal weather | BP | 118.574 | 1.302 | 2.419 | 1.555 | 1.924 | 0.915 |
| LSTM | 81.951 | 0.688 | 0.763 | 0.873 | 0.132 | 0.926 | |
| RF | 37.418 | 1.137 | 1.672 | 1.293 | 1.954 | 0.955 | |
| GWO-LSTM | 14.845 | 0.465 | 0.302 | 0.550 | 0.150 | 0.970 | |
| Snowstorm weather | BP | 80.527 | 0.972 | 1.643 | 1.281 | 0.706 | 0.875 |
| LSTM | 57.219 | 0.543 | 0.625 | 0.791 | 0.851 | 0.897 | |
| RF | 30.673 | 0.797 | 1.167 | 1.081 | 0.309 | 0.930 | |
| GWO-LSTM | 14.826 | 0.413 | 0.302 | 0.550 | 0.267 | 0.947 | |
| Rainstorm weather | BP | 87.870 | 1.112 | 1.793 | 1.339 | 0.199 | 0.853 |
| LSTM | 80.255 | 1.094 | 1.637 | 1.279 | 0.180 | 0.856 | |
| RF | 35.729 | 0.724 | 0.729 | 0.853 | 0.112 | 0.904 | |
| GWO-LSTM | 21.657 | 0.593 | 0.441 | 0.664 | 0.087 | 0.922 | |
| Sandstorm weather | BP | 69.130 | 0.491 | 0.507 | 0.712 | 0.164 | 0.861 |
| LSTM | 44.551 | 0.728 | 0.909 | 0.953 | 0.243 | 0.881 | |
| RF | 24.879 | 0.853 | 11.410 | 1.187 | 0.178 | 0.920 | |
| GWO-LSTM | 14.356 | 0.422 | 0.292 | 0.541 | 0.123 | 0.931 | |
| Unclustered weather | BP | 94.145 | 2.871 | 3.218 | 1.794 | 1.629 | 0.826 |
| LSTM | 103.837 | 2.489 | 2.981 | 1.726 | 0.892 | 0.815 | |
| RF | 59.198 | 2.212 | 2.436 | 1.560 | 0.415 | 0.880 | |
| GWO-LSTM | 37.028 | 1.918 | 2.189 | 1.479 | 0.319 | 0.893 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhang, H.; Zheng, J.; Wang, D.; Xue, F.; Zhu, J.; Zou, W. Research on Hybrid Optimization Prediction Models for Photovoltaic Power Generation Under Extreme Climate Conditions. Electronics 2025, 14, 4475. https://doi.org/10.3390/electronics14224475
Zhang H, Zheng J, Wang D, Xue F, Zhu J, Zou W. Research on Hybrid Optimization Prediction Models for Photovoltaic Power Generation Under Extreme Climate Conditions. Electronics. 2025; 14(22):4475. https://doi.org/10.3390/electronics14224475
Chicago/Turabian StyleZhang, Haomin, Jie Zheng, Daoyuan Wang, Fei Xue, Jizhong Zhu, and Wei Zou. 2025. "Research on Hybrid Optimization Prediction Models for Photovoltaic Power Generation Under Extreme Climate Conditions" Electronics 14, no. 22: 4475. https://doi.org/10.3390/electronics14224475
APA StyleZhang, H., Zheng, J., Wang, D., Xue, F., Zhu, J., & Zou, W. (2025). Research on Hybrid Optimization Prediction Models for Photovoltaic Power Generation Under Extreme Climate Conditions. Electronics, 14(22), 4475. https://doi.org/10.3390/electronics14224475
