FCM Clustering-ANFIS-based PV and wind generation forecasting agent for energy management in a smart microgrid

: This paper proposes a PV and wind output power generation forecasting agent for a multi-agent-based energy management system (EMS) in a smart microgrid. The microgrid EMS requires both generation forecast and load forecast to provide effective dispatch strategies. The efficiency of the EMS significantly relies on its forecasting accuracy. Firstly, this paper develops an adaptive neuro-fuzzy inference system (ANFIS)-based forecasting model and then utilise it for the development of wind and PV generation forecasting agent for microgrid energy management. ANFIS adopt the self-learning capability from the neural network and linguistic expression function from fuzzy logic inference and stands at the top of both the technologies in performance. The proposed model has been tested using two data sets, i.e., PV historical data and historical wind data. The fuzzy c means clustering (FCM) with hybrid optimisation algorithm-based ANFIS model shows better forecasting accuracy with both PV and wind forecast, therefore, implemented as PV and wind forecasting agent for microgrid EMS.


Introduction
The dynamics of the system significantly varies with the increasing penetration of the RES due to its unpredictability and intermittency. Thus, to tackle these situations, an intelligent EMS with optimal control strategies is required. The decentralised EMS have better controllability, fault tolerance and adaptability as compared to centralised EMS, and decentralised EMS are more robust and less complex [1,2]. Nowadays, the power system researchers are motivated towards multi-agent system (MAS)based distributed control for EMS in microgrid [3,4]. Fig. 1 demonstrates the proposed MAS-based EMS with different forecasting agents interacting each other in a microgrid. In the proposed design, the MAS-based EMS control centre collects the information from various agents. The control centre collected load forecasting information from load forecasting agent and forecasted output power production of photovoltaic, wind from respective PV and wind forecasting agent. The current state of charge (SOC) of the battery is crucial for planning and unit commitment which is handled by the SOC agent. After receiving real-time information from various agents, MAS-based EMS control centre execute unit commitment and sends control signals to real-time controllers and switches in such a way to maintain power quality, stability and security of the microgrid. The accuracy of agents is the determining factor of the efficiency of EMS. This paper concentrates on developing the PV and wind generation forecasting agent for the proposed system.
The short-term power prediction methods of PV and wind are broadly categorised into physical and statistical methods. The physical methods involve the forecasting established by physical equations by PV and wind generation process along with the weather data [5]. The statistical methods utilise the historical power data to forecast the upcoming PV and wind generations [6]. Traditionally, linear and nonlinear autoregression approaches have been employed for forecasting. The increase in nonlinearities in the data made the researchers to doubt the accuracy of such models and think about alternative models. Nowadays, the researchers in the field of PV and wind prediction are concentrated towards the artificial intelligence techniques due to its inherent capability to track the complex nonlinearities in the system. The artificial intelligence model includes fuzzy logic methods [7], artificial neural network (ANN) [8] and support vector machine (SVM) [9], etc. The authors in [10] proposed a hybrid forecasting model by using fuzzy information granulation and SVM, In which the authors have used fuzzy information granulation for refining the data, and after that, SVM uses that for forecasting. A hybrid forecasting model developed by combining three algorithms, i.e., wavelet transform (WT), genetic algorithm (GA) and SVM can be found in [11]. The self-adaptive data-driven neural network can approximate any arbitrary continuous function to any particular accuracy without needing large knowledge on the structural relationship [12]. The fuzzy logic can also be used for the same with the greatest accuracy [13]. The performance of the neural network and fuzzy logic models are good enough as compared to autoregression approaches and has been implemented in various engineering problems [14,15]. An expert system with rule-based forecasting approach by incorporating weight extrapolation methods and utilizing the features of time series can be found in [16].The forecast by weather information is difficult because the accurate measurement and availability of weather data are expensive. Moreover, the measurement errors induce information to the forecasting model and may lead to inaccurate forecast [17]. As a dynamic system, the wind has an interrelationship with its former values at any time [18]. So, an accurate and simple forecasting model by using historical data is required.
The accuracy of ANN models is proven to be higher as compared to other short-term prediction models for PV and wind prediction [19]. Even though the ANN models have the capabilities of nonlinear modelling, it possesses some disadvantages that it is considered as a black box and rules are not easily explicable [20]. These rules can be recognised by the implementation of fuzzy logic, but the number of variables associated with it is large and make it complex in dealing [21]. This paper utilises an ANFISbased forecasting model for the wind and PV generation forecasting. ANFIS model utilises the principles of both neural network and fuzzy logic. Neural networks involved in the class of supervised learning algorithms which uses historical data to predict the upcoming values. Whereas in fuzzy logic the control signal is produced from firing the rule base. The rule base is random in nature and extracted from historical data. This leads to makes the controller output is random. The advantage of using ANFIS prediction model is that it makes the rule base more realistic and adaptable to the situation by the use of the neural network. The capability of fuzzy logic to approximate a nonlinear function by its intelligence in developing if-then rules makes this hybrid technique to be a universal estimator [22]. The first step in the process of developing the ANFIS model is to create an initial fuzzy Inference system (FIS). After that, fine-tune the initial FIS model to achieve the final ANFIS model using either backpropagation algorithm or hybrid algorithm presented in [23]. This paper considers six model by the combinations of different initial FIS generation methods and optimisation algorithms used as represented in Table 1. The accuracy obtained from each model has been compared, and the model which provides the best performance is utilised to develop agents for proposed microgrid EMS.
Following of the paper is organised as follows: Section 2 describes the detailed modelling of the proposed PV and wind output power forecasting model. Section 3 brief the data selection. Section 4 analyses the performance of the developed model with PV and wind historical data. This section also provides the modelling of PV and wind generation forecasting agent using proposed model for microgrid EMS. Section 5 concludes that FCM -Hybrid optimisation-based model gives better results compared to different developed models and hence can be employed as an agent for microgrid EMS. However, load forecasting agents and SOC agents are not covered in this article.

Model description
ANFIS is a technique that is developed by the hybridisation of the fuzzy Inference system and neural networks by effectively utilizing the advantages of two cutting-edge technologies. The fuzzy logic inherently incorporates the uncertainty and fuzziness of the system that is being modelled. On the other hand, the neural network introduces the intelligence of adaptability in the model.

Basic structure of ANFIS
The FIS that considered to model maps (1) Input to input membership function (MF) (2) Input MF to associated rules (3) Rules to output features (4) Output features to output MF (5) Output MF to final output or associated decision. For the better understanding of the structure of the ANFIS consider a fuzzy Inference system with one output and two inputs. The fuzzy if-then rules in the rule base of Takagi and Sugeno's types as in [24] are. If x is P and y is Q, then z is f(x,y), where, P and Q -fuzzy sets in the antecedents and z = f(x,y)-crisp function in the consequent.
Generally, the f(x,y) is considered to be a polynomial function for a given input variables x and y. However, it is not necessary to consider it as a polynomial function always, can be any function that can represent the output of the system inside the fuzzy region provided by the antecedent. A zero-order Sugeno Fuzzy Model (SFM) is achieved when treating the f (x,y) as a constant and can be considered to be a distinct case of Mamdani FIS [25] that considers every rule consequent is described by a fuzzy singleton. When considering f(x,y) is to be a first-order polynomial a first-order SFM is achieved. The rules of a first-order two rule Sugeno FIS can be expressed as follows.
(1) IF x is P 1 and y is Q 1 THEN f 1 = k 1 x + l 1 y + m 1 (2) IF x is P 2 and y is Q 2 THEN f 2 = k 2 x + l 2 y + m 2 Here, the output of each rule is a linear combination of input variable along with the addition of a constant in the inference system. The final output is obtained by calculating the weighted average of every single rule's output. Fig. 2 shows the equivalent ANFIS structure.
The each layer in the structure is briefly explained as follows (1) Each node i in the layer is adaptive with a node function where, µP i -Membership function of P i , x -input to the i th node and P i -linguistic variable related to node function. Generally, µP i (x) is considered to be or where, a i , b i , c i -set of premise parameters.
(2) This layer calculates the firing strength w i of the particular node and produces an output corresponding to the product of incoming signals to that node represented as in (4) The each node in this layer is an adaptive node with a node function expressed as.
where, k i , l i , m i -set of consequent parameters and w i − Output from the layer 3.
(5) This layer provides the final output being the summation of all the incoming signals in that node.

Learning algorithm
The overall output can be represented as a linear combination of consequent parameters with the given values of premise parameters in the ANFIS structure. i.e.
f = (w 1 x)k 1 + (w 1 y)l 1 + (w 1 )m 1 + w 2 x)k 2 + (w 2 y)l 2 + (w 2 )m 2 (11) where, flinear in the consequent parameters (k 1 , l 1 , m 1 , k 2 , l 2 , m 2 ). These parameters will change through the learning process. A gradient vector facilitates the adjustment or computation of these parameters. Also, it represents the degree of measure to which the FIS is modelling the input-output data for a dispensed set of parameters. Further, any of the optimisation techniques can be used to adjust the associated parameter by reducing the difference in sum of squares of actual and desired outputs. This paper used the backpropagation algorithm and a hybrid (hybridisation of backpropagation and least squares estimation) algorithm.

Development of initial fuzzy model
Different methods can be used to develop the initial fuzzy model. In this article the initial fuzzy model has been modelled using grid portioning [26,27], subtractive clustering [28] and fuzzy c means clustering [29].

Grid partitioning technique:
This partition strategy required only a less number of MFs for each input [26,27].
However, it exhibits some issues as the number of inputs to the system increases. The number of fuzzy IF-THEN rule for 'n' input and membership functions can be represented as The membership functions can be any, but the degree of membership function information is used for the further processing can lead to the loss of the substantial amount of information through the process of fuzzification. Those mentioned above can be identified as a nonlinear transformation of the input. In case of the triangular or trapezoidal MF, the information may be the loss at the point where the slope is zero, where the function is not differentiable. Thus a fuzzy system with triangular or trapezoidal MF can face issues in learning from data. Therefore, the MFs like Gaussian or bell function can be used to avoid this issue due to the smoothness of the function. So, this paper considers 5 inputs and 2 Gaussian membership function and a total of 32 (2 5 ) rules are derived.

Subtractive clustering technique:
Subtractive clustering technique helps to locate the cluster centres of input-output data pairs, as each cluster centre is a sign of the existence of a rule. Which also supports in finding the rules which are distributed in the input-output space as well as in determining the values of the premise parameters. It also helps in finding the initial values that are closely related to input values facilitate the quick convergence of the model while training with the neural network. In subtractive clustering technique, the capability of each input-output data points is considered as a function of Euclidian distances from the remaining data points. The data point with a threshold more than a preset value is treated as cluster centres. The initial fuzzy model can be extracted after determining the cluster centre as in [30].

Fuzzy C means clustering:
The Fuzzy clustering associates each data point with each cluster using a membership function. The data point with similar properties are assigned with a higher degree of membership, and dissimilar properties are assigned with a lower degree of membership [31]. This clustering technique is based on the minimisation of the objective function represented in (13) .
where, degree of membership of X i in the cluster k th is represented by µ ij . Eqs. (14) and (15) presents the degree of membership µ ij and cluster centre V j respectively and m is a real number more than one. The algorithm for fuzzy C means is presented in algorithm 1 (see Fig. 3).

Fig. 3 Algorithm 1 Fuzzy C means clustering algorithm
In this algorithm, the relation between data points to each cluster is established using a membership function which characterises the fuzzy behaviour of the algorithm. The more details of the fuzzy c mean clustering can be found in [29].

Data selection
The performance of the proposed model is evaluated based on the average hourly PV and wind output power data collected from Tioman Island for the year 2011 [32]. The Tioman Island is the resort island in the South China Sea on the east coast of Peninsular Malaysia, located at 104°10 ' 24 '' E longitude and 2°47 ' 47 '' N latitude. The pre-processing of the data is important to achieve the higher forecasting accuracy. The preprocessing of the data has been performed using step 1 to 11 illustrated in algorithm 2 (see Fig. 4). Then the pre-processed data is given to the developed ANFIS as mentioned in the algorithm 2 (see Fig. 4) step 12 to 20. The algorithm 2 (see Fig. 4) represents the complete model implementation. The 15 days hourly PV and wind output power values have been used for the model implementation. For example to forecast the value for January 15th, the hourly values of January 1st to January 15th is used. In which the January 15th is used as a testing target, and the remaining values are used for model building and training. Respectively, all different days in 2011 can be predicted .

Result and discussion
The The solar irradiation follows a typical pattern having the maximum irradiation at the middle of the day, and wind speed follows the pattern having several ups and downs throughout the day. Figs. 5a and b show the forecasted and actual PV output power values of randomly selected January 15 for grid portioning, subtractive clustering and fuzzy c mean clustering-based backpropogation and hybrid optimisation algorithm-based model, respectively. Table 2 shows the numerical results obtained by grid portioning, subtractive clustering and fuzzy c mean clusteringbased backpropagation and hybrid optimisation algorithm-based model, respectively, for PV forecasting. From Table 2 it is clear that with backpropogation-based optimisation algorithm, initial FIS generation using fuzzy c mean clustering (FCM) provide better accuracy. Also in case of hybrid algorithm-based model, initial FIS generation using FCM shows better accuracy. Comparing the results of all the six model developed the FCM-based hybrid optimisation-based model gives better performance as shown in Table 2. Thus this model is used to develop PV forecasting agent as represented in Fig. 6a. Figs. 7a and b show the forecasted and actual wind output power values of randomly selected January 21 for grid portioning, subtractive clustering and fuzzy c mean clustering-based backpropagation optimisation algorithm-based model. Table 3 respectively show the numerical results obtained by grid portioning, subtractive clustering and fuzzy c mean clusteringbased backpropagation and hybrid optimisation algorithm-based model for wind forecast. From Table 3 it is has been found that with backpropogation-based optimisation algorithm, initial FIS generation using fuzzy c mean clustering (FCM) provide better accuracy. Also in case of hybrid algorithm-based model, initial FIS generation using FCM shows better accuracy. Comparing the results of all the six model developed the FCM-based hybrid optimisation-based model gives better performance as shown in Table 3. Thus this model is used to develop wind forecasting agent as represented in Figs. 6b. Fig. 6a shows the interaction of proposed PV output power forecasting agent with unit commitment (UC) agent and Fig. 6b shows the interaction of proposed wind output power forecasting agent with unit commitment (UC) agent developed in Stateflow. Figs. 8a and b represents the information/ message exchanged (i.e., the realtime forecasted values of PV and wind) by respective PV and wind agents to UC agent during 24hour simulation. Further, the UC agent receives the forecasted load demands from the load forecasting agent forecasting agent and the current state of charge of battery for SOC agent, and then UC agent takes UC decision accordingly. However, the UC agent decisionmaking process, load forecasting agent and SOC agent are not covered in this article as it is not within the scope of this article.

Conclusion
This paper developed a PV and wind output power generation forecasting agent for a multi-agent-based EMS in a smart microgrid. For providing the effective dispatch strategies the microgrid energy management system requires an efficient generation and load forecast. The efficiency of the EMS significantly relies on its forecasting accuracy. In this paper, six combinations of ANFIS-based forecasting models have been developed and analysed the performance with PV and wind historical data. The ANFIS model with fuzzy c means clustering   and hybrid optimisation algorithm provides better performance as compared to the other developed models. Thus, this paper utilised ANFIS model with fuzzy c means clustering and hybrid optimisation algorithm and developed agents (PV forecasting agent and wind forecasting agent) for the proposed MAS-based microgrid EMS. The PV forecasting agent and wind forecasting agent have been developed in Simulink State-flow. Also, this paper illustrates communication of developed PV and wind forecasting agents with the unit commitment agent. The decision-making process of unit commitment agent, load forecasting agent and soc estimation agents were not covered in this article.