Recurrent Neural Networks Based Photovoltaic Power Forecasting Approach

: The intermittency of solar energy resources has brought a big challenge for the optimization and planning of a future smart grid. To reduce the intermittency, an accurate prediction of photovoltaic (PV) power generation is very important. Therefore, this paper proposes a new forecasting method based on the recurrent neural network (RNN). At ﬁrst, the entire solar power time series data is divided into inter-day data and intra-day data. Then, we apply RNN to discover the nonlinear features and invariant structures exhibited in the adjacent days and intra-day data. After that, a new point prediction model is proposed, only by taking the previous PV power data as input without weather information. The forecasting horizons are set from 15 to 90 min. The proposed forecasting method is tested by using real solar power in Flanders, Belgium. The classical persistence method (Persistence), back propagation neural network (BPNN), radial basis function (RBF) neural network and support vector machine (SVM), and long short-term memory (LSTM) networks are adopted as benchmarks. Extensive results show that the proposed forecasting method exhibits a good forecasting quality on very short-term forecasting, which demonstrates the feasibility and e ﬀ ectiveness of the proposed


Introduction
Solar energy is a completely free cost and easily accessible source of energy that has proven to be one of the cleanest and most abundant renewable energy sources.Many large-scale solar photovoltaic (PV) plants are widely applied in many countries in the world to reduce environmental pollution and carbon emissions caused by fossil energy [1].However, the variability of solar energy resources has brought difficulties to electric power grid management with the increase of solar energy penetration rates.Meanwhile, the access of a large number of PV power plants to randomness and intermittency will seriously affect the stable operation of the entire power system [2].It should be mentioned that PV power forecasting is an important factor in the power system to solve the problem of solar PV power plant optimization planning and modeling.The research in [3] indicates that an accurate forecasting of PV power becomes crucial to improve the power system stability and to ensure an optimal unit commitment and economic dispatch.
In practice, the task of a more accurate solar power forecasting plays a crucial role in the smart grid.In [4], a reliable PV forecasting method provides the necessary predicted input data to the optimization stage for grid-connected PV systems with storage.Simulations show that the efficiency of the predictive schedule depends on the accuracy of the forecasts.With the forecasted values, the actual PV load can be calculated for a multi-objective economic load dispatch to minimize the total operating cost of the distributed network.The online prediction results can also be used to model the various uncertainties of PV power in real-time energy management systems [5].In [6], deterministic PV generation forecasting is utilized to design an efficient generation controller to achieve an optimal microgrid economic operation.In [7], a solar power forecasting system is used to design the ramp-rate control strategy for large PV systems without energy storage.The PV output power will ensure that it is smoothed in advance because the participation of the forecasting system provides sufficient pre-operation time for the inverter.PV power forecasting results can also help reduce power flows to the grid and improve the self-consumption of PV generated electricity [8].In addition, the PV power forecasting technology will be widely implemented in the electric vehicle charge-discharge management coordination between home and grid energy management systems [9], the multi-objective optimal design of hybrid renewable energy system [10] and the robust planning of the electric vehicle charging facilities [11].Therefore, a good PV power forecasting method is needed to promote the future application of solar energy.
In recent years, PV power generation has attracted great interest from researchers around the world.The PV prediction methods can be classified into three categories: the physical method, statistical method, and artificial intelligence method [12].The physical method obtains meteorological and geological parameters through numerical weather prediction (NWP), satellite remote sensing measurement and ground measurement devices.But service facilities with appropriate and frequent calibration are required [13].The statistical method is a data-driven approach that extracts features from historical samples to predict the future behavior of PV via an error minimization.The key to accurately predict PV output power is the quality of historical samples [14].Meanwhile, artificial intelligence techniques have become an excellent tool for wind generation and PV generation [15,16] and can solve the problem of a non-linear function estimation [17].For example, the neural networks can be used to model the characteristics of traditional silicon-based PV modules; then, such networks, together with the intelligent algorithmic, are utilized to automatically parametrize the Voltage-Current characteristics of organic PV modules [18].Meanwhile, the artificial intelligence technology is also playing a key role in the energy domain, such as the control system [19], energy consumption [20], pattern recognition and failure classification [21,22].In particular, with the rapid development of artificial intelligence algorithms and excellent performance in many fields, it is superior to other models in dealing with non-linear problems with strong uncertainties [23].
Focusing on solar energy prediction by artificial intelligence techniques, many direct forecasting models are generally proposed in the literature.In [15], a novel artificial neural network (ANN) model using statistical feature parameters is proposed for short-term solar irradiance forecasting.In [24], an improved adaptive back propagation neural network (BPNN) prediction model is established to forecast PV power.The forecasting model adapts to time and a changing external environment through the scrolling time window.In [25], the weather conditions are divided into four categories: clear sky, cloudy day, foggy day and rainy day.Then, a general framework based on weather classification data, historical measured power and support vector machine (SVM) is developed to approximate the PV generation prediction model.In [26], an advanced prediction model based on the radial basis function (RBF) neural network is proposed to predict the PV power of the next 24 h.Here, a self-organized map (SOM) is used to classify the weather types from NWP.However, an appropriate mathematical model without complicated calculations is still needed to predict the PV output power.As one of the deep learning algorithms, recurrent neural networks (RNN) has been successfully applied to the smart grid [27].In [28], the sunshine, radiation intensity, atmospheric pressure, and the temperature before the predicted time step is considered to establish the prediction model, and its forecast error is minimized by RNN.In [29], RNN is used as a good tool for the time series prediction, with a good performance for the solar radiation prediction.The authors in [30] propose the use of the long-short-term memory recurrent neural network (LSTM-RNN) to accurately forecast the output power of PV systems.
In particular in the forecasting approaches, a good approach could directly predict the PV output power based on some prior information or readily accessed data.RNN can remember the power changes between the inter-day because of their recurrent architecture and memory units.Previous studies have proven that the RNN model can discover the inherent abstract features and hidden invariant structures in data from the lowest level to the highest level without complicated calculations.Nevertheless, there is still no published research that considers both the inter-day (and day-to-day) and intra-day (or within-day) information for very short-term PV power forecasting.A natural extension in this context is that: if the forecasting model can utilize the PV power of inter-day and intra-day, it is expected to explore a more accurate prediction performance.Therefore, we originally propose a very short-term forecasting model, based on RNN, that considers both the inter-day and intra-day PV power.Meanwhile, the inter-day data input to RNN model can provide more detailed information for a very short-term PV power prediction.The main contributions of this article are as follows: (1) In this paper, the PV power correlation of adjacent days is verified and analyzed.
(2) The RNN model is introduced and tailored to fully extract high-level non-linear features hidden in the inter-day and intra-day power data.(3) For the first time, a novel PV power forecasting method based on adjacent days and intra-day data is proposed to mitigate the effects of the nonlinearity features that exist in the PV output power series on the prediction accuracy.
The performance is validated using real solar power in Flanders, Belgium.The extensive results show that the proposed method can effectively extract the invariant structures exhibited in the historical PV power data, and accurately predict the output power of PV.The main purpose of this paper is to predict PV power, i.e., to minimize the error between measured power and predicted power.Usually, the measurement error is very small and usually negligible.Therefore, measurement errors are generally not considered in PV power prediction.Consequently, we consider the measured power as the actual PV power in the proposed forecasting model.The paper is organized as follows.Section 2 presents the RNN model.Section 3 presents a point forecasting model based on RNN and the data of the adjacent days.Section 4 gives a case study and discussions.Section 5 presents the conclusions.

RNN Model
Figure 1 shows the structure of the RNN model.x t and y t are the input variable and output variable of the RNN at step t.The hidden state s t of the RNN model is calculated based on the input x t at the current step t and the previous hidden state s t−1 at the step t−1.The mathematical model of RNN is expressed as follows: where U ∈ R l x ×l s is the weight matrix between the input layer and the hidden layer.W ∈ R l s ×l s is the weight matrix between the hidden layer and the hidden layer.V ∈ R l o ×l s is the weight matrix between the hidden layer and the output layer.It can be noted that in Figure 1 the parameter values of the weight matrixes U, W, and V are not changed in the different steps.l x , l s and l o are the numbers of neurons in the input layer, hidden layer and output layer, respectively.s t is the hidden layer state at step t, and it is the "memory" of the RNN.The parameters b and c are bias vectors.o t is a temporary variable, and o t is only determined by the hidden state s t of the RNN model.f = tanh and g = sigmoid are the activation functions of the hidden layer and the output layer, respectively.

Parameter Learning Procedures of RNN
To learn the parameters U, V, W, b, and c of the RNN model, the back propagation through time (BPTT) approach is used in this work to calculate the gradient of these parameters [31].BPTT is a back propagation training algorithm of RNN, which is applied to the sequence data like time series.The BPTT approach works by unrolling all of the input time steps, and the sample errors of RNN are computed and accumulated at each time step.The cost function of RNN can be set as: where L is the total cost of all of the time sequences.Equation ( 4) indicates that the total cost is just the sum of the sub-costs at each time step.y t j and y t j are the measured value and predicted value, respectively.The hidden state gradient of step t is defined as: From the RNN model, it can be seen that δ t is determined by the sub-cost at the current step t and the sub-cost at step t+1.So, δ t is related to the output temporary variable o t and the hidden layer state s t+1 .
where diag( .) stands for creating a diagonal matrix from a given vector.Since there is no other hidden state after the last step τ, the δ τ is written as: The gradient of network parameters at step t is calculated step by step by back propagation.Then, the gradient of U, V, W, b and c can be expressed by the following formula: Obviously, the final gradients of the network parameters are the sum of the sub-gradients at each time step.The gradients of the network parameters can be easily calculated using Equations ( 2)-( 4), ( 9) and (10).Therefore, the updated rule for these parameters are as follows: where η is the learning rate of RNN, and the superscript n stands for the iteration times of BPTT.
The partial derivatives of the cost function with respect to the disturbance of b, c, V, W and U can be inferred from Equations ( 8)-( 12).

Adjacent Days and Intra-day Data
In Figure 2, we plot the PV power curves for seven days over a period of time.The unit of PV power is MW, and the historical data is recorded by an electricity transmission system operator in Belgium [32].From the plots, the PV power of one day is very similar to the PV power of the adjacent days when the weather condition does not change drastically in a short period of time.It can be seen that the PV power of adjacent days can provide more weather information for future PV power forecasting.The PV power of adjacent days with a shorter time interval has a higher degree of similarity.Hence, this paper considers the adjacent power data before the forecasting day for the proposed prediction model.In Figure 3, we evaluated the correlation of the output power of adjacent days for different k-day intervals.We consider a historical PV power dataset over one year and calculate the average of the performance metrics with k-day intervals.We consider 60 power points of one day, and the daily data covers the time period from 5:00 to 19:00, with a 15-min resolution.For adjacent days, we assume the PV output power for the ith day is P i = [p i1 , p i2 , . . ., p iM ] and the jth day output power is P j = [p j1 , p j2 , . . ., p jM ].We assume the ith day is the forecasting day and the jth day is a historical day adjacent to the forecasting day.Here, M is the length of the daily data, and p i1 is the PV power point at 5:00.Then, we use the cosine similarity [33] and the correlation coefficient [34] as the similarity degree metrics.The cosine similarity will reflect the trend similarity degree of the daily power on the forecasting day and a historical day adjacent to the forecasting day.The correlation coefficient is always used to measure the correlation between the two days.The metrics are defined as follows: where i∈[1, . . ., n-k], j=i+k, m∈[1, . . ., M], k is an interval value representing the number of days between the ith day and the jth day, n is the number of days in the whole year, p im is a power point of the ith day, and p i is the mean value of the ith daily data.The cosine similarity c ij can reflect the trend similarity degree of daily power between the ith day and the jth day, independent of their magnitude.The correlation coefficient r ij is always used to measure the day similarity degree of two days.The metric c k and r k are the average values of the cosine similarity c ij and correlation coefficient r ij , respectively.As can be seen from Figure 3, the cosine similarity and the correlation coefficient of the historical day both deteriorate when k increases.The results show that the historical day with a smaller k will have a higher cosine similarity and correlation coefficient.That is, the output power of the adjacent days has a high correlation under a scenario of a short time interval.Hence, the consideration of adjacent days' data has a positive effect on the PV power forecasting.This forecasting model that takes into account the PV power of adjacent days makes up for the deficiency of PV power forecasting that is only based on intra-day data.

Data Processing
We forecast the power at h+1 for the forecasting day not only by the previous power at h+1 of the previous days (as shown in Equation ( 21)), but also by the power at the time h-m, h-m+1, . . ., h of the forecasting day (as shown in Equation ( 22)).On the one hand, we believe that the previous power at h+1 of the previous d days can provide trend information for the predicted power at h+1 for the forecasting day, which will have a positive impact on the multi-step prediction.On the other hand, for the intra-day data, the PV power (from h-m to h) of the forecasting day before time h+1 of the forecasting day will provide better reference information for a very short-term prediction.The inputs of RNN for PV power forecasting are shown in Figure 4.As studied in Equations ( 1)-( 3), the input process of the RNN can be divided into multiple steps, and the latter step can retain the effective features of the previous step.Hence, the inputs of RNN can be expressed as: where x f (h) is the power at time h of the forecasting day, and x f − 1 (h + 1) is the power at time h + 1 of the day before the forecasting day.d is the number of the historical days adjacent to the forecasting day, and m represents the number of PV power points selected for the forecasting model in the forecasting day.
x f (h + 1) is the predicted power for our purpose, and y t and y t + 1 are the expected output in the RNN.
Based on the RNN model, we can explore a more accurate prediction performance by considering the power data of adjacent days.Therefore, we can predict the PV power point x f (h + 1) of the forecasting day by utilizing the PV power at time h + 1 of the historical adjacent days.In Equation ( 21), the trend information hidden in the adjacent days can be extracted by RNN, which will be fed as the input of the next step for the PV power forecasting.In Equation ( 22), the predicted power x f (h + 1) is also related to the PV power, such as x f (h − m), x f (h − 1) and x f (h) in the forecasting day.As depicted in Figure 4, both the x t and x t+1 are used as input of the RNN.The input data is the historical power data of the PV plants, and the range of the input data is from 0 to the rated outpower.Since RNN is a nonlinear model, it easily causes a gradient explosion when dealing with some large-value data.Moreover, it will also reduce the learning efficiency of RNN.A classic method to solve this problem is data normalization, and the power data can be limited to the normalized value between 0 and 1 to reduce the regression error.The mathematical formula of min-max scaling is as follows: x = x − x min x max − x min (24) where x is the original power data, and x max and x min are the maximum and minimum of the historical output power data.

Forecasting Model Based on RNN
Due to the chaotic nature of the weather conditions, the PV output power data always exhibits a high degree of variability and volatility.Therefore, this study proposes a novel point predictor to mitigate the impact of uncertainty on the accuracy of the PV output power prediction.This predictor is based on the RNN network and considers the adjacent days and intra-day power data.The RNN network has multiple steps input, and the current step input of the hidden layer also includes the state of the previous step hidden layer.This means that the short-term memory attributes based on RNN can better mine the potential links in adjacent days and improve the accuracy of the PV power generation prediction.
As shown in Figure 5, the original PV output power data is divided into a training dataset and a testing dataset.The training dataset and testing dataset are normalized and then arranged in several input sequences.A multi-horizon forecasting model based on RNN is established and trained in a back-propagation through time (BPTT) algorithm [31] to predict the PV output power as accurately as possible.

Forecasting Performance Evaluation
We select the mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE) as the evaluation criteria [35].The evaluation criteria are as follows: where N is the number of test data, P i a is the measured power, P i f is the predicted power, and P mean is the average of the total measured power.The MAE and RMSE indexes are used to measure the prediction accuracy, and MAPE is used to measure the degree of deviation between the predicted value and real value.It should be noted that the forecasting method has a high precision when the performance criteria are small.

Case Study and Discussions
The main characteristics for the output power of the PV systems are randomness and intermittency.These characteristics can lead to unexpected fluctuations in the voltages and PV power for the PV systems and can cause many problems in power systems, such as power quality, generation control, and storage devices protection.In essence, it is necessary to accurately predict PV power generation to ensure the safe operation and economic integration of the power system [35].In this paper, the historical solar-PV power data used are collected by Elia, Belgium's electricity transmission system operator, and the freely downloaded website can be found in the literature [32].The Flanders photovoltaic power plant has a rated capacity of 2140 MW.The photovoltaic power station transmits electric energy to the common coupling point of the AC grid through DC-DC-AC technology.The active power flow meter is used to measure the active power in real time.Among the collected data, the maximum PV power is 2140 MW and the minimum PV power is 0 MW.The measurement error of the power flow meter is within 0.5%.The measurement error is generally small when compared to the forecasting error.Therefore, the measurement error of PV power plants is generally not considered in this paper, just like other PV power forecasting articles.
Flanders, Belgium is located at 50 • 51 north latitude and 4 • 21 east longitude, in a temperate maritime climate, and the major features of the year are mild and humid, over the four seasons.Hence, we select four cases from the Flanders Belgium station for a predictive and performance evaluation.The PV power used in this paper are shown in Figure 6, which presents the PV power in Flanders, Belgium for one year.The data cover the period from January 2015 to December 2015 with a 15-minues resolution.The PV power data used in case 1 is from June 30, 2015 to July 31, 2015, and the power data covering the period from December 31, 2015 to January 31, 2016 are adapted to case 2. Similarly, the PV power data used in case 3 and case 4 are from March 31, 2015 to April 30, 2015 and from September 30, 2015 to October 31, 2015, respectively.For each case, the PV power dataset is divided into a training dataset and a testing dataset, which are the data from the 1st to 25th and the rest data, respectively.The training dataset is applied to train the RNN network and extract the nonlinear features hidden in the PV power data, and the testing dataset is used to evaluate the prediction performance of the proposed method.In each case, the predictive model is adapted to each time period through independent training and testing.In order to comprehensively evaluate the forecasting performance of PV power with a multi-time resolution, six forecasting horizons from 15 ahead up to 90 min are presented in this section.In the simulation, Persistence [36], RBF [26], BPNN [24], SVM [25] and LSTM [30] are chosen as benchmark methods to illustrate the improvement of the proposed forecasting model in terms of the forecasting quality.

15-Min Ahead Forecasting Results
For the 15-min ahead forecasting, the PV power forecasting results of the proposed method in case 1 and case 2 are shown in Figure 7a,b.In the plots, the predicted power curve and measured power curve are a red line and a blue line, respectively.Figure 7a shows the forecasting results of case 1 (Summer) in 15-min-ahead, and it can be seen from the figure that the PV has a higher output power, and the curve will be relatively smoother compared with Figure 7b.As shown in Figure 7b, the output power of case 2 (Winter) is lower than case 1, while the variation amplitude of the power data is larger than case 1.From the curves of Figure 7, we observe that the PV station has a larger and smoother output power curve when the ambient air temperature and solar radiation are high.This is because, at the Flanders Belgium station, the solar temperature and radiation are much stronger in summer than in winter.The 15-min ahead prediction results of case 1, case 2, case 3 and case 4 obtained from Persistence, RBF, BPNN, SVM, LSTM and the proposed method are presented in Table 1.In each case, the predictive model is adapted to each time period through independent training and testing.The best results from the different performance evaluation criteria are highlighted.From the MAE, RMSE and MAPE indexes, the proposed method is superior to the other benchmark methods in all cases.Compared to Persistence, RBF, BPNN, SVM and LSTM, the MAE index has been averagely improved by 72.43%, 60.25%, 33.15%, 43.56% and 43.07%, respectively.Similarly, the RMSE has been evenly improved by 71.51%, 54.37%, 27.17%, 26.78% and 39.96%, respectively, while the MAPE has been improved by 66%, 56.80%, 32.88%, 42.94% and 34.84%, respectively.Meanwhile, both the MAE and RMSE indexes of case 2 are smaller than for the other cases, and the MAPE index is larger than the rest of the cases.This is due to the fact that the PV output powers in July 2015, April 2015 and October 2015 are more stable and more moderate than that in January 2016.The performance evaluation indexes of case 1 and case 2 in Table 1 can be validated from Figure 7.For the 30-min ahead forecasting, the performance indexes of different methods are shown in Table 2.In the table, the proposed method generates the least MAE, RMSE and MAPE errors out of all four cases, which further reveals the effectiveness of the proposed model.From the average indexes, the LSTM performs better than SVM, BPNN, RBF and Persistence.Moreover, the proposed method has obvious advantages over other benchmarks.It clearly shows the improvement of the proposed method over the benchmark methods in terms of prediction performance in 30-min ahead.Generally speaking, the proposed method performs the best, followed by LSTM, SVM, BPNN, RBF and Persistence.The high precision results mainly result from the RNN architecture, which provides an effective way to mine the weather features in the adjacent days.Therefore, the high-level non-linear, non-stationary characteristics exhibited in the PV power dataset can be better extracted.To fully verify the feasibility and robustness of the proposed method, simulation experiments are performed under different forecasting horizons.The multi-step ahead forecasting linear regression results (predicted power and measured power) of the proposed method in case 1 and case 2 are shown in Figures 8 and 9.The forecasting horizons are 15-min, 30-min, 45-min, 60-min, 75-min and 90-min, respectively, corresponding to Figures 8a-f and 9a-f.For example, in Figure 8a, the black solid line is the linear regression curve, and the abscissa and ordinate values are the predicted power and measured power, respectively.Meanwhile, the measured power and the predicted power are represented by blue points.As shown in Figure 8, the deviation of the predicted power value from the measured power value increases in case 1 as the forecasting horizon increases.Similarly, the deviation of case 2 increases as the forecasting horizon increases in Figure 9. From the figures, when the prediction step is larger than 60 min, it can be seen that the linear regression results will have a large regression error.Compared to case 1, the forecasting results of case 2 have a significant degradation because of a poor solar radiation stability and low temperature.In terms of the season of the two cases, case 2 belongs to winter with a short illumination time and unstable temperature change.Therefore, the deviation of the multi-steps ahead forecasting results in case 1 is better than in case 2.  In Table 3, we calculate the R 2 (coefficient of determination) [37] in both case 1 and case 2. The R 2 is a measure of how the regression line represents the data, and a forecasting model is more efficient when R 2 is close to 1. From the table, the proposed model exhibits the values of R 2 (0.9699-0.9994) in case 1, and R 2 (0.8359-0.9954) in case 2. The results show that our proposed model has a good efficiency in a multi-step prediction.Furthermore, the values of R 2 deteriorate when the forecasting horizon increases.This implies that the efficiency of the proposed model can be affected by the forecasting horizon.Remarkably, the coefficient of determination in case 2 is worse than in case 1.This shows that the efficiency of the proposed model can also be affected by the seasons in Flanders.This is understandable because the weather environments in case 2 are relatively more chaotic and thus more unpredictable.In Figure 10, we plot the MAPE curves in different forecasting horizons, where the performance metric value is the average of case 1 and case 2. In addition, Persistence, RBF, BPNN, SVM and LSTM are selected as the reference bases for the proposed method.It can be seen from the figures that the MAPE index increases approximately linearly to the increase of the forecasting horizon; that is, the performance of the prediction model significantly decreases with the increase of the forecasting horizon.This is due to the higher uncertainty and randomness exhibited in the PV power sequences.The BPNN methods have a good forecasting performance in 15-min and 30-min ahead, but could not maintain a good prediction performance in a multi-step prediction due to the inherent limitations of the shallow network.The MAPE index of LSTM increased rapidly with the increase of the forecasting horizon, and the forecasting performances of LSTM in 60, 75 and 90-min are worse than our proposed model.Meanwhile, compared with RBF, BPNN, SVM and LSTM, the proposed method has a significant advantage in the forecasting horizon from 15-min ahead to 90-min ahead.In particular, the proposed method still has a lower prediction error within the 90-min ahead forecasting horizon, with the average MAPE being 31.33%.From the results, it is clear that the MAPE index obtained from the proposed method is significantly better than the benchmarks in all of the prediction horizons, which confirms the high efficiency and performance of the proposed model in solving short-term PV forecasting problems.

The Stability and Robustness of Forecasting Model
In this subsection, several simulations of the forecasting model are performed to ensure that the proposed method can provide stable and reliable prediction results.These methods have been run 25 times independently with different forecasting horizons.Figure 11 presents the related error bars of RMSE in case1, case 2, case 3 and case 4. The RMSE in the four cases obtained from the proposed method remains a low error over the forecasting horizons because the recurrent architecture and memory units are determined, and the adjacent power data in each forecasting process is utilized.As can be seen from the figure, the prediction error of the persistence forecasting model is large.The RMSE index of BPNN method fluctuates wildly, indicating that the prediction performance is not stable enough, which is not desirable in a practical application.Although the prediction performance of the RBF and SVM methods are relatively stable, their prediction accuracy still needs to be improved.The RMSE index of LSTM increases with the increase of the forecasting horizon, and its performance deteriorates rapidly when the forecasting horizon is large.Obviously, the averaged RMSE of the proposed method is the best among the benchmarks.In addition, the result of LSTM outperforms the RBF, BPNN and SVM in 15, 30, 45 and 60-min, which is consistent with the recurrent architecture in [30].Meanwhile, the complex structure of LSTM and the accumulation of errors in the multi-step prediction will lead to a large prediction error in 75 and 90-min.We can see that the prediction performance of the proposed method is more stable than RBF and BPNN, and that the error is smaller than Persistence, SVM and LSTM.These results show that our method can provide a reliable prediction result for the PV power generation prediction.Hence, from the numerical results, we can easily conclude that the proposed method exhibits the most desirable performance for PV power forecasting.

Conclusions
In this paper, we have proposed a new RNN-based short-term method for forecasting PV power.Unlike traditional forecasting methods, we feed the PV power of adjacent days to the RNN model, where the similarity and correlation have been verified with the real power data in Flanders, Belgium.The proposed forecasting model with a recurrent architecture and memory units can effectively learn the power changes and features in both the inter-day and intra-day PV power.Then, the proposed method has been comprehensively compared with the LSTM, SVM, RBF, BPNN and Persistence methods.Some results demonstrate that the average MAPE, RMSE and MAE of the proposed method outperform the benchmarks in the 15-min and 30-min forecasting horizons.Meanwhile, the proposed method also has a good prediction performance in different cases and forecasting horizons.Therefore, the proposed method can provide stable and reliable power forecasting for the actual PV power plants.Furthermore, the proposed method can be used to promote the future application of solar energy.The last time step s t

Nomenclature
The hidden state at step t x t The input variable at step t y t The output variable at step t o t A temporary variable, o t is only determined by the hidden state s t b, c Bias vectors f, g Activation function U ∈ R l x ×l s The weight matrix between the input layer and the hidden layer W ∈ R l s ×l s The weight matrix between the hidden layer and the hidden layer V ∈ R l o ×l s The weight matrix between the hidden layer and the output layer l x , l s , l o The number of neurons in the input layer, hidden layer and output layer.

L
The total cost of all time sequences L t The sub-cost at the current step t δ t The hidden state gradient of step t diag( .) The diag( .) stands for creating a diagonal matrix from a given vector η The learning rate of RNN k An interval value representing the number of days between the ith day and the jth day P i The PV output power for the ith day p im A power point of the ith day M The length of the daily data n The number of days in the whole year c ij The trend similarity degree of daily power between the ith day and the jth day r ij The correlation coefficient of daily power between the ith day and the jth day c k The average values of cosine similarity c ij in k-day intervals r k The average correlation coefficient r ij in k-day intervals p i The mean value of the ith daily data d The number of the historical days adjacent the forecasting day m The number of PV power point selected in the forecasting day x f (h) The power at time h of the forecasting day x f -1 (h + 1) The power at time h+1 of the day before the forecasting day x f (h + 1) The predicted power for the forecasting model y t , y t + 1 The expected output in the forecasting model x min , x max The maximum and minimum of the historical output power data N The number of test data P i a The measured power at the ith sample P i f The predicted power at the ith sample P mean The average of the total measured power

Figure 2 .
Figure 2. The PV power generation curves of adjacent days in Flanders, Belgium.

Figure 3 .
Figure 3.The similarity degree in adjacent days for k-day intervals.

Figure 4 .
Figure 4.The inputs of RNN for the PV power forecasting.

Figure 5 .
Figure 5.The flowchart for the PV generation power forecasting.

Figure 6 .
Figure 6.The PV power curves in Flanders, Belgium.

Figure 8 .
Figure 8. (a-f).The results of the linear regression for the predicted and measured power in case 1.

Figure 9 .
Figure 9. (a-f).The results of the linear regression for the predicted and measured power in case 2.

Figure 10 .
Figure 10.Average MAPE statistics for case 1 and case 2 in terms of various forecasting horizons.

Figure 11 .
Figure 11.RMSE statistics in terms of various forecasting horizons.

Table 1 .
Performance evaluation for the 15-min ahead forecasting.

Table 2 .
Performance evaluation for the 30-min ahead forecasting.

Table 3 .
The coefficient of determination R 2 .