Next Article in Journal
Optimal Design and Cost–Benefit Analysis of a Solar Photovoltaic Plant with Hybrid Energy Storage for Off-Grid Healthcare Facilities with High Refrigeration Loads
Previous Article in Journal
Research on Flexible Operation Control Strategy of Motor Operating Mechanism of High Voltage Vacuum Circuit Breaker
Previous Article in Special Issue
Optimal Distribution Planning of Solar Plants and Storage in a Power Grid with High Penetration of Renewables
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

LSTM-Based Prediction of Solar Irradiance and Wind Speed for Renewable Energy Systems

by
Ahmed A. Alguhi
* and
Abdullah M. Al-Shaalan
Department of Electrical Engineering, College of Engineering, King Saud University, Riyadh 12372, Saudi Arabia
*
Author to whom correspondence should be addressed.
Energies 2025, 18(17), 4594; https://doi.org/10.3390/en18174594
Submission received: 23 July 2025 / Revised: 20 August 2025 / Accepted: 26 August 2025 / Published: 29 August 2025

Abstract

Renewable energy systems like solar and wind power are the main source of sustainable energy production; however, their intermittent nature produces challenges for grid integration, so they require realistic forecast models. This study developed a Long Short-Term Memory (LSTM) neural network model to predict solar irradiance and wind power over a 24 h horizon using a 240 h (10-day) dataset. The dataset, being hourly measurements of solar irradiance (W/m2) and wind speed (m/s), was divided and normalized into 193 sequences of 24 h each, with 80% for training and 20% for validation. Two LSTM models, each consisting of 100 hidden units, were trained using the Adam optimizer to predict the next 24 h for each of the variables using forget, input, and output gates to capture temporal dependencies. The results have shown that the model accurately forecasted solar irradiance with a clear day–night cycle, while forecasts of wind speed revealed higher variability, although the PV system was better than the wind system due to low wind speeds. The results reveal that the LSTM model can effectively predict renewable energy output by predicting the wind speed and Solar Irradiance, which are the main parameters that control the output power of wind turbines and PV power, respectively.

1. Introduction

Nowadays, the renewable energy sources (RES) like wind-based DGs and PV-based DGs are being widely integrated into the distribution power system, but due to the intermittent nature of these RES, they necessitate robust predictive models to efficiently manage their inherent variability and intermittency. Accurate forecasting of solar irradiance and wind speed is essential for power system optimal operation and balance between supply and demand of energy. Many studies have demonstrated that using an appropriate prediction methodology would significantly enhance forecasting accuracy by leveraging historical data and advanced algorithms. Hui et al. emphasized that precise short-term prediction would enable the optimization of reserve capacities and dispatch decisions [1]. Chen and Xu further maintained that precise prediction is essential given the variability characteristics of renewable energy that encroach on successful grid integration and power scheduling [2]. Solar irradiance and wind speeds make predictive modeling complicated, given the compounding impact of their variability on undermining power generation stability [3]. The stochastic and intermittent nature of solar irradiance and wind speed is perhaps one of the largest hindrances in forecasting them. Wang and Wu note that prediction algorithms for such a time series can be categorized into three types, dependent on their non-linear characteristics, thus posing difficulties for the prediction model [4]. In addition, a sophisticated statistical method like the Kalman filter and autoregressive models is particularly appropriate to correct prediction errors in wind speed forecasts. A robust Kalman filter has been effectively applied in one-step-ahead wind speed forecasting by Zuluaga et al. with the inclusion of preprocessing for outlier detection [5]. The Hammerstein Auto-Regressive model developed by Maatallah et al. also showed excellent performance in recursive forecasting of wind speeds with minimal root mean square errors (RMSEs) [6]. However, in the recent machine learning innovation model for renewable energy forecasting, particularly for solar irradiance and wind speed, models such as ARIMA (Autoregressive Integrated Moving Average), GWO-LSSVM (Grey Wolf-Optimized Least-Squares Support Vector Machine), and their hybrid variants have emerged as potent tools [7,8,9]. Each of these methodologies possesses unique advantages rooted in statistical properties and optimization techniques. Additionally, models such as the GWO-LSSVM have proven effective in predicting solar irradiance, showcasing the flexibility and effectiveness of machine learning approaches in energy forecasting [10]. The union of different modeling approaches, discussed by Dong et al., illustrated the advantages of combining traditional statistical techniques with contemporary machine learning in an attempt to enhance the precision of forecasting solar irradiance and wind speed [11]. In the field of solar irradiance prediction, a number of studies stress the application of machine learning methods because of their capability in handling intricate datasets. For instance, the study by Tanaka and Takahashi addresses the effectiveness of Support Vector Machines (SVMs) for multi-point solar irradiance predictions and admits the computational expenses involved in them [12]. Approaches such as the probabilistic forecasting by conditioning joint probability methods, like the ones proposed by Kakimoto et al., are very promising with respect to merging numerical weather prediction data and measured irradiance data in order to produce more precise forecasts [13]. Moreover, new hybrid models combining statistical techniques and artificial neural networks, such as the cooperative Multi-Input Multi-Layer Perceptron Networks introduced by Madhiarasan et al., enhance forecasting ability through the integration of various meteorological parameters [14]. The hybrid models not only increase the precision of forecasting but also support the dynamic nature of solar irradiance and wind speed, emphasizing the importance of flexibility in model creation. As long as there are innovations in data analytics and processing technologies, the area of one-day-ahead prediction of solar irradiance and wind speed is rapidly evolving. The latest advancements in machine learning have led to the development of sophisticated algorithms that improve prediction; for example, Benti et al. outlined that machine learning techniques can effectively manage and forecast renewable energy outputs by reducing uncertainties associated with variability [15]. Therefore, various models, including Artificial Neural Networks (ANNs), Long Short-Term Memory (LSTM) networks, and hybrid ensemble models, have been employed to address the non-linear and complex trends in meteorological data [16,17,18]. Moreover, novel algorithms such as the Hilbert–Huang Transform and machine learning have been extensively studied. For instance, the use of LSTMs is promising in sequential data processing, enabling better solar irradiance forecasting [19]. LSTMs have increasingly been utilized as they are capable of learning temporal dependencies, which is essential in renewable energy forecasting [20].
Despite the diversity of forecasting methods, there are several gaps that remain unaddressed in the previous literature. First, most of these studies focus only on either solar irradiance or wind speed prediction, overlooking the combined forecasting challenges when both RES sources are modeled simultaneously at the same location in order to find the optimal renewable resource at this location. This makes it harder to use these kinds of models in real-world hybrid renewable systems. Second, many traditional approaches either require large datasets for training or rely on computationally intensive algorithms, which may not be practical for smaller utilities or regions with limited meteorological data. Furthermore, although machine learning methods like SVM, ARIMA, and hybrid models have demonstrated improved accuracy, they often lack adaptability to changing atmospheric conditions and fail to capture long-term temporal dependencies effectively.
In contrast, this study proposed a unified dual forecasting framework using two separate LSTM models designed for both solar irradiance and wind speed prediction. This model was specifically designed to handle limited-data scenarios by taking advantage of LSTM’s ability in learning temporal patterns and their robustness in modeling sequential data. This study addresses both prediction tasks using LSTMs simultaneously, while maintaining high accuracy with limited input data, which makes it a significant step forward in RES forecasting research. Therefore, this study fills this gap by proposing two separate LSTM networks to simultaneously forecast solar irradiance and wind speed for the next 24 h, using 240 h of data and 100 hidden layers alongside the Adam optimizer. The combination of dual forecasting methods, by means of observation from daily patterns and wind variability, acts novelly by increasing accuracy under data constraints, giving new insight into network integration, and, in turn, helps pave the way for adaptive forecasting innovations in RES.
The main contributions of this paper are as follows:
  • This research has presented a novel dual-forecasting approach by using two LSTM models to predict solar irradiance and wind speed. This framework supports more effective integration of renewable energy resources into the grid by addressing the forecasting challenges of hybrid RES systems.
  • This study has provided efficient short-term prediction by using 100 hidden units and the Adam optimizer; the models achieve high accuracy with a small dataset, ideal for limited data scenarios.
  • This study has demonstrated practical insights into the model accuracy by capturing solar day–night cycles and wind variability, which suggest a more reliable renewable resource at the studied location.
  • Providing real-time applicability by predicting the 24 h horizon, which enables practical and real-time applications in power system planning and operation. The inherent temporal learning ability of LSTM networks enhances the reliability of grid management and decision-making processes.
  • This study encourages exploration of adaptive LSTM models and hybrid approaches for improved forecasting precision.

2. Modelling and Research Design

Accurate prediction of wind speed and solar irradiance is essential for integrating renewable energy sources into power systems, enabling efficient generation planning and grid stability. Traditional statistical methods struggle with the nonlinear, time-dependent nature of these variables, prompting the use of advanced AI techniques. LSTM networks, which are a subset of recurrent neural networks (RNNs), excel at modelling sequential data with long-term dependencies, making them ideal for 24 h forecasting of wind speed and solar irradiance [21,22].

2.1. LSTM Model

LSTM is a robust tool used for time series forecasting as it can learn long-term dependencies in sequential data because it has a memory function, which can correlate information regarding time series, identify the features, and apply long-term learning, as illustrated in Figure 1.
The LSTM model used to predict wind speed and solar irradiance in this study consists of an input layer, a hidden layer with LSTM cells, and an output layer, as shown in Figure 2.
The input at each time step t, denoted as x t , is a 2 × 1 vector containing the normalized values of wind speed and solar irradiance at time t. The hidden layer processes the input sequence x 0 , x 1 , x 2 , . , x t (where t ranges from 0 to 23 for a 24 h sequence) and maintains a hidden state h t and cell state C t , with both dimensions equal to the number of hidden units. The LSTM cell uses three gates—the forget gate, input gate, and output gate—to control the flow of information through thdonee network, as described below:
1.
Forget gate: The forget gate f t determines how much of the previous cell state C t 1 to retain or discard. It is computed as:
f t = σ W f h t 1 , x t + b f
where h t 1 is the hidden state at the previous time step, x t is the current input, W f and b f are the weight matrix and bias for the forget gate, and σ is the sigmoid activation function (outputting values between 0 and 1). A value of 0 means forgets completely, while 1 means retain completely.
2.
Input Gate: The input gate consists of two parts: the input gate activation i t , which decides how much new information to add, and the candidate cell state C t ~ which proposes new information. These are computed as:
i t = σ W i h t 1 , x t + b i
C t ~ = t a n h W C h t 1 , x t + b C
where W i , b i , W C , and b C are the weight matrices and biases for the input gate and candidate cell state, respectively. The tanh function outputs values between −1 and 1, representing the new information to be added.
3.
Cell State Update: The cell state C t , is updated by combining the retained information from the previous cell state (via the forget gate) and the new information (via the input gate and candidate cell state):
C t = f t . C t 1 + i t . C t ~
4.
Output Gate: The output gate o t determines what parts of the cell state to output as the hidden state h t . It is computed as:
o t = σ W o h t 1 , x t + b o
h t = o t . t a n h ( C t )
where W o and b o are the weight matrix and bias for the output gate. The hidden state h t is then passed to the next step and used to produce the output.
The output of the LSTM at each time step, S t , is a sequence of hidden states h t , which is passed through a fully connected layer to produce the predicted values y t for each time step (a 1 × 24 vector for each variable).

2.2. LSTM Model Implementation

The prediction process involves five key steps: data preparation, LSTM network definition, training, prediction, and evaluation. Each step is detailed as follows:

2.2.1. Data Preparation

The raw data, a 240 × 2 matrix, is loaded into MATLAB R2023a, where the first column is wind speed and the second column is solar irradiance. The data size is verified to ensure that it has 240 rows and 2 columns. To enhance LSTM training performance, the data is normalized to the range [0, 1] using min–max normalization, as in (7):
X n o r m = X X m i n X m a x X m i n
The time series is segmented into sequences using a sliding window approach. In this study segment, we used 240 hourly data with a sequence length of 24 h (past data) and a prediction length of 24 h (future data), and the total number of sequences is calculated as 240 − 24 − 24 + 1 = 193 sequences. This accounts for the number of valid starting positions where a 24 h input can be paired with a 24 h output without exceeding the dataset’s bounds. These sequences are split into 154 sequences for training (80% split) and 39 for validation (20% split) to ensure robust generalization. This is a reasonable number of sequences for training an LSTM.
It is worth mentioning that the total number of sequences is determined by how many times the window can slide across the dataset without running out of data.
The last possible starting position is when the input begins at hour 193. The overall sequences are predicted as follows:
  • First sequence: Input = hours 1 to 24, Output = hours 25 to 48.
  • Second sequence: Input = hours 2 to 25, Output = hours 26 to 49.
  • Last sequence: Input = hours 192 to 215, Output = hours 216 to 240.
  • Total sequences = 193 (from hour 1 to hour 192 as starting points).
  • The +1 in the formula accounts for including both the first and last possible starting positions in the count. Without it, it would undercount by one sequence.
Therefore, each sequence uses 24 h of past data (sequence Length = 24) as input to predict the next 24 h (prediction Length = 24). For each sequence:
  • Input: A 2 × 24 matrix containing normalized wind speed and solar data over 24 time steps.
  • Output: 1 × 24 vectors representing the next 24 h of wind speed and solar irradiance, respectively.
The wind speed and solar irradiance data were obtained from the Al Jouf College of Technology Station weather monitoring station, Saudi Arabia, which is sponsored by King Abdullah City for Atomic and Renewable Energy (K.A. CARE). Ten days, i.e., 240 h, of data for wind speeds and solar irradiances were used.

2.2.2. Define the LSTM Network

Two separate LSTM networks are designed for sequence-to-sequence regression: one for wind speed prediction and one for solar irradiance. Each network consists of:
  • Sequence input layer: accepts 2 features (wind speed and solar) over 24 time steps for each 193 sequences.
  • LSTM layer: contains 100 hidden units to learn temporal patterns and output a prediction for each time step. This size was selected after testing a range (50, 100, 150, and 200), where 100 units achieved validation for RMSE, balancing model capacity and computational efficiency for the 240 h dataset’s 10-day span. Fewer units (e.g., 50) underfit the daily cycles, while more (e.g., 150) increase the overfitting risk with limited data.
  • Fully connected layer: maps the LSTM output to one value per time step, producing a 1 × 24 sequence, aligning the prediction horizon with the input sequence length
  • Regression layer: computes the loss for continuous predictions.
This architecture ensures the network predicts a 2 h profile aligned with the input sequence length.

2.2.3. Training the Network

The networks are trained using the Adam optimizer, selected for its adaptive learning rate, fast convergence, and robustness in handling the complex temporal dependencies of LSTM models [23,24]. Adam updates the parameter θ, which is the weight of LSTM, using the following steps:
  • Compute the gradient using (8) at time step t
g t = θ l o s s ( θ t )
2.
Update the first moment by moving average of gradients using (9)
m t = β 1 m t 1 + ( 1 β 1 )   g t
where β 1 is the decay rate for the first moment and is equal to 0.9 in this study.
3.
Update the second moment by moving average of squared gradients using (10)
v t = β 2 v t 1 + ( 1 β 2 )   g t 2
where β 2 is the decay rate for the second moment and is equal to 0.99 in this study.
4.
Apply bias correction to account for initialization at zero using (11) and (12)
m t ^ = m t 1 β 1 t
v t ^ = v t 1 β 2 t
5.
Update parameters θ using (13)
θ t + 1 = θ t α m t ^ v t ^ + ϵ
where the learning rate is equal to 0.01 in this study and ϵ is a small constant to prevent division by zero ϵ = 10 8 .
The following training options were used:
  • Maximum epoch: 50
This allows the model to iterate over the training sequences multiple times, ensuring it learns complex patterns like daily wind speed and solar cycles. With a mini-batch size of 32, each epoch consists of ⌈193/32⌉ = 6 iterations, resulting in 6 × 50 = 300 total iterations.
  • Mini-batch size: 32
A mini-batch size of 32 balances computational efficiency and gradient accuracy, providing 6 updates per epoch. This size is a common choice in deep learning, fitting well into memory and allowing frequent weight updates for faster convergence.
  • Initial learning rate: 0.01
An initial learning rate of 0.01 is suitable for Adam, as its adaptive nature adjusts the effective step size. The learning rate is reduced by a factor of 0.2 every 25 epochs α e = 0.01 × 0.2 e 125 , dropping to 0.002 at epoch 25. This schedule allows for fine-tuning in later stages, as the model approaches convergence.
  • Gradient threshold: 1
A gradient threshold of 1 prevents exploding gradients by clipping the gradient norm: if g t > 1 , then g t = g t × 1 g t . This ensures numerical stability during backpropagation through 24 time steps.
The wind speed model is trained with training predictors and responses, while the solar model uses the same predictors. Training progress is visualized to monitor loss reduction, ensuring convergence.
The selection of the above parameters (i.e., the number of LSTM hidden units, learning rate, maximum epoch, and batch size) was guided by a balance between empirical testing and established practices in LSTM-based forecasting tasks. The choice of 100 hidden units was validated by testing a range of sizes (50, 100, 150, and 200), where 100 hidden units provide sufficient capacity to capture daily temporal dynamics without leading to overfitting, which is particularly important due to the limited dataset size. The initial learning rate of 0.01 was selected due to its stability and effectiveness with the Adam optimizer, enabling efficient and robust convergence. The 50-epoch limit was determined by monitoring validation loss, which indicates sufficient learning of daily wind and solar patterns without excessive computation, aligning with the dataset’s limited temporal scope. A mini-batch size of 32 was adopted to balance computational efficiency and gradient accuracy by providing 6 updates per epoch, which outperformed smaller (16) and larger (64) sizes in preliminary trials; therefore, the mini-batch size of 32 offers a practical trade-off between training speed and generalization performance, being small enough to allow frequent weight updates while large enough to ensure stable gradient estimates. These hyperparameter settings were confirmed through convergence behavior and loss curve analysis in preliminary trials, where alternative configurations (e.g., 50 hidden units, batch sizes of 16 or 64) resulted in slower convergence.

2.2.4. Make Predictions

A test sequence (2 × 24) is selected from the test set. The trained models predict the next 24 h:
  • Normalized predictions are generated using predictions.
  • These are denormalized to the original scale.
  • This yields the 24 h wind speed and solar irradiance profiles.

2.2.5. Evaluate the Model

Model accuracy is assessed by comparing predictions to last actual test values by using root mean squared error (RMSE) and the training loss over the entire dataset using (14) and (15), respectively:
R M S E = 1 24 t = 1 24 ( P r e d i c e d t a c t u a l t ) 2
L o s s e p o c h = 1 N × 24 j = 1 N i = 1 24 ( P r e d i c e d j t a c t u a l j t ) 2
where N is the number of training sequences
These two metrics were selected due to their wide acceptance in time series forecasting applications and their effectiveness in evaluating model performance for renewable energy datasets. Although additional metrics such as MAE, MAPE, or R-squared could offer further insight, RMSE and loss were considered sufficient for assessing the model’s predictive capability within the scope of this study.

2.3. Renewables Output Power Model

Solar irradiance and wind speed are the primary parameters that determine the output of photovoltaic (PV) systems and wind turbines, respectively. The predicted output power of PV and wind turbines is determined as follows [25]:

2.3.1. PV Output Power Modeling

The predicted per unit PV generation power at solar irradiance P P V s can be calculated using (16). Table 1 presents the data parameters for the PV and the necessary solar irradiance data utilized in this study.
P P V s = s 2 s S T D × r C                           for   0 < s < r C s s S T D                           for   r C s < s S T D 1   p . u                               for   s > s S T D

2.3.2. Wind Turbine Output Power Modeling

Like PV, the predicted per unit wind turbine generation power at wind speed P w i n d v can be found from (17). Table 2 presents the data parameters for the wind turbine and the necessary wind speed data utilized in this study.
P w i n d v = 0                         0 < v < v i n   and   v > v o u t v v i n v r v i n ,                       v i n < v < v r 1   p . u                           v r < v < v r  
Figure 3 presents a comprehensive flowchart presenting the methodology used in this study for the forecasting of solar irradiance and wind speed using LSTM networks.

3. Results

3.1. Wind Speed Prediction Results

The LSTM model’s performance in predicting 24 h wind speed is assessed through its training progress and the accuracy of its predictions compared to actual data. The training progress provides insight into the model’s learning behavior, while the prediction results highlight its practical utility for wind power forecasting in power systems.

3.1.1. Training Progress Analysis for Wind Speed Prediction

Figure 4 shows that the training results reveal that the LSTM model required an extended learning phase before reaching convergence, as evidenced by the RMSE and loss in this figure. Initially, the RMSE started at around 0.35 due to the random initialization of weights, and over the span of 300 iterations, the value gradually decreased until it stabilized between 0.10 and 0.15 after 250 iterations. This extended convergence time is a result of the accurate nature of the wind speed data that is witnessed at the site, which likely has low variability that necessitates finer tuning of the model parameters. The steady and smooth decline in both RMSE and loss, with minimal fluctuations between them, confirms the fact that the model refined its estimates of the parameters properly by reducing the error sufficiently. A gradual convergence is expected if the underlying data is stable and less volatile, which provides the LSTM with ample opportunity to learn even the subtle trends and interrelations over the extensive training duration. The model did eventually settle into a plateau, which suggested diminishing returns from further iterations. The training process overall succeeded in capturing the dynamics inherent in the stable wind speed data.

3.1.2. Prediction Results Analysis for Wind Speed Prediction

Figure 5 presents the wind speed prediction results. The top graph shows 240 h of historical wind speed data in blue. However, the bottom graph shows the 24 h prediction of wind speed, comparing the actual wind speed (upper subplot) with the LSTM model’s predictions (lower subplot).
The historical data exhibits significant variability, with wind speeds ranging from 2 m/s to 8 m/s over 240 h, reflecting the stochastic nature of wind patterns. The 24 h prediction period captures a range of conditions, including a peak around 7 m/s at hour 18 and a dip to 1 m/s around hour 21. The predicted values closely follow the general trend of the actual data, accurately capturing the overall shape of the wind speed profile, such. This indicates that the model effectively learns the long-term trends in wind speed data. The forecasted values display a noticeably smoother profile compared to the actual data, which is a common characteristic of LSTM forecasts when dealing with stable and less erratic inputs. This smoothing effect may result in underestimating short-term fluctuations, such as sudden gusts or abrupt changes that are naturally present in wind speed data. The consistency in the pattern, paired with the slight smoothing of peaks and troughs, suggests that while the model is proficient in mimicking long-term trends, it requires further refinement to capture the finer and high-frequency variations. Enhancements like incorporating additional relevant meteorological variables and experimenting with more complex models, like stacked LSTMs or attention mechanisms, or using hybrid forecasting methods might help mitigate the smoothing issue and improve short-term accuracy.

3.2. Solar Irradiance Prediction Analysis

The LSTM model’s performance in predicting 24 h solar irradiance is evaluated through its training progress and the accuracy of its predictions compared to actual data. This analysis highlights the model’s ability to forecast solar power generation, a key factor in optimizing renewable energy integration in power systems.

3.2.1. Training Progress Analysis for Solar Irradiance Prediction

Figure 6 illustrates the training progress of the LSTM model for solar irradiance prediction over 300 iterations (50 epochs, with 6 iterations per epoch). The top graph shows the smoothed training RMSE in blue, and the bottom graph shows the training loss in orange. The RMSE drops sharply from 0.5 to 0.055 within the first 30 iterations (approximately 5 epochs), indicating rapid learning of the dominant patterns in solar irradiance data, such as the diurnal cycle driven by solar position. After this initial phase, the RMSE continues to decrease gradually, stabilizing at around 0.05 to 0.055 by the 300th iteration, suggesting effective convergence. The loss mirrors this trend, falling from 0.15 to below 0.01 within 30 iterations and stabilizing around 0.002, confirming that the model converges with minimal overfitting. The training progress of LSTM is notably efficient, reflecting the more structured nature of solar irradiance data compared to wind speed.
The smoother convergence compared to wind speed training may be attributed to the more predictable, periodic nature of solar irradiance, which lacks the stochastic variability of wind speed.

3.2.2. Prediction Results Analysis for Solar Irradiance Prediction

Figure 7 presents the solar irradiance prediction results. The top graph shows 240 h of historical solar irradiance data in blue, with the 24 h prediction period as shown in lower subplot in Figure 7. The historical data exhibits the expected diurnal pattern, with peaks around 800–1000 W/m2 during midday and zero values at night, which reflects the solar elevation cycles. The 24 h prediction period captures a single day, with irradiance rising from 0 W/m2 at hour 24 (midnight) to a peak of approximately 900 W/m2 around hour 12 (noon), then declining back to 0 W/m2 by hour 24. The predicted values closely match the actual data, accurately capturing the bell-shaped curve of solar irradiance. The peak is predicted slightly, underestimating the actual peak, which indicates high predictive accuracy. The model performs particularly well during the rising and falling phases with minimal deviation from the actual data. The slight underestimation at the peak suggests that the model may struggle with capturing the maximum intensity of solar irradiance. However, the overall alignment with the actual data highlights the model’s ability to predict solar irradiance effectively.

4. Discussion

In this study, it is important to note that the dataset used comprises 10 consecutive days (240 h) of real-world measurements for solar irradiance and wind speed at a specific location (Al Jouf, Saudi Arabia). While this sample period does not capture long-term seasonal variations, it includes representative daily and intra-day variability typical of the local weather conditions. The primary objective of this study is to evaluate the local performance and stability of solar and wind energy resources using a lightweight LSTM-based forecasting framework. This focus supports informed decision-making on the preferred renewable resource in regions where long-term meteorological data may be unavailable. Nevertheless, future work may incorporate extended datasets to evaluate model adaptability across broader climate patterns.
The LSTM model demonstrated strong performance in predicting 24 h solar irradiance and wind speed, as evidenced by its rapid convergence during training and the close alignment of predicted values with actual data. The low training RMSE and loss indicate that the model effectively captures the diurnal cycle of solar irradiance and wind speed, which is essential for optimizing solar and wind power generation and ensuring grid stability. Model efficiency supports its practical power system applications. Compared to wind speed predictions, the solar irradiance model exhibits smoother convergence and higher accuracy, reflecting the more deterministic nature of solar data.
The performance of the LSTM models for both wind speed and solar irradiance prediction was evaluated by comparing predicted values against actual data for a 24 h test period. Figure 8 illustrates the prediction accuracy, showing actual and predicted values within the same coordinate system for improved visual clarity. The LSTM model’s 24 h wind speed and solar irradiance predictions in this figure, when compared to the last 24 h (hours 216–240 of a 240 h dataset), reveal its capability to forecast renewable energy variables, though with distinct performance differences between the two. For wind speed, the model captures the general trend in the final 24 h, where actual data fluctuates between 4 m/s and 6 m/s, but smooths out short-term variations, such as a sharp dip to 2 m/s around hour 230, which reflects the challenge of modeling the wind’s stochastic nature. In contrast, the solar irradiance prediction closely matches the actual data in the last 24 h, accurately tracking the diurnal pattern with a peak of 900 W/m2 around hour 228 (noon), underestimating the actual peak of 950 W/m2 by 50 W/m2, which demonstrated higher accuracy due to the solar data’s predictable and periodic behavior driven by solar elevation cycles. The smoother convergence and higher accuracy in solar irradiance prediction stem from its deterministic nature, which allows the LSTM to effectively model long-term dependencies with less interference from erratic fluctuations, unlike the more variable wind speed data. In summary, the LSTM model performs well for both variables, but its superior accuracy in solar irradiance forecasting highlights its strength in structured data, making it highly effective for solar power scheduling, while improvements in capturing wind speed’s rapid changes could enhance its reliability for real-time grid management. This indicated that this location is more suitable for the installation of PV-DG-based turbines than wind turbines. Future research directions should focus on enhancing the interpretability of models and developing adaptive methodologies that can dynamically adjust to changing atmospheric conditions and improve prediction reliability.
Figure 9 illustrates the renewable predicted power outputs per unit (p.u.), where the upper subplot represents the wind prediction power output profile and the lower subplot shows the PV prediction power output profile. As shown in this figure, the predicted wind power output is very random throughout the 24 h, varying from 0 to 0.5 p.u., with a peak of 0.5 p.u. in hour 12, but then a steep drop to around 0.1 p.u. around hour 20. This demonstrates the periodic characteristic of wind generation through low wind speed-driven power, which is generally below the cut-in point of the turbine, leading to a reduced cumulative amount of power generation and depicting the limitations of relying on power supply from wind power in this area where the data is collected, where the wind resource turns out to be suboptimal for effective supply of energy, necessitating support from systems or storage to ensure grid stability. On the other hand, the predicted PV output power shown in the lower subplot in Figure 9 is a smooth bell-curve profile of the solar power, rising from 0 p.u. during night hours (0–5 and 18–24), rising gradually from hour 5 to a peak of 0.9 p.u. around hour 12, and falling back to 0 p.u. by hour 18. It shows a highly consistent diurnal profile with a high peak signifying perfect weather conditions and high panel efficiency, which increases the reliability and quality of the PV system compared to the wind system within this location. Even though low power output due to light wind speeds by wind power emphasizes the superior performance of the PV system in this aspect, combining both sources still offers potential synergy to smooth out the energy mix for different times of the day, where wind can be used as a supplement to solar power to provide moderate values during early morning and late evening hours where there is no sun. These results confirm that LSTM networks are capable of learning temporal patterns in renewable energy data even with limited historical input. The combined evaluation of meteorological and output power data demonstrates the practicality of LSTM models in supporting short-term renewable energy forecasting for real-time grid applications.
In comparison with other forecasting models, for example, ARIMA models are effective in capturing linear trends and seasonality and have been reported to achieve lower MAPE during abrupt changes in some datasets. However, LSTM architecture excels in modeling nonlinear patterns and longer temporal dependencies, making it particularly suitable for structured, periodic signals such as solar irradiance. Other approaches, such as GWO-LSSVM, combine optimization algorithms with machine learning to improve fitting capability, while hybrid models integrate statistical and deep learning strengths. Attention-based LSTMs further enhance predictive accuracy for complex, non-linear time series by focusing on the most relevant temporal features.
In our results, the LSTM achieved RMSE values of approximately 0.05–0.055 for solar irradiance forecasting, with peak prediction errors of ~50 W/m2 at ~900 W/m2 actual, indicating strong alignment with actual diurnal patterns. Table 3 summarizes a detailed comparison between the proposed LSTM model and several commonly used forecasting techniques (ARIMA, SVM, GWO-LSSVM, and a Hybrid model) in terms of their relative strengths, model complexity, and reported RMSE values for solar irradiance prediction. As shown in the table, the proposed model achieves an RMSE of 0.055, which is lower than ARIMA and comparable to SVM and the hybrid model, while maintaining moderate complexity and the ability to capture non-linear temporal dependencies.

5. Conclusions

This study has demonstrated that LSTM networks have vast potential in power system operation development, with realistic predictions of solar irradiance and wind speed that can maximize the integration of renewable energy and enhance grid stability. The LSTM model predicted wind speed with RMSE decreasing from 0.35 to 0.10–0.15 after ~250 iterations, capturing trends between 2 and 8 m/s but smoothing short-term fluctuations, leading to wind power forecasts from 0 to 0.5 p.u. with a midday peak. For solar irradiance, the RMSE dropped sharply from 0.5 to around 0.055 within the first 30 iterations, and then it stabilized near 0.05–0.055. The model accurately predicted zero irradiance during the early morning, then captured the gradual increase in solar irradiance toward a peak at noon around 1000 W/m2 and a decline to zero in the evening, which is exactly like the actual daily pattern for solar irradiance, leading to PV power forecasts from 0 to around 1 p.u at noon. These results confirm that PV constitutes optimal power generation potential compared to wind at this location. These results have shown that LSTM can be used to address the many power system issues, such as real-time prediction. However, limitations such as the requirement for large amounts of historical data, computing costs, and the smoothing of short-term changes are areas that require more study. This study recommends incorporating real-time weather updates and combining LSTM with comparative evaluations of alternative AI methods—such as ARIMA, GWO-LSSVM, hybrid networks, the attention-based LSTM FractalNet-LSTM, and ensemble learning models—to further assess predictive performance. Additionally, while this study used two separate LSTM models for wind speed and solar irradiance forecasting, future work may explore unified or multivariate architectures that consider the potential correlation between these variables, such as combined LSTM models or multivariate hybrid structures. Also, uncertainty quantification techniques such as Bayesian deep learning or Monte Carlo dropout can be integrated into the model to provide confidence intervals for predictions, thereby improving the model’s reliability in high-variability conditions typical of renewable energy sources. Overall, this study has laid the groundwork for the use of AI in power systems forecasting to enhance the shift toward sustainable energy infrastructures and more efficient and reliable electricity systems in the future.

Author Contributions

Conceptualization, A.A.A.; funding acquisition, A.M.A.-S.; investigation, A.A.A. and A.M.A.-S.; methodology, A.A.A.; resources, A.A.A. and A.M.A.-S.; software, A.A.A.; supervision, A.M.A.-S.; writing—original draft, A.A.A.; writing—review and editing, A.M.A.-S. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Ongoing Researchers Funding Program, (ORF-2025-337), King Saud University, Riyadh, Saudi Arabia.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

The authors would like to extend their gratitude to the Ongoing Researchers Funding Program, (ORF-2025-337), King Saud University, Riyadh, Saudi Arabia.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Huang, H.; Zhu, Q.; Zhu, X.; Zhang, J. An adaptive, data-driven stacking ensemble learning framework for the short-term forecasting of renewable energy generation. Energies 2023, 16, 1963. [Google Scholar] [CrossRef]
  2. Chen, Y.; Xu, J. Solar and wind power data from the Chinese State Grid renewable energy generation forecasting competition. Sci. Data 2022, 9, 1. [Google Scholar] [CrossRef]
  3. Sanjari, M.; Gooi, H.; Nair, N. Power generation forecast of hybrid PV–wind system. IEEE Trans. Sustain. Energy 2020, 11, 703–712. [Google Scholar] [CrossRef]
  4. Wang, Y.; Wu, L. On practical challenges of decomposition-based hybrid forecasting algorithms for wind speed and solar irradiation. Energy 2016, 112, 208–220. [Google Scholar] [CrossRef]
  5. Zuluaga, C.; Álvarez, M.; Giraldo, E. Short-term wind speed prediction based on robust Kalman filtering: An experimental comparison. Appl. Energy 2015, 156, 321–330. [Google Scholar] [CrossRef]
  6. Maatallah, O.; Achuthan, A.; Janoyan, K.; Marzocca, P. Recursive wind speed forecasting based on Hammerstein auto-regressive model. Appl. Energy 2015, 145, 191–197. [Google Scholar] [CrossRef]
  7. Jeon, H.-J.; Choi, M.-W.; Lee, O.-J. Day-Ahead Hourly Solar Irradiance Forecasting Based on Multi-Attributed Spatio-Temporal Graph Convolutional Network. Sensors 2022, 22, 7179. [Google Scholar] [CrossRef]
  8. Zafar, R.; Vu, B.H.; Husein, M.; Chung, I.-Y. Day-Ahead Solar Irradiance Forecasting Using Hybrid Recurrent Neural Network with Weather Classification for Power System Scheduling. Appl. Sci. 2021, 11, 6738. [Google Scholar] [CrossRef]
  9. Rabehi, A.; Guermoui, M.; Lalmi, D. Hybrid models for global solar radiation prediction: A case study. Int. J. Ambient. Energy 2018, 41, 31–40. [Google Scholar] [CrossRef]
  10. Yasin, Z.M.; Salim, N.A.; Aziz, N.F.A.; Mohamad, H.; Wahab, N.A. Prediction of solar irradiance using Grey Wolf Optimizer least square support vector machine. Indones. J. Electr. Eng. Comput. Sci. 2020, 17, 10–17. [Google Scholar] [CrossRef]
  11. Dong, Y.; Zhang, L.; Liu, Z.; Wang, J. Integrated forecasting method for wind energy management: A case study in China. Processes 2019, 8, 35. [Google Scholar] [CrossRef]
  12. Tanaka, Y.; Takahashi, M. Dynamic time warping-based cluster analysis and support vector machine-based prediction of solar irradiance at multi-points in a wide area. In Proceedings of the 47th ISCIE International Symposium on Stochastic Systems Theory and Its Applications, Honolulu, HI, USA, 5–8 December 2015; Volume 2016, pp. 210–215. [Google Scholar]
  13. Kakimoto, M.; Endoh, Y.; Shin, H.; Ikeda, R.; Kusaka, H. Probabilistic solar irradiance forecasting by conditioning joint probability method and its application to electric power trading. IEEE Trans. Sustain. Energy 2019, 10, 983–993. [Google Scholar] [CrossRef]
  14. Madhiarasan, M.; Louzazni, M.; Roy, P. Novel cooperative multi-input multilayer perceptron neural network performance analysis with application of solar irradiance forecasting. Int. J. Photoenergy 2021, 2021, 7238293. [Google Scholar] [CrossRef]
  15. Benti, N.E.; Chaka, M.D.; Semie, A.G. Forecasting Renewable Energy Generation with Machine Learning and Deep Learning: Current Advances and Future Prospects. Sustainability 2023, 15, 7087. [Google Scholar] [CrossRef]
  16. Zhang, H.; Liu, Y.; Zhang, C.; Li, N. Machine learning methods for weather forecasting: A survey. Atmosphere 2025, 16, 82. [Google Scholar] [CrossRef]
  17. Yang, N.; Cong, Y.; Xing, C.; Ye, D.; Jia, J.; Chen, D.; Shen, X.; Hunag, Y.; Zhang, L.; Zhu, B. Deep learning-based SCUC decision-making: An intelligent data-driven approach with self-learning capabilities. IET Gener. Transm. Distrib. 2021, 16, 629–640. [Google Scholar] [CrossRef]
  18. Huang, X.; Zhang, C.; Li, Q.; Tai, Y.; Gao, B.; Shi, J. A comparison of hour-ahead solar irradiance forecasting models based on LSTM network. Math. Probl. Eng. 2020, 2020, 4251517. [Google Scholar] [CrossRef]
  19. Madhiarasan, M.; Louzazni, M. Combined long short-term memory network-based short-term prediction of solar irradiance. Int. J. Photoenergy 2022, 2022, 1004051. [Google Scholar] [CrossRef]
  20. Qin, Q.; Lai, X.; Zou, J. Direct multistep wind speed forecasting using LSTM neural network combining EEMD and fuzzy entropy. Appl. Sci. 2019, 9, 126. [Google Scholar] [CrossRef]
  21. Van Houdt, G.; Mosquera, C.; Nápoles, G. A review on the long short-term memory model. Artif. Intell. Rev. 2020, 53, 5929–5955. [Google Scholar] [CrossRef]
  22. Lindemann, B.; Müller, T.; Vietz, H.; Jazdi, N.; Weyrich, M. A survey on long short-term memory networks for time series prediction. Procedia CIRP 2021, 99, 650–655. [Google Scholar] [CrossRef]
  23. Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar]
  24. Zhang, Z. Improved Adam optimizer for deep neural networks. In Proceedings of the 2018 IEEE/ACM 26th International Symposium on Quality of Service (IWQoS), Banff, AB, Canada, 4–6 June 2018. [Google Scholar]
  25. Alguhi, A.A.; Alotaibi, M.A.; Al-Ammar, E.A. Probabilistic Planning for an Energy Storage System Considering the Uncertainties in Smart Distribution Networks. Sustainability 2024, 16, 290. [Google Scholar] [CrossRef]
Figure 1. LSTM model structure.
Figure 1. LSTM model structure.
Energies 18 04594 g001
Figure 2. LSTM model for predicting wind speed and solar irradiance.
Figure 2. LSTM model for predicting wind speed and solar irradiance.
Energies 18 04594 g002
Figure 3. The flowchart illustrates the LSTM-based dual forecasting methodology for predicting 24 h solar irradiance and wind speed profiles.
Figure 3. The flowchart illustrates the LSTM-based dual forecasting methodology for predicting 24 h solar irradiance and wind speed profiles.
Energies 18 04594 g003
Figure 4. Training progress of the LSTM model for 24 h wind speed prediction.
Figure 4. Training progress of the LSTM model for 24 h wind speed prediction.
Energies 18 04594 g004
Figure 5. The 240 h of historical wind speed data with the 24 h prediction.
Figure 5. The 240 h of historical wind speed data with the 24 h prediction.
Energies 18 04594 g005
Figure 6. Training progress of the LSTM model for 24 h solar irradiance prediction.
Figure 6. Training progress of the LSTM model for 24 h solar irradiance prediction.
Energies 18 04594 g006
Figure 7. The 240 h of historical solar irradiance data with the 24 h prediction.
Figure 7. The 240 h of historical solar irradiance data with the 24 h prediction.
Energies 18 04594 g007
Figure 8. Wind speed and solar irradiance prediction compared to the last 24 h of actual data from a 240 h dataset.
Figure 8. Wind speed and solar irradiance prediction compared to the last 24 h of actual data from a 240 h dataset.
Energies 18 04594 g008
Figure 9. Wind output power prediction.
Figure 9. Wind output power prediction.
Energies 18 04594 g009
Table 1. The PV and solar irradiance parameters [25].
Table 1. The PV and solar irradiance parameters [25].
ParametersValue
Adjustable   value   of   irradiance   ( r C ) 200 W/m2
Standard   irradiance   ( s S T D ) 1000 W/m2
Table 2. The wind speed and wind turbine parameters [25].
Table 2. The wind speed and wind turbine parameters [25].
ParametersValue
Cut   in   speed   ( v i n ) m/s3
Rated   speed   ( v r ) m/s14
Cut   out   speed   ( v o u t ) m/s25
Table 3. Comparison of the proposed model with other forecasting models.
Table 3. Comparison of the proposed model with other forecasting models.
ModelStrengths Compared to the Proposed ModelAccuracyComplexityRMSE for Solar IrradianceAdvantages of the Proposed Model Over This Model
ARIMA [7]Better for sudden changes and linear trends.Lower for non-linear dataLower0.87Captures non-linear temporal dependencies, unlike ARIMA’s focus on linear trends and sudden changes.
SVM [8]Effective for general regression problems and small datasetModerateModerate0.0576Incorporate temporal information via recurrent connections, whereas SVM treats each input independently.
GWO-LSSVM [10]Improved accuracy via optimization.Comparable with optimizationHigher-Offers streamlined sequential learning, reducing the computational overhead of optimization techniques.
Hybrid Model [9]Enhanced predictive power for complex patterns.Potentially higherHigher0.03537Provides a balanced design with moderate resource usage, avoiding the complexity of attention mechanisms.
Proposed Model-High for non-linear dataModerate0.055-
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.

Share and Cite

MDPI and ACS Style

Alguhi, A.A.; Al-Shaalan, A.M. LSTM-Based Prediction of Solar Irradiance and Wind Speed for Renewable Energy Systems. Energies 2025, 18, 4594. https://doi.org/10.3390/en18174594

AMA Style

Alguhi AA, Al-Shaalan AM. LSTM-Based Prediction of Solar Irradiance and Wind Speed for Renewable Energy Systems. Energies. 2025; 18(17):4594. https://doi.org/10.3390/en18174594

Chicago/Turabian Style

Alguhi, Ahmed A., and Abdullah M. Al-Shaalan. 2025. "LSTM-Based Prediction of Solar Irradiance and Wind Speed for Renewable Energy Systems" Energies 18, no. 17: 4594. https://doi.org/10.3390/en18174594

APA Style

Alguhi, A. A., & Al-Shaalan, A. M. (2025). LSTM-Based Prediction of Solar Irradiance and Wind Speed for Renewable Energy Systems. Energies, 18(17), 4594. https://doi.org/10.3390/en18174594

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop