Introduction

Environmental pollution has become a serious modern-day problem which mainly causes by burning fossil fuels. As a result, scientists and researchers are looking for appropriate alternatives which are more environmentally friendly. Renewable energy sources like wind, solar, thermal and biomass energies seem to be suitable solutions. It is widely believed that in comparison with other green energy resources, solar energy is the most suitable option instead of fossil fuels as it is not only sustainable but also available and abundant almost everywhere. It is predicted that solar energy will be widely utilised shortly for fulfilling the world’s energy demands Khanlari et al. (2020a, b).

One of the essential parameters in optimising and designing solar radiation types is solar radiation, as it plays a crucial role in the initiation and installation of panels and solar collectors. Therefore, predicting and measuring this parameter in the desired locations should be prioritised (Bakirci 2009; Vakili et al. 2016). However, it is pretty challenging to access solar radiation in different locations because the number of meteorological stations is limited due to the maintenance cost of instruments, calibration requirements and necessary facilities (Khatib et al. 2012). For example, in Turkey, 129 out of 1798 stations can record solar radiation data until 2020, and in China, there were 756 stations until 2012 which only 122 of them could record this data (Zang et al. 2012). Therefore, different modeling methods have been introduced for anticipating solar radiation in recent decades, which are divided into three general categories, namely empirical models (Ustun et al. 2020), regression models (Guermoui et al. 2020) and modeling by artificial intelligence (AI) (Üstün et al. 2020).

Empirical models are based on mathematical formulas. Although these models are accepted as accessible and valuable techniques for calculating and predicting monthly average global solar radiation, they fail to anticipate short-term solar radiation data due to quick changes in weather conditions (Ağbulut et al. 2021). Moreover, only a handful of parameters can be used to predict this technique, like minimum and maximum of daily temperature, sunny hours and the amount of cloudiness. At the same time, there is an intimate relationship between solar radiation and the rate of humidity. However, the complicated and nonlinear relations of both independent and dependent variables, particularly in a humid climate, cannot be explained by these models (Kisi and Parmar 2016; Fan et al. 2018a). Furthermore, constant coefficients exist in empirical equations whose amount depends on the study area and experience (Yadav and Chandel 2014). Thus, empirical models cannot be considered a functional approach in many situations.

Recently, artificial intelligence (AI) models have attracted considerable attention in many fields. Different AI approaches are being used to anticipate solar radiation data such as wavelet transform (Zhang et al. 2020), support vector machine (SVM) (Hou et al. 2018), extreme learning machine (Bouzgou and Gueymard 2017), artificial neural network (ANN) (El Mghouchi et al. 2019), kernel nearest neighbour (k-NN) (Ağbulut et al. 2021), adaptive neuro-fuzzy inference system (ANFIS) (Zou et al. 2017), multilayer perceptron (MLP) (Guermoui et al. 2018), fuzzy logic (Baser and Demirhan 2017) and Gaussian process regression (GPR) (Zhou et al. 2020). ANN does not cause any restriction in choosing parameters for the prediction and estimation of solar radiation. Recent studies have shown that anticipating solar radiation AI algorithms is more accurate and precise than empirical techniques (Liu et al. 2020). So ANNs have done a great job modeling nonlinear, complex and time-varying input-output systems (Gani et al. 2016).

A regression model is another method for predicting solar radiation data. Comparing this technique with the artificial neural network has shown that the result derived from ANN modeling is more precise and accurate as the principal absolute percentage error amount of regression modeling results are higher than that of the ANN model. Furthermore, the values of R2 for regression models are lower than that of obtaining from ANN. This result evidences that ANN models are more effective ways for prediction (Kumar et al. 2015).

Nowadays, the statistical approach, physical model, hybrid method and artificial intelligence are commonly used for predicting solar irradiance (Wang et al. 2020). However, this study mainly was focused on AI techniques. In hybrid models, different methods are combined in order to gain benefit from every single anticipating model. For example, for predicting hourly solar radiation, a hybrid method based on fuzzy logic (FL), genetic algorithm (GA) and artificial neural network can be used (Garud et al. 2020). As mentioned before, models based on artificial intelligence play a crucial role in anticipating solar radiation. Table 1 indicates a summary of other researchers investigating solar radiation prediction in different locations with different methods.

Table 1 List of literature studies on forecasting solar radiation that used machine learning methods

Recently, the artificial neural network has drawn scientists’ attention more than other methods to predict solar radiation. Some results of several works of literature are mentioned as follows. Yıldırım et al. (2018) predicted monthly global solar radiation of four different Turkey stations using ANN and regression analysis. For training the algorithm, longitude, relative humidity, maximum possible sunshine duration, temperature extraterrestrial solar radiation, sunshine duration and the year were used. In this study, ANN models presented the best outcome with 0.14 and 0.961 of RMSE and R2, respectively. Khosravi et al. (2018) employed some developed methods namely, multilayer feed-forward neural network (MLFFNN), group method of data handling (GMDH), adaptive neuro-fuzzy inference system (ANFIS), ANFIS optimised with genetic algorithm (ANFIS-GA), ANFIS optimised with particle swarm optimisation algorithm (ANFIS-PSO) and ANFIS optimised with ant colony (ANFIS-ACO) to predict daily global solar radiation of Iran. Comparing these models, GMDH has the best result as R2, RMSE and MSE for this model were 0.9886, 0.2466 and 0.0608, respectively. Meenal and Selvakumar (2018) predicted daily global solar radiation using three empirical, ANN and SVM models. More than 0.99 correlation was seen in the SVM model. In another study, Kaba et al. (2018) used a deep learning algorithm in different Turkey stations to predict monthly average daily global radiation. Some parameters were used to train the DL algorithm like cloud cover, extraterrestrial solar radiation, minimum and maximum temperatures and sunshine duration. The best result of R2 was 0.98 in this study. Jahani and Mohammadi (2019) applied ANN, the combination of ANN with genetic algorithm and empirical models, to forecast daily global solar radiation in Iran. However, the hybrid model outperformed the other approaches with MBE, R2 and RMSE at 38.4, 0.92 and 185 J/cm2/day, respectively. Marzouq et al. (2019) anticipated daily global solar radiation by ANN, k-NN and empirical models. In this study, the value of R2 was equal to 0.96 and 0.97 for k-NN and a proposed hybrid model (k-NN and ANN), respectively. Rabehi et al. (2020) used boosted decision tree and multilayer perceptron (MLP) and a hybrid linear regression with these two models for anticipating daily global solar radiation in the south of Algeria. R2 and root mean square error were accounted for 0.977 and 0.033, respectively, in the MLP model, which shows the highest accuracy compared to other technique. Belmahdi et al. (2020) anticipated daily global solar radiation in three cities in Morocco using different techniques, namely ANN, ARIMA and ANN-ARIMA. In this study, the statistical errors that validate the models’ accuracy include MBE, NRMSE, MAPE, RMSE, TS, SD and R2. However, the hybrid model presented a better result as the value of R2 was 0.988. In another study, Dhakal et al. (2020) predicted DGSR in Nepal using ANN, five different machine learning methods and temperature-based empirical models. Among ANN models, ANN3 performed better than others with R2 = 0.8446 and RMSE = 1.4595, while stepwise linear regression outperformed other ML approaches. These models recommended for the locations where max and min ambient temperatures, sunshine duration, relative humidity and precipitation data are available.

In the current study, artificial neural network (ANN), hybrid genetic algorithm and ANN and adaptive neuro-fuzzy inference system (ANFIS) have been applied to estimate the daily global solar radiation of ten different cities worldwide. The input variable includes latitude, longitude, minimum and maximum temperatures (°C), relative humidity (%), wind speed (m/s), surface pressure (kPa), amount of air pollutants (O3, NO2, PM2.5, PM10), dew frost point, wet bulb temperature (°C) and mean solar radiation (MJ/m2/day) on a horizontal surface. This research aims to investigate the impact of various input parameters, particularly hazardous air pollutants and dew frost point wet bulb temperature, on the amount of solar radiation in different locations of the world. Therefore, an attempt has been made to introduce precise and accurate and global models that consider many useful parameters on solar radiation. According to the authors’ knowledge, no unique model has estimated the mean monthly global solar radiation for any cities worldwide with this accuracy.

Case study regions and data

In this study, ten cities from all over the globe are considered to present a general model. These well-known metropolises are from different locations with different climate and rate of pollution. As shown in Fig. 1, these cities consist of Beijing, Delhi, Tehran and Tokyo selected from Asia, Hamburg, London from Europe, Johannesburg from Africa, Los Angeles from North America, Rio de Janeiro from South America and Melbourne from Oceania. The monthly climatic data of these cities, namely, latitude, longitude, min and max temperatures (°C), relative humidity (%), wind speed (m/s), surface pressure (kPa), amount of air pollutants (O3, NO2, PM2.5, PM10), dew frost point, wet bulb temperature(°C) and mean solar radiation (MJ/m2/day) on a horizontal surface, were considered as modeling inputs between 2018 and 2019. Table 2 shows some essential geographical details of the cities along with the average data for 2 years.

Fig. 1
figure 1

Location of the cities on the map

Table 2 The average input data of the sites

Input parameters for the neural network were measured experimentally and used for training, validation and testing for 730 days in 2018 and 2019. The results are shown in Fig. 2 concerning the maximum temperature, in Fig. 3 concerning the minimum temperature, in Fig. 4 concerning the dew point of the environment, in Fig. 5 concerning the wet bulb temperatures, in Fig. 6 concerning the relative humidity, in Fig. 7 concerning the surface pressure, in Fig. 8 concerning the amount of NO2, in Fig. 9 concerning the amount of O3, in Fig. 10 concerning the amount of PM10, in Fig. 11 concerning the amount of PM2.5, in Fig. 12 concerning the wind speed and in Fig. 13 concerning the mean solar radiation.

Fig. 2
figure 2

The maximum temperature of each month between 2018 and 2019

Fig. 3
figure 3

The minimum temperature of each month between 2018 and 2019

Fig. 4
figure 4

The dew point of different months between 2018 and 2019

Fig. 5
figure 5

The wet bulb temperature of different months between 2018 and 2019

Fig. 6
figure 6

The relative Humidity of different months between 2018 and 2019

Fig. 7
figure 7

The surface pressure of different months between 2018 and 2019

Fig. 8
figure 8

The amount of NO2 in the different months between 2018 and 2019

Fig. 9
figure 9

The amount of O3 in the different months between 2018 and 2019

Fig. 10
figure 10

The amount of PM10 in the different months between 2018 and 2019

Fig. 11
figure 11

The amount of PM2.5 in the different months between 2018 and 2019

Fig. 12
figure 12

The wind speed in the different months between 2018 and 2019

Fig. 13
figure 13

The mean solar radiation of the different months between 2018 and 2019

Modeling

These days, modeling methods that include mathematical relationships and conceptual models are considered appropriate tools for anticipating natural phenomena. Because of complicated relationships between components and too many natural process variables, modeling techniques can be pretty challenging for the users (Vakili et al. 2017b). In this paper, artificial neural network, genetic algorithm and adaptive neuro-fuzzy inference system (ANFIS) have been implemented as modeling methods briefly discussed in the following.

ANN method

The artificial neural network is a novel method for solving complex and time-consuming problems. It is commonly used in almost all science branches for modeling conceptual phenomena since one of the essential capabilities of this technique is to comprehend nonlinear relation between parameters which is practical. ANN is an interconnected group of nodes inspired by a simplification of neurons in the human brain’s nervous system. Each connection can transmit a signal to other neurons like the synapse in a brain. In an artificial neural structure, each neuron has two states, training and acting. While training, neurons are trained to find appropriate outputs for specific input. During acting states, according to the training state, the defined input gives the proper result. Therefore, this structure has many inputs and outputs (Haykin and Network 2004). Generally, neurons are aggregated into three layers, namely, input layer (receiving raw data), hidden layers (specifying using connection weights and inputs) and output layer (affects the performance and character of the hidden layer). Different layers transform their inputs differently, and the relation between components defines the ANN’s behaviour (Tahani et al. 2016). The artificial network performs as a function, and it is a vital tool for analysing. After visually training the model, the prediction level will be started. According to the input layer’s amount of belonging neurons, the input variable will receive, and the same process happens for the output layer (Vakili et al. 2017b).

There are different kinds of artificial neural networks; however, in this study, feed-forward neural network is used to solve different problems. Moreover, the backpropagation algorithm is applied to train the neural network. In this way, to each incorrect matching of the network’s processing element, responsibility is allocated. The hidden layer is achieved by propagating the activation function gradient and the network between each hidden and input layer. Then, the inclinations and weights are adjusted in which the difference between predicted and objective mean square error was minimised.

Establishing network parameters is an empirical method. In most cases, it is an innovative technique in which networks are trained with different learning rates, various numbers of layers, different functions and momentums, and the best network is selected.

In recent decades, different activation functions have been used; however, as can be seen below, in this paper, Log-sigmoid and Tangent sigmoid for hidden layers and Purelin for output layers are used (Yahyaei et al. 2020).

$$ \mathrm{Tansig}(x)=\frac{2}{1+\exp \left(-2x\right)}-1 $$
(1)
$$ \mathrm{Logsig}(x)=\frac{1}{1-\exp \left(-x\right)}\kern0.5em $$
(2)
$$ \mathrm{Purelin}(x)=x $$
(3)

where x is the input of the activation function.

Overall, ANN functions as a function which means the number of input variables is the same as that of input layer neurons and the number of outputs commensurate with the output layer’s neurons. In this paper, the first layer’s input parameters include latitude, longitude, maximum and minimum temperatures, dew point, relative humidity, wet bulb temperature, surface pressure, wind speed, PM2.5, PM10, O3, NO2 and mean solar radiation on a horizontal surface. According to each neuron weight and the number of neurons in the middle layers, the thermal conductivity coefficient is presumed to be the network’s output in the output layer (Fig. 14).

Fig. 14
figure 14

Schematic diagram of the ANN structure

In this research, models are achieved by MATLAB R2019a. The input parameters, namely, latitude, longitude, min and max temperatures (°C), relative humidity (%), wind speed (m/s), surface pressure (kPa), amount of air pollutants (O3, NO2, PM2.5, PM10), dew frost point wet bulb temperature (°C) and mean solar radiation (MJ/m2/day) are calculated experimentally, and 70% of them are used for training the network, 15% for validation and the rest of them for testing the model. Using Eq. 4, the data are normalised between −1 and 1 to be applied in the network (Vakili et al. 2017a).

$$ y=2\times \left(\frac{x-{x}_{\mathrm{min}}}{x_{\mathrm{max}}-{x}_{\mathrm{min}}}\right)-1 $$
(4)

Hybrid genetic algorithm and ANN method

Genetic algorithm (GA) is based on the survival of the fittest or natural selection, inspired by Darwin’s genetics and evolution theory. With this technique, the evolutionary process of life can be simulated. The optimisation is a typical GA method application; it is also a useful model for visual perception, feature selection, pattern recognition and machine learning (Ebrahimi-Moghadam and Moghadam 2019; Bagherzadeh et al. 2019).

Surviving a population in a genetic algorithm depends on individual desirability. The ones with high ability are more likely to get married and have children. As a result, their following generations will have the better capability. In the genetic algorithm, individuals represent as chromosomes with a set of properties, and during several generations, these chromosomes will be evolved. Each chromosome has undergone the assessment process, and their values determine whether they will survive and breed or be left out. Two operators, namely, mutation and cross over, are used in the genetic algorithm’s generation process. Preferable parents are selected according to a fit function (Man et al. 1999).

In each stage of the genetic algorithm, a group of space points was processed by chance. During the process, character sequence is assigned to each point, and genetic operators are applied to these sequences. Then, in order to obtain new points in the search space, the sequences will be decoded. In the end, each point’s participation chance in the next stage is determined by their objective function amount. Figure 15 indicates the combination of genetic algorithm and artificial neural network.

Fig. 15
figure 15

Hybrid model of genetic algorithm and neural network structure

In this study, the genetic algorithm has been used to enhance the training process of ANN. In this case, after defining the amount of neuron correlation weights and bias of each layer by the genetic algorithm, the network trains itself, and by considering the errors, it presents a model.

In modeling by genetic algorithm, these steps are followed:

  1. 1.

    At first, a random population is selected. Each individual’s first generation features are chosen randomly from the weight in an artificial neural network.

  2. 2.

    To investigate each person, the ANN is performed according to inputs, output and defined weight for each layer and neuron. In the end, the modeling output is compared with the experimental amount.

  3. 3.

    Individuals are ranked based on minimising the network error (elitism)

  4. 4.

    The next generation consists of the best person of the previous generation who has a lower error rate.

  5. 5.

    Best parents are selected for reproduction using genetic algorithm operators.

  6. 6.

    For the second generation, this technique is repeated, and with regard to the defined cycling number, the algorithm is run. The final set of weights for each neuron (the best chromosomes of the previous generation) is chosen to train the neural network.

  7. 7.

    The neural network will start to perform after the genetic algorithm is trained.

In this study, modeling is done by considering the initial population of 150, 50 generations, the intersection link rate of 0.5 and the mutation rate of 0.5. The algorithm stop condition is considered for lack of objective function progression for 50 consecutive generations or when the generations are finished. To substitute the newborns for the previous generations, the befitting chromosomes of the parents and children are selected as replacing the population.

ANFIS method

The adaptive network–based fuzzy inference system is a hybrid method that combines artificial neural networks and fuzzy system architecture to capture the benefits of both models in a framework. ANFIS is a powerful tool for determining nonlinear relationships of inputs and outputs (Jang 1993a). This model is based on Takagi-Sugeno fuzzy inference system in constructing five forward network layers (Takagi and Sugeno 1985). Fuzzy and neural networks establish the relation between output and input variables to improve fuzzy membership functions and help them become more efficient. Multilayered connected networks consist of forwarding comparative nodes, which mean the learning algorithm adjusts the parameters that determine the outputs to minimise the modeling error. Figure 16 illustrates a summary of this model.

Fig. 16
figure 16

Schematic of the ANFIS model

The gradient reduction rule is the fundamental principle used in adaptive networks. However, because of being slow and converging to local minima, it is not an ideal approach. Instead of hybrid methods that combine gradient-based technique with other approaches like least square estimation (LSE), it results in better performance.

Parameters of an adaptive network include all the network groups’ parameters, which must be set up according to reduced-gradient training and learning method.

Five layers compose the ANFIS with N inputs number. Each input has dependency functions K1, K2, …, Kn, respectively. As a result, the most number of rules can be accomplished as below (Jang 1993b):

$$ R={k}_1\times {k}_1\times \dots \times {k}_n $$
(5)

First layer: Input values are taken and determined by the membership functions belonging to them at this step. The fuzzy logic is applied, so this layer is commonly called the fuzzification layer. O1,k is the output of each layer.

$$ {O}_{1,\mathrm{k}}={\mu}_{Ak}\left({x}_i\right),\kern1em \mathrm{k}=1,2,3\dots, \mathrm{n} $$
(6)
$$ {\mu}_{Ak}\left({x}_i\right)=\exp \left[-{\left(\frac{x_i-{\tau}_k}{2{\sigma}_k}\right)}^2\right],\kern1em \mathrm{k}=1,2,3\dots, \mathrm{n}\kern1.5em i=1,2,..,R $$
(7)
$$ {\displaystyle \begin{array}{c}{i}_1\in \left\{1,2,\dots, {k}_1\right\}\\ {}{i}_2\in \left\{1,2,\dots, {k}_2\right\}\\ {}\begin{array}{c}\dots, \\ {}{i}_n\in \left\{1,2,\dots, {k}_n\right\}\ \end{array}\end{array}}\kern0.75em $$
(8)

where σk and τk are the fuzzy set Ak membership function parameters, and each node parameter defines the form of the fuzzy set membership function.

Second layer: Firing strengths are generated, and nodes are responsible for calculating their rule. These nodes called rule nodes.

$$ {O}_{2,\mathrm{k}}={w}_k={\mu}_{Ak}\left({x}_1\right).{\mu}_{Ak}\left({x}_2\right),\kern1em \mathrm{k}=1,2,3\dots, \mathrm{n} $$
(9)

Third layer: The computed firing strengths are normalised by dividing each value for all firing strength, so these nodes are called intermediate nodes.

$$ {O}_{3,\mathrm{k}}={\overline{w}}_k=\frac{w_k}{\sum_{k=1}^n{w}_k},\kern1em \mathrm{k}=1,2,3\dots, \mathrm{n} $$
(10)

where \( {\overline{w}}_k \) is the kth rule normalised firing strength.

Fourth layer: The fourth layer’s nodes’ role, known as the result layer, divides each fuzzy rule normalised weight in the last part output.

$$ {O}_{4,\mathrm{k}}={\overline{w}}_k{f}_k={\overline{w}}_k\left({p}_0^k+{p}_1^k{x}_1+{p}_2^k{x}_2\right),\kern1em \mathrm{k}=1,2,3\dots, \mathrm{n} $$
(11)

Fifth layer: The fifth layer defuzzicates the outputs of the fourth layer in order to pass them to the final output of the whole network, and it is called output layer. (The number of nodes and outputs are equal.)

$$ {O}_{5,\mathrm{k}}=\sum \limits_{k=1}^n{\overline{w}}_k{f}_k $$
(12)

The final output can be obtained as below by putting Eq. 11 in Eq. 12.

$$ {O}_{5,\mathrm{k}}=\hat{Y}=\sum \limits_{k=1}^n\left({\overline{w}}_k{p}_0^k\right)+\sum \limits_{k=1}^n\sum \limits_{i=1}^n\left({\overline{w}}_k{p}_i^k\right){x}_i $$
(13)

A hybrid algorithm combined forward and backward propagations in order to train the data. The least-squares method (backwards) is applied to optimise the secondary parameters. The primary parameters are gained by applying the reduced-gradient algorithm (backward) when the secondary parameters are estimated. Afterwards, for anticipating parameters of the model, the learning algorithm was employed as below:

Dividing data into two groups, testing and training.

  1. 1-

    The data are trained.

  2. 2-

    By putting the primary and secondary parameters in Eq. 12, the output is gained.

  3. 3-

    The acquired parameters are gone through trial and error using testing data.

  4. 4-

    The training ends when it meets the maximum number of iterations or the error is less than the predefined value. Otherwise, step 2 is rerun, and the weights are optimised.

  5. 5-

    The testing data error is computed in order to validate the method.

In designing fuzzy systems, selecting the correct number of rules is crucial. Too many regulations cause a highly complex system, whereas insufficient rules will result in an ineffective system that cannot meet its goals. In this paper, the rules numbers of fuzzy system are vital parameter which is defined according to subsequent modeling error and input-output pairs. A primary reason why data are gone through clustering is to classify input-output pairs into distinct categories where the fuzzy rules are employed. The number of clusters and rules is equal. Conceptually, clustering means separating data into different clusters (subset) so that the data in a cluster are similar as possible and distinguishable from other cluster data.

In this study, a fuzzy C-means algorithm is applied for clustering. This technique allows data points to belong to more than one cluster, used in pattern recognition. This method is performed according to minimise the objective function in Eq. 14:

$$ {J}_m={\sum}_{i=1}^n{\sum}_{k=1}^n{u}_{ik}^m{\left\Vert {x}_i-{C}_k\right\Vert}^{\ast }2\kern3.25em 1\le m\le \infty $$
(14)

where each cluster centre is Cj, uik is the membership functional degree of xiin the jth cluster, * is the norm measured the distance between the cluster centre and data point, xi is the Ith measured data dimension and m can be responsible for any natural number (Tilson et al. 1988).

According to the preparing data procedure for modeling, at first, the input parameters were experimentally measured, namely latitude, longitude, maximum and minimum temperatures, dew point, relative humidity, wet bulb temperature, surface pressure, wind speed, PM2.5, PM10, O3 and NO2 in order to predict daily global solar radiation. While creating the network, the inputs were accidentally divided into two groups which 70% of them were accounted for training and the rest were used to test the network.

For having accurate and precise models, the number of fuzzy rules, the effects of clusters, the impact of other membership function on each other and many other influential parameters on FCM modeling are reported in Table 3.

Table 3 Terms of the developed ANFIS model

Statistical analysis

In this study, for estimating the accuracy and performance of the model, various statistical measures were applied, such as determination coefficient (R2), mean absolute percentage error (MAPE), root mean square error (RMSE) and mean bias error (MBE). For examining the model’s accuracy, the last three indexes are suitable and the closer they are to zero, the more accurate the model is. To define the future correlation tendency between the two datasets, the coefficient of determination is used. Again, as much as it is close to zero, the model possesses a higher accuracy and shows the model’s better performance. The statistical measures equations are as below (Vakili et al. 2021):

$$ \mathrm{RSME}=\sqrt{\frac{1}{n}{\sum}_{i=1}^n{\left({G}_p-{G}_a\right)}^2}\kern0.5em $$
(15)
$$ \mathrm{MAPE}=\frac{1}{n}{\sum}_{i=1}^n\left|\frac{\left({G}_p-{G}_a\right)}{G_a}\right|\times 100 $$
(16)
$$ {R}^2=1-\frac{\sum_{i=1}^n{\left({G}_a-{G}_p\right)}^2}{\sum_{i=1}^n{\left({G}_a-{\bar{G}}_a\right)}^2} $$
(17)
$$ \mathrm{MBE}=\frac{1}{n}{\sum}_{i=1}^n\left({G}_p-{G}_a\right) $$
(18)

where Gp is the predicted amount of solar radiation, Ga is the real amount of monthly solar radiation, \( {\bar{G}}_a \) is the average of real solar radiation during the measurement period and n is the number of measured samples.

Results and discussion

ANN method

As mentioned before, 70% of data were responsible for training, 15% for testing and the rest were accounted for validating the model. In order to choose the best amount for the number of neurons and hidden layers, trial and error are employed. The statistical indicators are assessed according to the different layers and neurons to find the best result. The results are indicated in Table 4 (the best result of modeling mentioned in bold).

Table 4 The results of calculated statistical indexes of modeling accuracy in ANN modeling concerning various conditions

According to the result shown in Table 4, which is based on modeling by the artificial neural network, the most optimal model is selected with more accuracy than other models. Among different activation functions, including tansig, logsig and purline, the most optimal model is created using the tansig function in the first hidden layers, the logsig function in the second hidden layer and the purelin function in the output layer. Furthermore, the optimal number of neurons in the first layer is eight and in the second layer is ten. Since the only output is mean solar radiation, the last layer’s output layer has a single neuron. Finally, by comparing the results, the best model is related to ANN-3.

Considering the statistical indicators introduced before, if the MAPE index is less than 10%, the model would have high accuracy and reliability. The closer it is to zero, the more accurate it would be. According to Table 4, the MAPE for ANN-3 is 0.43, the RMSE index is 0.062, the R2 index is 0.995 and the MBE index is −0.012. The results of indexes can claim, the model has good accuracy and reliability.

In order to have a more comprehensive study of the neural network’s performance and the results of modeling, it is essential to investigate the correlation between experimental and predicted results. Therefore, Fig. 17 shows the correlation between the optimal model’s predicted data and the amount of experimental measurement of mean solar radiation for the different cities around the world. According to the diagrams, the correlation coefficient between the experimental and forecasted results is 0.981 on average. The correlation coefficient is close to one, and the prediction results are suitable for each city.

Fig. 17
figure 17figure 17

The diagrams of the correlation between the foretold amounts of ANN-3 model and the experimental data in different cities worldwide

Figure 18 shows the deviation of the mean solar radiation predicted in the ANN-3 model from the measured data separately for the different cities in months between 2018 and 2019. According to the investigation of each measured data, the prediction results had a deviation of about 0.1 MJ/m2/day on average, and the maximum error is 4.07 MJ/m2/day, which belongs to Delhi.

Fig. 18
figure 18

The error amount of ANN-3 model in comparison with real values in different cities worldwide

Hybrid GA-ANN method

According to the stages explained in the “Hybrid genetic algorithm and ANN method” section, modeling has been done with the hybrid of genetic algorithm and artificial neural network. In this stage, as same as ANN, a trial and error method has been used to determine the number of neurons, layers and functions of the network that act in every layer. Table 5 shows the accuracy of the model results and statistics indexes and  the best result of modeling mentioned in bold.

Table 5 The results of calculated statistical indexes of modeling accuracy in Ga-ANN modeling concerning various conditions

Since the trial-and-error method was used to predict a fair number of neurons and layers, investigation of statistics indexes is a suitable method for choosing the most accurate model, which has less difference between measured data and predicted data. Considering the indexes figures’ investigation, it can be seen that GA-ANN 1 has the most accurate results. The MAPE index is 3.052, and since this amount is close to zero, it shows that the model is accurate. Furthermore, the amounts of RMSE and R2 are 0.194 and 0.945, respectively. The former is near zero, and the latter is close to one, which means the model is suitable for predicting mean solar radiation. Finally, considering the MBE index, GA-ANN 1 model predicts the mean solar radiation of about 0.019 MJ/m2/day more than the actual amount.

In Fig. 19, the amount of predicted and measured data of mean solar radiation has been compared. As can be seen, most of the data are near to the trendline, which is linear. This means that predicted data and actual data have proper conformity in comparison to each other. According to the diagrams shown in Fig. 19, the correlation coefficient between the measured data and the predicted data is 0.978 on average.

Fig. 19
figure 19figure 19

The diagrams of the correlation between the foretold amounts of GA-ANN-1 model and the experimental data in different cities worldwide

Figure 20 shows the deviation of the mean solar radiation predicted in the GA-ANN-1 model from the measured data separately for the different cities in months between 2018 and 2019. According to the investigation of each measured data, the prediction results had a deviation of about 1.00 MJ/m2/day on average, and the maximum error is 5.66 MJ/m2/day, which belongs to London.

Fig. 20
figure 20

The error amount of GA-ANN-1 model in comparison with real values in different cities worldwide

ANFIS method

In line with the process of preparing data for modeling, at the beginning of modeling, measured data, namely, latitude; longitude; min and max temperatures; relative humidity; wind speed; surface pressure; amount of O3, NO2, PM2.5 and PM10; dew point; and wet bulb temperature are used as input parameters and mean solar radiation as the output parameter.

In this method, while creating a network, the input data is randomly divided into two sections, 70% of them would be dedicated to training and the remaining 30% to network testing. According to the measured data, which are 2856 data, including 13 types of input data and one type of output, 2000 data were used for training and 856 data for testing.

In this data clustering method, FCM, the trial-and-error method, has been used to determine each cluster's repetition number. Therefore, in each rerun, the number of clusters has been changed, and the statistic indexes for any new model have been calculated. The accuracy and precision of each model and the results of each model’s statistical indicators are shown in Table 6 and the best result of modeling mentioned in bold.

Table 6 The results of calculated statistical indexes of modeling accuracy in ANFIS modeling concerning various conditions.

According to Table 6, the mean absolute percentage error is 5.50E−04, the root mean square error is 5.90E−05, the determination coefficient is 0.999 and the mean bias error is 0.425. These values indicate high accuracy and reliable model results. Figure 21 shows the correlation between the optimal model’s predicted data and the amount of measured data of mean solar radiation for the different cities worldwide. According to the diagrams, the correlation coefficient between the experimental and the anticipated results is 0.988, which means that the model is suitable for predicting mean solar radiation in every city around the world.

Fig. 21
figure 21

The diagrams of the correlation between the foretold amounts of ANFIS-8 model and the experimental data in different cities worldwide

Figure 22 shows the deviation of the mean solar radiation predicted in the ANFIS-8 model from the measured data separately for the different cities in terms of the months between 2018 and 2019 investigating each measured data. The predicted results had a deviation of about −0.007 MJ/m2/day on average. The maximum error is −2.64 MJ/m2/day, which belongs to Rio de Janeiro.

Fig. 22
figure 22

The error amount of ANFIS-8 model in comparison with real values in different cities worldwide

It is necessary to compare three models for investigation of the performance of each model. Therefore, in Fig. 23, each model’s most accurate results have been compared with all cities’ measured data. According to the results shown in Fig. 23, there is the most correlation between data in ANFIS modeling. It can be seen that the points in this modelling are closer to the bisector line, which means that predicted are almost as high as the measured data. Moreover, each model’s calculated R index shows that the ANFIS model, which is 0.995 and the most amount among different models, is the most accurate.

Fig. 23
figure 23

The diagrams of the correlation between the measured data and the predicted amounts of three models: a ANN, b hybrid ANN and GA and c ANFIS around the world

As shown in Fig. 24, there is a good correspondence between predicted data by the ANFIS-8 model and the measured data compared with other models, which are ANN-3 and ANN-GA-1. Generally, there is a slight difference between the figures for predicted data on the one hand and the figures for actual data. Among different cities, Hamburg has the most conformity, while Rio de Janeiro has the least.

Fig. 24
figure 24figure 24figure 24

The investigation of the accuracy of the different modelling methods on prediction of the amount of mean solar radiation in various cities

Moreover, this study’s modeling results show that input parameters’ role in predicting solar radiation is vitally important. Using parameters such as latitude, longitude, min and max temperatures, relative humidity, wind speed, surface pressure, amount of air pollutants (O3, NO2, PM2.5, PM10), dew frost point and wet bulb temperature as input parameters can result in a decline in mean absolute percentage error (MAPE) compared to other studies which other researchers in the prior did according to Table 7.

Table 7 Comparison between the results of this study with other prior researches done by other researchers

Conclusion

Solar energy has gained considerable attention as clean and sustainable energy. Solar radiation is a vital parameter in modeling, designing and operating solar energy systems, and accurate solar radiation estimation is the primary concern in solar energy applications. Although because of the limited number of meteorological stations, solar radiation data are unavailable for each desired location. These days, empirical and artificial intelligence models have been developed to predict solar irradiance data at every point of interest. These techniques utilise the correlation between solar radiation and different atmospheric factors derived from climatological and geographical data.

In this study, mean monthly global solar radiation has been estimated by ANN, a hybrid of ANN-GA and ANFIS. The investigation results showed that using a fuzzy c-means clustering type model with 16 clusters was more accurate than other models, ANN and GA-ANN. This was determined by the determination coefficient, mean absolute percentage error, root mean square error and mean bias error, which were 0.999, 5.50E−04, 5.90E−05 and 0.425, respectively.

Finally, since the measurement empirically of global solar radiation needs specific equipment, it also may be expensive and impossible in some areas. Therefore, according to the modelling results, particularly the ANFIS method, the use of artificial intelligence for predicting mean monthly global solar radiation by considering input parameters is recommended by authors to replace the empirical method. Moreover, the authors would like to encourage other researchers to develop the learning process using metaheuristic algorithms, such as ant colony, particle swarm, to training input data.