Abstract

Solar photovoltaic energy generation due to its high potential is being adopted as one of the main power sources by many countries to mitigate their climate and electrical power issues. Hence accurate forecasting becomes important to make grid operations smoother, and for this purpose, modern-day artificial intelligence technologies can make a significant contribution. This study is an endeavor to target accurate forecasting for different weather conditions by using a simple recurrent neural network, long–short-term memory and gated recurrent unit-based hybrid model, and bidirectional gated recurrent unit. The experimental dataset has been acquired from Quaid-e-Azam Solar Park, Bahawalpur, Pakistan. This study observed that the bidirectional gated recurrent unit outperforms the hybrid model, whereas the simple recurrent neural network lags most in accuracy. The results confirm that the bidirectional gated recurrent unit technique can perform accurately in all critical weather types. Whereas the values of root-mean-square error, mean absolute error, and R-squared values also ensure the precision of the model for all weather conditions, and the best of these parameters for bidirectional gated recurrent unit observed are 0.0012, 0.212, and 0.99, respectively, for the overcast dataset.

1. Introduction

The use of renewable energy to ensure sustainable and healthy economic and social development has become the consensus of countries around the globe. Solar photovoltaic (PV) power has proven itself as a viable technique and cost-effective power source among renewable and un-replenishable counterparts. At the end of 2020, solar PV power had a total installed capacity of at least 758.9 GW, accounting for around 3.7% of worldwide electricity output [1]. Pakistan also has a tremendous potential for solar PV power generation, which might be a vital and clean energy source for future energy demands. According to the World Bank, Pakistan could compass its electricity necessity by exploiting 0.071% of its geographical area for solar PV power output [2]. Considering solar PV power is transitory, its productivity is entirely dependent on the number of sunny hours available during a day, solar intensity, angle of incidence, cell circuit, and metrological characteristics. As a result, interconnecting PV power (generated) into a system involves network management and operating issues. Thus, solar PV power forecasting is a key task, and a precise PV power estimation is required to eliminate PV-induced volatility and enable solar PV system integration [3, 4].

Several authors have used several forecasting techniques for solar power and solar irradiance forecasting in recent years. Advanced artificial intelligence (AI)-based approaches have been explored extensively for this goal. The study [5] highlights the competency of long–short-term memory (LSTM) and also gated recurrent unit (GRU) models in forecasting future values of six sensors deployed 30 days in advance at an industrial paper press. As proven in the case study, GRU models work with fewer data and produce greater outcomes with various parameters. In the research work [6], a comparison of three different machine learning models was carried out. The cryptocurrency dataset was used to collect time-series data to create forecasts. As a result, the GRU outperformed LSTM, with mean absolute percentage error and root-mean-squared error (RMSE) of 3.97% and 81.34%, respectively. In reference [7], the enactment of an LSTM-recurrent neural network (LSTM-RNN) to precisely estimate the output for PV systems has been put forward. For a year, the proposed approach is tested utilizing hourly datasets from several sites. The suggested method is compared against three other PV forecasting methods: multiple linear regression, bagged regression trees, and neural networks (NN). When compared to other algorithms, LSTM delivers a considerable depletion in forecasting inaccuracy.

AlKandari and Ahmad [8], for more accurate forecasting of future solar power generation, suggest a hybrid model that integrates machine learning approaches with the theta statistical method. LSTM, GRU, auto-encoder LSTM (Auto-LSTM), and a newly proposed Auto-GRU are among the machine learning models. The results show that a hybrid model that combines machine learning methods with statistical approaches outperforms a hybrid model that just uses machine learning methods without statistical methods. Jung et al. [9] forecasted the amount of PV power generation at new sites utilizing a case study of South Korea. The study developed the LSTM model to predict PV power using a dataset of 164 different locations. The LSTM model proved to be capable of adapting complex and nonlinear patterns between power output and factors impacting it at several sites. In conclusion, the proposed LSTM framework is helpful in reliably predicting PV power output in any place with known historical meteorological data. In reference [10], a case study evaluated artificial neural networks (ANNs) and recurrent neural networks (RNNs) to forecast solar irradiance. The study recommends deep learning RNN as a superior performing algorithm for predicting solar radiations. In contrast to ANNs, RNNs demonstrated a significant improvement of 47% in normalized mean bias error and a 26% improvement in RMSE in the findings. Furthermore, the coefficient of variation of RMSE (CV-RMSE) of ANN declined by around 30%, and CV-RMSE of RNN decreased by about 2.19% while the sampling frequency increased from 1 hour to 10 minutes. In another study by Lee and Kim [11], without knowing future meteorological information, the paper presents two PV output forecasting models based on LSTM and GRU. Predicted the PV power output at midday considering weather information from the morning hours. The results indicate that the suggested GRU-based framework was more effective than the LSTM-based model at identifying the seasonal relationship between PV power output in the peak zone and its preceding zones. Furthermore, the GRU-based model outperformed other models even when the complexity level increased. Table 1 summarizes the modern deep-learning-dependent research works in recent years for solar PV forecast.

Table 1.

Summary of literature.

Ref (Year)Study spanLocal dataMethodErrors
ANNLSTMHybridBi-GRUGRURMSEMAER2
Miraftabzadeh et al. (2023) [12]A day ahead
Li et al., (2022) [13]Hourly
Meftah et al., (2022) [14]Hourly
Zang et al., (2020) [15]Hourly
Ghimire et al, (2020) [16]30 minutes
He et al., (2020) [17]Hourly
Joen et al., (2020) [18]Hourly
Li et al., (2020) [19]Short-term
Yan et al., (2020) [20]Short-term
Wang et al., (2019) [21]Day ahead
Abdel-Nasser et al., (2019) [7]Hourly
Lee et al., (2019) [22]Hourly
Wen et al., (2019) [23]Hourly
This ResearchHourly
Ref (Year)Study spanLocal dataMethodErrors
ANNLSTMHybridBi-GRUGRURMSEMAER2
Miraftabzadeh et al. (2023) [12]A day ahead
Li et al., (2022) [13]Hourly
Meftah et al., (2022) [14]Hourly
Zang et al., (2020) [15]Hourly
Ghimire et al, (2020) [16]30 minutes
He et al., (2020) [17]Hourly
Joen et al., (2020) [18]Hourly
Li et al., (2020) [19]Short-term
Yan et al., (2020) [20]Short-term
Wang et al., (2019) [21]Day ahead
Abdel-Nasser et al., (2019) [7]Hourly
Lee et al., (2019) [22]Hourly
Wen et al., (2019) [23]Hourly
This ResearchHourly
Table 1.

Summary of literature.

Ref (Year)Study spanLocal dataMethodErrors
ANNLSTMHybridBi-GRUGRURMSEMAER2
Miraftabzadeh et al. (2023) [12]A day ahead
Li et al., (2022) [13]Hourly
Meftah et al., (2022) [14]Hourly
Zang et al., (2020) [15]Hourly
Ghimire et al, (2020) [16]30 minutes
He et al., (2020) [17]Hourly
Joen et al., (2020) [18]Hourly
Li et al., (2020) [19]Short-term
Yan et al., (2020) [20]Short-term
Wang et al., (2019) [21]Day ahead
Abdel-Nasser et al., (2019) [7]Hourly
Lee et al., (2019) [22]Hourly
Wen et al., (2019) [23]Hourly
This ResearchHourly
Ref (Year)Study spanLocal dataMethodErrors
ANNLSTMHybridBi-GRUGRURMSEMAER2
Miraftabzadeh et al. (2023) [12]A day ahead
Li et al., (2022) [13]Hourly
Meftah et al., (2022) [14]Hourly
Zang et al., (2020) [15]Hourly
Ghimire et al, (2020) [16]30 minutes
He et al., (2020) [17]Hourly
Joen et al., (2020) [18]Hourly
Li et al., (2020) [19]Short-term
Yan et al., (2020) [20]Short-term
Wang et al., (2019) [21]Day ahead
Abdel-Nasser et al., (2019) [7]Hourly
Lee et al., (2019) [22]Hourly
Wen et al., (2019) [23]Hourly
This ResearchHourly

It is apparent from Table 1 that this research has considered and compared all major deep learning techniques frequently used in recent years to upgrade solar PV forecasting. These models have beneficial qualities, such as the ability to simulate complex relationships between process variables without the requirement for an explicit model formulation, which is usually necessary. In the previous research, the same group of authors proposed a bidirectional LSTM (Bi-LSTM) model for an accurate PV power forecast, multiple layers of LSTM were also examined in contrast to the Bi-LSTM model [24]. However, the current research forecasts PV power output using advanced novel deep learning techniques based on the bidirectional gated recurrent unit (Bi-GRU) and LSTM and GRU (LSTM-GRU) hybrid model for the first time in the scenario of Pakistan. Data for this research has been taken from the 100 MW Quaid-e-Azam solar park (QASP) [25].

Pakistan encounters many difficulties when it comes to solar PV generation [26, 27]. In formulating and executing lucid and efficient rules and regulations to promote the installation of solar PV systems, the government has implemented several incentives, such as feed-in tariffs and net metering laws, but the expansion of the solar industry has been hampered by uneven implementation, administrative roadblocks, and a lack of stable long-term strategy. The antiquated and inadequately constructed power grid infrastructure in Pakistan makes it difficult to integrate intermittent renewable energy sources such as solar PVs. The grid would not be able to handle a lot of solar energy, which would force curtailment or wasteful use of solar resources. Some variables, including dust, cloud cover, and air pollution, can affect the intermittent and variable nature of solar PV power [28]. It might be difficult to ensure a regular and dependable power supply from solar PV installations in areas with erratic sunshine patterns, like some portions of Pakistan. Pakistan’s water shortage is a serious issue, especially for large-scale solar PV projects that need a lot of water for upkeep and cleaning [29]. Agricultural operations and solar projects may compete for land, which may lead to disputes and regulatory obstacles for the growth of solar energy. All of these challenges were highlighted by different researchers throughout the years [28–30]. In general, by optimizing energy production, improving grid stability and reliability, facilitating energy trading and market operations, guiding infrastructure planning and investment decisions, and lowering operating costs while optimizing resource utilization, accurate solar PV power forecasting promotes economic efficiency and sustainability [29, 31–33]. Consumers can propel the transition toward a more sustainable energy future by fully realizing the economic and environmental possibilities of solar energy through the utilization of forecasting technology and methodology.

This work highlights two of the most important aspects of this research area:

  1. This work uses a real-world dataset to forecast the solar PV power, which can aid in better grid operation of that specific power plant.

  2. This work incorporates deep learning technologies for forecasting accurately, and these techniques have been compared rigorously to suggest one better-performing model for a real-world solar PV system.

2. Methodology

This paper attempts to forecast PV output accurately through deep learning approaches while considering diverse weather conditions. The dataset for evaluation of this paper is acquired from 100 MW QASP, Bahawalpur, Pakistan. A hybrid model, a simple RNN model, and modern-day deep learning models are studied for the forecasting of the dataset. The utilization of deep learning approaches is intended to accurately forecast, and promising results over a real-time dataset signify the adaptability of the proposed approach to be inclusive for related problems, regardless of geography and weather conditions.

Figure 1 illustrates the complete framework that has been carried out for this research work. The same processing has been explained in detail in the subsections of this section below.

Framework of current research.
Figure 1.

Framework of current research.

This flow of data preprocessing, training, validation, and error estimation is described in detail in this section. Data preprocessing involves data normalization to maintain the stability of data, and the division of the dataset into sets for validation, and training. In this case, the data are divided into segments such as 20% for validation and 80% for training. Then in the training phase, 80% of the historical PV power generation dataset is trained along with corresponding features, and the internal details of the models are given in Table 2. After training, the data are then validated with the results obtained by the model and the validation data. Lastly, the error is calculated using diverse techniques to obtain detailed results. RMSE, MAE, and R-squared are used in this work, and the formulae for these are given in Equations 13, respectively:

Table 2.

Models description.

ModelHidden layersUnits/neuronsOptimizerDropout rateEpochs
RNN1100Adam0.5100
Hybrid2 (LSTM + GRU)100 * 2Adam0.5100
Bi-GRU1100Adam0.5100
ModelHidden layersUnits/neuronsOptimizerDropout rateEpochs
RNN1100Adam0.5100
Hybrid2 (LSTM + GRU)100 * 2Adam0.5100
Bi-GRU1100Adam0.5100
Table 2.

Models description.

ModelHidden layersUnits/neuronsOptimizerDropout rateEpochs
RNN1100Adam0.5100
Hybrid2 (LSTM + GRU)100 * 2Adam0.5100
Bi-GRU1100Adam0.5100
ModelHidden layersUnits/neuronsOptimizerDropout rateEpochs
RNN1100Adam0.5100
Hybrid2 (LSTM + GRU)100 * 2Adam0.5100
Bi-GRU1100Adam0.5100
(1)
(2)
(3)

where yi represents actual PV power, y^i represents forecasted PV power, y¯i represents the mean of actual solar PV power, and n represents the number of samples.

2.1 Data acquisition and preprocessing

The dataset for this research has been acquired from a 100 MW power unit in Bahawalpur, Pakistan, named as QASP. At the power plant, data were recorded at 15-minute intervals. The dataset has been averaged on hourly time stamps for better execution of the algorithm. The data set spans over a year, from 1 January 2019 to 31 December 2019. Between the hours of 7 p.m.and 7 a.m., power output was reported to be constant at zero; as a result, we only examined data from 7 a.m. to 7 p.m. clear or sunny days, overcast or cloudy days, rainy days, dusty days, and foggy days were all separated from the dataset to study the behavior of solar PV under different weather conditions. As per the requirements of the neural network method, data are normalized using the min–max normalization technique, refer to Equation 4.

The gates and state of a GRU and LSTM are calculated using sigmoid and “tanh” activation functions. The range of the sigmoid function is [0, 1], while the range of the “tanh” function is [−1, 1]. Thus, to normalize the dataset, the min–max algorithm is used, as follows [34]:

(4)

2.2 Forecasting models

In this research, various models have been investigated for accurate PV power forecasting, that is, a simple RNN, an LSTM-GRU hybrid, and an advanced deep learning technique Bi-GRU have been considered. Along with this layer arrangement, a dropout layer technique has also been implemented to avoid the risk of overfitting. All these models have been trained on 80% of time-series data and are validated on the remaining 20% of data. Multiple error-calculating methods have been considered to further validate the model’s accuracy. Table 2 depicts the configuration of the investigated models. This arrangement is the result of multiple experiments; multiple sets of neurons were tested to conclude the finest model. Moreover, further results are discussed in Section 3.

RNNs learn from training data in the same way as CNNs and feedforward neural networks, which are examples of conventional neural networks. Their ability to use information from previous inputs to affect the present input and output sets them apart. Recurrent units, which are specifically referred to as “Recurrent Neurons,” are the basic processing units of RNNs. Because of this unit’s special capacity to preserve a concealed state, the network may recognize sequential dependencies by processing inputs in the past [35]. The simple RNN is used in this work only to make an understanding of the working principles of state of art types of RNN like LSTM and GRU.

2.2.1 Long–short-term memory

LSTM was developed in the late 90s to alleviate long-term reliance issues [36]. There are three separate kinds of layers used in LSTM: the input layer, the hidden layer, and the output layer. Since it has memory blocks that are linked with layers, the LSTM network outperforms the simple recurrent neural network. Every block has gates that regulate the state and output of the block [7]. There are three gates in the LSTM Block: a forget gate, an input gate, and an output gate. The forget gate specifies which particulars should be preserved in the cell state and which should be deleted. The forget gate’s sigmoid layer generates a value of 0 or 1 to discard or store. In Fig. 2, ft illustrates the forget gate [37]. What is preserved in the cell state is governed by the input gate. The hyperbolic tangent (tanh layer) creates a new value to be updated to cell state (C’t in Fig. 2), while the sigmoid (δ) layer produces acceptable values to update in cell state (it in Fig. 2) [8, 37]. The output gate produced output formed on the block’s input and memory. The sigmoid layer carries information concerning the desired outcome (Ot in Fig. 2), whereas the tanh layer pushes values between −1 and 1. The outputs from the sigmoid and tanh layers are then multiplied to generate the results [7, 37].

LSTM cell structure.
Figure 2.

LSTM cell structure.

In Fig. 2, Ht−1 represents the hidden state of the previous cell which is added into the current cell along with the current input of cell xt. The ft indicates the forget gate, indicated with a red arrow in Fig. 2, in which the hidden state of the previous cell and current input is inserted via a sigmoid gate. This sigmoid gate function ranges the data into 0–1 shapes. Moving upward, we identify a multiplier sign, which simply indicates multiplication, where the ft and Ct−1, which is the cell state of the previous cell, are multiplied. At the bottom belt, we see a sigmoid and a tanh function right after the forget gate; this is an input gate, indicated as a green arrow in Fig. 2. Here, the previous hidden cell state and current input are inserted; these values cross two functions: one sigmoid and another tanh. The resultant of tanh becomes the current cell state C’t, and the resultant of the sigmoid gate becomes the input. These two values, it and C’t are then multiplied, indicated by the multiplier sign, the resultant of this multiplier is then added into the resultant of Ct−1 × ft, and that makes it the current cell state Ct. The last gate is the output gate which is represented by red arrow and notation of Ot. The input and previously hidden state values are injected into the output gate crossing the sigma function. The output of the sigma function is then multiplied with the resultant of the current cell state (upper bar), which is crossed via tanh function, hence the output of the current hidden cell state is generated. Equations 57 show the mathematical arrangement of three different gates of LSTM [37].

The input gate:

(5)

The output gate:

(6)

The forget gate:

(7)

where it, ot, and ft show input, output, and forget gate, respectively; σ is sigmoid function; wx is the respective weight of the gate; ht1 is the input from previous cell; xt is the input of current cell; and bx is biased value of respective gate.

2.2.2 Gated recurrent unit

In 2014, Cho et al [38] established a GRU. The GRUs enable each recurrent unit to collect correlations all over the different periods. The GRU, like the LSTM, contains gated units that dominate the flow of information within the units but omit the separate memory cells. LSTMs and GRUs are much more similar [39]. Like LSTM, GRU regulates the flow of information through gates. Compared to LSTMs, GRUs re relatively new [40]. There are only two gates: an update and a reset gate [41]. The update gate (zt) operates much similarly to forget and also the input gate of an LSTM. The update gate regulates what particulars should be discarded and included [41]. Moreover, the other gate used to decide how much past information to discard is the reset gate (rt) [41]. GRU has fewer tensor operations, so it trains slightly faster than LSTM. Equations 13 demonstrate the mathematical representation of an update and reset gates, as well as a hidden state, respectively [6, 38]. Equation 8 is for the update gate of a GRU; once xt is connected to the network unit, it gets multiplied by its weight Uz. The same is evident for ht−1, as ht−1 contains information regarding previous units, which is multiplied by its weight wz. Afterward, the two results are summed, and the outcome is then squeezed between 0 and 1, utilizing a sigmoid activation function [42]. Equation 9 is for the reset gate; the reset gate formula is Equation 1. As previously, we plug in ht−1 and xt, multiply them by the appropriate weights, add the results, and then use the sigmoid function [42]. Equation 10 is for current memory content and to store the pertinent historical data; this will employ the reset gate. The inputs xt and ht−1 should be multiplied by the respective weights. The product of the reset gate 00rt and Wht−1 should be calculated. Depending on it, we will know what to take out of the earlier time steps. Finally, use the nonlinear activation function tanh to create h’t by adding up the outcomes [42]. Figure 3 shows the cell structure of GRU [38].

GRU cell structure.
Figure 3.

GRU cell structure.

(8)
(9)
(10)

2.2.3 Hybrid model

Some researchers have incorporated hybrid models to enhance the accuracy of forecasting [43, 44]. In this work, one layer of LSTM and another layer of GRU are put together to form the hybrid model. Figure 4 depicts a model calibration block diagram. The hybrid model combines the use of two distinct methods to carry out a single task, which always improves model performance. An LSTM and a GRU model are used in this specific instance, as seen in Fig. 4. An LSTM model was included first, followed by a GRU model, and the output will be based on the outcomes of the hybrid combination.

LSTM-GRU hybrid model layers configuration.
Figure 4.

LSTM-GRU hybrid model layers configuration.

2.2.4 Bi-GRU model

Another novel model, the Bi-GRU, is employed in this work. The advantage of the bidirectional technique is that it gets information from both the past and future. Bidirectional methodology is a contemporary method that can be used in a variety of applications to forecast accurately. In this scenario, a Bi-GRU is used to anticipate solar PV power generation with accuracy. The model operates in both the forward and backward directions. This phenomenon is known as a bidirectional approach, and it uses information from the past to forecast future values and information from the future to forecast past values. As may be expected, forecast results will be much more accurate following a thorough comprehension of the capabilities of this bidirectional approach [24]. Figure 5 demonstrates the bidirectional arrangement of GRU, wherein xt−1, xt, and xt+1 are, respectively, a collection of entries from the past records, present information, and future information. The cell structure shown in Fig. 3 is the GRU that is indicated in a box in Fig. 5.

Bidirectional GRU.
Figure 5.

Bidirectional GRU.

3. Results and discussion

Different models have been trained and tested in a variety of weather scenarios, including clear, overcast, rainy, foggy, and dusty days. For the PV power forecast, a real-time dataset is taken into account. The dataset was separated into training and testing sets, with training taking 80% of the time and testing taking 20%. The Adam optimizer has been used to fit the model; neurons in each layer are set to 100, and the epochs are set to 100.

The experimental RMSE, R-squared, and MAE findings of the hybrid model, Bi-GRU model, and simple RNN model are presented in Table 3.

Table 3.

RMSE, MAE, and R-squared results of forecasting models.

ModelWeatherRMSEMAER-squared
Bi-GRUClear0.00420.3190.99
Overcast0.00120.2120.99
Rainy0.007870.5040.99
Foggy0.00660.5210.99
Dusty0.02551.8190.99
HybridClear0.0171.380.99
Overcast0.0150.6840.99
Rainy0.022.040.99
Foggy0.0161.290.99
Dusty0.0160.880.99
RNNClear0.2442.910.98
Overcast0.2825.5060.94
Rainy0.3253.110.97
Foggy0.0972.890.98
Dusty0.2495.390.96
ModelWeatherRMSEMAER-squared
Bi-GRUClear0.00420.3190.99
Overcast0.00120.2120.99
Rainy0.007870.5040.99
Foggy0.00660.5210.99
Dusty0.02551.8190.99
HybridClear0.0171.380.99
Overcast0.0150.6840.99
Rainy0.022.040.99
Foggy0.0161.290.99
Dusty0.0160.880.99
RNNClear0.2442.910.98
Overcast0.2825.5060.94
Rainy0.3253.110.97
Foggy0.0972.890.98
Dusty0.2495.390.96
Table 3.

RMSE, MAE, and R-squared results of forecasting models.

ModelWeatherRMSEMAER-squared
Bi-GRUClear0.00420.3190.99
Overcast0.00120.2120.99
Rainy0.007870.5040.99
Foggy0.00660.5210.99
Dusty0.02551.8190.99
HybridClear0.0171.380.99
Overcast0.0150.6840.99
Rainy0.022.040.99
Foggy0.0161.290.99
Dusty0.0160.880.99
RNNClear0.2442.910.98
Overcast0.2825.5060.94
Rainy0.3253.110.97
Foggy0.0972.890.98
Dusty0.2495.390.96
ModelWeatherRMSEMAER-squared
Bi-GRUClear0.00420.3190.99
Overcast0.00120.2120.99
Rainy0.007870.5040.99
Foggy0.00660.5210.99
Dusty0.02551.8190.99
HybridClear0.0171.380.99
Overcast0.0150.6840.99
Rainy0.022.040.99
Foggy0.0161.290.99
Dusty0.0160.880.99
RNNClear0.2442.910.98
Overcast0.2825.5060.94
Rainy0.3253.110.97
Foggy0.0972.890.98
Dusty0.2495.390.96

In the graphs for all models, the graphs are ranked from low to high RMSE values. Figure 6 shows the result of a Bi-GRU model which is also suggested by the outcomes reported in Table 3 that the overall performance of the Bi-GRU model is extraordinary. In addition, this model showed better results in cloudy weather (mentioned as overcast in Table 3), precession methods for cloudy weather cases observed are RMSE = 0.0012, MAE = 0.212, and R-squared = 0.99. Moreover, for all other weather scenarios, Bi-GRU has outclassed the Hybrid and simple RNN model. The lowest RMSE 0.0255, for Bi-GRU, was observed for dusty days, which is still competitive to hybrid and simple RNN models. Hence, the BI-GRU model has outperformed other models.

Bi-GRU forecast results.
Figure 6.

Bi-GRU forecast results.

Figure 7 illustrates the end results of the LSTM-GRU hybrid model. This model also presented high accuracy in all of the weather conditions. Considering Table 3, the overcast weather data from this model showed better results; the RMSE for this case is 0.015, MAE 0.684, and R-squared 0.99. The hybrid technique performed much more accurately in contrast to the simple RNN model. The highest RMSE for the hybrid model is lower than the lowest RMSE for the simple RNN model. Overall performance of the hybrid model is much more accurate than simple RNN and slightly less accurate than the Bi-GRU model.

Hybrid (LSTM-GRU) model forecast results.
Figure 7.

Hybrid (LSTM-GRU) model forecast results.

Figure 8 depicts the outcomes of the simple RNN model. In comparative analysis with Bi-GRU and hybrid models, the RNN model has low accuracy. Considering Table 3, it is determined that the best result of the RNN model is for foggy weather, with RMSE 0.097, MAE 2.89, and R-squared 0.98. Bi-GRU model results are exceptionally accurate in all weather conditions. Figure 5 shows a graphical representation of the Bi-GRU model, showing the diminutive gap between actual and forecasted values, which is also justified by the results in Table 3. Moreover, Fig. 9 illustrates the validation and training loss for LSTM, Bi-GRU, and hybrid models. Figure 9 shows a close relation between validation and training losses. As can be seen in Fig. 9c, the training loss initially is lesser than LSTM in Fig. 9a and Bi-GRU in Fig. 9b. Moreover, the validation loss drops higher from Bi-GRU as compared to LSTM and Hybrid approach, which drops from 0.1. But an initial lesser calculated loss in hybrid indicates the model to be good fit and avoids overfitting, while serving our aim to be accurate. The performance of the hybrid model of the GRU and LSTM is significant as well, which is due to a number of important reasons. First, RNN versions, LSTM and GRU, were created to solve the vanishing gradient issue that conventional RNNs had. Second, to effectively capture long-term dependencies in sequential data, and LSTM and GRU architectures incorporate specific gating algorithms that selectively preserve or reject information over time. Hence by integrating the LSTM and GRU designs into a hybrid model, each architecture’s special advantages provide enhanced results while minimizing its drawbacks. Because they employ distinct memory cells and gating units, long-range dependencies are well captured and information is preserved across lengthy periods in LSTM networks.

Simple RNN model forecast results.
Figure 8.

Simple RNN model forecast results.

Training and validation losses for RNN, Bi-GRU, and hybrid models. (a) Simple RNN. (b) Bi-GRU. (c) Hybrid.
Figure 9.

Training and validation losses for RNN, Bi-GRU, and hybrid models. (a) Simple RNN. (b) Bi-GRU. (c) Hybrid.

4. Conclusions

In this study, an improved deep learning algorithm has been developed by integrating a simple RNN, LSTM, and GRU-based hybrid model with a Bi-GRU. The Bi-GRU model demonstrated superior performance compared to individual deep learning architectures. The initial exploration involved a simple RNN model, which was followed by the design of a hybrid architecture combining GRU and LSTM elements. Subsequently, an advanced Bi-GRU-based architecture was introduced, achieving significant improvements over the RNN-based model when evaluated on real-world data. The Bi-GRU model exhibited high adaptability and resilience across various weather conditions, as confirmed by evaluation metrics such as R-squared, MAE, and RMSE, with results consistently within acceptable bounds. The experimental dataset, obtained from QASP in Bahawalpur, Pakistan, further validated the model’s accuracy. Notably, the Bi-GRU achieved optimal parameters, including an RMSE of 0.0012, MAE of 0.212, and R-squared value of 0.99, particularly for overcast datasets. The findings indicate that the hybrid and Bi-GRU models excel in datasets representing challenging weather conditions, such as cloudy days, highlighting their efficacy for accurate power generation forecasting in renewable energy systems. The demonstrated precision under complex weather scenarios underscores the potential of this approach for deployment in similar applications.

5. Future recommendations

There are many opportunities for this work to be expanded and improved in the future. This includes adjusting model parameters by expanding the number of parameters, investigating renewable energy alternatives like hydropower and wind, and weighing the financial effects of applying deep learning forecasting methods in an industrial approach.

Acknowledgments

The findings herein reflect the work and are solely the responsibility of the authors.

Author contributions

Laveet Kumar (Conceptualization [equal], Data curation [equal], Formal analysis [equal], Investigation [equal], Methodology [equal], Resources [equal], Software [equal], Validation [equal], Visualization [equal], Writing—original draft [equal]), Sohrab Khan (Conceptualization [equal], Data curation [equal], Formal analysis [equal], Investigation [equal], Methodology [equal], Software [equal], Validation [equal], Writing—original draft [equal]), Faheemullah Shaikh (Conceptualization [equal], Data curation [equal], Investigation [equal], Software [equal], Supervision [equal], Writing—review & editing [equal]), Mokhi Maan Siddiqui (Data curation [equal], Formal analysis [equal], Supervision [equal], Visualization [equal], Writing—review & editing [equal]), and Ahmad Sleiti (Formal analysis [equal], Funding acquisition [equal], Supervision [equal], Validation [equal], Writing—review & editing [equal])

Conflict of interest statement

None declared.

Funding

Open access funding is provided by Qatar National Library.

Data availability

The data underlying this article will be shared on reasonable request to the corresponding author.

References

[1]

International Energy Agency (IEA)
.
Snapshot of Global PV Markets 2021.
Paris
:
International Energy Agency
,
2021
,
1
16
.

[2]

World Bank
.
Expanding Renewable Energy in Pakistan’s Electricity Mix.
USA
:
World Bank’s Energy Sector Management Assistance Program (ESMAP)
,
2020
.

[3]

Nwaigwe
KN
,
Mutabilwa
P
,
Dintwa
E.
An overview of solar power (PV systems) integration into electricity grids
.
Mater Sci Energy Technol
2019
;
2
:
629
33
. https://doi.org/

[4]

Hu
Z
,
Gao
Y
,
Ji
S
et al.
Improved multistep ahead photovoltaic power prediction model based on LSTM and self-attention with weather forecast data
.
Appl Energy
2024
;
359
:
122709
. https://doi.org/

[5]

Mateus
BC
,
Mendes
M
,
Farinha
JT
et al.
Comparing LSTM and GRU models to predict the condition of a pulp paper press
.
Energies
2021
;
14
:
6958
. https://doi.org/

[6]

Yamak
PT
,
Li
Y
,
Gadosey
PK.
A comparison between ARIMA, LSTM, and GRU for time series forecasting
. In: Proceedings of the 2019 2nd International Conference on Algorithms, Computing and Artificial Intelligence.
New York
:
Association for Computing Machinery
,
2020
,
49
55
. https://doi.org/

[7]

Abdel-Nasser
M
,
Mahmoud
K.
Accurate photovoltaic power forecasting models using deep LSTM-RNN
.
Neural Comput Appl
2019
;
31
:
2727
40
. https://doi.org/

[8]

AlKandari
M
,
Ahmad
I.
Solar power generation forecasting using ensemble approach based on deep learning and statistical methods
.
Appl Comput Inform
2019
;
20
:
231
50
. https://doi.org/

[9]

Jung
Y
,
Jung
J
,
Kim
B
et al.
Long short-term memory recurrent neural network for modeling temporal patterns in long-term power forecasting for solar PV facilities: case study of South Korea
.
J Clean Prod
2020
;
250
:
119476
. https://doi.org/

[10]

Pang
Z
,
Niu
F
,
O’Neill
Z.
Solar radiation prediction using recurrent neural network and artificial neural network: a case study with comparisons
.
Renew Energy
2020
;
156
:
279
89
. https://doi.org/

[11]

Lee
D
,
Kim
K.
PV power prediction in a peak zone using recurrent neural networks in the absence of future meteorological information
.
Renew Energy
2021
;
173
:
1098
110
. https://doi.org/

[12]

Miraftabzadeh
SM
,
Colombo
CG
,
Longo
M
et al.
A day-ahead photovoltaic power prediction via transfer learning and deep neural networks
.
Forecasting
2023
;
5
:
213
28
. https://doi.org/

[13]

Li
P
,
Zhou
K
,
Lu
X
et al.
A hybrid deep learning model for short-term PV power forecasting
.
Appl Energy
2020
;
259
:
114216
. https://doi.org/

[14]

Elsaraiti
M
,
Merabet
A.
Solar power forecasting using deep learning techniques
.
IEEE Access
2022
;
10
:
31692
8
. https://doi.org/

[15]

Zang
H
,
Liu
L
,
Sun
L
et al.
Short-term global horizontal irradiance forecasting based on a hybrid CNN-LSTM model with spatiotemporal correlations
.
Renew Energy
2020
;
160
:
26
41
. https://doi.org/

[16]

Ghimire
S
,
Deo
RC
,
Raj
N
et al.
Deep solar radiation forecasting with convolutional neural network and long short-term memory network algorithms
.
Appl Energy
2019
;
253
:
113541
. https://doi.org/

[17]

He
H
,
Lu
N
,
Jie
Y
et al.
Probabilistic solar irradiance forecasting via a deep learning-based hybrid approach
.
IEEJ Trans Electr Electron Eng
2020
;
15
:
1604
12
. https://doi.org/

[18]

Jeon
BK
,
Kim
EJ.
Next-day prediction of hourly solar irradiance using local weather forecasts and LSTM trained with non-local data
.
Energies (Basel)
2020
;
13
:
5258
. https://doi.org/

[19]

Li
G
,
Wang
H
,
Zhang
S
et al.
Recurrent neural networks based photovoltaic power forecasting approach
.
Energies
2019
;
12
:
2538
. https://doi.org/

[20]

Yan
K
,
Shen
H
,
Wang
L
et al.
Short-term solar irradiance forecasting based on a hybrid deep learning methodology
.
Information
2020
;
11
:
32
. https://doi.org/

[21]

Wang
K
,
Qi
X
,
Liu
H.
A comparison of day-ahead photovoltaic power forecasting models based on deep learning neural network
.
Appl Energy
2019
;
251
:
113315
. https://doi.org/

[22]

Lee
D
,
Kim
K.
Recurrent neural network-based hourly prediction of photovoltaic power output using meteorological information
.
Energies
2019
;
12
:
215
. https://doi.org/

[23]

Wen
L
,
Zhou
K
,
Yang
S
et al.
Optimal load dispatch of community microgrid with deep learning based solar power and load forecasting
.
Energy
2019
;
171
:
1053
65
. https://doi.org/

[24]

Khan
S
,
Shaikh
F
,
Siddiqui
MM
et al.
Hourly forecasting of solar photovoltaic power in Pakistan using recurrent neural networks
.
Int J Photoenergy
2022
;
2022
:
7015818
. https://doi.org/

[25]

Park
Q-AS.
Quaid e Azam Solar Power (Pvt) Ltd. - QASP n.d. https://www.qasolar.com/ (
22 September 2021
, date last accessed).

[26]

Khatri
SA
,
Harijan
K
,
Uqaili
MA
et al.
Solar photovoltaic potential and diffusion assessment for Pakistan
.
Energy Sci Eng
2022
;
10
:
2452
74
. https://doi.org/

[27]

Kumar
M
,
Soomro
AM
,
Uddin
W
et al.
Optimal multi-objective placement and sizing of distributed generation in distribution system: a comprehensive review
.
Energies
2022
;
15
:
7850
. https://doi.org/

[28]

Shah
HH
,
Bareschino
P
,
Mancusi
E
et al.
Environmental life cycle analysis and energy payback period evaluation of solar PV systems: the case of Pakistan
.
Energies
2023
;
16
:
6400
. https://doi.org/

[29]

Irfan
M
,
Zhao
ZY
,
Ahmad
M
et al.
Solar energy development in Pakistan: Barriers and policy recommendations
.
Sustainability
2019
;
11
:
1206
. https://doi.org/

[30]

Hussain
F
,
Maeng
SJ
,
Cheema
MJM
et al.
Solar irrigation potential, key issues and challenges in Pakistan
.
Water
2023
;
15
:
1727
. https://doi.org/

[31]

Singla
P
,
Duhan
M
,
Saroha
S.
A dual decomposition with error correction strategy based improved hybrid deep learning model to forecast solar irradiance
.
Energy Sources Part A
2022
;
44
:
1583
607
. https://doi.org/

[32]

Singla
P
,
Duhan
M
,
Saroha
S.
A point and interval forecasting of solar irradiance using different decomposition based hybrid models
.
Earth Sci Inform
2023
;
16
:
2223
40
. https://doi.org/

[33]

Singla
P
,
Duhan
M
,
Saroha
S.
An integrated framework of robust local mean decomposition and bidirectional long short-term memory to forecast solar irradiance
.
Int J Green Energy
2023
;
20
:
1073
85
. https://doi.org/

[34]

Kuan
L
,
Yan
Z
,
Xin
W
,
Yan
C
,
Xiangkun
P
,
Wenxue
S
, et al.
Short-term electricity load forecasting method based on multilayered self-normalizing GRU network
. In: 2017 IEEE Conference on Energy Internet and Energy System Integration (EI2), Beijing, China, 26-28 November 2017,
1
5
.
New York
:
IEEE
. https://doi.org/

[35]

IBM
. What is a Recurrent Neural Network (RNN)? https://www.ibm.com/topics/recurrent-neural-networks (
11 October 2024
, date last accessed).

[36]

Hochreiter
S
,
Schmidhuber
J.
Long short-term memory
.
Neural Comput
1997
;
9
:
1735
80
. https://doi.org/

[37]

Olah
C.
Understanding LSTM Networks -- Colah’s blog,
2015
. https://colah.github.io/posts/2015-08-Understanding-LSTMs/ (
22 September 2021
, date last accessed).

[38]

Cho
K
,
van Merriënboer
B
,
Bahdanau
D
,
Bengio
Y.
On the properties of neural machine translation: encoder–decoder approaches
. In:
Wu
D
,
Carpuat
M
,
Carreras
X
,
Vecchi
EM
(eds),
Proceedings of SSST-8, Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation.
Stroudsburg
:
Association for Computational Linguistics
,
2014
,
103
11
. https://doi.org/

[39]

Chung
J
,
Gulcehre
C
,
Cho
K
,
Bengio
Y.
Empirical evaluation of gated recurrent neural networks on sequence modeling
. In:
NIPS 2014 Deep Learning and Representation Learning Workshop
.
Montréal, Canada
,
8–13 December
2014
. https://doi.org/

[40]

Saxena
S.
Gated Recurrent Unit | Introduction to Gated Recurrent Unit (GRU),
2021
. https://www.analyticsvidhya.com/blog/2021/03/introduction-to-gated-recurrent-unit-gru/ (
28 November 2021
, date last accessed).

[41]

Phi
M.
Illustrated Guide to LSTM’s and GRU’s: A Step by Step Explanation,
2018
. https://towardsdatascience.com/illustrated-guide-to-lstms-and-gru-s-a-step-by-step-explanation-44e9eb85bf21 (
28 November 2021
, date last accessed).

[42]

Kostadinov
S.
Understanding GRU Networks. https://towardsdatascience.com/understanding-gru-networks-2ef37df6c9be (
5 September 2022
, date last accessed).

[43]

Saxena
N
,
Kumar
R
,
Rao
YKSS
et al.
Hybrid KNN-SVM machine learning approach for solar power forecasting
.
Environ Chall
2024
;
14
:
100838
. https://doi.org/

[44]

Nunes Maciel
J
,
Javier Gimenez Ledesma
J
,
Hideo Ando Junior
O.
Hybrid prediction method of solar irradiance applied to short-term photovoltaic energy generation
.
Renew Sustain Energy Rev
2024
;
192
:
114185
. https://doi.org/

This is an Open Access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted reuse, distribution, and reproduction in any medium, provided the original work is properly cited.