 Review
 Open Access
 Published:
Using the artificial neural networks for prediction and validating solar radiation
Journal of the Egyptian Mathematical Society volumeÂ 27, ArticleÂ number:Â 47 (2019)
Abstract
The main objective of this paper is to employ the artificial neural network (ANN) models for validating and predicting global solar radiation (GSR) on a horizontal surface of three Egyptian cities. The feedforward backpropagation ANNs are utilized based on two algorithms which are the basic backpropagation (Bp) and the Bp with momentum and learning rate coefficients respectively. The statistical indicators are used to investigate the performance of ANN models. According to these indicators, the results of the second algorithm are better than the other. Also, model (6) in this method has the lowest RMSE values for all cities in this study. The study indicated that the second method is the most suitable for predicting GSR on a horizontal surface of all cities in this work. Moreover, ANNbased model is an efficient method which has higher precision.
Introduction
The solar energy is considered as one of renewable energy sources that are from the most promising sources to supply the worldâ€™s energy demand. Accurate knowledge of the solar radiation (SR) data is considered the first stage in solar energy availability assessment. It is used as the basic input for many solar energy applications. But there is unavailability of the solar radiation measurements for different sites, due to the high cost of measuring equipments and their maintenance [1,2,3,4].
Many studies are implemented to develop for predicting the GSR using different techniques such as ANN, fuzzy control, and empirical models. These techniques depended on different types of datasets (such as meteorological and geographical). For example, Fadare [3] used several models which depended on feedforward and multilayered ANN for estimating GSR in 195 cities in Nigeria. He used some meteorological data as inputs in ANN models. The study demonstrated the ability of ANN to predict GSR in most of these cities in Nigeria. Elminir et al. [5] implemented ANN to estimate the GSR in some cities in Egypt. The authors used the different combinations of inputs of meteorological data as input of ANN models. The outcomes showed that the ANN models donate excellent predictions. Koca et al. [6] utilized an ANNbased model for assessment of GSR for seven cities in Turkey. They applied linear and nonlinear activation functions in the hidden layer in ANN models. The study showed that the ANN models are suitable for evaluating solar radiation in Turkey. Mohandes et al. [7] designed the ANNbased models for forecasting the GSR in Saudi Arabia. They used Bp algorithms for training the different pattern of multilayer feedforward NN. The outcomes indicated that MAPE is the best in all models. Rehman and Mohandes [8] employed the temperature, day of the year, and relative humidity values as input in ANN models for estimating GSR in Saudi Arabia. The outcomes showed that the ANN models are highly accurate for prediction of solar radiation. Jiang [9] employed the ANN model to forecast GSR in China and found the ANN model is better than regression models.
Khatib et al. [10] used many models to estimate GSR. These models are linear, nonlinear, adaptive neuron fuzzy inference system (ANFIS) and ANN models. The study showed that the most accurate methods for prediction of SR were ANN models. Mellit et al. [11] presented new models for the estimation of GSR, and these models combined the neural network and the fuzzy logic. The correlation coefficient obtained for the validation dataset is 98%. These models can be used for the estimation of the GSR for any locations in Algeria. Hassan et al. [12] introduced a new temperaturebased model for predicting GSR. The results showed that the new proposed models have accurate estimations for GSR at different sites in Egypt.
The main aim of this paper is to predict and assess the daily GSR based on set of inputs used in all ANN models. The datasets of three cities Borg ElArab, Cairo, and Aswan are used for training and testing. All ANN models used two different Bp algorithms which are basic Bp and Bp with momentum and learning rate coefficients. We calculated these statistical indicators to evaluate the performance of the proposed models. These indicators are root mean square error (RMSE), the mean absolute percentage error (MAPE), mean absolute bias error (MABE), correlation coefficient (r) and coefficient of determination (R^{2}). Accurate ANN models were based on the minimum values to RMSE, MABE, and MAPE and maximum values of r and R^{2}. In the present work, ANN models are compared with other similar works to establish the performance of our models with others.
Data description
Most regions of Egypt obtain enormous amount of solar energy due to their valuable geographical place. The data used in this study are the global solar radiation (GSR), maximum temperature (T max), minimum temperature (T min), averages temperature (T avg), relative humidity (RH), and atmospheric pressure (Atm.p) of three different locations which are Borg ElArab, Cairo, and Aswan. These locations varied in climatic condition across Egypt and data were collected for a period of 14â€‰years from 1 January 2002 to 31 December 2015 which we obtained from the NASA Surface meteorology and Solar Energy web site^{Footnote 1}.
The city of Borg ElArab is a coastal region located in the Mediterranean, Cairo city is a moderate region and has dry climate in summer season, and Aswan city is located in the Upper Egypt and has the dry desert climate. The selected locations in the work are presented in Table 1. In addition, Egypt is one of the countries located in the most favorable solar belt, which enjoys abundant solar radiation almost 4500â€‰h of sunshine per year, 13â€“35â€‰MJ/m^{2}/day of solar energy magnitude [12,13,14].
The description of artificial neural network technique
The ANN model is an intelligent system and is used to solve complicated problems in many applications such as optimization, prediction, modeling, clustering, pattern recognitions, simulation, and others. The ANN structure consists of three layers: the input layer which has collected data, an output layer which produces computed information, and one or more hidden layers suitable to connect the input and output layer. A neuron is a basic processing unit of a NN and performs two functions: the collecting of the inputs and producing of the output. Each input is multiplied by connection weights, and its products and biases are added and then passed through an activation function to produce an output as shown in Fig. 1.
A multilayer feedforward network has neurons structured into layers and can pass in one direction without feedback connection. The Bp algorithm is the most method used for training feedforward ANNs which is dependent on the gradient descent optimization technique. Bp is a technique based on supervised learning [15] that is used for training NN, and it is processed to learn samples iteratively. Therefore, it compared the network predicted for each input with the actual value. To minimize the mean squared error between the network estimated and the measured data, the weights are adjusted for each training model [5].
In Fig. 2, each input x_{i} in the input layer is multiplied by a connection weightÂ w_{ij} between the neuron i in the input layer to the neuron j of the hidden layer and get its products, and bias b_{j} are summed formally net input I_{j} in Eq. (1) and then passed to the hidden layer by a nonlinear sigmoid activation function in Eq. (2) to produce an outputÂ y_{j} as in Eq. (3):
Then, it sends the out signal y_{j} from the hidden layer to all k neuron in the output layer o_{k} and computes the input to the k neuron of the output layer is oâ€²_{k} in Eq. (4).
where wâ€²_{jk}Â is the weight of the connected between the j neuron in the hidden layer to the k neuron of the output layer; bâ€²_{k}Â is the bias.
Finally, it computes the output layer signals by the sigmoid activation function in Eq. (5).
The error training between the target output and the measured data is in Eq. (6).
This procedure is applied to all pairs in the training set and the training cycle which is known an epoch and is repeated until the error reduces to the limit value [16, 17].
The error gradient for output layer is completed in Eq. (7).
The difference between two algorithms which are the basic Bp and Bp with momentum and learning rate is in the updates of weights.
In Bp algorithm with momentum and learning rate, the weights between the different layers may be updated. And the error was then propagated backward from the output layer to the input layer in Eq. (8).
where Î· is the learning rate and Î± is the momentum coefficient.
But in the basic Bp algorithm, the weight update between neuron k from the output layer and neuron j from the hidden layer is as follows (Eq. (8â€²)):
wâ€²_{jk}(tâ€‰+â€‰1)â€‰=â€‰wâ€²_{jk}(t)â€‰+â€‰Î·Î´_{k}y_{j} (8â€²)
Both of the coefficients Î· and Î± are used at the start of learning process and demonstrate the speed and stability of the network [15, 18]. Selecting small learning rate Î· may lead to slow rate of convergence, but the large Î· may show oscillation. The solution to make the convergence of the network fast without oscillation is used in the momentum coefficient. It is used for accelerating the convergence of the algorithm, and it contains the effect of previous weight changes on the current direction of movement.
The \( \Delta {w}_{jk}^{\prime } \) and âˆ†bâ€²_{k} are computed to update \( {w}_{jk}^{\prime } \) and bâ€²_{k} as shown in Eqs. (9) and (10) respectively.
And the error gradient for the hidden layer is computed in Eq. (11).
âˆ†w_{ij} and âˆ†b_{j} are calculated to update w_{ij} and b_{j} as shown in Eqs. (12) and (13) respectively.
The weights and the biases are updated in Eqs. (14)â€“(17) respectively:
In this study, the Bp algorithm with momentum and learning rate is applied as the following:
 1.
Initialize all weights and biases and normalize the training data.
 2.
Set the values of learning rate and momentum coefficients.
 3.
Compute the output of neurons in the hidden layer and in the output layer.
 4.
Compute the error by comparing the actual and predicted values.
 5.
 6.
Repeat steps 3 to 5 for all training data until the error converges to limit level.
To measure the performance of the network and show the error rate of proposed methods, there are six indicators used as error assessment techniques:Â MSE,Â RMSE,Â MAPE, MABE, r, and R^{2} [5, 12,13,14, 16, 19]. These indicators are calculated by the following equations (Eqs. (18)â€“(23)).
whereÂ X_{t},andÂ Xâ€²_{t} are the values of tth actual and predicted global solar radiation respectively. \( \overline{X_t} \) is the average value of actual global solar radiation, \( \overline{X{\prime}_t} \) is the average value of the predicted global solar radiation, and n is the total number of observations.
The statistical error RMSE is used as a metric to measure model performance; its value is always positive and zero is the ideal case. The accuracy of the model is evaluated by the indicator MAPE, and the minimum value means that the model is with high accuracy. MABE is another metric to measure how close the predicted values are to the measured values, and the best model performance is with minimum value. The correlation coefficient (r) is used to estimate the correlation between model and observations. If r = 1, it means that there is an exact linear relationship between measured and predicted values; the largest value is better. Determination (R^{2}) shows information about the goodness of fit; its values are between zero and one (0 â‰¤ R^{2} â‰¤ 1), and the largest value is the best value [2, 20].
Artificial neural network implementation
In this paper, we applied two Bp algorithms: the basic Bp and Bp with momentum and learning rate, respectively. ANN is employed to estimate the daily mean and yearly mean global solar radiation using the following parameters: maximum temperature, minimum temperature, average temperature, relative humidity, and atmospheric pressure of three cities in Egypt in the period from 2002 to 2015.
The performance and accuracy of the model depends on input dataset, the number of neurons in the hidden layer, the number of hidden layer, and learning algorithm. RMSE, MAPE, MABE, r, and R^{2} are used to evaluate and measure the performance and accuracy of the ANN models and the correlation between the model and the observations. MATLAB software is working to apply the proposed models. To train and test the neural network, we got the measured meteorological data from NASA Surface meteorology and Solar Energy web site containing the time period of 14â€‰years (from 2002 to 2015). That dataset from 2002 to 2012 is utilized to train the network, and the period from 2013 to 2015 is employed to test the network.
In the training phase, we determined the input dataset, and it should be normalized in the range (âˆ’â€‰1, 1) [21]. For assurance, use all parameters with small magnitudes due to consistency in the learning algorithm and then return to original values after the simulation using Eq. (24).
where X_{i} is original value, X_{min} and X_{max} are the minimum and the maximum value of original values, and X_{nor} is the normalized value.
After creating the normalization values from the previous equation, the datasets in the training and testing phases are divided randomly into three subsets: training, validation, and testing [3]. The numbers of hidden neurons are 20 for estimating the performance of the model with different values of learning rate which are 0.01, 0.2, and 0.3 and of momentum coefficient which are 0.7 and 0.9. The minimum performance gradient is 10^{âˆ’6}, maximum number of epochs to train is 2000, maximum validation failure is 60. The values of the weights and the biases are set randomly in the first; the results of the fitting tool differ every time during it runs. Hence, the network with the same number of neurons is retrained through 80 runs to detect the run number for best validation performance.
The results and discussions
To indicate the performance of the ANN models, we implemented the first algorithm (basic Bp) in three models with different values of learning rate which are 0.01, 0.2, and 0.3 respectively for both training and testing samples. The second algorithm (Bp with learning rate and momentum coefficients) is applied in six models with the same inputs in the experimental and with different values of two parameters, learning rate and momentum, which are 0.01, 0.2, 0.3, and 0.7, 0.9 respectively for both training and testing samples.
The statistical errors RMSE, MAPE, MABE, r, and R^{2} are calculated using Eqs. (18)â€“(23). The acceptable models are illustrated and the best model is identified by comparing the statistical errors associated with all models, and the best model is shown in italics as presented in Table 2. Based on the obtained results, all ANN models are ranked according to their RMSE values. The best model has the lowest value of RMSE for every city of two methods in the training and the testing.
Based on these results, the ANN models are ranked according to their RMSE values and the best model has the lowest value [5, 12, 13]. Also, in each city, the best model is recognized by comparing the statistical errors with all models in the two algorithms, and it is specified in italics as displayed in Table 2. Moreover, all models are arranged according to their performance.
According to the values of statistical indictors of the first algorithm, the proposed model (3) is the best model in this method in all testing cities. Its different error values are RMSE of 2.662â€‰MJ/m^{2}/day, 2.824â€‰MJ/m^{2}/day, and 1.455â€‰MJ/m^{2}/day; MAPE values are in the range of 10.852â€“14.106%, 11.875â€“15.925%, and 5.642â€“6.362%; the values of MABE are 2.026â€‰MJ/m^{2}/day, 2.144â€‰MJ/m^{2}/day, and 1.073â€‰MJ/m^{2}/day. The values of correlation coefficient (r) are 89.90%, 92.83%, and 96.09% respectively in testing cities. Coefficient of determination R^{2} showed the goodness fitting of data based on testing dataset; all values of R^{2} are greater than 0.99 in the testing cities as presented in Table 2. The performances of the other models in training cities demonstrated a good estimation for GSR with R^{2} values larger than 0.99.
Table 3 summarizes the results of the second algorithm Bp with learning rate and monument coefficients, and the proposed model (6) is the best model in this method in all testing cities. The various errors values of proposed model (6) are RMSE of 2.245â€‰MJ/m^{2}/day, 2.470â€‰MJ/m^{2}/day, and 1.439â€‰MJ/m^{2}/day; the values of MAPE are 10.684%, 11.466%, and 5.282%; the values of MABE are 1.715â€‰MJ/m^{2}/day, 1.878â€‰MJ/m^{2}/day, and 1.180â€‰MJ/m^{2}/day. The r values are 92.23%, 94.76%, and 96.55% respectively in the testing cities. Coefficient of determination R^{2} is larger than 0.99 in all testing cities as shown in Table 3.
In general, there is a good agreement between the measurements and predictions. Also, Bp algorithm with momentum and learning rate is better and more accurate than basic Bp algorithm, and it has needed less computation time than other methods.
The comparison between the predicted global solar radiations by ANNbased models and the measured global solar radiation of the three cities Cairo, Borg Al Arab, and Aswan is presented in Fig. 3 and Fig. 4 respectively. In the first algorithm, the proposed model (3) has the minimum value of RMSE in testing stage in all testing cities, and the values of least RMSE of these cities are 2.662â€‰MJ/m^{2}/day, 2.824â€‰MJ/m^{2}/day, and 1.555â€‰MJ/m^{2}/day as shown in Fig. 3.
Figure 4 displays results of model (6) which has the minimum overall RMSE of 2.245â€‰MJ/m^{2}/day, 2.470â€‰MJ/m^{2}/day, and 1.439â€‰MJ/m^{2}/day of the Bp with learning rate and momentum algorithm. The coefficient of determination R^{2} obtained for the datasets is almost 0.9999. This showed that there is a good agreement between measured and predicted datasets. We observed from the chart that ANNpredicted results of GSR of the second algorithm are better than the ANNpredicted results of GSR of the first algorithm and are considered more consistent with measured data for almost all the datasets.
Table 4 displays the values of RMSE_{ave.}( ave. is referred to the average test values for selected test cities), MAPE_{ave}^{,}_{.} and R^{2} in the present study and other similar studies in literature [3, 6,7,8].
Conclusions
In this paper, ANNbased models were employed for evaluating and predicting of global solar radiation for three cities in Egypt. According to the statistical indicators, the second algorithm is better than the other ANN models in the testing data. Moreover, in all cases, R^{2} is greater than 99% and RMSE values are small. This indicated that the Bp with momentum and learning rate algorithm is better than the basic Bp algorithm, and the performance of the second algorithm is the best in all cities. These results showed that the developed ANN model can be the best alternative to the traditional estimation models with acceptable accuracy.
Availability of data and materials
The datasets used and analyzed during the current study are available from the corresponding author on reasonable request.
Notes
www.nasa.gov
Abbreviations
 ANFIS:

Adaptive neuron fuzzy inference system
 ANN:

Artificial neural network
 Bp:

Backpropagation
 GSR:

Global solar radiation
 MABE:

Mean absolute bias error
 MAPE:

Mean absolute percentage error
 r :

Correlation coefficient
 R ^{2} :

Coefficient of determination
 RMSE:

Root mean square error
 SR:

Solar radiation
References
Amrouche, B., Le Pivert, X.: Artificial neural network based daily local forecasting for global solar radiation. Applied Energy. 130, 333â€“341 (2014). https://doi.org/10.1016/j.apenergy.2014.05.055
Hassan, G.E., Youssef, M.E., Ali, M.A., Mohamed, Z.E., Hanafy, A.A.: Evaluation of different sunshinebased models for predicting global solar radiation â€“ case study: New Borg ElArab city. Thermal Science. 22(2), 979â€“992 (2018). https://doi.org/10.2298/TSCI160803085H
Fadare, D.A.: Modelling of solar energy potential in Nigeria using an artificial neural network model. Applied Energy. 86, 1410â€“1422 (2009)
Voyant, C., Darras, C., Muselli, M., Paoli, C., Nivet, M.L., Poggi, P.: Bayesian rules and stochastic models for high accuracy prediction of solar radiation. Applied Energy. 114, 218â€“226 (2014). https://doi.org/10.1016/j.apenergy.2013.09.051
Elminir, H.K., Azzam, Y.A., Younes, F.I.: Prediction of hourly and daily diffuse fraction using neural network, as compared to linear regression models. Energy. 32, 1513â€“1523 (2007). https://doi.org/10.1016/j.energy.2006.10.010
Koca, A., Oztop, H.F., Varol, Y., Koca, G.O.: Estimation of solar radiation using artificial neural networks with different input parameters for Mediterranean region of Anatolia in Turkey. Expert Systems with Applications. 38(7), 8756â€“8762 (2011). https://doi.org/10.1016/j.eswa.2011.01.085
Mohandes, M., Balghonaim, A., Kassas, M., Rehman, S., Halawani, T.O.: Use of radial basis functions for estimating monthly mean daily solar radiation. Solar Energy. 68(2), 161â€“168 (2000)
Rehman, S., Mohandes, M.: Artificial neural network estimation of global solar radiation using air temperature and relative humidity. Energy Policy. 36(2), 571â€“576 (2008). https://doi.org/10.1016/j.enpol.2007.09.033
Jiang, Y.: Computation of monthly mean daily global solar radiation in China using artificial neural networks and comparison with other empirical models. Energy. 34, 1276â€“1283 (2009). https://doi.org/10.1016/j.energy.2009.05.009
Khatib, T., Mohamed, A., Sopian, K.: A review of solar energy modeling techniques. Renewable and Sustainable Energy Reviews. 16, 2864â€“2869 (2012)
Mellit, A., Kalogirou, S.A.: ANFISbased modelling for photovoltaic power supply system: a case study. Renewable energy. 36(1), 250â€“258 (2011)
Hassan, G.E., Youssef, M.E., Mohamed, Z.E., Ali, M.A., Hanafy, A.A.: New temperaturebased models for predicting global solar radiation. Applied Energy. 179, 437â€“450 (2016). https://doi.org/10.1016/j.apenergy.2016.07.006
Hassan, G.E., Youssef, M.E., Mohamed, Z.E., Ali, M.A., Shehata, A.I.: Performance assessment of different dayoftheyear based models for estimating global solar radiation  Case study: Egypt. Journal of Atmospheric and SolarTerrestrial Physics. 149, 69â€“80 (2016). https://doi.org/10.1016/j.jastp.2016.09.011
ElMetwally, M.: Simple new methods to estimate global solar radiation based on meteorological data in Egypt. Atmospheric Research. 69, 217â€“239 (2004). https://doi.org/10.1016/j.atmosres.2003.09.002
R. Rojas Neural networks: a systematic introduction, Springer, ISBN 3540605053, Germany, (1996).
Ã‡elik, O., Teke, A., YÄ±ldÄ±rÄ±ma, H.B.K.: The optimized artificial neural network model with Levenberge Marquardt algorithm for global solar radiation estimation in Eastern Mediterranean Region of Turkey. Journal of Cleaner Production. 116, 1â€“12 (2016). https://doi.org/10.1016/j.jclepro.2015.12.082
Hasni, A., Sehli, A., Draoui, B., Bassou, A., Amieur, B.: Estimating global solar radiation using artificial neural network and climate data in the southwestern region of Algeria. Energy Procedia. 18, 531â€“537 (2012). https://doi.org/10.1016/j.egypro.2012.05.064
Qazi, A., Fayaz, H., Wadi, A., Raj, R.G., Rahim, N.A., Khan, W.A.: The artificial neural network for solar radiation prediction and designing solar systems: a systematic literature review. Journal of Cleaner Production. 104, 1â€“12 (2015). https://doi.org/10.1016/j.jclepro.2015.04.041
Azadeh, A., Babazadeh, R., Asadzadeh, S.M.: Optimum estimation and forecasting of renewable energy consumption by artificial neural networks. Renewable and Sustainable Energy Reviews. 27, 605â€“612 (2013). https://doi.org/10.1016/j.rser.2013.07.007
Khorasanizadeh, H., Mohammadi, K.: Prediction of daily global solar radiation by day of the year in four cities located in the sunny regions of Iran. Energy Conversion and Management. 76, 385â€“392 (2013). https://doi.org/10.1016/j.enconman.2013.07.073
Rahimikhoob, A.: Estimating global solar radiation using artificial neural network and air temperature data in a semiarid environment. Renewable energy. 35, 2131â€“2135 (2010). https://doi.org/10.1016/j.renene.2010.01.029
Acknowledgements
The author would like to thank the Informatics Research Institute, City for Scientific Research and Technological Applications, New Borg ElArab City, 21934 Alexandria, Egypt, for providing the weather data.
Funding
None
Author information
Authors and Affiliations
Contributions
The author read and approved the final manuscript.
Authorsâ€™ information
Zahraa Elsayed Mohamed received M.Sc. and PhD degrees in computer science from Faculty of Science, Zagazig University, Egypt. Her research interests are in the areas of computer science and their applications, distributed data base, and wireless sensor.
Corresponding author
Ethics declarations
Competing interests
The author declares that there are no competing interests.
Additional information
Publisherâ€™s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Mohamed, Z.E. Using the artificial neural networks for prediction and validating solar radiation. J Egypt Math Soc 27, 47 (2019). https://doi.org/10.1186/s4278701900438
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s4278701900438
Keywords
 Artificial neural network
 Backpropagation algorithm
 Solar radiation
 Egypt
Mathematics subject classification
 97P10, 97R20, 97R30, 97R40