A Multi-Level World Comprehensive Neural Network Model for Maximum Annual Solar Irradiation on a Flat Surface

With the growing demand for clean and economically feasible renewable energy, solar photovoltaic (PV) system usage has increased. Among many factors, the tilt and azimuth angles are of great importance and influence in determining the photovoltaic panel’s efficiency to generate electricity. Although much research was conducted related to solar PV panels’ performance, this work critically determined the tilt and azimuth angles for PV panels in all countries worldwide. The optimum tilt and azimuth angles are estimated worldwide by the photovoltaic geographic information system (PVGIS). Also, annual and average daily solar irradiation incident on the tilted and oriented plate optimally (AR1 and DR1) are calculated. Besides, annual and average daily solar irradiation incident on plate tilt optimally and oriented because of the south in the northern hemisphere and because of the north in the southern hemisphere (AR2 and DR2) are estimated. PVGIS is also used to calculate the annual and average daily solar irradiation incident on the horizontal plate (AR3 and DR3). The data collected from PVGIS are used to develop an efficient and accurate artificial neural network model based on feed-forward neural network approach. This model is an essential subpart that can be used in an embedded system or an online system for further PV system analysis and optimization. The developed neural model reflected very high accuracy in predicting the PV panels’ optimal tilt and azimuth angles worldwide. The benefit of tilting is generally increased by increasing the latitude. As the latitude increases, the tilt factor (F) increases because of the increase in the optimum tilt angle by increasing the latitude. The optimal orientation is due to the north in the southern hemisphere and due to the south in the northern hemisphere for most cities worldwide. In sum, it can be concluded that the optimum tilt angle is equal to or greater than the latitude until the latitude 30◦. The optimum tilt angle becomes less than the latitude, and the difference is increased until it reaches more than 20◦. Hence in this study the aim is to develop a simple neural network model which can accurately predict the annual radiation and optimum tilt and azimuth angle in any region of the world and can be easily implemented in a low-cost microcontroller.


Introduction
Solar energy is considered as an original and unlimited source of energy and it also works to enhance energy security and sustainability, and this in turn leads to reducing pollution; also, to keep the prices of fossil fuels lower than others. It also reduces the cost of mitigating climate change [1,2]. Thus, according to IRENE [3], the production of solar photovoltaic (PV) energy is increasing annually. For example, the existing solar PV energy production increased more than 27 times from the production ten years ago; in 2009, it was less than 23 gigawatts. The solar PV installation capacity reached 627 gigawatts in 2019 compared to 512 in 2018 [3].
Because of rapid technological progress and reduce costs, solar PV will have an essential role in reaching the sustainable development goals (SDGs) by 2030 [4], increase the share of renewable energy in the universal electricity sector, in addition to the provision of electricity for remote areas [5][6][7][8][9].
The amount of solar energy produced by a solar PV panel can be determined based on the local insolation. However, it is affected by the solar PV panels' tilt and orientation angles [10][11][12][13]. Thus, an appropriate tilt and orientation angle must be applied to achieve the maximum produced energy for a specific location [14][15][16][17]. Although one can use a solar tracking system that follows the sun to receive the maximum amount of daily energy, on the other hand, solar tracking systems are expensive and additional energy is needed for its operation [2].
Thus, it is commonly convenient to fix the solar PV on an optimum orientation and tilt angle [18][19][20]. Therefore, solar PV panels are recommended to be placed at the optimum tilt and orientation angle to obtain the yearly maximum energy production [10,11].
Many authors have attempted various analytical, simulations, and experimental work to obtain the optimum angles [21,22]. A general approximate rule for optimizing angles is that a given location's tilt angle is approximately equal to its latitude. The orientation angle should be south for Northern Hemisphere and north for Southern Hemisphere [23].
The present study used data from the Photovoltaic Geographical Information System (PVGIS), 2019 [24] for estimating optimum angles. The PVGIS gives solar irradiation on a horizontal surface and a surface tilted from horizontal or oriented because of the south. Moreover, the PVGIS provides an optimum tilt and azimuth angle that give the maximum yearly solar irradiation. The PVGIS is employing irradiation data based on satellite images. Based on satellite images, all databases provide hourly solar irradiation estimates. This means that PVGIS can be employed for any place, no matter how far from particular meteorological stations.
This study aims to find an artificial neural network model that can calculate an optimum tilt and azimuth angle in any world region. This model can be used inside an embedded system or as an online service. For an artificial neural network to be constructed and trained, it is required to obtain data from many locations worldwide.
The used data are obtained by PVGIS. First, the optimum tilt angles that give the maximum yearly solar irradiation for surfaces directed because of the south in the northern hemisphere and north in the southern hemisphere are calculated. Second, the optimum azimuth angles accompanying the optimum tilt angle are also calculated. Third, the annual and average daily irradiation in different regions all over the world is calculated for surfaces tilted with optimum tilt angles and directed because of the south in the northern hemisphere and because of north in the southern hemisphere (AR2 and DR2) and surfaces tilted with optimum tilt angle and oriented with optimum azimuth angles (AR1 and DR1). Fourth, the annual and average daily irradiations for horizontal surfaces are calculated (AR3 and DR3). Lastly, the tilt fact (F), which can be defined as the ratio of the irradiation collected by a tilted surface to the irradiation collected by a horizontal surface, is calculated.
Although one can use mathematical or statistical modules to calculate that based on some rules or conditions, these approaches tend to be very difficult and inaccurate when such conditions are hard to predict, has a non-linear form, or with a pattern that is hard to find [25]. Adding to that, for their hardware implementation they require expensive microcontrollers. The best output energy of a PV panel depends mainly on the maximum vertical amount of solar radiation that hits the PV panel surface. This maximum vertical solar irradiation changes according to the tilt and azimuth angles. Artificial intelligence can help increase this amount of solar irradiation by finding optimum tilt and azimuth angles, which is challenging to model accurately using mathematical or statistical modules, even for a single location [26].
Neural networks are characterized by being capable to learn by themselves and produce an output that is not limited to the input provided to them. Moreover, even if a neuron is not responding or a piece of information is missing, the network can detect the fault and still produce the output. Hence in this study, the aim is to develop a simple neural network model that can accurately predict the annual irradiation and optimum tilt and azimuth angle in any region of the world and can be easily implemented in a low-cost microcontroller.

Literature Review
Obtaining the photovoltaic system's optimum tilt angle is a significant issue because it helps to effectively transform the amount of sunlight received into energy [27]. Numerous studies have used various research approaches to find a tilt angle that maximizes the amount of irradiation received by the solar panel [27]. Such models include Hay's model, PVsyst simulation, PV-Simulation model, Nijegorodov equations, Harmony search meta-heuristic algorithm, PVWatts program, PVGIS program, particle swarm optimization (PSO) estimator, analytical method, MATLAB software, Oracle Crystal Ball software, and Gradient Boosting Algorithm. Table 1 summarizes these methods.
Kim Gi et al. [11] used a machine learning approach to find the optimum tilt angle of a PV panel to maximize the energy obtained from the PV panel. Although the analysis was conducted in a single area, and all PV panels shared similar geometric attributes, the optimal angles varied to certain degrees.
Artificial intelligence techniques can be employed in many problems. Their importance is realized in the ability to learning and adapt to new variations efficiently. This ability makes these techniques a promising solution in finding optimum tilt and azimuth angles for PV panels worldwide with high accuracy. While some attempts to explore the benefits these techniques offer [26,27], there is insufficient research in this field for such techniques.
This research provides an estimate of optimum tilt angles for (PV) panels for all countries worldwide. The algorithm Harmony (meta-heuristic) determines the azimuth angle and optimum tilt [41]. The findings are built on the ergodic mechanism [41].  PV simulation software will be used to determine the average solar radiation on different tilt. From this, to assess an optimal tilt angle, the peak annual average solar radiation shall be obtained on various tilted surfaces [43].

Methodology
In this work, an artificial neural network is used to find the optimum tilt and azimuth angles that yield maximum energy from PV panels in any worldwide location. To effectively build such neural networks, training data is sampled from many locations worldwide using PVGIS (Photovoltaic Geographical Information System, 2019) [24]. PVGIS provides solar irradiation on a horizontal surface and a surface tilted from horizontal or oriented because of the south. Moreover, the PVGIS provides an optimum tilt and azimuth angle that gives the maximum yearly solar irradiation. The PVGIS employs irradiation data based on satellite images. Satellite images are used to collect solar irradiation data. The different satellites available in PVGIS are: • PVGIS-SARAH: CM SAF [51] and the PVGIS [24] team have calculated these data covering Europe, Africa, most of Asia, and parts of South America. • PVGIS-NSRDB: These data have been supplied by the National Renewable Energy Laboratory (NREL) [52] and is part of the National Solar Irradiation Database. • PVGIS-CMSAF: CM SAF collaboration [51] have calculated these data covering Europe, Africa, and parts of South America. • PVGIS uses two more satellites to cover high-latitude areas not covered by previous satellites. • PVGIS-ERA5: This new re-analysis product is obtained from ECMWF [53]. It covers all over the world on an hourly basis and is used by PVGIS for Europe. • PVGIS-COSMO: COSMO-REA6 is a regional re-analysis product, covering Europe at hourly time resolution.
Based on the satellite images, all databases provide hourly solar irradiation estimates. This means that PVGIS can be employed for any place, no matter how far from particular meteorological stations.
The PVGIS is used to obtain data for training and validating the developed artificial neural network model. Figure 1 shows the locations around the world used to gather training data.

Methodology
In this work, an artificial neural network is used to find the optimum tilt and azimuth angles that yield maximum energy from PV panels in any worldwide location. To effectively build such neural networks, training data is sampled from many locations worldwide using PVGIS (Photovoltaic Geographical Information System, 2019) [24]. PVGIS provides solar irradiation on a horizontal surface and a surface tilted from horizontal or oriented because of the south. Moreover, the PVGIS provides an optimum tilt and azimuth angle that gives the maximum yearly solar irradiation. The PVGIS employs irradiation data based on satellite images. Satellite images are used to collect solar irradiation data. The different satellites available in PVGIS are: • PVGIS-SARAH: CM SAF [51] and the PVGIS [24] team have calculated these data covering Europe, Africa, most of Asia, and parts of South America. • PVGIS-NSRDB: These data have been supplied by the National Renewable Energy Laboratory (NREL) [52] and is part of the National Solar Irradiation Database. • PVGIS-CMSAF: CM SAF collaboration [51] have calculated these data covering Europe, Africa, and parts of South America. • PVGIS uses two more satellites to cover high-latitude areas not covered by previous satellites. • PVGIS-ERA5: This new re-analysis product is obtained from ECMWF [53]. It covers all over the world on an hourly basis and is used by PVGIS for Europe. • PVGIS-COSMO: COSMO-REA6 is a regional re-analysis product, covering Europe at hourly time resolution.
Based on the satellite images, all databases provide hourly solar irradiation estimates. This means that PVGIS can be employed for any place, no matter how far from particular meteorological stations.
The PVGIS is used to obtain data for training and validating the developed artificial neural network model. Figure 1 shows the locations around the world used to gather training data. In Figure 1, the locations are highlighted by colored circles. The circles' color is separated to give the figure more detail, and they do not mean anything else.
The development of the artificial neural network model is carried out using feed-forward neural networks (FFNN). The development process is divided into the training phase and the testing phase. Figure 2 shows the methodology used to develop the FFNN model. In Figure 1, the locations are highlighted by colored circles. The circles' color is separated to give the figure more detail, and they do not mean anything else.
The development of the artificial neural network model is carried out using feed-forward neural networks (FFNN). The development process is divided into the training phase and the testing phase. Figure 2 shows the methodology used to develop the FFNN model. The data collected were normalized and divided into two sets after the correct validation using the PVGIS method. One was used at the development stage of the neural model, representing 90% of the data collected, and one was used at the neural model test stage, representing around 10%. The testing phase aims to evaluate the neural network model developed in the training phase. The 90% of the gathered data used in the training phase was further divided into a neural network model training set, about 80% of the gathered data, and a neural network model validating set, which is about 10% of the gathered data. After the training phase, a multi-level FFNN model was developed. The developed multi-level FFNN model is discussed in the subsequent section.

Multi-Level Neural Network Model
Feed-forward neural network (FFNN) is a supervised learning algorithm that learns, by training on a dataset, a function . : → . Where o is the number of dimensions for output, and n is the number of dimensions for inputs. Given a set of features = , , … , and targets = , , … , , it can learn a non-linear function approximator for either regression or classification problems. In this work, FFNN is used as a regression model, and this differs from logistic regression, as there are one or more non-linear layers, called the hidden layer, which lies between the input and output layers. Figure 3 shows one hidden layer FFNN.
The leftmost layer, known as the input layer, consists of neurons expressing the input patterns, as shown in Figure 3. With a weighted linear summation ∑ , each neuron in the hidden layer transforms the previous layer's values, which are then evaluated using activation function [54]. Where wij is the weight relation between the ith neuron in the input layer and the jth neuron in the hidden layer, xi is the value of ith neuron in the input layer. The values are propagated to the neurons of the output layer to generate the output patterns. The data collected were normalized and divided into two sets after the correct validation using the PVGIS method. One was used at the development stage of the neural model, representing 90% of the data collected, and one was used at the neural model test stage, representing around 10%. The testing phase aims to evaluate the neural network model developed in the training phase. The 90% of the gathered data used in the training phase was further divided into a neural network model training set, about 80% of the gathered data, and a neural network model validating set, which is about 10% of the gathered data. After the training phase, a multi-level FFNN model was developed. The developed multi-level FFNN model is discussed in the subsequent section.

Multi-Level Neural Network Model
Feed-forward neural network (FFNN) is a supervised learning algorithm that learns, by training on a dataset, a function f (.) : R n → R o . Where o is the number of dimensions for output, and n is the number of dimensions for inputs. Given a set of features X = {x 1 , x 2 , . . . , x n } and targets Y = y 1 , y 2 , . . . , y o , it can learn a non-linear function approximator for either regression or classification problems. In this work, FFNN is used as a regression model, and this differs from logistic regression, as there are one or more non-linear layers, called the hidden layer, which lies between the input and output layers. Figure 3 shows one hidden layer FFNN.
The leftmost layer, known as the input layer, consists of neurons expressing the input patterns, as shown in Figure 3. With a weighted linear summation n i=1 x i w ij , each neuron in the hidden layer transforms the previous layer's values, which are then evaluated using activation function [54]. Where w ij is the weight relation between the ith neuron in the input layer and the jth neuron in the hidden layer, xi is the value of ith neuron in the input layer. The values are propagated to the neurons of the output layer to generate the output patterns. Figure 4 shows the topology of the proposed model. The proposed network model predicts the PV's optimum tilt and azimuth angle of annual irradiation in various regions worldwide.   The proposed model is composed of two phases, as shown in Figure 4. The model consists of three layers in the first stage: Input, Hidden, and Output. Two nodes form the input layer: longitude (deg.) and latitude (deg.). Three hundred fifty nodes compose the hidden layer, each of which uses the activation function of the hyperbolic tangent sigmoid. The output layer consists of two nodes that evaluate the optimal PV's tilt and azimuth angles.    The proposed model is composed of two phases, as shown in Figure 4. The model consists of three layers in the first stage: Input, Hidden, and Output. Two nodes form the input layer: longitude (deg.) and latitude (deg.). Three hundred fifty nodes compose the hidden layer, each of which uses the activation function of the hyperbolic tangent sigmoid. The output layer consists of two nodes that evaluate the optimal PV's tilt and azimuth angles.  The proposed model is composed of two phases, as shown in Figure 4. The model consists of three layers in the first stage: Input, Hidden, and Output. Two nodes form the input layer: longitude (deg.) and latitude (deg.). Three hundred fifty nodes compose the hidden layer, each of which uses the activation function of the hyperbolic tangent sigmoid. The output layer consists of two nodes that evaluate the optimal PV's tilt and azimuth angles. The second stage's input layer is composed of four nodes, two of them are the outputs of the first stage (tilt and azimuth angles), and the others are the Latitude and the Longitude. The hidden layer is like the first stage; it has 350 nodes with tanh activation function. At the same time, the output layer has three nodes, which are the annual irradiation under (1) optimum tilt angle and orientation (2) optimum tilt angle (azimuth angle = 0 for the Northern hemisphere and 180 for Southern) (3) horizontal surface. The output nodes in the two stages use an activation function of linear type [49].
Min-Max normalization method is used on all data to improve the qualified network's efficiency [55]. The data are then used to trained the network to understand the relationships between the input patterns.  [55,57,58]. These include the Gradient descent with momentum approach, the Levenberg-Marquardt (LM) backpropagation, the Gradient descent backpropagation, and the adaptive learning rate resilient scaled conjugate gradient backpropagation. The LM training algorithm has been chosen for this work for the training of the proposed network model. Since the less responsive approach to local converges, the LM teaching method offers a more robust learning training approach. It also offers a healthy trade-off between the pace of preparation and stability [55]. Figure 5 displays the pseudocode for the training algorithm. The goal is to minimize as much as possible, the mean square error (MSE) by tuning the parameter (µ) as follows: • µ × 0.1 when the MSE is equal or less to the previous one.

Results Obtained by PVGIS
In the first part of the paper, PVGIS was used to obtain the results and tabulated in Table A1 (Appendix A). The optimum tilt angles, optimum azimuth angle, AR1, DR1, AR2, DR2, AR3, DR3, and F, are calculated for the different regions worldwide.
It can be concluded that the tilt angle is equal to or greater than the latitude until the latitude of 30°, then the tilt angle becomes less than the latitude until the difference between them reaches more than 20°. The relation between them is not linear for all the latitudes because the linear relationship does not take into account the air pollution and cloud cover. As the cloud cover increases, the optimum tilt angle decreases because the cloud cover scatters the solar irradiation. The solar PV is closer to the horizontal as it receives more of the diffuse solar irradiation that is scattered by the cloud cover. Besides, the direct solar irradiation, which mainly depends on the tilt angle, is mostly blocked by clouds, so the diffuse irradiation becomes more critical in the overcast latitudes. The azimuth or orientation of the solar PV is measured from the south, meaning that if it is directed to the south, then the azimuth angle is 0°, while if it is directed to the north, then the azimuth angle is 180°. For the east, the azimuth is −90 degrees, and for the west, it is 90 degrees. It can be concluded that the optimum azimuth angle for most cities in the northern hemisphere and southern hemisphere is close to 0° and 180°, respectively. Even cities with an optimum azimuth angle further from 0° and 180° gain a little extra annual solar irradiation (AR1-AR2). This means that the solar PV can be directed toward the south in the northern hemisphere and toward the north in the southern hemisphere.

Results Obtained by PVGIS
In the first part of the paper, PVGIS was used to obtain the results and tabulated in Table A1 (Appendix A). The optimum tilt angles, optimum azimuth angle, AR1, DR1, AR2, DR2, AR3, DR3, and F, are calculated for the different regions worldwide.
It can be concluded that the tilt angle is equal to or greater than the latitude until the latitude of 30 • , then the tilt angle becomes less than the latitude until the difference between them reaches more than 20 • . The relation between them is not linear for all the latitudes because the linear relationship does not take into account the air pollution and cloud cover. As the cloud cover increases, the optimum tilt angle decreases because the cloud cover scatters the solar irradiation. The solar PV is closer to the horizontal as it receives more of the diffuse solar irradiation that is scattered by the cloud cover. Besides, the direct solar irradiation, which mainly depends on the tilt angle, is mostly blocked by clouds, so the diffuse irradiation becomes more critical in the overcast latitudes. The azimuth or orientation of the solar PV is measured from the south, meaning that if it is directed to the south, then the azimuth angle is 0 • , while if it is directed to the north, then the azimuth angle is 180 • . For the east, the azimuth is −90 degrees, and for the west, it is 90 degrees. It can be concluded that the optimum azimuth angle for most cities in the northern hemisphere and southern hemisphere is close to 0 • and 180 • , respectively. Even cities with an optimum azimuth angle further from 0 • and 180 • gain a little extra annual solar irradiation (AR1-AR2). This means that the solar PV can be directed toward the south in the northern hemisphere and toward the north in the southern hemisphere. Table 1 shows that the annual solar irradiation increases as it moves away from the equator until it reaches the maximum point (25-30 • ) for latitude and then begins to decrease. It can also be noticed that the tilt factor (F) increases with increasing latitude because of the increase in the optimum tilt angle with latitude.
The results obtained from PVGIS are compared with many previous studies and the results are very close [59,60].

Evaluation of the Proposed Nural Network Model
Several experiments have been performed to determine the best composition of the neural network. The decisions were made based on two main features: the activation function for each layer and the neurons' number in the hidden layer. Table 2 shows the attributes of the selected configurations. Another important feature that has been studied to complete the neural network structures is the number of nodes in each hidden layer. Table 3 compares the mean square error (MSE) results in various hidden layer numbers for both network stages. The best-obtained configuration for models' stages 1 and 2 is 350 neurons the hidden layer, seen in Table 3. MSE for both first stage preparation, checking, and validation is 0.0253, 0.041, and 0.00117, respectively, and for the second stage is 0.0074, 0.0063, and 0.00016, respectively. However, the results did not get any higher, while the sophistication grew as we went to the deep neural network.
Once the network configuration was chosen and before the simulation started, the dataset of 573 cities was split into three sections: training (459 cases), validation (57 cases), and testing (57 cases) (57 cases). The dataset has been chosen in a way that covers the maximum possible area, according to the map shown in Figure 1. Using the early stop technique and the validation set [61], the overfitting was reduced. Figure 6 demonstrates the consequences of both systems during training and validation.
Once the network configuration was chosen and before the simulation started, the dataset of 573 cities was split into three sections: training (459 cases), validation (57 cases), and testing (57 cases) (57 cases). The dataset has been chosen in a way that covers the maximum possible area, according to the map shown in Figure 1. Using the early stop technique and the validation set [61], the overfitting was reduced. Figure 6 demonstrates the consequences of both systems during training and validation.
As shown Figure 6, the linear regression for the training and validation of both models exactly matches the data sets, which means that the decision coefficient (R2) is very similar to 1.
The testing dataset portion was used to assess the model, and then measure the output after the training stage is finished.   Figure 6, the linear regression for the training and validation of both models exactly matches the data sets, which means that the decision coefficient (R2) is very similar to 1.

As shown
The testing dataset portion was used to assess the model, and then measure the output after the training stage is finished.
Table A2 (Appendix A) shows a comparison between the calculated model using PVGIS and the proposed model. The comparison has been made regarding 40 cities (30 in-sample and ten out-of-sample). As shown in Table A2 (Appendix A), the residual average difference (between the calculated and proposed model) for the tilt angle, azimuth angle, and the three annual irradiations (see Figure 4)

Conclusions
The solar energy incident on a PV depends of the tilt angle and orientation. Therefore, they considered a vital factor to obtain maximum solar radiation. It can be concluded that in most cases in the northern hemisphere, solar PV must be directed toward the south, this means that the azimuth angle is equal to zero. Whereas for the southern hemisphere, the solar panels must be directed toward the north, which means that the azimuth angle is equal to 180. So AR1 and AR2 are almost the same for most cities. In general, as the latitude of a specific city increases, it benefits from tilting increases, So the tilt factor increases with increasing latitude.
Neural networks are distinguished by being able to learn and generate an output of their own that is not limited to the feedback they receive. In addition, the network will detect the fault and still generate the output, even though a neuron is not responding, or a piece of information is missing. Therefore, the purpose of this research is to create a simple neural network model that can reliably predict the annual radiation and optimum tilt and azimuth angle in any area of the world and can be easily implemented in a low-cost microcontroller.
It can be concluded that the tilt angle is about or greater than the latitude until the latitude of 30 • , then it becomes less than the latitude until the difference between them reaches more than 20 • . The relation between them is not linear for all the latitudes.
Moreover, this study presents a multi-level world comprehensive neural network model for annual irradiation and PV optimum azimuth and tilt angles. Several simulations were carried out with different evaluation criteria to select the best network topology.
The proposed network topology is composed of two stages. The first stage is to predict the PV optimum tilt and azimuth angle, and the second stage is to predict the AR1, AR2, and AR3. The simulation result shows that the proposed module exhibits excellent performance with an average training MSE of 0.01635. This proposed model can be used in an embedded system or an online system for further PV system analysis and optimization.

Acknowledgments:
The authors would like to acknowledge the: An-Najah National University and the University of Almeria for facilitating this research.

Conflicts of Interest:
The authors declare no conflict of interest.