A Short-Term Photovoltaic Power Prediction Model Based on an FOS-ELM Algorithm

With the increasing proportion of photovoltaic (PV) power in power systems, the problem of its fluctuation and intermittency has become more prominent. To reduce the negative influence of the use of PV power, we propose a short-term PV power prediction model based on the online sequential extreme learning machine with forgetting mechanism (FOS-ELM), which can constantly replace outdated data with new data. We use historical weather data and historical PV power data to predict the PV power in the next period of time. The simulation result shows that this model has the advantages of a short training time and high accuracy. This model can help the power dispatch department schedule generation plans as well as support spatial and temporal compensation and coordinated power control, which is important for the security and stability as well as the optimal operation of power systems.


Introduction
With the fast-growing consumption of fossil fuels and the resultant environmental deterioration, we are much encouraged to use renewable energy such as solar energy, wind energy, etc. [1].According to the statistics from the International Energy Agency [2], the global photovoltaic (PV) generation capacity growth from 2010 to 2014 has exceeded that of the last 40 years.China has been taking the lead in the global PV market since 2013, followed by Japan and the United States.Furthermore, a lower PV array price has greatly reduced the costs of building PV systems.Therefore, it is predicted that, by 2050, PV power will contribute 16% to the total energy generation capacity worldwide.
Research on PV systems may provide solutions to the many challenges faced by the environment and the power system itself.Studies have been conducted in related areas of optimizing the energy structure and of improving the performance of a PV system.Despite the advantages mentioned above, a PV system is highly subject to environment pollution, and has been criticized for its unstable, random and intermittent power output [3].When a PV system is connected to the grid, its power fluctuation may destabilize the grid and pose a threat to network security, which makes it even harder to formulate generation plans.As such, an accurate prediction of PV power output is required to make better generation plans, support the spatial and temporal compensation, and achieve coordinated power control, so that the need for energy storage capacity and operating costs can be reduced [4].Moreover, better prediction of PV power also helps to enhance system security and stability, as well as optimize the operation of the power system [5].The prediction methods include physical methods and statistical methods.Usually, a physical method first predicts the factors which directly influence the PV power output (such as solar radiation and ambient temperature) and then uses the forecast result as the input of the physical model to obtain the output power.On the other hand, a statistical method uses historical data to build a statistical model based on some machine learning algorithms, and predicts the PV power output directly without building a specific physical model.
It has been proved that the physical method is superior to the statistical method, given large data sets [6].Some regression models are also used to figure out the relationship between the input and output variables, such as the random forest model [7] and the support vectors regression model [8].Researchers have built many kinds of neuron networks to predict the power production of PV systems.For example, Li has proposed an improved gray prediction model [9].Also, the radial basis function (RBF) network has been applied to this area [10].In another paper [11], they use a back propagation (BP) neural network to solve the prediction problem.
In recent years, many hybrid methods have been proposed, which combine the advantages of both methods.In reference [12], a hybrid approach was developed to forecast short-term solar PV power based on the combination of the wavelet transform (WT) and radial basis function neural network (RBFNN).Some researchers also combined the seasonal auto-regressive integrated moving average method (SARIMA) and the support vector machines (SVM) method [13].These models are proved to be effective in PV prediction, although many of them, such as SVM and RBFNN models, are complicated in terms of computation and very data-intensive for the network.
All the models reviewed above ignored the time validation of the data, and assumed the data would not be out-of-date.In actual practice, training data are time sensitive, so the training data need to be updated in real time.Only a few published research papers have considered this fact so far.Among them, an online 24-h prediction model was proposed, which used an RBF network and classified the input variables based on the weather type [14].Some researchers have described a two-stage method where a statistical normalization of the solar power is first obtained, and then the forecasts of the normalized solar power are calculated to predict the PV power [15].
We chose to employ the extreme learning machine (ELM) algorithm because of the following advantages: (1) The computation complexion of ELM is much lower than many other machine learning algorithms.
(2) The learning speed of ELM is much faster than most feed forward network learning algorithms.
(3) The generalization performance of ELM is better than many others.(4) The amount of hidden layer nodes is small and they do not need to be tuned [16].
The aim of our work was to develop a simple and accurate online model for forecasting the power produced by a PV power plant.In order to achieve this goal, we built the prediction model based on the online sequential extreme learning machine with forgetting mechanism (FOS-ELM), which predicts the PV power output for the next 15 min in a rolling manner.
The main contributions of our work are summarized below: 1.
We introduced an online learning model with a Forgetting Mechanism to the area of photovoltaic prediction, which can update the data in real time.

2.
We compared the ELM, OS-ELM and FOS-ELM prediction models in predicting PV power in different seasons.

3.
The simulation results showed that the FOS-ELM model can not only improve the accuracy but also reduce the training time.

Classical Extreme Learning Machine (ELM)
The architecture of the ELM is shown in Figure 1, and the algorithm is presented as follows [17].The ELM is a single hidden-layer artificial neural network.It is assumed that the number of random hidden neurons in the ELM model is L, and the number of different learning samples   , and i a , and i b are randomly generated matrices and vectors, respectively.Then, the output function can be rewritten as: where  is the output weight vector, which connects the random hidden neurons with the output.
G is the active function, which connects the th i random hidden neuron with all of the input nodes, and can be any infinitely differentiable function, such as the Sigmoid function as shown below: Equation ( 1) can be written in the form of matrices, such as: where where the matrix H is the hidden layer output matrix, within which the th i element ( i h ) is the hidden layer output vector for input i x .Y is the vector of the output of the training data. is the only parameter for the training process to determine.The upper bound of the required number of hidden nodes is the number of distinct training samples, in other words, the number of hidden nodes should be less than the number of training samples.
To improve the stability and generalizability of the results, we added the regularization parameter C to (4) to transform it as [18]: The ELM is a single hidden-layer artificial neural network.It is assumed that the number of random hidden neurons in the ELM model is L, and the number of different learning samples (x, y) is and a i , and b i are randomly generated matrices and vectors, respectively.Then, the output function can be rewritten as: where β is the output weight vector, which connects the random hidden neurons with the output.G is the active function, which connects the i th random hidden neuron with all of the input nodes, and can be any infinitely differentiable function, such as the Sigmoid function as shown below: Equation ( 1) can be written in the form of matrices, such as: where Then, the least-square solution of ( 1) is: where the matrix H is the hidden layer output matrix, within which the i th element (h i ) is the hidden layer output vector for input x i .Y is the vector of the output of the training data.β is the only parameter for the training process to determine.The upper bound of the required number of hidden nodes is the number of distinct training samples, in other words, the number of hidden nodes should be less than the number of training samples.
To improve the stability and generalizability of the results, we added the regularization parameter C to (4) to transform it as [18]:

Online Sequential ELM (OS-ELM)
The classical ELM assumes that all the data (samples) are used for training, but in the prediction model, the data is coming chunk-by-chunk (a block of data) or one-by-one (the latter can be seen as a special condition of the former).Therefore, the classical ELM should be adjusted to such conditions [19].In the PV power prediction model, historical weather and PV power data are collected from the Supervisory Control And Data Acquisition (SCADA) system periodically.As OS-ELM updates the training data on time, it is more suitable for the PV power prediction.The algorithm is shown as follows.
Step 1: Initialization-use a chunk of training data {(x i , y i )} N 0 i=1 as initial data.
(b) Calculate the initial hidden layer output matrix H 0 .
(c) Estimate the initial output weight vector: where Step 2: Online study.
(a) When the (k + 1) th chunk of new data {(x i , y i )} is ready, (b) Calculate the partial hidden layer output matrix H k+1 based on the latest data.
(d) Set k = k + 1, and then go back to Step 2.

OS-ELM with Forgetting Mechanism (FOS-ELM)
In practice, training data are time sensitive.In other words, data are only valid within a certain time period.In the process of the FOS-ELM, the data obtained earlier than a certain time can no longer be used under the forgetting mechanism, since the outdated data may make the prediction less accurate [20].As solar radiation and temperature vary seasonally, the FOS-ELM is more appropriate for the PV power prediction model.The algorithm of FOS-ELM is presented as follows.
Step 1: Initialization, which is the same as Step 1 in the OS-ELM.
Step 2: Online learning with the forgetting mechanism.
When the (k + 1) th chunk of new data {(x i , y i )} is ready, (a) Calculate the partial hidden layer output matrix H k+1 , which corresponds to the latest data.
(c) Set k = k + 1, and then go back to Step 2.
It is obvious that the difference between FOS-ELM and OS-ELM is the addition of the forgetting mechanism, which can not only get rid of the outdated data to avoid their interference in the training networks, but also can reveal the timeliness of the data.

Physical Model
The output power of a PV array can be calculated by [21]: where η is the transform efficiency; S is the size of the PV array (m 2 ); R is the solar radiation (kW/m 2 ); e is the loss in efficiency of the array for every degree Celsius of cell temperature increase (always equals to 0.005); and t 0 is the ambient temperature ( • C).
As shown in (11), the output power is affected by several factors, including the transform efficiency, PV array size, solar radiation and ambient temperature.

Input Vector
Based on the physical model presented in Section 3.1, we identified the factors that influence the output power.For a certain array, the efficiency and the size are fixed, as included in the historical data.However, the solar radiation and ambient temperature change with time periodically.Therefore, we choose time, solar radiation and ambient temperature as the input parameters.The input data is obtained from a numerical weather predilection (NWP) model, which uses mathematical models of the atmosphere and oceans to predict the weather on current weather conditions [22].The input vector is: where tem is the ambient temperature, and R is the amount of solar radiation reaching the part of the Earth's surface near the photovoltaic cells.

Data Pre-Processing
We then normalize the different variables to adapt to the ELM in the following way: where x i is the input or output data, while x max and x min are the maximum and minimum of the value.
As the measurement results cannot be exactly accurate, the measured power production and solar radiation data can sometimes be less than zero due to measurement errors, which is impossible in actual practice.In this case, we tune them and the corresponding predicted data to zero.When we calculate the errors, we will eliminate the data set where the measured and predicted values are both equal to zero.

Error Evaluation
The normalized Root Mean Square Error (nRMSE) and Mean Absolute Percent Error (MAPE) are used to evaluate the prediction methods, which are calculated as follows: where n is the number of time periods for power generation; P rated is the rated power; P pi is the predicted power in the i th time period; and P mi is the measured power in the i th time period.In order to avoid the nighttime data, we disregarded the data set where both the solar radiation and PV generated power data are equal to zero.

Flowchart of the Model
The prediction process is illustrated in Figure 2. First, we input the initial historical data for pre-processing, generate the initial hidden layer output matrix H 0 , and estimate β 0 and P 0 .Then, we input the weather forecast data of the next period of time and calculate the prediction value.When the historical data such as the weather and power data arrive, we calculate the prediction error and save the data.After that, we check the time.If it is equal to 1 h, we update the matrices H, β and P; otherwise, the above process is repeated.

Examples and Simulation
In this paper, we used the data from the solar power plant in Ashland, Oregon, with the capacity of 5 kW, downloaded from the website of [23], to simulate the proposed FOS-ELM-based prediction model and compare it with the OS-ELM and ELM models.The plant faces south, tilted 15 degrees.As the paper has shown, the training time and prediction accuracy (in terms of MAPE and RMSE ) of the ELM method are better than the BP neural networks [24], so we therefore focus on the comparison of ELM, OS-ELM and FOS-ELM.
The 5 kW solar electric arrays are located on the roof of the Ashland Court House, which is shown in Figure 3.The details of the three models are presented as follows:

Examples and Simulation
In this paper, we used the data from the solar power plant in Ashland, Oregon, with the capacity of 5 kW, downloaded from the website of [23], to simulate the proposed FOS-ELM-based prediction model and compare it with the OS-ELM and ELM models.The plant faces south, tilted 15 degrees.As the paper has shown, the training time and prediction accuracy (in terms of MAPE and RMSE) of the ELM method are better than the BP neural networks [24], so we therefore focus on the comparison of ELM, OS-ELM and FOS-ELM.
The 5 kW solar electric arrays are located on the roof of the Ashland Court House, which is shown in Figure 3.

Examples and Simulation
In this paper, we used the data from the solar power plant in Ashland, Oregon, with the capacity of 5 kW, downloaded from the website of [23], to simulate the proposed FOS-ELM-based prediction model and compare it with the OS-ELM and ELM models.The plant faces south, tilted 15 degrees.As the paper has shown, the training time and prediction accuracy (in terms of MAPE and RMSE ) of the ELM method are better than the BP neural networks [24], so we therefore focus on the comparison of ELM, OS-ELM and FOS-ELM.
The 5 kW solar electric arrays are located on the roof of the Ashland Court House, which is shown in Figure 3.The details of the three models are presented as follows:

Monthly Average Accuracy Comparison
To compare the accuracy of the three models in different seasons, we choose the data in Spring (from April to June), Summer (from July to September), Autumn (from October to December) and Winter (from January to March) for testing.The results are shown in Table 1.We can see from Table 1 that, in terms of nRMSE , the prediction accuracy is higher in Winter and Summer than in Autumn and Spring; among the three models, Model 1 has the highest accuracy while Model 3 is the lowest.In terms of MAPE , the prediction accuracy is higher in Summer than in Winter; again, the accuracy of Model 1 is the highest and that of Model 3 the lowest.In a nutshell, the FOS-ELM method proves to have the best performance.

Comparison of Training Time
The three models were run in MATLAB.In Model 1, it takes 0.095 s for initialization and 0.052 s for online study.In Model 2, it takes the same time as that of Model 1 to initialize, but only 0.049 s for online study.It takes 0.076 s to train each time in Model 3. Therefore, it can be seen that online study can save about 30% of retraining time.However, it takes 6% more time in Model 1 than in Model 3 for every time online study is conducted.

Conclusions
In this paper, we proposed a new short-term PV power prediction model based on the FOS-ELM method.First of all, we gave a brief introduction to the theories of ELM, OS-ELM,

Monthly Average Accuracy Comparison
To compare the accuracy of the three models in different seasons, we choose the data in Spring (from April to June), Summer (from July to September), Autumn (from October to December) and Winter (from January to March) for testing.The results are shown in Table 1.We can see from Table 1 that, in terms of nRMSE, the prediction accuracy is higher in Winter and Summer than in Autumn and Spring; among the three models, Model 1 has the highest accuracy while Model 3 is the lowest.In terms of MAPE, the prediction accuracy is higher in Summer than in Winter; again, the accuracy of Model 1 is the highest and that of Model 3 the lowest.In a nutshell, the FOS-ELM method proves to have the best performance.

Comparison of Training Time
The three models were run in MATLAB.In Model 1, it takes 0.095 s for initialization and 0.052 s for online study.In Model 2, it takes the same time as that of Model 1 to initialize, but only 0.049 s for online study.It takes 0.076 s to train each time in Model 3. Therefore, it can be seen that online study can save about 30% of retraining time.However, it takes 6% more time in Model 1 than in Model 3 for every time online study is conducted.

Conclusions
In this paper, we proposed a new short-term PV power prediction model based on the FOS-ELM method.First of all, we gave a brief introduction to the theories of ELM, OS-ELM, FOS-ELM, and analyzed the differences between the three models to explain why FOS-ELM is the best one to predict PV power generation, in theory.After that, we built our prediction system that is ready to be applied in practice.Finally, in the simulation part, we used the data provided by the University of Oregon Solar Radiation Monitoring Laboratory to test our models.The proposed FOS-ELM model showed shorter training time and higher accuracy than the classical ELM and OS-ELM models, in all seasons and weather conditions.

Figure 1 .
Figure 1.The architecture of Extreme Learning Machine.

Figure 1 .
Figure 1.The architecture of Extreme Learning Machine.

Figure 2 .
Figure 2. Flowchart of the online sequential extreme learning machine with forgetting mechanism (FOS-ELM) prediction model.

Figure 3 .
Figure 3.The 5 kw solar electric arrays on the roof of the Ashland Court House.

Figure 2 .
Figure 2. Flowchart of the online sequential extreme learning machine with forgetting mechanism (FOS-ELM) prediction model.

Figure 2 .
Figure 2. Flowchart of the online sequential extreme learning machine with forgetting mechanism (FOS-ELM) prediction model.

Figure 3 .
Figure 3.The 5 kw solar electric arrays on the roof of the Ashland Court House.

Figure 3 .
Figure 3.The 5 kw solar electric arrays on the roof of the Ashland Court House.

Table 1 .
Monthly average accuracy comparison.

Table 1 .
Monthly average accuracy comparison.