Application of Fuzzy Logic to Forecast Hourly Solar Irradiation

Accurate forecasting of solar resource is a key issue for a successful integration of the solar power plants into the grid. This paper proposes the fuzzy logic approach as alternative to classical statistics, aiming to forecast hourly global solar irradiation. Hourly clearness index, defined as the ratio of hourly global solar irradiation at the ground and at the top of the atmosphere, is the quantity directly processed by the fuzzy algorithms. It takes into account all random meteorological influences, being a measure of the atmospheric transparency. Thus, clearness index isolates the stochastic component of the solar irradiation data series. Four new autoregressive-fuzzy models are studied in this paper. The models are mainly differentiated by the number of the input variables and attributes. The results show that a model which includes seasonal terms is the most performant. The model can be applied in sites where measurement of hourly global solar irradiation is currently performed, only a re-estimation of the parameters being necessary. Overall results demonstrate that the fuzzy models have the strength to translate the information enclosed in past measurements into an actual prediction with acceptable accuracy.


Introduction
The weight of solar electricity in the energy mix experienced an impressive augment in the last decade, and this trend is expected to continue. The European photovoltaic (PV) cumulative installed capacity has progressed from less than 1 GW in 2003 to over 30 GW in 2010 and 70 GW in 2012. Regarding the energy mix, at the end of 2012 PV covers 2.6% of the electricity demand and 5.2% of the peak electricity demand in Europe [1]. To date, there are two challenges standing against the growing share of PV systems in the energy mix. The first challenge refers to the price of the electricity which is still high in comparison to that of power plants based on fossil fuels. Many efforts are spent all over the world to reduce the costs associated to solar electricity production. The second challenge stems from the intrinsic nature of solar energy which is stochastic fluctuating in time owing to irregular weather pattern. Therefore, in order to reduce the costs of integrating the solar plants in the existing power grid, forecasting the energy generated by the solar plants is a key issue. Currently, there are several ongoing research projects in Europe, testing different procedures for accurately forecast the PV output power. For example, COST Action ES1002 "Weather Intelligence for Renewable Energies" has the main objective to improve the forecast of the output power of solar and wind power plants [2].
There are two methods currently used to perform the forecast: (1) Statistical modeling of the PV plant output power time series (e.g. [3]) and (2) Modeling the output power, using as entries forecasts of radiometric quantities (solar irradiance/irradiation) and weather parameters (air temperature, cloud cover) (e.g. [4]).
The accuracy of forecasting the output power of a solar plant is closely related to the accuracy of forecasting of solar resource. Depending on the time horizon, different forecasting methods are considered [5]. In nowcasting (horizon time less than 3 hours) the forecasts are based on the extrapolations of real-time measurements [6][7][8][9]. The most popular methods are: Autoregressive Integrated Moving Average (ARIMA) and artificial neural network. A concise but outstanding review of these methods can be read in [10].
This paper is focused on the practice of hourly solar irradiation forecasting by using the fuzzy logic approach.
Fuzzy logic has been introduced in 1965 by Lotfy A. Zadeh [11]. Basically it replace the binary 0/1 logic with a multi-valued logic. Because the fuzzy approach is quite different from classical approaches, a short introduction is given in Appendix A. Additional references and examples can be found in many books (e.g. [12]).
Although fuzzy logic has been adopted as a standard method in various applications [13] its use is still incipient in modeling solar radiation at the Earth surface. There are several works dealing with the estimation of the solar irradiation via fuzzy approach [14][15]. Up to now, only a few attempts related to solar resource forecasting were published. In Ref. [16], our group reported a fuzzy model for forecasting daily global solar irradiation. Here we report an extension of this study by dropping the forecasting time horizon to one hour. Four auto-regressive fuzzy models constructed in an innovative manner are proposed and assessed.
The structure of the paper is as follows. Next section is devoted to the database description. In Sec. 3 the models construction is illustrated and their prediction accuracy is discussed. The main conclusions are gathered in Sec. 4.

Database
Measurements performed in the Romanian town of Timisoara (45°46′N, 21°25′E) are used in this study. Timisoara is placed at 85 m asl on the southeast edge of the Pannonian plain. Timisoara is characterized by a warm temperate climate, fully humid (Köppen climate classification Cfb -based on the digital Köppen-Geiger world map on climate classification [17]) with warm summer, typical for the Pannonia Basin.
Global and diffuse solar irradiance recorded on the Solar Platform of the West University of Timisoara are used here [18]. Measurements are performed all day long at equal time intervals of 15 seconds. DeltaOHM LP PYRA 02 first class pyranometers which fully comply with ISO 9060 standards and meet the requirements defined by the World Meteorological Organization are employed. The sensors are integrated into an acquisition data system based on National Instruments PXI.
Hourly clearness index kt is the quantity directly processed by the proposed fuzzy algorithm. This choice is motivated by the fact that kt isolates the stochastic component of the solar irradiation [19]. In the present study, time series of hourly kt was derived from solar irradiance measurements following the definition: In In Eq. (2) ω is the hour angle and ω 1 and ω 2 delimit the hour interval. The factor 12/π assigns the unit: if G ext is in W/m 2 , then H ext is in Wh/m 2 . For a given day, the extraterrestrial radiation was calculated as function of the elevation angle h: the solar constant, ε is the eccentricity correction factor that can be calculated with the equation of Spencer [20].
Another quantity used in this study is the relative sunshineσ . It was evaluated following the pyranometer method. At first, the sunshine number t ξ , a Boolean quantity stating if the sun shining or not [21,22], was calculated using the World Meteorological Organization sunshine criterion [23]. According to this, it is considered that the "sun is shining" at time t if direct solar irradiance exceeds 120 W/m 2 , i.e.: where G t and G d,t denote the global and diffuse solar irradiance at the moment t and h represents the sun's elevation angle.
Then, the relative sunshine in a given time interval ∆t was simply computed as the average values of t ξ over ∆t: The series of hourly relative sunshine was derived from measurements assuming in Eq. (4) ∆t = 1 hour. In the following we denote The database used in this study consists of 17520 values for each variable, kt and σ, corresponding to all hourly intervals of 2009 and 2010 (including zero night values). The data from 2009 were used to build the models while data from 2010 were used to test the models.

Results and Discussions
In this section the structure of the fuzzy models is presented in detail and their accuracy is assessed.

Models
Four autoregressive-fuzzy models are studied in this paper. The models are mainly differentiated by the number of the input variables and the number of attributes. Model #1 has only one variable at the input kt t-1 (measured at time t-1) characterized by 3 attributes. Model #2 extends the number of inputs increasing the order of auto-regressive terms to two, kt t-1 , kt t-2 . Following the findings from [16] the variable kt t-1 preserves the three attributes while the variable kt t-2 is characterized by two attributes. The model #3 adds to model #1 an exogenous input, namely relative sunshine. The model #4 includes a seasonality term, kt t-24 adjacent to kt t-1 .
The models #1, #2 and #3 were applied to the daily series (DS) of hourly kt. This series was obtained by the following procedure. First, for each day a sub-series of kt has been prepared. Only hourly measurements associated to sun elevation angle greater than 5° were considered. Next, the DS series was build by stacking the sub-series prepared for each day in part. Since model #4 includes a seasonal term, it was applied to the whole day-night series (DNS) of kt (i.e. including zero night values). The results presented in Sec. 3.3 shows that the model #4 is the most accurate. Thus, more details on the structure and the operation of this model are presented in the following.

Seasonal autoregressive fuzzy model
Model #4 is a seasonal autoregressive fuzzy model with two input variables kt t-1 , kt t-24 and one output variable kt t . The membership functions are specified in Fig. 1. The geometry of all membership functions was choosing triangular and always the peak of a triangle matches with the corresponding extremities of the adjacent membership functions. The membership functions of all variables, either in or out, reads: where v = 0, 1 or 24 specify the variable and the index i counts the attributes of a given variable. The parameters a i , b i and c i have the meaning as is illustrated in Fig. 1a on the M1 attribute. The membership functions of the attributes S24 and H24 are saturated toward zero and infinite, respectively. The mapping of the input to the output of the system, materialized in the rules-base, is listed in Table 1, as a matrix. There are 6 rules, each rule being an implication in sense of Eqs. (A3a,b).
The models #1, #2 and #3 have a similar structure with the model #4.

Models performance assessment
The models performance has been assessed with three statistical indicators: relative root mean squared error (rRMSE), relative mean bias error (rMBE) and relative mean absolute error (rMAE), defined as follows ( ) where N is the number of measurements taken into account. Fitting period. Table 2 shows the models ability to fit the data. Only forecasts for the daylight time were considered. It can be seen that model #4 is the best fit to the data, with an improvement in rRMSE over persistence of 25.2%. The persistence model assumes that the conditions at the time of the forecast will not change. The ability of the fuzzy model to trace the measured time series is well illustrated in Fig. 2, where the measured and the forecasted kt series with model #4 in 10 days (16 to 25 June 2009) are plotted. The DNS series was also modeled by a seasonal autoregressive integrated moving average sARIMA model (see Appendix B for an introduction), as the first competitor. The model ARIMA(1,0,1)×(1,0,1)24 was identified as the best, with rRMSE = 0.254 and rMBE = -0.021. It shows that there are no notable differences between the performance of the fuzzy logic model and the performance of the sARIMA model. However, a slightly advantage for the fuzzy model can be noted. Testing period. All the models were tested against data measured in 2010. This is in line with rather common practice that a forecasting model is often developed with data from only one location. Then, only the model parameters are re-estimated when it is applied to another location.
The models performance in the testing period is also presented in Table 2. Again, model #4 registered the best performance with rRMSE = 0.283. This is a reasonable value taking into account that the statistical indicators were calculated over the entire year. The improvement in rRMSE over persistence is of 24.3%. A smaller improvement in rRMSE of only 4% is found compared to sARIMA model.
The ultimate goal of this work is the forecasting of hourly solar irradiation. Reikard [7] reported a comparison of different models (including ARIMA, UCM -unobserved components model, NNneural networks and hybrid models) for forecasting mean hourly solar irradiance at different horizons of time, against data measured at six stations. The results were assessed in terms of mean absolute percentage errors ( . For one hour forecast horizon, MAPE reported in [7] falls between 19.6% and 75.4%. Comparing the forecasted solar irradiation time series generated by the model #4 with measurements we found MAPE = 29.4% in the fitting period and MAPE = 37.0% in the testing period. Therefore, our results are in good agreement with the results from [7]. When the fuzzy models were tested monthly, the models accuracy was better in summer months than in winter months. As example, monthly statistical indicators of accuracy for model #4 are presented in Table 3. It can be seen that rRMSE decreases from 32.4% in January to 19.6% in August and increases again to 41.6% in December, which indicates a seasonal dependence of the model accuracy. This is in accord with the results reported in Ref. [9], which demonstrated that the accuracy of the autoregressive models for sunshine number is primarily linked to the stability of the state of the sky, which, however, depends on the season.

Conclusions
In this paper four auto-regressive fuzzy models for forecasting hourly global solar irradiation are assessed. Being a measure of the stochastic component of solar irradiation, the hourly clearness index is the effective forecasted quantity. A seasonal fuzzy model which includes two auto-regressive terms of order 1 and 24 was found as the most performing. The proposed model exploits a very simple rulesbase matrix. Since the data series used to build the model can be considered coming from an arbitrary environment, the procedure is general and it can be applied in any place where hourly global solar irradiation is currently measured, only a re-estimation of the parameters being necessary. The detailed presentation of the model is intended to help the potential users to devise an appropriate fuzzy model for their own requirements.
The comparison with the traditional ARIMA model shows that the fuzzy logic approach is a competitive alternative for accurate forecasting short-term solar irradiation. Allowing intermediate values between the two binary options 0 and 1, the fuzzy sets theory can provide mathematics with the ability to capture uncertainties associated with natural phenomena. Thus, fuzzy logic may be regarded as an extension of the binary logic, which is successful in many applications, like computer science, but may lack the flexibility needed in other applications, like solar irradiation forecasting.
Further efforts will be devoted to the integration of some meteorological parameters in the fuzzy algorithm (related to the state of the sky, atmospheric pressure), aiming to increase the model accuracy.

A. Fuzzy logic
The basis of Zadeh's logic theory is the fuzzy set concept, which is defined as follows. If X is a collection of objects, the associated fuzzy set A is defined as: where m A (x) is the membership function showing the degree of affiliation of the element x to the fuzzy set A. A physical variable is named linguistic variable and its values are linguistic values, called attributes, expressed by words. The membership function indicates the level of confidence with which an attribute characterizes a certain element x X ∈ . The number of attributes of a linguistic variable and the shape of the membership functions depend on the application, being specified in a heuristic way. In fuzzy sets theory, these operations are defined through the membership functions, e.g.:

( )
Intersection: min ( ) , ( ) , Generally, a fuzzy logic model is a functional relation between two multidimensional spaces. The associative rules between different input and output fuzzy sets are expressed in the form: Every premise or conclusion consists of an expression like: Thus, the information is carried out from the input to the output of a fuzzy model in three steps: (1) Fuzzification. A coding process in which each numerical input of a linguistic variable is changed into the membership function values of its attributes.
(2) Inference. A process consisting of two steps: (i) The computation of the degree in which a rule is fulfilled by the intersection of individual premises (Eq. A2a). (ii) Sometimes some rules drive to the same attribute of an output linguistic variable. For finding the confidence level of this conclusion, the individual degrees of fulfilling the rules driving to this conclusion are joined (Eq. A2b).
(3) Defuzzification. It is a decoding operation of the conclusion resulted from the inference process, on the purpose of providing the output crisp value. There are many defuzzification methods (see e.g. [12]); in this work, the following equation was applied: