Forecasting and Modelling Electricity Demand Using Anfis Predictor

: Problem statement: Load forecasting plays an important task in power system planning, operation and control. It has received an increasing attention over the years by academic researchers and practitioners. Control, security assessment, optimum planning of power production required a precise short term load forecasting. Approach: This study tries to combine neural network and fuzzy logic for next week electric load forecasting. The suitability of the proposed approach is illustrated through an application to electric load consumption data in 2010 downloaded from the RTE France website. Results: The study presents the results and evaluates them. Corresponding code was developed and used to forecast the next week load in a practical power system and the final forecasting result is perfect and consistent. Conclusion: The ANFIS system provides a useful and suitable tool especially for the load forecasting. The forecasting accuracy is high.


INTRODUCTION
Forecasting electric load consumption is one of the most important areas in electrical engineering, due to its main role for the effectiveness and economical operation in power systems. It has become a major task for many researchers. The common approach is to analyze time series data of load consumption and temperature to modelling and to explain the series. Several load forecasting models have been used in electric power systems for achieving accuracy. Among the models are statistical, linear regressions, ARMA, Box-Jenkins, filter model of Kalman. In addition, artificial intelligence has been introduced based on neural network, fuzzy logic, neuro-fuzzy system and genetic algorithm. Forecasting short, medium and long term electric load consumption with artificial neural network has received more attention because of its easy implementation, accuracy and good performance (Abd, 2009;Harun et al., 2009;Senabre et al., 2010;Filik and Kurban, 2007;Liu and Li, 2006;Badran et al., 2008). (James et al., 2005) in their study compare the accuracy and performance of several methods for load forecasting for lead times up to a day-ahead. They describe six approaches: double seasonal ARMA modelling, exponential smoothing for double seasonality, artificial neural network, a regression method with Principal Component Analysis (PCA) and two simplistic benchmark methods using a time series of hourly demand for Rio de Janeiro and a series of half-hourly demand for England and Wales. They conclude that in addition to its forecasting performance smoothing method is simplest and quickest to implement. Espinoza et al. (2007), Suykens, Belmans and De Moor used a fixed-size least squares support vector machines for nonlinear estimation in NARX model for prediction the load at a given hour by the evolution of the load at previous hours. They conclude that the forecasting performance assessed for different load series is satisfactory with a mean square error less than 3% on the test data. Chen et al. (2004) and all in their study are also used support vector machine techniques for med-term load forecasting by constructing models on relative information such as climate and previous electric load data. They recommend the use of available complete information for medium-term load forecasting because taking climate factors into account may lead to imprecise prediction and that the use of time-series concept may improve the forecasting. Song et al. (2005) present a new fuzzy linear regression method for the short term 24 hourly electric loads forecasting of the holidays. Results shows relatively big load forecasting errors are significantly enhanced due to the dissimilar electric load pattern of the special days compared of regular weekdays.
The use of neural network for short term load forecasting provides errors in case of speedy fluctuations in load and temperature. To overcome this problem, (Jain et al., 2009) uses an adaptive neurofuzzy to adjust the load curves on selected similar days which takes into account the effect of humidity and temperature. Results obtained show a good prediction with a small mean absolute percentage error. Furthermore, Neuro-fuzzy approaches have been used in short, medium and long term load forecasting (Bodyanskiy et al., 2008;Mordjaoui et al., 2010).
The main purpose of this study is to develop and test a model for short term electric load forecasting in order to cross the bypass of existing model based on large scale of data and much time consuming and complexity.

MATERIALS AND METHODS
Electric load forecasting description: Electricity is a necessary product that cannot be stored. However, to ensure safety power system, the balance between supply and demand should be respected at all times. Electricity demand varies with exogenous factors. Domestic consumption should be known in order to provide the best means of production necessary to meet it. Consumption of each site must also be known so that each provider can inject into the network much electricity as close as possible the consumption of its customers. Generally, the daily consumption begins with low values early in the morning followed by morning peak consumption. The power demand decreases significantly towards the end of the day. It shows also that the power demand on weekend is different from workday's Fig. 1. For diverse seasons, from Fig. 1 and 2 of the data under study, we can observe that the maximum power consumption occurs in winter seasons but the patterns of weekly load consumption in spring, summer and autumn are similar along the week except the first two days of the week.
Among the techniques used by RTE for the resolution of the supply-demand equation is the establishment of a prediction model for next day of French consumption. The prediction of the load curve is complicated by exogenous factors which are: • Atmospheric conditions including temperature and cloudiness • Economic activity • Trade Offers for erasing electric power consumption • The legal working time • Unpredicted events and random disturbances Global energy demand increases with temperature and cloudiness due to the increased use of air conditioners, fans, chillers, water pumps and many other electrical equipments. For example and according to RTE, it is currently estimated that in winter an average change of one degree Celsius over the entire territory leads to a variation of about 1450 Mega Watts (MW) of the consumption. In summer, the variation is of the order of 500 MW per degree. Cloudiness is the indicator of the rate of cloud cover. His knowledge is necessary because it has an influence on the use of lighting and heating. An average change of one unit of cloudiness measurement results in considerable variation in power consumption (for 1 okta the consumption increase with 650 MW in France) (INC Hebdo, 2006).
There are many other factors influencing load patterns like geographical conditions (rural and urban area), type of consumer (residential, commercial and industrial) and many other conditions and events which can cause sudden load changes (shutdown of an industrial operation).

Fig. 3: Anfis architecture with two inputs and an output
Adaptive Neuro-Fuzzy inference system structure: An adaptive neuro-fuzzy inference system model was used to forecast the weekly load consumption. It's defined as a cross between an artificial neural network and a fuzzy inference system. An adaptive network is a multilayer feed-forward network in which each node (neuron) performs a particular function on incoming signals. However, the Anfis network is composed of five layers. Each layer contains some nodes described by the node function. A few layers have the same number of nodes and nodes in the same layer have similar functions.

Architecture of ANFIS:
The ANFIS is a fuzzy inference system based on the model of Takagi-Sugeno and uses five layers. To present the ANFIS architecture, we suppose that there are two inputs and one output as indicated in the Fig. 3, in which a circle indicates a fixed node whereas a square indicates an adaptive node. In the case of first order using two rules we have: Rule1: If (x is A 1 ) and (y is B 1 ) then (f 1 = p 1 x + q 1 y + r 1 ) Rule 2: If (x is A 2 ) and (y is B 2 ) then (f 2 = p 2 x + q 2 y + r 2 ) Each ANFIS layer has specific functions that are used in calculating input and output parameter sets. The function of each layer is described below (Jang, 1993).
Layer 1: In this layer, the entire node is an adaptive node with a node outputs given by Eq. 1 and 2: where, µ Ai (x), µ Bi-2 (y): Any appropriate parameterized membership function and 1 i O : the membership grade of fuzzy set. It specifies the degree to which the given input x(y) satisfies the quantifier A.
The use of bell shaped fuzzy sets is generally preferable and employed from computational point of view. It's given by Eq. 3: where, a i , b i and c i are the antecedent parameters of the FIS.
Layer 2: Each node in this layer is a fixed node labeled Π, it computes the firing strengths of the associated rules. The output is the product of all the incoming signals and can be represented by Eq. 4: Layer 3: All nodes in this layer are also fixed nodes labeled N. The ith node calculates the ratio of the ith rules firing strength to the sum of all rules firing strength. They play a normalization role to the firing strength from the previous layer. The outputs of this layer can be represented as Eq. 5: Layer 4: Every node i in this layer is an adaptive node with a node function Eq. 6: where, ϖ is the output of layer 3 and {P i , q i , r i }, are the consequent parameters of the FIS.

Layer 5:
The single node in this layer is a fixed node labeled with Σ, which computes the overall output as the summation of all incoming signals. Hence, the overall output of the model is given by Eq. 7: ANFIS learning algorithm: There are several learning algorithms for a Neuro-fuzzy model. The ANFIS system is generally trained by a hybrid learning algorithm proposed by Jang. This algorithm combining the least squares method and the gradient descent method. The role of training algorithm is tuning all the modifiable parameters to make the ANFIS output match the training data. In the forward pass the algorithm uses least-squares method to optimize the consequent parameters. Once the optimal consequent parameters are found, the backward pass start. However, in this stage the hybrid algorithm use a gradient descent method for updating and adjusting optimally the premise parameters corresponding to the fuzzy sets in the input. The system output is calculated by using the consequent parameters calculated in the forward pass. Table 1 summarizes the algorithm for adjusting the rules of the ANFIS system.

RESULTS
In this study, an ANFIS model based on both ANN and FL has been developed to predict electric load. The input variables consist of the times series half hour weekly load data rearranged in multi input single output. For the given weekly data points Neuro-Fuzzy predictor is supposed to work with twelve inputs and one output only. The inputs are directly extracted from the data sets. Here, the weekly load data is used. There are 336 data samples (y (t), u (t)), from t = 1 to t = 336 corresponding of half hourly load for a week. Figure 4 shows the corresponding structure of input vectors and output. With this idea, the sample ahead is forecasted by using past samples. Prior to the learning phase and prediction of weekly electric load, we used 12 input vectors candidate to ANFIS (y (t i ) for i = 1:5 and u (t j ) for j = 1: 7) converted from the original data containing 336 pairs.  Firstly, we suppose that there are two inputs of ANFIS and we have to create 35 ANFIS models with different input combinations and then select the one with minimum error in training phase. Results obtained after several attempts to choose the number and type of membership functions used. Results obtained after several attempts to choose the number and type of membership functions used with respect to training error for one epoch was the model [y (t) u (t-7)].
The first 50% of data pairs selected was used for training and the remaining data pairs for checking. The data concerns the active power consumption of France realized in 2010. The final and the initial membership's functions on x and are illustrated by Fig. 5.

DISCUSSION
The graphical representation of the comparison between the desired weekly load values and the ANFIS predicted values is presented in Fig. 6. Results clearly show the excellent training as well as prediction performance. The training error; checking error and the step-size progress are illustrated in Fig. 7 and 8.
The initial step size is defined to 0.01. The step size decrease rate is 1.5 and the step size increase rate is 2.5. The training error goal is set to 0. The model developed was tested several times using different number of rules and membership functions. Finally the best results are obtained by four bell shaped membership functions and sixteen rules. The performance of the forecast model was evaluated and the results are as shown in Fig. 9 and 10 for 1 day and 3 day respectively.  The parameters of the system for next half hour load forecasting are as mentioned in Table 2.
The structure of ANFIS used contains a total of 72 fitting parameters, of which 24 are nonlinear and 48 are linear and the Anfis surface is shown in Fig. 11, it is cut off at the maximum and the minimum of the desiredoutput.

CONCLUSION
This study presents an application of neurofuzzy model with a high forecasting accuracy that depends on previous weekly load data. The results obtained show that the ANFIS approach can accurately predict weekly load consumption and the performance of the proposed model is not affected by rapid fluctuations in power demand which is the main drawback of neural networks models.