Abstract
Accurately predicting solar power to ensure the economical operation of microgrids and smart grids is a key challenge for integrating the large scale photovoltaic (PV) generation into conventional power systems. This paper proposes an accurate short-term solar power forecasting method using a hybrid machine learning algorithm, with the system trained using the pre-trained extreme learning machine (P-ELM) algorithm. The proposed method utilizes temperature, irradiance, and solar power output at instant i as input parameters, while the output parameters are temperature, irradiance, and solar power output at instant i+1, enabling next-day solar power output forecasting. The performance of the P-ELM algorithm is evaluated using mean absolute error (MAE) and root mean square error (RMSE), and it is compared with the extreme learning machine (ELM) algorithm. The results indicate that the P-ELM algorithm achieves higher accuracy in short-term prediction, demonstrating its suitability for ensuring accuracy and reliability in real-time solar power forecasting.
Similar content being viewed by others
Introduction
With the increasing penetration of renewable energy into the traditional power grid, issues related to grid operation security have emerged. Therefore, accurate power forecasting for renewable sources such as solar and wind energy is essential. However, precise solar power forecasting remains challenging.
A large number of studies have been conducted on solar power forecasting in the past. Most of these studies utilize statistical analysis methods based on data-driven models to predict solar energy time series using historical measurement data1,2. Statistical forecasting requires establishing mathematical relationships among various influencing factors, such as load, time consumption, and the share of industrial output in total power generation, before a mathematical model can be employed for predictions. This entire process is time-consuming, often involving calibration and adjustment of the mathematical models. Artificial intelligence techniques, such as back propagation (BP) neural network algorithms3, multi-layer perceptron neural network (MLPNN) model, radial basis function neural network (RBFNN) neural network, recurrent neural network (RNN) neural network4,5,6, support vector machine (SVM) and adaptive network-based fuzzy inference system (ANFIS) hybrid models7,8, have been employed in solar power forecasting. The ELM algorithm has also been utilized for short-term power prediction9,10. The particle swarm optimization (PSO) was used to update the weights and biases of the ELM model, demonstrating superior performance compared to BP prediction models11. The fundamental ELM model randomly selects weights and bias matrices; however, improved ELM algorithms can yield better predictive performance12. Additionally, there are studies utilizing numerical weather prediction or satellite imagery to develop physical models for forecasting solar irradiance and PV power13,14. In practice, to meet decision-making needs, it is essential to consider different forecasting horizons when selecting an appropriate prediction method15.
Since solar output power primarily depends on meteorological factors, it exhibits significant uncertainty. The aim of this study is to further improve the accuracy of solar power prediction using machine learning algorithms. A hybrid P-ELM algorithm is used, integrating the persistence method and the characteristics of ELM for power forecasting Temperature, irradiance, and solar output power are used as input parameters, while the temperature, irradiance, and solar output power at the next instant serve as output parameters. Data is collected at 15-minute intervals, yielding 124 sets of temperature and irradiance measurements from a specific location as sample data. The maximum output power of the solar system is calculated based on the model in16. The performance of the P-ELM algorithm is evaluated in terms of mean absolute error (MAE) and root mean square error (RMSE). From the simulation results, the P-ELM algorithm provides the temperature, insolation and solar power output at the next instant, i.e., it predicts the temperature, insolation and solar power output values one day in advance. The performance is better than the persistence method and ELM algorithm, making is more suitable for the practical application of solar power forecasting. It mitigates the uncertainties caused by meteorological factors and can effectively enhance the security and stability of the power system.
In the short-term range, the proposed method combines the advantages of both the persistence method and the ELM algorithm. The simulations were conducted on an Intel(R) Core(TM) i7-7700HQ CPU at 2.8 GHz, with 16 GB RAM, running a 64-bit Windows 10 system. MATLAB 2014b was used as the simulation tool.
Extreme learning machine algorithm
The ELM algorithm is a type of single hidden layer feedforward neural network (SLFN), as shown in (Fig. 1). In this structure, the hidden layer does not require adjustment, and the input weights and biases can be arbitrarily specified, while the output weights are calculated analytically17. Unlike traditional single hidden layer neural network learning algorithms, ELM aims not only to minimize training error but also to achieve a minimal norm of the output weights. Its computational speed is hundreds to thousands of times faster than that of traditional neural networks, while also exhibiting universal approximation capability. The ELM algorithm flow is illustrated in (Fig. 2).
For a neural network, it is entirely possible to think of it as a function, which is much simpler in terms of inputs and outputs alone. As can be seen from the model structure of the algorithm in (Fig. 1), from left to right the input of the neural network is the training sample set x, in the middle is the hidden layer, and the hidden layer and the input layer are fully connected. So far the computation of ELM algorithm from input to output is shown below:
The samples are selected such that S samples form a matrix (Xj, Yj), j = 1,2,3 …S. where X is a p-dimensional input matrix and Y is a q-dimensional target matrix. First, initialize the weight matrix wi and bias matrix bi connecting the input layer, and set the number of hidden layer neurons to L, i = 1, 2,…, L .
Then, the activation function g(.) is selected to calculate the hidden layer output. The Sigmoid function is used as the activation function in this study, and the ELM output model is shown as:
where the parameter of the input weight vector \(w_{i} = [w_{{i1}} {\text{ }}w_{{i2}} {\text{ }}...{\text{ }}w_{{if}} ]^{T}\) is arbitrarily selected to connect the input node to the i-th hidden layer node; βi is the output weight vector connecting between the ith hidden layer node and the output node; and bi is the threshold value of the i-th hidden layer node. xj is the feature vector of the j-th sample, yj denotes the vector of dependent variables corresponding to the j-th dependent variable, and Y is the output of the neural network.
Equation (Eq.) (1) can be written in the following form18:
where
Finally, the output matrix of hidden layer weights is computed, that is, the least squares solution of this system14. The calculation formula is as:
According to the theory of the Moor-Penrose generalized inverse19, the output of weights matrix is:
Unlike traditional single hidden layer neural network learning algorithms, ELM aims not only to minimize training error but also to achieve a minimal norm of the output weights. Feedforward neural networks can achieve lower training errors, smaller weight norms, and enhanced network generalization performance. The ELM is designed to minimize both training errors and the norm of the output weights.
P-ELM algorithm
Persistence method
The persistence method assumes that the value at instant t + x remains consistent with the value at instant t; in other words, the persistence technique is based on the hypothesis of a high correlation between the current and future values. This method demonstrates higher accuracy in short-term and very short-term predictions compared to other forecasting methods. However, as the prediction time scale increases, the accuracy of the persistence method declines rapidly. The model for this method is presented:
P-ELM algorithm
The P-ELM algorithm, which combines the persistence method with the ELM algorithm, retains the simplicity and accuracy of the persistence method while incorporating the rapid learning and error minimization capabilities of the ELM algorithm.
The sample is described as \((X_{i} ,X_{{i + 1}} )_{{i = 1}}^{{S{\text{ - 1}}}} ,\begin{array}{*{20}c} {} \\ \end{array} i = 1,2, \cdots ,S,\)\(X_{i} \in R^{p} \begin{array}{*{20}c} {} \\ \end{array} X_{i} = \left[ {\begin{array}{*{20}c} {X_{{i1}} } & {X_{{i2}} } & \cdots & {X_{{i\left( {S - 1} \right)}} } \\ \end{array} } \right]^{T} ,X_{{i + {\text{1}}}} \in R^{p} ,\)
\(X_{{i + {\text{1}}}} = \left[ {\begin{array}{*{20}c} {X_{{\left( {i + {\text{1}}} \right){\text{2}}}} } & {X_{{\left( {i + {\text{1}}} \right){\text{3}}}} } & \cdots & {X_{{\left( {i + {\text{1}}} \right)S}} } \\ \end{array} } \right]^{T} ,\)
The vectors at instant i are used as inputs, the vectors at instant i + 1 are used as outputs, and the dimensionality of the input and output vectors coincides with p. The number of nodes in the hidden layer is L and the activation function is g(.). The mathematical model of the P-ELM can be described by:
where β is the output weight matrix connecting the hidden layer and the output layer, w is the input weight matrix connecting the input layer and the hidden layer, and b is the bias matrix. This can be expressed in the form of Eq. (2).
The matrix is given:
The target matrix is given:
The output weight matrix is shown in Eq. (6).
The P-ELM algorithm model structure is similar to the basic ELM algorithm model structure, as shown in (Fig. 3).
Simulation model description
PV array model description
The result of model predict is the output power of the PV system, and the PV generator is affected not only by solar irradiation, reflection, and temperature but also by the parameters and performance of the generator itself20. The PV array is the fundamental power conversion unit of the PV generator, exhibiting nonlinear characteristics and being expensive; and requires a lot of time to obtain its operating curves under various operating conditions. This paper employs the PV generator model based on a 100 W monocrystalline solar panel as a reference template, allowing the operational characteristics of the PV array to be applied under various operating conditions and physical parameters, with the model parameters summarized in (Table 1). Its maximum power point output can be expressed as:
Where η is the PV array conversion rate A is the area of the PV array, I is the daily irradiance, and te is the outdoor air temperature.
The maximum power point tracking (MPPT) technology is an essential part for improving the efficiency of PV systems, MPPT technology automatically identifies the voltage VR and current IR that maximize the operational efficiency of the PV array under given temperature and irradiation21,22, as illustrated in (Fig. 4).
Description of performance estimation
This paper employs different statistical analysis metrics, namely the MAE and the RMSE, as indicators for forecasting trend recognition and evaluates the performance of each computational method. The formulas for calculating these metrics are as follows:
where yj and tj are the measured and corresponding predicted values of solar output power; N is the number of sampling points.
Simulation and result analysis
The input parameters of the P-ELM structure include the outdoor air temperature t, daily irradiance I, and the maximum output power P of the photovoltaic array at instant i; the output parameters correspond to the outdoor air temperature t, daily irradiance I, and maximum output power P at instant i + 1. The test data is obtained from a photovoltaic array simulation model, comprising a total of 124 sets of data. The first 100 sets are utilized as training samples for the P-ELM algorithm, while the remaining 24 sets serve as testing samples.
For comparative analysis, the persistence algorithm, ELM algorithm, and P-ELM algorithm are utilized in this section. To verify the advantages, two-part experiments are conducted on the system: one is the experiment of solar power output prediction, and the other is the training and testing results of the ELM and P-ELM algorithms. Considering that the persistence algorithm did not have this training step, so the persistence algorithm did not conduct this experiment. The prediction results of the persistence method, ELM algorithm, and P-ELM algorithm on the test samples are shown in (Fig. 5). The MAE and RMSE are computed and listed in (Table 2 )to compare with the persistence method and ELM algorithm.
The training and testing results of the ELM and P-ELM algorithms are shown in (Figs. 6 and 7), respectively. (Table 3) is the ELM and P-ELM training time comparison table.
Solar output power prediction curve can be seen from (Fig. 5). Through the comparison of different prediction methods, the persistence algorithm and the ELM algorithm show a large discrepancy between the predicted fluctuation results and the actual output power curve, making the prediction inaccurate. In contrast, the PELM algorithm predicts fluctuations that are similar to the actual output curve, and the difference between the predicted power values and the actual power values is smaller compared to the ELM algorithm, indicating better performance. Combined with the statistical index data for solar output power prediction in (Table 2), it can be concluded that the combination of the persistence method and ELM proposed in this paper can better realize the tracking of power fluctuations and get better prediction results, and the prediction effect of this method is better.
From the training data curves of ELM prediction algorithm and P-ELM prediction algorithm in (Figs. 6 and 7), it can be seen the fluctuation of the testing output power curve and the fluctuation of the predicted output power curve are not significantly different according to the training results of the two algorithms. Analyzing the testing results, the ELM algorithm’s predicted output power curve shows large discrepancies compared to the testing output power curve, indicating poor prediction performance. In contrast, the P-ELM algorithm shows a predicted output power curve that closely follows the fluctuations in the testing output power curve, indicating better prediction accuracy. In summary, the P-ELM algorithm achieves better prediction results. The statistical metrics MAE and RMSE for the three prediction algorithms are shown in (Table 2). Since the weight and bias matrices in both the ELM and P-ELM algorithms are randomly assigned, the statistical metrics vary with each run. Here, data from five randomly selected runs are compared.
As can be seen from the data in (Table 2), the metrics of the persistence method are fixed and significantly worse than ELM and P-ELM algorithms. The P-ELM algorithm exhibits notably better performance metrics compared to the ELM algorithm, with an accuracy improvement by an order of magnitude. Therefore the prediction accuracy of P-ELM algorithm is better than the persistence method and ELM algorithm.
The five running time records of the ELM and P-ELM algorithms are shown in (Table 3). For training on 100 data samples, the running time of the ELM algorithm is slightly shorter than that of the P-ELM algorithm, both operating on the millisecond scale. This minimal difference indicates that the computational time has negligible impact on real-time performance, making both algorithms well-suited for short-term and very short-term prediction applications.
Simulation results show that the proposed P-ELM algorithm applied to solar power prediction can ensure the reliability and effectiveness of the real-time prediction system.
Conclusion
Accurate prediction of solar power is important to avoid customer penalties, build trust in energy markets, and rationalize power generation. Both mainstream deep learning and traditional learning methods use features based on simple phenomena; they only consider spatial or temporal features to bypass the nonlinearity of solar power series. However, some studies have combined different spatiotemporal feature extraction methods through a stacked layer mechanism. This paper proposes a hybrid intelligent algorithm that combines the advantages of persistence forecasting and machine learning algorithms. The proposed P-ELM method utilizes meteorological factors and the current output power as input conditions for the next-step prediction, preserving the high correlation between data across consecutive time steps. This approach enables accurate one-step-ahead predictions of temperature, daily irradiance, and output power. Due to the high accuracy of persistence methods for ultra-short-term predictions, the accuracy decreases as the sampling interval increases. Therefore, this approach is suitable only for short-term and ultra-short-term power forecasting applications. Additionally, P-ELM incorporates the high-speed training characteristic of the ELM algorithm, making it suitable for real-time short-term solar power output prediction.
Data availability
The datasets used and/or analysed during the current study available from the corresponding author on reasonable request.
References
Panamtash, H. et al. A very short-term solar power forecasting using a frequency incorporated deep learning model. IEEE Open. Access. J. Power Energy 10, 517–527. https://doi.org/10.1109/OAJPE.2023.3294457 (2023).
Mellit, A. et al. Deep learning neural networks for short-term photovoltaic power forecasting. Renew. Energy 172, 276–288. (2021).
Aslam, M. et al. Two-stage attention over LSTM with bayesian optimization for day-ahead solar power forecasting. IEEE Access 9, 107387–107398. (2021).
Zhang, Z. et al. Solar radiation intensity probabilistic forecasting based on K-means time series clustering and gaussian process regression. IEEE Access 9, 89079–89092. https://doi.org/10.1109/ACCESS.2021.3077475 (2021).
Li, Q. & Xu, Y. An integrated missing-data tolerant model for probabilistic PV power generation forecasting. IEEE Trans. Power Syst. 37, 4447–4459. https://doi.org/10.1109/TPWRS.2022.3146982 (2022).
Su, H. Y. & Tang, C. Dynamic-error-compensation-assisted deep learning framework for solar power forecasting. IEEE Trans. Sustain. Energy 13, 1865–1868. https://doi.org/10.1109/TSTE.2022.3156437 (2022).
Yue, H. & Ali, M. Ultra-short-term forecasting of large distributed solar PV fleets using sparse smart inverter data. IEEE Trans. Sustain. Energy 15, 1968–1980. https://doi.org/10.1109/TSTE.2024.3390578 (2024).
Yan, J. et al. Frequency-domain decomposition and deep learning based solar PV power ultra-short-term forecasting model. IEEE Trans. Ind. Appl. 57, 3282–3295. https://doi.org/10.1109/TIA.2021.3073652 (2021).
Zhou, H. & Wang, J. A. Two-stage method for ultra-short-term PV power forecasting based on data-driven. IEEE Access. 11, 41175–41189. https://doi.org/10.1109/ACCESS.2023.3267515 (2023).
Shi, J. et al. Bayesian optimization-LSTM modeling and time frequency correlation mapping based probabilistic forecasting of ultra-short-term photovoltaic power outputs. IEEE Trans. Ind. Appl. 60, 2422–2430. https://doi.org/10.1109/TIA.2023.3334700 (2023).
Zhen, Z. et al. Deep learning based surface irradiance mapping model for solar PV power forecasting using sky image. IEEE Trans. Ind. Appl. 56, 3385–3396. https://doi.org/10.1109/TIA.2020.2984617 (2020).
Jalali, S. M. J. & Ahmadian, S. Automated deep CNN-LSTM architecture design for solar irradiance forecasting. IEEE Trans. Syst. Man. Cybernet. Syst. 52, 54–65. (2021).
Ziyabari, S. & Zhao, Z. Multi-branch resnet-transformer for short-term spatio-temporal solar irradiance forecasting. IEEE Trans. Ind. Appl. 59, 5293–5303. https://doi.org/10.1109/TIA.2023.3285202 (2023).
Hong, Y. Y. & Martinez, J. J. F. Day-ahead solar irradiation forecasting utilizing gramian angular field and convolutional long short-term memory. IEEE Access. 8, 18741–18753. https://doi.org/10.1109/ACCESS.2020.2967900 (2023).
Mohamed, M. & Mahmood, F. E. Dynamic forecasting of solar energy microgrid systems using feature engineering. IEEE Trans. Ind. Appl. 58, 7857–7869. https://doi.org/10.1109/TIA.2022.3199182 (2022).
Obiora, C. N. & Hasan, A. N. Forecasting hourly solar radiation using artificial intelligence techniques. IEEE Can. J. Electr. Comput. Eng. 44, 497–508. https://doi.org/10.1109/ICJECE.2021.3093369 (2021).
Razavi, S. E. & Arefi, A. From load to net energy forecasting: short-term residential forecasting for the blend of load and PV behind the meter. IEEE Access 8, 224343–224353. https://doi.org/10.1109/ACCESS.2020.3044307 (2020).
Liang, J. & Tang, W. Ultra-short-term spatiotemporal forecasting of renewable resources: an attention temporal convolutional network-based approach. IEEE Trans. Smart Grid 13, 3798–3812. https://doi.org/10.1109/TSG.2022.3175451 (2022).
Jia, P. & Zhang, H. Short-term photovoltaic power forecasting based on VMD and ISSA-GRU. IEEE Access 9, 105939–105950. https://doi.org/10.1109/ACCESS.2021.3099169 (2021).
Liu, C. & Li, M. A review of multitemporal and multispatial scales photovoltaic forecasting methods. IEEE Access 10, 35073–35093. https://doi.org/10.1109/ACCESS.2022.3162206 (2022).
Abdel-Nasser, M. & Mahmoud, K. Reliable solar irradiance forecasting approach based on Choquet integral and deep LSTMs. IEEE Trans. Industr. Inf. 17, 1873–1881. https://doi.org/10.1109/TII.2020.2996235 (2020).
Bazionis, I. K. et al. An advanced hybrid boot- LSTM- ICSO-PP approach for day-ahead probabilistic PV power yield forecasting and intra-hour power fluctuation estimation. IEEE Access 12, 43704–43720. (2024).
Acknowledgements
This work was supported by Hunan Provincial Department of Education Youth Fund Project of China under Grant No. 23B0705, the Hunan Provincial Natural Science Foundation of China under Grant 2022JJ50202, the Shaoyang City science and technology innovation guiding project under Grant No. 2023ZD0061 and the Horizontal Project of Shaoyang University under Grant No. 2024hx22.
Author information
Authors and Affiliations
Contributions
Shuqi Shi wrote the entire text section and all computational data, while Boyang Liu, Long Ren, and Yu Liu prepared all the tables and revised all the figures. All authors reviewed the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Shi, S., Liu, B., Ren, L. et al. Short time solar power forecasting using P-ELM approach. Sci Rep 14, 30999 (2024). https://doi.org/10.1038/s41598-024-82155-7
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41598-024-82155-7









