1 Introduction

Today, renewable energy sources have become more important due to climate change affecting the world entirely. The fact that solar energy is a clean, renewable, and usable energy source has led all the countries of the world to produce energy from this source due to the global climate crisis of the world. Therefore, to increase the efficiency of solar energy systems and to evaluate their applicability, engineering designs and scientific studies need up-to-date data on the amount of solar irradiation which could not be easily measured in some regions [1, 2]. These data are not always available due to the high cost of solar irradiation measurement sensors and require constant maintenance and calibration [3,4,5,6].

Reliable solar irradiation information is essential for the design and development of solar energy systems [7]. Additionally, knowing the solar irradiation is crucial for determining the most suitable location for installing a photovoltaic (PV) system [8]. Therefore, accurate knowledge of solar irradiation plays a significant role in ensuring the security of the power grid and effectively storing reserves of backup energy sources [9, 10].

Accurate irradiation forecasting assists in grid planning and improves power quality [11, 12]. However, the non-stationary behavior and variability of solar irradiation make this task quite challenging [13]. To overcome this challenge, solar irradiation prediction models are required, and many models have been developed. Currently, the methods used for solar irradiation prediction can be categorized as shown in Fig. 1, with the selection of these methods primarily dependent on the prediction time horizon [14].

Fig. 1
figure 1

Solar irradiation prediction methods [11, 15]

When examining the prediction methods in Fig. 1, it is known that hybrid methods demonstrate better performance in terms of prediction accuracy compared to basic methods [16]. However, they come with a computational complexity that requires a longer time to reach a result. Additionally, their performance is highly dependent on carefully selected historical input data [17]. Therefore, this study focuses on investigating the effectiveness of network architecture, data set distribution, algorithms, and functions in ANN models using commonly used meteorological parameters for solar irradiation prediction. The best results obtained from the algorithms and functions used in the ANN model for solar irradiation prediction are tested with different data distributions.

ANN is widely used for predicting different solar irradiation components [13, 18,19,20,21]. Recent studies have confirmed that both experimental methods and models are acceptable approaches for solar irradiation prediction. However, the use of methods like ANN modeling has been shown to enable researchers to achieve higher accuracy in their predictions [18, 22].

ANNs are commonly used in models aimed at predicting solar irradiation in different time intervals and locations around the world. Meteorological parameters such as sunshine duration (S), relative humidity (H), temperature values (Tmax, Tmin, and Tavg), extraterrestrial solar irradiation (H0), latitude (Lo), longitude (La), altitude (Z), wind speed (w), and wind direction are among the most frequently used data for solar irradiation prediction [23,24,25].

Gutierrez-Corea et al. propose an ANN approach for short-term prediction of solar irradiation in Spain, using nine input sequences consisting of ten values from ten different locations in Spain. They use the “logsig” activation function. The results obtained show errors ranging from 22.6 to 32.1% for forecast horizons of 1 to 6 h [26]. Similarly, Bosch et al. indicate that in their solar irradiation prediction study using data obtained from 12 different stations in Spain, ANN is an effective and straightforward methodology for calculating solar irradiation levels over complex mountainous terrains using data from a single radiometric station [27].

Mellit and Pavan proposed an ANN model using daily solar irradiation and air temperature data obtained in Italy. They used the LM training algorithm and reported that the model showed good prediction performance with a minimum correlation coefficient of 94% [28]. Voyant et al. conducted a study in France using data obtained from a ground station to predict solar irradiation using the ANN model. They evaluated the impact of external data and data selection on the prediction. Additionally, they examined the effects of the number of hidden layers and neurons, activation function, learning algorithm, and comparison functions used during the learning stage [29].

Mohandes et al. [30] conducted a solar irradiation prediction study in Saudi Arabia using data obtained from 41 stations and employing the “logsig” activation function. Wang et al. [19] performed solar irradiation prediction in China using an ANN model with the LM algorithm and “logsig” and “purelin” activation functions. Yadav and Chandel [31] predicted solar irradiation in India using an ANN model with the LM algorithm and the “tansig” activation function. In addition to these studies, there are numerous other works on solar irradiation prediction carried out by Quej et al. [32], in Mexico, Marzo et al. [33], in Chile, Halabi et al. [34], in Malaysia, Marzouq et al. [35], in Morocco, Jahani et al. [36], in Iran, Antonopoulos et al. [37], in Greece, and Guermoui et al. [38], in Algeria.

Turkey is a country surrounded by seas on three sides, with an average annual total irradiation of 1527.46 kWh/m2 and an average annual sunshine duration of 2741 h. The regions located in the south and east, in particular, are suitable areas for solar energy investments. Therefore, successful results are obtained in solar irradiation prediction studies, especially for the regions located in these areas. These studies and their details are presented in Table 1.

Table 1 Solar irradiation estimation studies and evaluation metrics in Turkey

In this study, an attempt has been made to predict the instantaneous solar irradiance, which is the most crucial parameter for electricity generation in PV systems. Real meteorological data, including ambient temperature, relative humidity, atmospheric pressure, wind speed, and solar irradiance, recorded at 5-s intervals depending on the time series from the meteorological station, were utilized. Data from the meters are transferred to a workstation (Intel Xeon Silver 4114 CPU @ 2.20 GHz, 32.0 GB RAM) along with date and time values and used as input and output data on the ANN model created in a MATLAB environment. Various training algorithms and activation functions based on ANN were employed. With the use of ANN, two different network structures with 5 different functions were developed to analyze the relationship between meteorological input data (such as ambient temperature, relative humidity, atmospheric pressure, wind speed) and solar irradiance based on the time series (year, month, day, hour, minute, and second). The obtained results enable the determination of the effectiveness of network structure, data set distribution, algorithms, and functions in solar irradiance prediction using basic meteorological data. In this context, the main contributions of the study are as follows:

  • Determining the effectiveness of activation functions used in the ANN model for solar irradiance prediction.

  • Developing an ANN model for solar irradiance prediction using data obtained from a single geographical location and ensuring its generalizability to other regions.

  • Determining the impact of data distribution used during the training and testing stages of the ANN model on solar irradiance prediction.

  • Investigating the prediction performance of the ANN model in solar irradiance prediction using statistical indicators to assess accuracy.

  • Determining the most suitable network architectures in ANN models used to predict solar irradiance for designing or assessing solar energy facilities in regions without meteorological measurement stations.

  • Developing various ANN models with the capability to analyze the relationship between meteorological parameters and solar irradiance.

  • Determining the effectiveness of training algorithms and transfer functions on prediction accuracy in ANN models modeled with different network architectures.

The remaining sections of the article are structured as follows: Sect. 2 provides details about ANN, the study area, the data set used, and the criteria for performance evaluation based on research methodology. In Sect. 3, the results obtained from the ANN models are presented, discussed, and analyzed. The final section presents the main findings of the study.

2 Methodology

In this study, many ANN-based approaches to predict solar irradiation were designed and applied, and their results were confirmed. In the first stage of the study, models were developed to analyze the relationship between time-dependent solar irradiance and a set of meteorological parameters in a specific geographical area. In these models, the effectiveness of different training algorithms (trainscg, trainlm, trainrp, traingd, and trainoss) and different transfer functions (logsig, poslin, tansig, purelin, radbas, hardlim, tribas, and satlin), which are easy to implement, widely utilized in the literature, and have demonstrated predictive accuracy, has been investigated. The functions that give the best results in these models were determined. In the second stage, the performance in forecasting success of the created network models was analyzed, and the best-performing model was determined. Each model was dedicated to estimating the amount of solar irradiation at times, including all seasonal periods of the year. All components of all approaches were designed, implemented, and validated according to the flowchart in Fig. 2 using the multi-layer perceptron (MLP) neural network model created with the MATLAB2021a software. The process of preparing the information and its uses in modeling are described as follows:

  • To prevent prediction models from being affected by different ranges, the input data are normalized as depicted in Fig. 2 (in the range − 1 to + 1) [13].

  • To create neural networks by defining different functions with neural network layers and neurons.

  • To train networks according to defined functions.

  • To test networks according to the defined data.

  • To receive output data from the neural network.

  • To return normalized data to output data.

  • To evaluate the performance of the neural network and compare its output with the measured data.

Fig. 2
figure 2

The flowchart used in the study

Using meteorological parameters measured by sensors depending on time parameters, the study, network training, and modeling are based on two different network models. In both network models, the input parameters were selected as similar. The first type of network model (10-10-1) is called ANN_I, which consists of small hidden layers that are the same as the number of input parameters. The second type of network model (10-100-1) is called ANN_II, in which a large hidden layer is formed by squaring the number of input parameters. Thus, in addition to different training algorithms and transfer functions in solar irradiation estimation, the effect of the network structure was determined by taking into account the model, the number of neurons, and different hidden layers. The operating conditions for the design of network models are given in Table 2. Training of the ANN architecture was continued until the minimum MSE value was reached.

Table 2 Operating conditions set for models

2.1 Artificial neural networks (ANN)

ANN models demonstrate higher accuracy in solar irradiation prediction compared to empirical models and other forecasting methods. Qazi et al. [49], by evaluating the work of various researchers, have proposed the application of ANN techniques to achieve better results in future studies aimed at forecasting solar irradiation. The ANN technique is one of the most popular performance applications and is widely used in many areas such as optimization, regression, control, and classification [50,51,52]. The basic unit of an artificial neural network is a neuron, which uses a transfer function to formulate output. Choosing the number of neurons in the hidden layer and the number of hidden layers for any artificial neural network model is very complex. Often, one hidden layer is sufficient for complex applications. The training behavior of neurons depends on their activation function. Each input is multiplied by a weight as a relationship parameter between a neuron and several layers of neurons. A transfer function is applied to obtain the neuron result in the final stage [51]. The multi-layer network used in this study is presented schematically with input parameters in Fig. 3.

Fig. 3
figure 3

Schematic diagram of the multi-layered ANN with the inputs used in the study

As can be seen in Fig. 3, the parameters of ambient temperature, relative humidity, wind speed, and atmospheric pressure, which are measured depending on the time parameters, are included in the first layer. According to the weights assigned to neurons and the number of neurons in the latent layer and the last layer, the total amount of solar irradiation is accepted as the network output.

2.2 Study region

The study area is located in the province of Hakkari in the southern part of the Eastern Anatolia Region with a surface area of 9551 km2, accepting a sunshine duration of approximately 14 h especially in summer, and high solar irradiation potential. Ahlborn brand “Almemo 2590 Datalogger” device with measurement sensors is used in the meteorological station at Hakkari University Çölemerik Vocational School campus (N: 37.571799, E: 43.724936) located at an altitude of 1755 m. above sea level. Some important geographical details of the study area and its appearance on the map of Turkey are given in Fig. 4. The selected location has a cold climate zone and has a very high value in terms of solar irradiation value and sunshine duration. From this point of view, the place chosen for the study is quite important. In addition, the region chosen as the study area in the current solar irradiation estimation studies in the literature has very suitable areas for the installation of solar power plants and the efficient operation of the system. For this reason, the results obtained from this study are a guide for academic and investment studies to be made for the operation and operation of solar energy systems. The fact that no study has been carried out on the data obtained with real measurement values in Hakkari adds innovation and contributes to the study.

Fig. 4
figure 4

Location and information of the study zone on the map of Turkey

2.3 Data

The actual data measured from the meteorological station located at the campus of Hakkari University are used during the design and verification phases. Solar irradiation is constantly changing due to instantaneously changing weather conditions, and it can be obtained better with the data measured in shorter intervals [53]. The data set consists of one million data with a five-second period between 2019 and 2021. These measured data versus the measurement time include solar irradiation, ambient temperature, wind speed, relative humidity, and atmospheric pressure from the measurement sensors. The chosen study area, Hakkari, represents a region in which all four seasons with their respective meteorological characteristics occur throughout the year. Conducting measurements at short intervals, as frequent as every 5 s, and covering all seasons enables the collection of comprehensive data. Interestingly, the obtained data not only exhibit the unique characteristics of the study area but also display similarities with other geographically comparable regions within Turkey. Table 3 provides an example of data obtained from other regions with similar characteristics to the study area. As a result, this study benefits from an extensive data set comprising long-term and multi-seasonal measurements, along with diverse meteorological parameters, indicating that the results obtained are likely applicable to other regions as well.

Table 3 Meteorological record samples (data set sample)

The data set is divided into two subgroups: A design subset including 800,000 pieces of data and a simulation test subset including 200,000 pieces of data. Table 3 shows some examples of a data set sample. In this table, the first six columns represent time parameters, and the last five columns represent five meteorological records based on time parameters.

As shown in Fig. 5, the data obtained from the weather station are divided into two parts: training and simulation. The training data set is designed as 5% testing, 5% validation and 90% training data, 10% testing, 10% validation and 80% training data, 15% testing, 15% verification and 70% training data, 20% testing, 20% verification and 60% training data and 25% testing, 25% validation and 50% training data, respectively. After completing the training stage, the simulation was performed with randomly selected 200,000 data which are not included in the training data set to simulate the model and compare the results. The evaluation of all models was made according to the simulation results.

Fig. 5
figure 5

Data set layout for training, verification, and testing of solar irradiation forecasting models

2.4 Performance evaluation criteria

Prediction performance is an evaluation metric that measures how well a model matches the actual values and the accuracy of its predictions. Commonly used performance metrics serve the purpose of evaluating the results of prediction models and comparing them with one another. As a dependency scale metric, RMSE cannot be used for model comparison across multiple data sets [38]. In this context, MSE, nRMSE, MBE, MAPE, and R2 metrics have been used to compare the performance success of prediction models. These performance evaluation criteria, along with their equations and explanations, are provided in Table 4.

Table 4 Performance metrics used in the study and their explanations

In Table 4, N refers to the number of data; \({y}_{{\i} }\) refers to the true value of global solar irradiation; \(\widehat{{y}_{i}}\) refers to forecast value; \(\overline{{\mathrm{y} }_{i}}\) refers to the average of the measured global solar irradiation.

3 Results and discussion

In this research, ANN reaches the optimum result to estimate the solar irradiation by changing the transfer function types and the number of neurons in the hidden layer using trainlm, trainscg, trainrp, traingd, and trainoss training algorithms. Thus, in solar irradiation estimation studies, the performance of transfer functions in network structures with small and large neurons is determined in different training algorithms. Tables 5, 6, 7, 8 , and 9 present the modeling results with several conditions in the mentioned categories. A network structure was modeled with ten inputs, a single layer, having 10 and 100 neurons to estimate the amount of solar irradiation using ANN. Measurements of ambient temperature, wind speed, relative humidity, and atmospheric pressure at intervals of 5 s and the time parameters in the form of year, month, day, hour, minute, and second are introduced to the input layer. There is a neuron in the output layer since only one parameter is considered as the network output. The “purelin” function was selected as the conversion function for all models, and the most efficient function type was determined by using the transfer functions “logsig,” “poslin,” “tansig,” “purelin,” “radbas,” “hardlim,” “tribas,” and “satlin”  for hidden layers. Each model created in the ANN was tested five times, and the best-performing model was determined.

Table 5 Prediction performance of “trainscg” training algorithm based on data set and transfer functions
Table 6 Prediction performance of “trainlm” training algorithm based on data set and transfer functions
Table 7 Prediction performance of “trainrp” training algorithm based on data set and transfer functions
Table 8 Prediction performance of “traingd” training algorithm based on data set and transfer functions
Table 9 Prediction performance of “trainoss” training algorithm based on data set and transfer functions

Prediction performance metrics are used to evaluate the accuracy of the model and compare the performance of different models or methods. Lower error values indicate better prediction performance, while higher error values may indicate that the model needs improvement. However, each metric has its own advantages and disadvantages. The most appropriate metric should be selected depending on the type of model and application area. In this study, the evaluation results on the MSE metric on how the percentage change of the data in the input layer of the ANN model in solar irradiation estimation affects the solar irradiation estimation performance according to the transfer functions and the training algorithms included in the ANN structure are shown in Tables 5, 6, 7, 8, and 9.

When Tables 5, 6, 7, 8, and 9 are examined, ANN_II determined the best predictive value for the “tansig” transfer function as 97.58% using 15% test data with the “trainlm” training algorithm. ANN_I model determined the best predictive value for the “logsig” transfer function as 96.25% using 15% test data with the “trainlm” training algorithm. Both network models showed similar predictive values when using the “logsig” and “tansig” transfer functions. In these algorithms, the results with the lowest performance were obtained using the “purelin” and “hardlim” functions. In this study, the optimum result is reached by changing the function types and the number of neurons in the hidden layer. The statistical performance of the modeling results performed under the best test conditions is presented in Tables 10, 11.

Table 10 Statistical performance of the test results of the ANN_I model according to the algorithm and data set distribution
Table 11 Statistical performance of the test results of the ANN_II model according to the algorithm and data set distribution

In line with the changes made on the data set, the effect of the change of training algorithms and transfer functions on the performance results shows little change. The reason for this is that the ANN model is trained with a large number of data sets. The ANN model can analyze the changes in almost all meteorological data sets during the training phase and can show successful performance results during the testing phase. However, it can still be suggested to use “15%” test data, “trainlm” training algorithm, and “tansig” transfer function in solar irradiation estimation studies using a data set consisting of basic meteorological parameters.

Successful results could not be obtained in solar irradiation estimation by using the “traingd” training algorithm and “satlin” and “purelin” transfer functions used in the study. The reason for this is that the training algorithm is a network training function that updates the weight and deviation values according to the gradient descent, while the network model is running. Because “trainlm” is a network training function that updates the weight and bias values according to LM optimization, and it also contains more memory than other training algorithms; very successful results can be obtained in solar irradiation estimation studies. The results of the forecast performance shown in Tables 5, 6, 7, 8, and 9 and the evaluation metrics shown in Tables 10, 11 demonstrate this situation.

In this research, the optimum result is reached by changing the function types and the number of neurons in the hidden layer. Tables 10, 11 give the statistical performance of the modeling results for ANN_I and ANN_II performed under the best test conditions. In Tables 5, 6, 7, 8, 9, 10, and 11 all of the methodologies used throughout the study were used in the same way. Within the scope of the study, the effects of all existing functions and data set changes were explained in detail and their performance values were analyzed.

Figures 6a and 7a show slight deviations between the forecast data and the measurement data depending on the time series in the most successful functions using the ANN_I and ANN_II models. Figures 6b and 7b show the worst prediction success in the same models. In these shapes, a solid line represents the actual value, and a dashed line represents the predicted value.

Fig. 6
figure 6

Comparison of forecast and measurement data based on time series of the most successful and worst situation in ANN_I

Fig. 7
figure 7

Comparison of forecast and measurement data based on time series of the most successful and worst situation in ANN_II

In the ANN-I model, the prediction error nRMSE ranges from 8.947 to 20.749. Based on the nRMSE performance metric intervals shown in Table 4, it is evident that the worst prediction result was obtained with the “traingd” training algorithm and the “hardlim” transfer function used in the ANN model. On the other hand, the most successful model achieved an nRMSE value of 8.947, utilizing the “trainlm” training algorithm and the “tansig” transfer function.

In the ANN-II model, the prediction error nRMSE ranges from 7.354 to 20.167. In this neural network model, the most successful prediction performance was observed with an nRMSE value of 7.354, achieved using the “trainlm” training algorithm and the “tansig” and “radbas” transfer functions. However, it is worth noting that although the “tansig” transfer function resulted in a higher correlation coefficient, it is recommended for better performance. On the other hand, when the same network structure was tested with the “trainoss” training algorithm, the “hardlim” transfer function exhibited significantly poor performance.

In all the developed models except for the ones created using the “purelin” and “hardlim” functions, it is observed that the R index has a high value. However, since this index shows little variation depending on the number of neurons and layer functions, it is not appropriate to use it in the evaluation of models. During the modeling process, better results can be achieved by increasing the number of hidden layers. However, increasing the number of neurons may also lead to longer computation times and potentially reduce the accuracy of the modeling. For predicting solar irradiation using meteorological parameters, the ANN_I model with the “trainlm” training algorithm and the “logsig” transfer function, as well as the ANN_II models with the “tansig” transfer function, was selected as the optimal neural network models among the developed models. Figure 8a, b illustrates the variations in predicted solar irradiation by the most successful ANN models.

Fig. 8
figure 8

Solar irradiation predicted by ANN_I and ANN_II using the “trainlm” training algorithm

In the charts in Fig. 8, the vertical axis is the prediction values and the horizontal axis is the actual values. According to the simulation results, the correlation coefficient (R) for the prediction values is shown in the graphs. R = 1 means that there is a definite linear relationship between the measured value and the actual value. As can be seen in Fig. 8a, most of the point for the most successful function in the ANN_I model, “logsig,” is scattered along the diagonal line. In Fig. 8b, the points for the “tansig” transfer function in the ANN_II model are located more collectively and regularly on the diagonal line. This is an indication that the forecast results are successful. In addition, the results revealed that the prediction values had high precision. The determination coefficient (R2) represents the percentage of data closest to the best line of compliance of the overall data set for a given station. Within the scope of this study, the R2 and MAPE results calculated for the LM algorithm ANN_I and ANN_II that give the best results in the prediction of instantaneous solar irradiation using the parameters recorded by the weather station are shown in Table 12.

Table 12 Simulation results for R2 and MAPE

The R2 results clearly show that the predicted instantaneous solar irradiation values are very close to the values measured by the selected ANN_I and ANN_II model. MAPE results are highly accurate as they perform below 10%. Therefore, from the statistical error analysis shown in Tables 10, 11, and 12, it can be concluded that the ANN models created with the LM training algorithm and “tansig” and “logsig” transfer functions performed well compared to the data set sample used in this study. Furthermore, the current study confirms the ability of the identified ANN models to accurately predict solar irradiation values for all regions with similar meteorological data located in and around Hakkari.

In this study, solar irradiation estimation studies were carried out using ANN, and results were obtained depending on the transfer functions affecting the prediction result and the network structure. In the study, the most commonly used training algorithms and transfer functions in the literature have been employed. During the training phase, solar irradiation prediction results were obtained using an ANN model with randomly selected test data from the total data set, which was different from the data set used for training. In addition, many tests were performed on several ANN-based network structures created. The simulation results show that highly accurate predictions can be obtained in the ANN’s solar irradiation prediction. It has also been observed that the percentage of the estimate changes in the ANN when the test data and training data change. Tests were carried out on two different training algorithms with looping on the eight different transfer functions, and it was tried to determine the algorithm and function type that would give the best response to the system under similar conditions. Although these cycles for the study yielded prediction values, the algorithm that gave the best results was “trainlm” and the best transfer function was “logsig” in networks with small neurons and “tansig” in networks with large numbers of neurons. Deviation values depending on the number of repetitions as the results of the comparison are shown in Fig. 9.

Fig. 9
figure 9

Deviation values depending on the number of repetitions for functions used in the ANN_II model

4 Conclusion

This study creates a neural network model of different network structures to predict solar irradiation from a multivariate time series data set consisting of meteorological data for the Hakkari Province of Turkey. The comparison of these neural network models was then evaluated by a set of performance metrics.

This assessments provides a better view of the training and transfer functions in the network structure in predicting solar irradiation, as well as the contribution of neuron counts in the hidden layer to the performance. Identifying conditions that affect forecast accuracy helps in many applications where solar irradiation is the main factor. In the study, the ANN_II network structure of 100 neurons created using the “trainlm” algorithm and the “tansig” transfer function performed best. In addition, according to the results obtained in the network structures created by using regional meteorological data, “logsig” and “tansig” transfer functions, especially with “trainlm” training algorithm, produced a prediction success rate of approximately 97%. The same transfer functions showed successful results in the “trainscg” and “trainoss” training algorithms. The performance criteria used to evaluate the models were found satisfactory considering the size of the data set. In the analyses made with the “traingd” and “trainrp” training algorithms, the prediction success in all transfer functions showed worse results. Therefore, to use both training functions in solar irradiation forecasting using meteorological parameters is not recommended. A large, more diverse data set with more parameters in different climatic conditions can be used to create models that will help to provide even better results in the future. It can also be a guide for monitoring and optimizing the results of solar power plants that we will benefit more from in the future.

Finally, it is not yet possible to empirically measure the total solar irradiation at all locations on the Earth, and it also requires specialized and expensive equipment with advanced systems. Furthermore, developing the neural network models will help the prediction of the solar irradiation accurately since that process. For this reason, the ANN-based solar irradiation estimation models are recommended to replace with the experimental measurements and methods based on empirical relationships.