Dynamic Simulation and Optimization of Flat Plate Solar Collector Parameters Using the MATLAB Program for Erbil-Iraq Climate Condition

This research aims to investigate the performance solar water collector by varing five parameters; which are mass flowrate, inclination angle, total solar radiation, pipe size, and number of glass covers. The test rig was established to collect the data for the whole months of September and October and use it as a focal point for analysis of the solar water heating system's performance. The dynamic behavior simulated and optimizated with M ATLAB software for the practical data to investigate the performance of the flat plate solar collector. The novelity in this study is the first time the authors use the whole practical data instead of using an average to approximate the theoretical dynamic investigation of the flat plate solar collector. The achievements are as follows: The increase in collector efficiency was from 62.17% to 71.26% when the collector pipe spacing was reduced from 186 mm to 86 mm; the increase in efficiency was approximately 2% as the collector pipeline diameter grew from 1 mm to 50 mm; the optimum efficiency was achieved with triple glazing and was about 0.83%; the increase in mass flowrate from; 1 to 5 liters per minute, would improve the efficiency of the system from 64% to 83%. Moreover, the best tilt angle for the flat plate solar collector was 30°.Also, heat loss coefficient rises by around 50% when wind speed is increased from 1 m/s to 5 m/s. Thus, the use of dynamic investigation with actual data will assist the researcher in improving the performance of the solar water flat plate collector.


INTRODUCTION
Nowadays the renewable energy used in the electricity prodction broadly. The renewable energy resources have a positive influence on the world's environmental, economical, and political challenges. The entire installation capability of renewable energy sources accounted for 9% of total power output by the end of 2001. Subsequently, in 2017 the capacity of renewable energy sources worldwide increased to 2,195 GW, where the solar -wind power driving had the majority of this expansion. However, using the renewable energy in buildings and power plants still faces several difficulties. To address these issues, several nations are working to change their renewable energy policy via the use of enforceable laws, financial incentives, and other support mechanisms [1] and [2].
The necessary to develop solar energy as an alternative has increased as the world's power sources have run out. Due of solar energy's abundance, freedom, and environmental friendliness, research into its applications has widely used. Recently, solar energy deployed to conserve 1383 kW of power annually. In addition, it is environmental friend; by reducing the annual Emissions of CO2 around 781 kg for every flat plate solar collecoter [3].
The Solar collector are classified as non-focused and focus [4]. Solar thermal collectors flat plat seem to be the greatest prevalent kind of the solar collector used in domestic solar liquid heaters for home warming and heated water processes [5].
Several tests and researches continue to be interested in improving the design and optimizing the working environments of a flat solar collector. These studies assessing qualities of such devices, the design and potential user must evaluate a number of aspects, thermal efficiency, cost and longevity, durability, upkeep, and simplicity of installation are the primary categories. Moreover, if the losses are kept to a minimum and the output temperature is raised as much as possible, the collector's performance can be improved [6].
If losses are kept to a minimum and the output temperature is raised as much as possible, the collector's performance can be improved. Several studies [6,7] have been conducted in the areas of collector solar hot water system design, thermal performance appraisal, and optimization. In reference [6] the collector's total loss coefficient under various numbers and types of covers studied. Also, by adding more covers to a FPSC reduced a top heat loss. This improvement of the performance is made by mixing Plexiglas and glass.
Cooper [8] investigated the effect of a collector's inclination angle relative to the horizontal mostly on heat-losses coefficient. The overall heat loss coefficient increases somewhat with an angle of the inclination until a value expected to 60°, at which point the coefficient of the losses increases dramatically. The impact of wind speed, number of a glass cover, temperature of ambient, gap space among glazing cover as well as absorber plate, incline angle, plus absorbers plate emissivity on a total loss of heat coefficient of a flat plate collectors was investigated by Agbo plus Okoroigwe [9].
These characteristics have been proven to impact the total losses that occur within the collecting unit of the solar collectors' water heating systems. Ango et al. in reference [7] considered investigated the influence of various operational and design factors on the act of the polymer flat plat solar collectors , This work revealed that the extending the length of the polymer FPSC have no influence on a solar collector's achievement, but increasing an air gap width does, with an ideal performance achieved at such the air cavity width of roughly 10 millimeter lead to an ideal performance. In addition, raising a flow rate enhances the efficiency of a polymer FPSC, however also lowers the coolant's exit temperature. The temperature of the inlet coolant has been proven to have a significant impact mostly on polymer collector effectiveness. The temperature of the input coolant must be at least equal to the ambient temperature for excellent performance.
The Flat plate solar collectors are often evaluated in a steady state or quasi-stationary state [6,10]. However, the weather in various regions of a world is insufficient for outside steady state testing, which need that the ambient temperature be kept below particular parameters. Whereas, it is difficult to attaining steady state testing procedures, the dynamic test methodologies; considerd in this paper, is a good alternative for assessing the heat transfer performance of collectors have been developed.
A dynamic response is a mathematical block diagram representation of a process depends on time varing; namely continuous system [11]. This dynmic behavior of flatplatesolar collectors has significant interest and used to forecast the collector's time-dependent behavior under varying solar radiation intensity combine to weather situations. The dynamic evaluation method is used in analyzing of specific solar panels by examining collector characteristics. This modeling is a guide to increase the efficiencies and minimize cost function; which is used as error term in control system, for certificate authorities.
Furthermore, the dynamic simulation and optimization of flat plate solar collector by MATLAB software of any parameter has great importance in quality management and performance. These simulation and optimization are enhancement of the solar collector in a short time and effectively by solar collector producers.
A great number of research found in the literature to assessing a collector's transitory behavior [12,13]. Understanding of a thermal behavior (or modeling) of a solar collector is crucial for predicting the yearly energy production. Since, for solar thermal system this modeling is acceptable to achieve the suitable heat energy for a practical experience.
A dynamic analysis approach and Optimization for the solar collector parameters were investigated in this research in order to generate thermal performance parameter estimations and how increasing collector efficiency.
The goal of this study is to see how the liquid mass flow rate, inclination angle, total solar radiation, pipe size, and number of the glass cover affect the performance of solar water collectors. To accomplish these goals, MATLAB software was employed.
This study presents for the first time in Iraq-Erbil optimization a group of the most Al-Rafidain Engineering Journal (AREJ) Vol.27, No.2, September 2022,pp.127-139 important parameters for the flat plate solar collector system, which in turn affect the improvement of the performance of this system. Figure 1 shows the design representation of an flat plat solar collecroar (FPSC) with water pipelines. A complete investigation of all heat losses from a collector is fundamental to obtain a total heat loss coefficient (conductance). The quantity of solar energy engrossed per the unit area of a plate is indicated by It at some representative place on an absorber plate where the temperature is Tp. This absorbed energy was split between losses at the top, Rear, and edges, as well as usable energy gain.

Flat-plate solar collector's heat transfer
The following relationship [14,15] may be applied for represent the heat gated by the collector: (1) FR = Collector heat removales factor. Ac = Collector area m 2 . It = Incident tatal solar irradiation W/m 2 . UL = Top heat loss over all W/m 2°C . α= absorptance . τ = transmittance . Tci = Collector water temperature at inlet °C. Ta = temperature of ambient °C. Usable Heat gain by the fluid Qu. Q u = ṁC p (T co − T ci ) (2) Where m dot denotes masses flow of the fluid in kg/s, Cp is the heat capacity of a fluid kJ/kg.°C, and Tco is the outlet water temperature of the collector℃.

Systems of the solar heating thermal efficiency
The fraction of usable heat uptake by means of the collector to solar radiations on absorber ( η c ) is the collector efficiency of solar heating systems [16].
The collector performance coefficient is definite as (Tci -Ta)/It. The performance of the system is anticipated in the theoretical analysis through resolving mathematical equations and adjusting a values of next parameters: temperature of the ambient air (Ta), temperature of the collector inlet liquid (Tci), plus solar radiation (It).

Dynamic Simulation process in MATLAB program
The following equation models can be utilized in a simple simulation: Equations 6, 7, and 8, 9 may be used to compute the collecting fluid output temperature of flat plate solar collectors: Correlation for(U t ): [17] Derived a correlation for U t as, since the process to evaluate U t is laborious and involves an iterative approach.
N = is glass cover number. The following is the formula for calculating the plate temperature, T p , which may also be equivalent to the mean plate temperature,T p,m : [18] (19) efficiency factor of the Collector (F ′ ):

Optimizing the Tilted Angle
The Flat plate solar collector must be set approximately at right angles to the energy rays during in the drying seasons to obtain the extreme solar radiation rays. When a collector is oriented south inside the northern hemisphere, it has the superior heat performance all year [19]. The inclination of the collectors facilitates water drainage and enhances air circulation [20].The optimization equation for tilt angle is based on a model created by [21] and [22].
f is the beam's square root ratio to total radiation, which is defined as: The beam component can be founded by: )ω s ′ sin(φ+β) sin δ cos φ cos δ sin ω s ′ +( π 180 )ω s ′ sin φ sin δ (26) We take the lesser of the two numbers in brackets (ω s ) Sunset hour angle is given by: (29) (n) The number of days in a year  Figure. 2). In addition, every pipeline is 1.935 meters long and has an inner diameter of 12 millimeters. Outside diameters are equal to 14 millimeters. The pipelines are welded in both finishes to a header pipeline, which has an internal diameter of 28 mm, an outside diameter of 28.8 mm, and a length of 834 mm.

Setup for the experiment equipment
Absorber-water pipe organization is put in an internal box, which is then fixed to an exterior box; the area between the inside and outside boxes is insulated with wood chips. The front side of a box is at that time enclosed with 5 millimeters of abundant strong basic glass, as well as the air cavity among a plate and a glass cover is 50 millimeters. The total dimension of the FPSC is (1935 x 934 x 100) millimeters, and the operational glazing area is equal to 1.80 m2. An absorbent surface was coated with nonglossy black to boost the amount of absorbed energy. Figure 3 depicts the practical arrangement of the (FPSC). The collector's input and outflow water temperatures, as well as A K-type thermometer with standard accuracy limits of 97.4% was used to measure the air temperature and the temperature of the water within the tank. Also has a flow of water sensor capacity of 1-30 L/min (type YF-S201). The usual case fluid flow rate with error margins 3.4%. The solar radiation was measured using a LI-19 read-out device and a data historian with µV sensitivity plus a basic accuracy of 99 %.
The study was tested for 30-days during the months of September and October 2021, and a reading was taken every 7-hour between 9am-4 pm every day. Water suppliy by a collector from lowest level of a storage tank. The realized inlet temperature of the water varies among 25 and 60 °C. The gathered data was utilized to derive system achievement characteristics using the above-mentioned formulae.
In figure 4 shown the general block diagram of the simulation the flat plate solar collector system in MATLAB program. In this modeling, the equations of solar panal in previous sections are implemented as a mathematical blocks. The inputs of this representation are ambient temperature, wind speed, water mass flowrate, temperature of the collector inlet liquid, average solar irradiance. These inputs are used to simulate the system. The outputs are outlet temperature of the panal and efficiency. The curves in the next section are obtained from this model.
Thus, to increase the efficiency, five variables manuplated separately to predict weater the system predict the best operating point. As mentioned previousely this block diagram representation is the dynamic behavior in continuous; time base, system.
In this paper the well known book in control engineering field provided by [11] is used as the refrence of building, simulating and optimizing the solar collector panal process After calibration of all the instruments in the system, Accuracy of the different apparatuses and the errors of them are attached within this  table below Table 1a.

RESULT AND DISCUSSION
The current parametric paper is based on climatological data for Erbil, the capital of Kurdistan. The latitude of Erbil is (36.2191113) and the longitude is (44.009167) during the month of October 2021 (14-Oct). Hourly solar radiation at a particular date and ambient temperature shown in figure 5 were considered constant in the dynamic simulation and optimization. Table 1b displays the parameters are also fixed to obtain the dynamic simulation with optimization. The collector efficiency, top loss coefficient, heat rate, and fluid outlet temperature of solar collector are recorded.
The following subsections will deal with the main results for simulating the process dipected in figure 4. The responses (or outputs) obtained by simulating the block diagram are solar collector output temperature and effeciency due to manipulating the design variables. The variables are the change in the mass flow rate, wind speed, average solar irradiance, glass layer, tilt angle, diameter of the raiser pipe line, and tube pitch of the solar collectors' systeam.

Parametric analysis
Dynamic simulation and optimizations conducted using different mass flow rate, wind speed, average solar irradiance, glass layer, diameter of the raiser pipes line and tube pitch of flat plate solar collectors are Shown in figure 7, figure 8, figure 9, figure 10, figure 11, affect to the value of the Collector efficiency, top loss coefficient, heat rate and fluid outlet temperature. In addition, the tilt angle optimization reveals that the only parameter varied is the solar irradiance. Then, this changing in the values of tilt angle handled to find the best tilt angle this is shown in figure 6. The results of the dynamic simulations as will as optimizations are discussed in the following subsections.  Figure 6 and table 2 show plotted values of solar radiation on the collector surface versus collector tilt angle, demonstrating that when the collector plate tilt angle was raised from 0°, the solar radiation collected on the collector plate increased significantly. This increase lasted until the tilt angle of the collecting plate reached 30°; after that, any further increase in the tilt angle resulted in a decrease in the solar energy collected on the collector plate. As a result, 30° was chosen as the best value for the tilt angle of the solar collector plate for the latitude of Erbil (36.2191113) in Iraq, Kurdistan Climate Conditions, with 27970000 J/m 2 /day of solar insolation gathered on the flat plate collector.  Table 3 and Figure 7 demonstrate how the collector momentary efficiency varies with collector pipe diameter D and solar radiation intensity. From curves in figure 7, whenever solar radiation intensity fixed, the collector momentary efficiency improves as the collector tube diameter D increases. Since, the pipe diameter D increasing leads the area of contact between both the fluid and tube wall increase. Then, a heat transfer resulting will improve. Moreover, dimeter increasing produces the increase in outer surface area of the tube. Hence, increases the effective absorber area and allowing the fluid to absorb more heat. However, under the high solar radiation intensity, the collector momentary efficiency increases with increasing collector tube diameter. This phenomenon is increasingly visible.

Tilt angle
The results show the collector momentary efficiency improves as the collector tube diameter D raises from 1 mm to 50 mm under various solar radiation intensity (the fixed values are 450 W/m 2 , 650 W/m 2 , and 1050 W/m 2 respectively) is increased by 1.68%, 1.83%, and 1.96% respectively. Thus, raising the collector pipe diameter D under higher solar radiation intensity may increase the the collector momentary efficiency. Similarly, when the diameter of the collector pipe D is increased from 1 mm to 50 mm, the collector's momentary efficiency under fixed solar radiation intensities are increased from 60.70% to 62.38%, from 66.00% to 67.83%, from 70.54% to 72.50% respectively.   Figure 8 and Table 4 show how it collector momentary efficiency varies with collector pipe spacing (W); under fixed solar radiation intensities for each curve. In any curve the collector momentary efficiency drops as the collection pipe spacing (W) increases, and vice versa. Consequently, enhance the heat transfer area as well as a weakening of the heat transfer when the collector pipe spacing W is increased. Furthermore, since the usable energy obtained by the working fluid in the tube is smaller some percentage of the overall energy gained by the absorber plate, the collector momentary efficiency is lowered.
Also, can observe that the amount of solar radiation is strong and it is similar to lower the collector momentary efficiency by increasing the collection pipe separation. While, as collector pipe spacing W rises from 86 mm to 186 mm, the collector instantaneously efficiency under similar solar radiation amounts (equals to 450 W/m 2 , 650 W/m 2 , and 1050 W/m 2 respectively) is decreased by 7.84%, 8.53%, and 9.47% respectively.
As a result, by lowering the collector pipe spacing W, the collector momentary efficiency may be significantly improved. When the collector tube spacing W is increased from 86 mm to 186 mm, the collector instant efficiency is reduced from 61.31 percent to 53.47 percent, 66.07 percent to 58.14 percent, and 71.26 percent to 62.17 percent, respectively, under various solar radiation intensity levels (450 W/m 2 , 650 W/m 2 , and 1050 W/m 2 ).   5 illustrated that the efficiency will increase with increasing the glass numbers. This improvement is due to the greater heat gain. It can be noted that the collector efficiency percent is about 0.83% in triple glazing, 0.81% in double glazing, and 0.80% in single glazing. Therefore, the larger top-loss heat transfer coefficient as well as the lower heat transfer rate to liquid in single glazing and lower efficiency.
Then, curves in Figure (9b) dipected the top losses in heat transfer coefficients of single, double, and triple glazing systems are shown with time. Many factors influence the total top-loss heat transfer coefficient; including wind, sun intensity, and the space between the absorber plate and the glass cover numbers (i.e. 1 and 2 or 3). In single glazing the influence of wind velocity and the total top loss coefficient are greater than for double and triple glazing systems. Since, the temperature differential (ΔT) between the absorber plates and covers (2 or 3) was lower in multi-glass systems. Hence, the overall convective heat transfer coefficient was lower, as observed.
Furthermore, referring to the figure (9c), the results indicate that its usable heat gain (Qu) is greater for double as well as triple glazing than for single glazing. In this case the upper heat loss coefficient's is lower for double as well as triple glazing. In addition, the heat has been converted properly and transferred to the water. Accordingly, there is more useful and valuable gain absorbed in double glazing compare to single glaze.
Later, Figure (9d) dipects the outlet heated water temperature was 343 K for triple glazing. This increasing in temperature is due to the influence of distance and double glazing. However, with the same sun intensity, spacing dimensions, and testing circumstances, only 340 k was attained in a single glazing system. Fig.9 [a] Changing of efficiency due to Number of glass cover Fig.9 [b] Changing of Ut due to Number of glass cover  Table  6 and Figure  (10a) demonstrate the escalation of the efficiency with increasing the water flow rate. The increasing flowrate leads to increasing absorption of thermal energy, improves the collector efficiency, and reduces the radiation loss.

Mass flow rate
In the case of 1 L/m, the minimum efficiency gained is 0.64 percent, while the greatest efficiency obtained in the case of 5 L/m is 83 percent. The fluid with the largest mass flow rate (5 L/m) has the maximum efficiency over time. This increasing in efficiency by raising the fluid mass flow rate is due to increase in the fluid usable heat gain and improved collector efficiency. The outcome here the fluid with the smallest flow rate (1 L/m) kg/s has the lowest efficiency compared to the other flowrates in the curve. Morovere, Table 6 and Figure (10b) show the progression of the water outlet temperature gradient over time for various mass flow rates. It indicates that the temperature of the fluid outflow rises with time and falls with a reduced mass flow rate. In the case of 5 L/m, the smallest fluid outlet temperature attained is 303 K, whereas the highest in the case of 1 L/m is 348 K. Since the mass flow of water is inversely related to fluid outlet temperature, a low mass flow rate results in a higher water outlet temperature level. Furthermore, during the slow circulation of liquid through the pipe, needs more time for the water to heats up (homogeneous heat transfer). The temperature rise via the collection also reduces as the water flow rate rises. This drooping in the collector outlet temperatures is commensurate increase in the usable energy gain and will result in fewer losses.   Figure 11 and table 7 show the influence of wind speed on the collector's upper heat loss coefficient. Convection heat transfer coefficient raises with wind speed, therefore proportionally the quantity of top heat loss coefficient increases. The simulation curves reveal that as wind speed increases from 1 m/s to 5 m/s, the quantity of upper heat loss coefficient increases by about 50%. For example, when the wind speed is 1 m/s, the maximum peak heat loss coefficient is 2.593 W/m 2 K. While, when the wind speed is 5 m/s, the maximum peak heat loss coefficient has been 3.718 W/m 2 K. The behavior is due to increases in wind speed results to raises the Raynaud number. Then, creats a change in cooling quality from natural into forced cooling. Hence, a dispersion of the sun's rays landing on the collector's surface will happen, as well as a quick reduction in temperature and increases heat loss.

Explain the difference between theoretical and practical outcomes.
The most important parameters to be compared in this study are efficiency and outlet water temperature. The result showed that under the same operating conditions; particularly, at maximum values of both, theoretically are 0.82%, and 340.2 K, and practically are 0.77%, and 336.9 K, respectively. These minor differences are due to the instability of the surrounding environment in practical tests.

Current results and published data
In this work, to confirm the validity of the results can be summarized; that the results are very close to the published results in this scope. The two important parameters are efficiency and outlet water temperature are improved to justify this research. The improvments rely on deploying different parameters to attain good performances. For this purpose the modeling of the process is built, simulated, and optimized by MATLAB software. Finally, theoretical and practical results show that they are very close to each other.

Description of the proposed system
This paper proposed specific flat plate solar collector systems. Then, the most important parameters optimized for the flat plate solar collector system. This optimizing gives the sufficent output values for efficiency and temperature.
The ability of the collector area for heating water (1 m 2 ) provides 50 liters of heated water per day.
Active system with a mass flow rate not less than 2 L/m. Triple or double glasses covered. The absorber tube's diameter must not be less than 15 mm.
Tube pitch must not exceed 86 mm. As much as possible, stay away from high wind speeds.
Keep the system clean, particularly the glass cover.

CONCLUSION
A mathematical block diagram representation model with simulation created in the MATLAB environment. Also, different parameters manipulated and compared to optimize the outputs. The thermal performance of flat plate solar collectors analysed based to these parameters. As a result, in study following conclusions have been achieved: 1-The increase in collector efficiency was from 62.17% to 71.26% when the collector pipe spacing was reduced from 186 mm to 86 mm, lowering collector tube spacing is a good way to boost collector instantaneous efficiency.
2-The increase in efficiency was approximately 2% as the collector pipeline diameter grew from 1 mm to 50 mm, increasing the collector pipe diameter is a good way to boost immediate collector efficiency.
3-The optimum efficiency was achieved with triple glazing and was about 0.83% and the maximum output temperature for a triple glazing system was 343 k, but only 340 k for a single glazing system. 4-The increment of the mass (1 to 5 liters per minute) flow rate would improve the efficiency of the system from 64% to 83%, for a mass flow of 1 L/M, the highest outflow temperature was 348 k, but only 335 k for 5 L/M. 5-Heat loss coefficient rises by around 50% when wind speed is increased from 1 m/s to 5 m/s 6-The best tilt angle for the flat plate solar collector was 30°, biased from the horizontal towards the south, in the examined geographical region (Erbil). 7-Optical efficiency is achieved when the fluid input temperature matches the ambient temperature.
8-The collector efficiency and fluids output temperature are used to understand the final data. It is expected to have 77 percent efficiency and a fluid output temperature of 60 to 62.5 degrees Celsius.
9-The use of dynamic investigation (modeling) with actual data will assist the researcher in improving the performance of the solar water flat plate collector.

Recommendation
To be brief, the following things must be understood and taken into account to obtain the best results when using flat plate solar collectors: As solar irradiation rises, thermal efficiency rises as well.
As the mass flow rate increases, the solar collector's efficiency increases.
Optical efficiency is reached when the fluid intake temperature equals the ambient temperature.
As the ambient temperature and wind speed rise, the energy available for use (heat gain) rapidly decreases.