An ANFIS‐based model for solar energy forecasting and its smart grid application

In the present work, a model underlying the principle of adaptive neural‐fuzzy inference system (ANFIS) architecture is proposed. This research investigates the ANFIS‐based model performance to forecast global solar energy under different weather conditions, namely, clear sky, hazy sky, hazy and cloudy sky, and cloudy sky; and for distinct climate zones using salient meteorological parameters. Power generation from solar photovoltaic (PV) may be affected by different factors, such as cloud cover, topographical locations, time, and seasonal variations. Therefore, accurate forecasting of PV power is an important factor for system reliability and robustness. In this work, the proposed model is implemented for smart grid applications in forecasting short‐term PV power in a composite climate zone. Finally, the accuracy of the model is compared with other approaches, namely, support vector machine, feedforward neural network, multivariate adaptive regression splines, generalized regression neural network, linear neural network, fuzzy logic‐based model, and empirical models based on multiple regression analysis using statistical performance indicators. The overall analysis reveals that the ANFIS‐based model outperforms the other models in terms of accuracy.

of solar photovoltaic (PV) systems. Unfortunately, the data based on solar energy resource are unavailable because of the high cost of the instrument, maintenance, sufficient length of the record, and calibration of the measuring equipment. Due to nonavailability of the measured data, forecasting solar energy has been important at the surface of the earth. Therefore, a need has arisen for developing the model based on readily available data to forecast global solar energy. Furthermore, the power prediction has been a new concept and gained economic importance and it has been known that, solar energy changes with time, topographical locations, and seasonal variations. Therefore, if investors know the prediction of power in short-term duration, it would be easy for the investor to market and make a decision about energy planning for them. Therefore, in this research, the model being proposed has been further implemented for application in smart grid system for short-term PV power forecasting.
Many previous types of research have been carried out that employ artificial intelligence techniques for global solar energy forecasting using large datasets. Artificial neural network (ANN) models have been used in a broad series of applications which include optimum estimation and forecasting; least-square optimization of numerical weather prediction. [1][2][3][4] In one of the recent research by Nespoli et al wherein 24 hour ahead solar power forecasting has been performed in a solar PV system. In this research, two methods based on the ANN have been used, one in which training and testing have been done on the same dataset and the other based on the daily weather forecast. It has been concluded that for cloudy days, the performance of both of these methods has reduced; however, the performance has been noticed stable for the method, which uses the same dataset for training and testing and does not use weather forecasts. 5 Researches carried out shows that for estimating complex functions, accurately analyzing the number of neurons, and hidden layers using ANN has been difficult as they are large in number. In addition to this, the training time involved has been large which resulted in slower system response. Therefore, adaptive neural-fuzzy inference system (ANFIS)-based model has been introduced focusing onto the theoretical aspects, design, and methodology to forecast global solar energy.
Many researches have been carried out based on the integrated features of ANFIS to forecast global solar energy. [6][7][8] Zheng et al proposed a hybrid approach based on ANFIS for a day-ahead PV power estimation in microgrids. It has been concluded from this research that the proposed method outperforms the ANN model and persistence based forecasting methods with favorable accuracy and reliability. 9 Olatomiwa et al proposed ANFIS model for simulating solar radiation based on meteorological parameters, namely, sunshine hours and ambient temperature. It has been concluded from this research that the proposed ANFIS-based model provides an efficient method to estimate global solar energy. 10 Yadav et al proposed an ANFIS-based model to forecast short-term PV power and it has been concluded in this research that the ANFIS model provides more accuracy as compared with other models such as fuzzy logic model and regression model. [11][12][13] Many researches have been carried out that employs ANFIS-based model for wind power forecasting. [14][15][16][17] In one of the recent research, Diaz et al proposed an ANFIS-based model for obtaining the best electrical power estimation from the solar PV system. It has been concluded from this research that the ANFIS-based model overcomes both multiple linear regression and gradient descent optimization methods. 18 For real-time applications, a comprehensive survey has been carried out based on neuro-fuzzy rule generation algorithm for delivering maximum power to the load based on the maximum power point (MPP) as it gives a faster response with precision and accuracy. Many grid-connected solar PV plants have been based on PV technology, but variation in weather condition makes the system output nondeterministic and stochastic. [19][20][21] Therefore, accurately forecasting global solar energy under variation in weather conditions has been essential as the uncertainty in weather condition greatly affects the PV power output in smart grid systems.
In recent years, for modeling nonlinear complex processes, soft computing approaches have been used to define as support vector machines (SVMs) and multivariate adaptive regression splines (MARS) widely used in a variant branch of engineering. Vapnik proposed SVM model based on statistical learning theory and used for classification and regression analysis. 22,23 MARS has been modeled using a set of coefficients and functions based on the nonparametric regression approach. Its ability includes the estimation of the contribution of basis functions in a manner that the additive and interactive effects of predictors have been allowed to determine the response variable. 24,25 A lot of researches have been carried out based on a linear neural network (LNN) which can be trained to model static and dynamic linear systems, given a low learning rate to be stable and generalized regression neural network (GRNN) which has been designed and used for function approximation. Many kinds of research have been carried out using these soft computing approaches for estimating mean reference evapotranspiration. 26,27 Wen et al proposed SVM and ANN models for estimating evapotranspiration using meteorological parameters in China. It has been concluded that the SVM model gives better performance as compared with the ANN model. 28 Feng et al proposed different methods for estimating evapotranspiration using temperature parameter for six stations located in south-west China. It has been concluded in this research that the GRNN model has been observed to perform better than other methods available in the literature. 29 Detailed literature analysis reveals that the ANFIS-based model available in the literature has been based on using meteorological parameters such as ambient temperature, relative humidity, and others; however, very few literatures have focused on forecasting solar energy using dew point, the addition of which has significantly increased the model accuracy .  Furthermore, most of the models have been defined for the clear weather condition; however, very few literatures have  discussed varying weather condition such as clear/sunny sky, hazy sky, hazy and cloudy sky, and cloudy weather forecast  and for different climate zone. Therefore, the novelty of the work lies in establishing an ANFIS-based model to forecast global solar energy for different weather condition classified as clear sky, hazy sky, hazy and cloudy sky, and cloudy sky condition and for five different climate zones. Furthermore, the proposed model has been implemented in a smart grid system for estimation of short-term PV power and for the composite climate zone. A comparative analysis has been done in evaluating the performance of SVM, feedforward neural network (FFNN), MARS, GRNN, LNN, fuzzy logic-based model, and empirical models based on multiple regression analysis using statistical performance indicators for validation of the results.
The work has been arranged in the following fashion. The methods and methodology have been presented in Section 2. Section 3 presents ANFIS-based model to forecast global solar energy. Section 4 presents the implementation of an ANFIS-based model for smart grid application. Statistical performance indicators have been made in Section 5. Section 6 carries out the results and discussions. The comparison of ANFIS-based model with other models has been carried out in Section 7. The conclusion has been shown in Section 8 followed by references.

Data
In the present work, the recorded data on an hourly basis averaged of 15 years have been obtained from IMD, NISE, and NIWE. 30,31 The measured data have been considered for the duration of 24 hour at the meteorological stations for five distinct climate zones. Furthermore, the scaling/normalization has been done and defined in 0.1 to 0.9 range for avoiding any convergence issues and have been shown in Tables 1-5, respectively.

Climate zone
The climate of India possesses a wide range of weather conditions with varied topography ranging from glaciers in the north, arid desert in the west, tropical in the south, and the island territories. The factors affect the Indian climatic conditions include location and latitudinal extent, the northern mountain ranges, monsoon winds, upper air circulation, physiography, tropical cyclones, and the southern oscillation. One of the main criteria for assigning a site to climatic zone depends on weather condition which exists for 6 months or more. Bansal and Minke 32 have divided the entire country in a different climate zone after averaging the climate data of 233 meteorological stations/sites as shown in Figure 1.

Classification of weather condition
The variation in weather condition can be classified in the following fashion 33 :

Clear sky (blue sky)
If the sunshine hours are equal and more than 9 hour. In addition, the diffuse solar energy is lower or equal to 25% of global solar energy.

Hazy sky (fully)
If the sunshine hours lies in the range of 7 to 9 hour. In addition, diffuse solar energy is less than 50% or more than 25% of global solar energy.

Hazy and cloudy sky (partially)
If the sunshine hour lies between 5 and 7 hour. In addition, diffuse solar energy is less than 75% or more than 50% of global solar energy.

Cloudy sky (fully)
If diffuse solar energy is more than 75% of global solar energy and the sunshine hour is less than 5 hour.

ANFIS-BASED MODEL TO FORECAST GLOBAL SOLAR ENERGY
ANFIS is a hybrid-learning rule for system optimization, which involves Fuzzy-Sugeno system lying within the adaptive-network frameworks and is surrounded by neural learning capabilities. The main factor influencing this model is that the rate of convergence is faster as search space dimensions are reduced for the neural network method. The architecture is a multilayered feedforward network, which contains five layers wherein the first and the fourth layer comprises an adaptive node while others have a fixed node. The first layer consists of adaptive neurons wherein the fuzzification is performed and the second layer comprises fixed nodes the output of which signifies the incoming signal products. The third layer comprises fixed nodes where each node is fixed and labeled as "N," indicating firing strength normalization from the previous layer and simulates precondition fuzzy rules matching. The fourth layer comprises adaptive nodes, which result from the rule inference and the output layer is the fifth layer labeled as "Σ." It does the summation of signals coming from previous layers and converts fuzzy classification outcomes into crisp values. 34

IMPLEMENTATION OF AN ANFIS-BASED MODEL FOR SMART GRID APPLICATION
The power generation in a solar PV system is sensitive to fluctuation and varying weather condition; so, to forecast accurately the power output can enhance the system robustness, reliability, and lessen the impact of solar PV output uncertainty on the grid. In the present work, 250 W p multicrystalline solar PV modules are considered wherein the module efficiency obtained is 15.30% for the short-term PV forecast. The input parameters include solar irradiance and cell temperature while PV power is the output. The data have been collected on a daily basis, which depends on sunshine hours availability from sunrise to sunset. The implementation of an ANFIS-based model for smart grid application has been carried out to predict the behavior of a PV system under composite climatic conditions. The PV power generation can be given by Equation (1) as Reference 35: and where P PV is the PV system output at MPP, S T is solar irradiance in W/m 2 at STC, P PV, STC denotes rated PV system output at MPP, N PVS is the series-connected PV modules, is MPP temperature parameter, N PVP is the parallel-connected PV modules, T amb is ambient/air temperature in • C, T j is the junction temperature of the module in • C, and N OCT is a constant.

STATISTICAL PERFORMANCE INDICATORS
For model evaluation, statistical performance indicators have been used and defined as follows Reference 36:

Mean absolute percentage error
It reflects the amount of error present in comparing the measured and forecasted data. It is defined as the summation or addition of the absolute error which is divided by the measured data and then averaging the fixed percentages. The relationship is expressed by Equation (3) as follows: where E = (m i − f i ) is the absolute error, x represents the number of observations, f i and m i are the ith forecasted and measured value, respectively.

Normalized mean absolute error
The hourly measured power significantly changes during the entire day from sunrise to sunset, so normalized mean absolute error (NMAE) has been preferred for comparing the forecasted and measured data. The relationship is expressed by Equation (4) as follows: where E = (m i − f i ) is the absolute error, x represents the number of observations, f i and m i are the ith forecasted and measured value, respectively.

Normalized root mean square error
It measures the absolute hourly errors mean and is normalized over the maximum power output in the considered time range. The relationship is given by Equation (5) as follows: where E = (m i − f i ) is the absolute error, x represents the number of observations, f i and m i are the ith forecasted and measured value, respectively.

RESULTS AND DISCUSSION
The proposed model has been employed in forecasting global solar energy with the aid of meteorological parameters. For training and testing of the data, MATLAB software has been used with function "anfisedit" and evaluating the output using the function "evalfis (input, tra)" where "input" contains the input data and "tra" represents the training data. The recorded hourly data, night hours included, are used as the data for the comparison between forecasting methods. In the present research, the recorded hourly data has been employed for forecasting global solar energy. The required data were gathered from the National Institute of Solar Energy and the Indian Meteorological Department. The dataset covers the monthly mean meteorological parameters between the period 2002 and 2016. The mentioned data include input parameters such as ambient temperature, sunshine duration, relative humidity, wind speed, and dew point whereas clearness index is the output parameter. The data have been segregated in two parts: wherein the data for the year 2002 to 2011 have been used for training, whereas the data for the year 2012 to 2016 have been used for testing and are shown in Tables A1-A5 of Appendix A, respectively. In the proposed model, membership function has been assigned for every input, so that the rules were formed. After effective training of the proposed model based on ANFIS modeling, the model has been tested with data samples which were not present in the training datasets. For validation of the proposed model, statistical performance indicators have been used for comparing the measured and forecasted data values for varying weather condition such as sunny sky (blue sky), hazy sky (fully), hazy and cloudy sky (partially), and cloudy sky (fully), respectively, and applied for distinct climate zone and are shown in Table 6. Furthermore, the training details generated in MATLAB with input, hidden, and output parameters are shown in Figures 2 and 3 wherein the input layer has five inputs and the clearness index is the output parameter.
From Table 6, a significant difference has been noticed between the measured and forecasted data with respect to statistical performance indicators for distinct climate zone.

Clear sky (blue sky)
For clear/sunny sky, the computed error has been observed to be less for the Jodhpur station in comparison to other station with a mean absolute percentage error (MAPE) of 0.00010%. The reason behind is that Jodhpur enjoys hot and dry climatic conditions wherein prevails sunny weather all through the year.

Hazy sky (fully)
For hazy sky condition, the computed error has been observed to be less for the composite climate in comparison to other stations with a MAPE of 0.00005%. This is due to the presence of high value of relative humidity which varies about 60% to 90% in wet periods and 25% to 35% in dry periods that places Delhi under composite climatic conditions. For this sky condition, the computed error has been observed to be less for a warm and humid climate in comparison to other station with MAPE of 0.0075%. This is due to high diffuse solar radiation owing to the cloudy weather condition, which results in the marginal dissipation of heat during the night.

Cloudy sky (fully)
In this weather condition, the computed error has been observed to be less for a Shillong station in comparison to other station with MAPE of 0.00001%. The main contributing factor is that in winter the solar radiation intensity is comparatively low with a high percentage of diffuse solar radiation that makes winters very cold. Furthermore, the comparison of the measured and forecasted data obtained by employing ANFIS model for different weather condition has been shown in Figures 4-8 and further simulated for five meteorological stations across India.
From Figures 4-8, it has been observed that the forecasted data attained by employing ANFIS-based model for different weather condition closely follows the measured data. The model performance seems to be satisfied.
Attributing to meteorological factor, the power output of the solar PV system is fluctuating and difficult to control. The output fluctuates along with the solar insolation intensity, which shows random behavior due to various environmental factors such as cloud cover, solar irradiance, dust on PV panels, topographical location, and seasonal variations affecting the power output in a smart grid system. Such problems may be overcome by forecasting renewable energy sources with intelligent models.
In addition, the generation and load forecasting give an adequate solution to the problem, which depends on the power availability; the customers may decrease their demand. Keeping the above facts, ANFIS-based model has been employed to forecast solar energy for smart grid applications. In the present work, 250 W p multicrystalline solar PV modules are used  Table 7 for the composite climate zone. From Table 7, it has been revealed that the average value of MAPE in a solar PV system has been observed to be 0.0077% by employing ANFIS methodology, which is comparatively accurate and found within the permissible error limit.
Furthermore, it has been noted that for the winter season (January), the average MAPE is 0.0057%, for summer season (May), the average MAPE obtained is 0.0020%, and MAPE is comparatively large for the rainy season (July) of the value of 0.0220% due to uncertainty associated with the data. This method integrates the features of fuzzy logic and neural network resulting in increasing the system robustness and accuracy.
The daily power generation in a solar PV system based on the performance characterization has been shown in Figure 9 wherein the generation of power for 3 consecutive days, that is, ninth, 10th, and 11th June, have been shown and the days considered to represent sunny days, so that the solar radiation remains almost the same.
Thus, it has been observed that a high correlation prevails for generated power on a daily basis. The power output is available during the entire day and causes fluctuation to the grid when integrating unsteady PV power into the grid. As

F I G U R E 10
The ANFIS architecture generated in MATLAB with two inputs for forecasting power of solar PV system. ANFIS, adaptive neural-fuzzy inference system; PV, photovoltaic many factors are involved, which affects the solar PV system power output, but the main factor is the variation in weather condition which makes it difficult to examine the performance characteristics with a single model. In this work, the input parameters include solar irradiance, cell temperature, and based on weather condition the solar PV power output has been obtained and arranged within 10 minute interval for estimating short-term PV power for smart grid applications by employing ANFIS-based models. Simulation has been carried out with ANFIS training details generated in MATLAB with two input parameters, that is, cell temperature and solar irradiance and PV power as the output parameter as shown in Figure 10. Statistical indicators have been used for performance evaluation of the models and are shown in Table 8.
From Table 8, it is evident that for clear sky condition (blue sky), the MAPE has been observed to be 0.05% when simulated between the forecasted and measured data; and for the hazy and cloudy sky (partially) the MAPE has been observed to be 0.09%, respectively.
Similarly, for the hazy sky (fully) condition, the average MAPE has been observed to be 0.03% when simulated between the forecasted and measured data; and for the cloudy sky (fully) the MAPE has been observed to be 0.18% as shown in Table 9.
From Tables 8,9, it has been observed that the hazy sky model gives better performance to forecast short-term PV power in a smart grid system with MAPE of 0.03%, which is followed by clear sky, hazy and cloudy sky, and cloudy sky model with MAPE of 0.05%, 0.09%, and 0.18%, respectively. Furthermore, the comparative analysis of measured and forecasted power employing ANFIS-based model under four weather types is shown in Figure 11.
It can be seen from Figure 11 that the power generation in a solar PV system has varied significantly with the varying weather condition. Such forecasts would be helpful for managing supply and demand in a smart grid environment and would help the technocrats, utility and designer for a smart energy management system where solar power forecasting has been important in this new paradigm.

COMPARISON OF ANFIS-BASED MODEL WITH OTHER MODELS
The proposed model has been compared with other available models in the literature to forecast global solar energy.  from the statistical analysis that the MARS model performs better than the FFNN model. In addition, the model has been developed using fuzzy logic-based approach and empirical models based on multiple regression analysis and it has been observed that the fuzzy logic-based model performs better than empirical models. From Table 10, it has been clearly shown that on comparing different models, however, the ANFIS-based model provides more accuracy in results as compared with other models with MAPE of 2.1 × 10 −7 %.

CONCLUSION
In this research, ANFIS-based model has been established for forecasting global solar energy with the aid of meteorological parameters for different weather condition such as clear sky (blue sky), hazy sky (partially), hazy and cloudy sky (fully), and cloudy sky (fully) and successfully applied for different climate zones across the entire country. The proposed model has been trained for forecasting global solar energy. The validation of the model was performed with the unknown test data, which the model has not seen before. It has been concluded from the overall analysis that by employing ANFIS-based model, the error has been reduced significantly for each of the climate zones across the entire country. Furthermore, out of the four models investigated, it has been observed that the sunny/clear sky model gives better performance for Jodhpur station representing a hot and dry climate zone. Similarly, the hazy sky model provides favorable results for Delhi station representing composite climatic conditions, hazy and cloudy sky model is favorable for Chennai station representing warm and humid climatic conditions and lastly, cloudy sky model achieves favorable results for Shillong station representing cold and cloudy climatic conditions. The accuracy has been found within the acceptable range used by design engineers, to confirm the validity of the proposed model. The advantage of the ANFIS-based model is  that its convergence time has improved significantly, thus, ANFIS-based model provides more accuracy and have shown promising results in comparison to other models available in the literature. The number of sites used together with their geographical range allows us to conclude that the proposed model is generally valid for forecasting global solar energy in each climate zones across the entire country. Furthermore, the obtained results have been exploited to forecast short-term PV power in a smart grid system based on weather condition that employs 250 W p multicrystalline solar PV modules operated at MPP conditions for composite climate zone. It has been concluded that the hazy sky model performs well for the composite climate zone as compared with other models. The comparative results demonstrate the predicting capability of ANFIS-based model and its compatibility for any region with varying climatic conditions. Possible application of the proposed model can be found in meteorology, renewable energy, and solar energy conversion devices. The prediction of solar energy makes it suitable for installation of a monitoring station for a remote place and furthermore, can be extended for sizing of a standalone PV system as a part of the future work.