A Model to Compute the Solar Parameters in Relation to Determining the Optimal Angles for Solar Panels in Many Locations in Iraq

Directing solar panels in a way that collects the largest possible amount of solar energy is still attracting a lot of attention due to the continuous need to get clean, inexpensive renewable energy. Iraq is one of the countries characterized by the abundance of solar energy but the investment in this field has been far below ambition. In this study, an application developed with the visual basic programing language was used to compute precisely various solar angles and parameters , as a powerful tool for engineers and researchers. The outputs of the model were tested and discussed in detail. The air mass values were also computed for three cities: Mosul, Baghdad, and Basra. The results showed that the best time to acquire the solar radiation would be from 10 am to 2 pm (local time), the period that has the lowest values of air mass. Additional useful calculations that can be estimated by the application were the terrestrial irradiances from four empirical models for the clear sky: Roledo-Soler, Adnot, Kasten – Czeplak, and Berger-Duffie. The calculated values of terrestrial irradiance were compared with observed data measured by automatic weather station. The application simulated the actual values with some deviations due to the existence of clouds and aerosols. Kasten – Czeplak model was recommended to be used in Iraq since it was the best model to simulate the measured values. The comparison between the model’s output and the measured values on a daily basis on the 21 st of June showed good agreement. The study suggested that the solar panels should face the south direction with a change of the tilt angle of the panels from 25 o in June to a value of 60 o each month towards the coldest months by an increment of 5 degrees.


Introduction
Solar irradiance drives our weather and climate [1] and offers energy that is clean, cheap, and renewable. The solar energy research and technology have attracted increasing attention in the last decades as a promising alternative to the use of fossil fuels that pollute the atmosphere and enhance the climate change effects. A great deal of research work was devoted to improve the modeling and technical aspects of solar panels and collectors. Middle East is a rich spot of solar radiation but ,at the same time, it suffers from some climatic obstacles such as dust [2]. However, mineral dust is not the only pollutant that decrease the solar irradiance reaching the earth surface. Air molecules absorb, scatter, and reflect the sun light; many aerosols in addition to the clouds affect the overall portion of solar energy [3]. Air mass (AM) refers to the optical path length through the atmosphere where light is scattered and absorbed [4]. It is described as the relative length of the direct-beam path through the atmosphere compared with a vertical path directly to sea level [5]. Hence, the air mass is 1.0 when the sun is directly overhead, 1.5 when the sun is 48.2° from vertical (zenith) and 2.0 when the sun is at 60.0° [6]. The sun elevation is a function of space and time. It affects the amount of energy reaching the solar panels and collectors. The closer the regions are to the equator, the higher the sun elevation, the lowest the air mass and the higher the solar energy [7]. In winter, the celestial path of the sun is closer to the horizon than in summer [6]. Figure (1) shows the solar angles that determine the position of the sun with respect to earth. In this study, a model consisting of many equations of solar mechanics and solar energy is proposed and developed using visual basic dot net scripts and interfaces. The main objectives are to study and estimate the various solar parameters, air mass, extraterrestrial and terrestrial irradiance, and to find the optimal tilt angle of the solar panels in some locations in Iraq.

The sun's position and irradiance
It is important to explain the celestial mechanics, which describe the position of the sun in the sky at any moment [8], [9]. The elevation angle ( ) is the angle between the sun light and the horizontal level: where, is the local latitude, is the declination angle [10], is the day number in the year, e.g. 1 for 1 st January. is the hour angle that describes the angular movement of the sun from the noon (12 pm). The sun travels 15° longitudes per hour being negative value in the morning, positive in the evening, and zero at noon [11], is the apparent solar time [12], is the local standard time, is the equation of time, is the standard longitude, is the local longitude, and is the summer time (0 or 60 minutes).
From equation 1, the hour angle at the sunrise and sunset ( can be written as [13], The solar azimuth is the angle between the sunlight projection and the longitude. In the northern hemisphere, the azimuth angle equals to 0° for the south-facing surface, and 180° for the north-facing surface, 0 to180° for the westfacing surface, and 0 to -180° for the eastfacing surface,

Air Mass
The air mass characterizes the path travelled by the sunlight through the atmosphere to the sea level. It equals zero for the extraterrestrial space or if one thinks of the earth without atmosphere. Near the equator, when the sun is at the zenith, the air mass is regarded as 1, since the solar rays travels the shortest path. The simplest form of air mass is [14], where is the zenith angle ( the angle between the sunlight and the vertical) and is given by, At , AM = 2 which means that the solar radiation will travel a path two times longer than at and hence will be greatly attenuated and less energy will reach the solar panels, for instance. The above formula considers the density constant for the atmosphere and ignores the earth's curvature using the geometry of a parallel plate [4]. For zenith angle greater than 80°, equation 9 fails to give accurate values of AM. Kasten and Young [15], in 1989, suggested the following formula that best fits the measured data for all expected values of zenith angles,

Solar Irradiance reaching the solar panels
The extraterrestrial radiation I o , or the radiation that reaches the outer part of the earth atmosphere is regarded as constant (Solar constant ≈1367.7) for most applications. However, it varies slightly throughout the year and can be calculated by taking into account the astronomical facts according to the following formula [4]: On the other hand, air molecules and aerosols attenuate the terrestrial radiation reaching the earth surface. Calculation of the solar irradiance reaching the earth surface is a bit complicated process because some of the light is absorbed and scattered by the atmosphere. Many models in literature are used to estimate the solar irradiance, mostly with clear sky assumption [16]. The attenuation is a function of the zenith angle. High zenith angles result in high air mass and more interaction between the solar radiation and the atmosphere [4]. There are many simple formulas to estimate the Global Horizontal Irradiance (GHI), for instance [17], [18]: It is worth mentioning that there are many other models that estimate the GHI depending on variables other than the zenith angle, such as e air temperature [19].

Materials and Methods Data and location
The dataset of the observed global horizontal irradiance was acquired from the Department of Atmospheric Sciences, College of Science, Mustansiriyah University. The dataset was measured by an automatic weather station (DAVIS VANTAGE PRO2) installed on the roof of the department building (33.3672 N, 44.4034 E, Altitude= 56 m). This dataset was used to evaluate the calculated values of the global irradiance. The scripts of the algorithm were written using Visual Basic dot net programing language to compute the various solar parameters. Figure 2 shows the weather station and Figure 3 shows the main interface of the developed application.

Calculation of Optical Air Mass
The optical air mass (or just air mass) for three cities were calculated by Equation  Air Mass

Calculation of Extraterrestrial and Terrestrial Global Horizontal Irradiance
The global extraterrestrial and terrestrial horizontal irradiance were calculated for Baghdad city every 10 days in 2019. The calculations of the extraterrestrial irradiance were based on Equation (12)

Results and Discussion
The application, which was developed with Visual Basic programing language, has a powerful interface that offers many outputs.It is beneficial for any researcher or engineer who works on solar facilities. The application program has been confirmed to be free of bugs and errors.
The study of the curves of solar angles and equation of time in Figure 3 showed that the declination and altitude angles are increasing during the summer days and decreasing toward winter. On the contrary, the azimuth angle is decreasing toward the summer solstice. The values of the hour angle depend solely on time and hence it was still constant during the year since the time was fixed at 10 am. The hour angle was negative in the morning and positive in the evening. Equation of time was changing in value and sign during the year. From Figure 4, it is clear that the declination angle and equation of time do not change throughout the same day since it depends on the day's number. Altitude angle was greater at noon and smaller at sunrise and sunset. Hour angle changed linearly from negative in the morning to positive in the evening. Whereas the azimuth angle changed from negative in the morning to positive in the evening and equal to zero at 12 pm and 12 am. The equation of time was equal to zero on the 21 st of June. The curves in Figures 3-4 can give visual tool to understand the change of the position of the sun with respect to earth. The air mass charts in Figures (5-7) for the three cities: Mosul, Baghdad, and Basra showed distinct differences. If one takes air mass value of 2 as a level of reliable factor, the best time to acquire the solar radiation will be at 12 local time. The solar panels would be in perfect operation at 12. The period extended from 10 am to 2 pm is also good to get a great deal of solar radiation all over the year. On the other hand, the periods before 10 am and after 4 pm are far from the acceptable periods of getting the required radiation except in the period from March to September. Hence, one should not pay much attention in tracking radiation for the imperfect times at the process of changing the tilt angle of the solar panels. In this context, it was noticed that the criteria of getting the solar radiation are better for Basra than for Baghdad and Mosul because of the small value of air mass in Basra.

Extraterrestrial and Terrestrial Irradiances
The extraterrestrial irradiance reaching the outer atmosphere is not exactly constant throughout the year. It does reveal some slight changes ranging from 1320 to 1413 W/m 2 as in Figure 8. The highest values were in the winter and the least in the summer. The reason is that the earth is closer to the sun in winter (147 million km in January, 152 million km in July) [20]. All the recorded and calculated irradiance values on a horizontal surface on earth were under 1000 W/m 2 because of the air mass that attenuate the solar radiation. In Figure 9, the curve drawn for the global horizontal irradiance (GHI), or simply the terrestrial irradiance, versus day's number resembled that of four empirical models, with the observed values measured by an automatic weather station. The curves showed bell-shaped lines with a peak located in the middle of the year on June 21 st . The models simulate the actual values to some extent. The differences may belong to the existence of clouds and aerosols that attenuate the solar radiation. The model of Kasten -Czeplak, was the best to simulate the measured values and therefore it is recommended to estimate the global horizontal irradiance in the Iraqi cities. The comparison between the models output and the measured values on a hourly basis on the 21 st of June showed good agreement in a clear sky condition in the middle of summer( Figure 10). On the 21 st of December, the measured values did not match the models in the morning (Figure 11). This can be justified by the presence of fog, haze, or even stratus clouds in the morning, which may have disappeared in the afternoon.

The Orientation of Solar Panels
The study showed that the solar panels should face the south direction. Also, the tilt angle of the panels (which is equal to the zenith angle) should gradually be changed from a value of 25 degrees in June to a value of 60 degrees towards the cooler months with an monthly increment of 5 degrees.. Conclusions 1. The application of solar parameters which was developed with visual basic programing language offers a powerful interface that compute the various parameters required by users and researchers. The application calculated with great precision the various solar angles and parameters and the measurements were discussed. 2. The air mass calculations for three cities: Mosul, Baghdad, and Basra showed distinct differences. If one takes air mass value of 2 as a level of reliable factor, the best time to acquire the solar radiation will be at 12 local time. The solar panels would be in perfect operation at 12. The period extended from 10 am to 2 pm is also good to get a high solar radiation all over the year. On the other hand, the periods before 10 am and after 4 pm are far from the acceptable periods of getting the required radiation except in the period from March to September. Hence, one should not pay much attention in tracking radiation for the imperfect times at the process. 3. The curves of the global horizontal irradiance (the terrestrial irradiance) of the models: Roledo-Soler, Adnot, Kasten -Czeplak, and Berger-Duffie simulated the actual values to some extent. There were some differences that may be due to the existence of clouds and aerosols that attenuate the solar radiation. Kasten -Czeplak model was the best to simulate the measured values. So it is recommended to estimate the global horizontal irradiance in the Iraqi cities. The comparison between the models output and the measured values on an diurnal basis on the 21 st of June showed good agreement in a clear sky condition. The existence of clouds, haze, and aerosols lessened the agreement due to the attenuation of solar radiation. 4. The study showed that the solar panels should be facing south . Also, the tilt angle of the panels (which is equal to the zenith angle) should be gradually changed from a value of 25 degrees in June to a value of 60 degrees towards the cooler months with an monthly increment of 5 degrees.