Prediction of Hydropower Generation Using Grey Wolf Optimization Adaptive Neuro-Fuzzy Inference System

: Hydropower is among the cleanest sources of energy. However, the rate of hydropower generation is profoundly affected by the inflow to the dam reservoirs. In this study, the Grey wolf optimization (GWO) method coupled with an adaptive neuro-fuzzy inference system (ANFIS) to forecast the hydropower generation. For this purpose, the Dez basin average of rainfall was calculated using Thiessen polygons. Twenty input combinations, including the inflow to the dam, the rainfall and the hydropower in the previous months were used, while the output in all the scenarios was one month of hydropower generation. Then, the coupled model was used to forecast the hydropower generation. Results indicated that the method was promising. GWO-ANFIS was capable of predicting the hydropower generation satisfactorily, while the ANFIS failed in nine input-output combinations.


Introduction
Hydropower is a renewable source of energy that is derived from the fast reservoir water flows through a turbine. One of the main purposes of dam construction is to generate the hydropower via installation of a hydropower plant near the dam site. The rate of hydropower generation depends on the dam height and the inflow to the dam reservoir. Nonetheless, hydropower is one of the major sources of power supply in each country. In addition, the power consumption varies strongly during the year. Therefore, an insight on the value of hydropower energy to be produced in the coming months would be an important tool in managing the electricity distribution network and operation of the dam. Consequently, hydropower generation forecasting could be a key component in dam operation. Hamlet et al. [1] evaluated a long-lead forecasting model in the Colombia river and stated that long-lead forecasting model led to an increase in annual revenue of approximately $153 million per year in comparison with no forecasting model. Several researches carried out based on the inflow forecasting to the dam and executing an operating reservoir model to determine the hydropower generation [2][3][4][5][6][7][8]. While these researches are promising, some challenges arise during the implementation of these models. First, forecasting the precipitation is needed and in the next step the inflow to the river and then a reservoir model needs to be run. Each step, including the precipitation or inflow forecasting and reservoir modeling, is associated with uncertainty and the results are highly affected by the uncertainty in these models. Second, an optimization algorithm seems to be needed to optimize the parameters of predictive models.
During the past two decades, several artificial intelligent models were utilized for hydrologic model prediction [9] and hydropower stream flow forecasting [10]. Among them, the ensemble models [11][12][13] and hybrid models [14] have recently become very popular. Recently, to produce novel hybrid models, different optimization algorithms were coupled with these models to improve their performance [15][16][17][18][19][20]. Among the optimization algorithms, Grey wolf optimization (GWO) has shown promising results in a wide range of application when coupled with machine learning algorithms [21]. Consequently, in this study, to reduce the source of uncertainty, an artificial intelligent model was used for hydropower generation forecasting. For this purpose, the adaptive neuro-fuzzy inference system (ANFIS) was coupled with GWO to forecast the monthly hydropower generation directly based on the precipitation over the basin, the inflow to the dam and the hydropower generation in previous months. This method is capable to facilitate the hydropower generation forecasting. The rest of this chapter is organized as follows. In section 2, the coupled model of ANFIS and GWO and study area are presented. Section 3 involves the results of hydropower forecasting and its reliability. Finally, section 4 includes the conclusion of the study.

Study Area
The Dez dam is an arch dam constructed in 1963 on the Dez river southwestern of Iran ( Figure  1). The dam is 203 m high and has a reservoir capacity of 3340 Mm 3 . The upstream catchment of the dam with the mean elevation of 1915.3 m above sea level and average slope of 0.0084 has an area of 17843.3 Km 2 . The catchment length is about 400km and ends with the dam reservoir at the outlet. Flow to the reservoir was measured at the Tele-Zang hydrometric station ( Figure 1). The precipitation stations that were used in the present study include four precipitation stations in the catchment and 10 others around the catchment (Figure 1). The hydrometric data was taken from Iran's Water Resources Management Company (http://www.wrm.ir/index.php?l=EN) and the precipitation data is available from Iran Meteorological Organization (http://www.irimo.ir/eng/index.php). The monthly data used here covered the range of October 1963 to September 2017. The average Inflow to the reservoir and precipitation were calculated and shown in Figure 2. According to Figure 2, the most precipitation occurred from October to May. Precipitation in the winter accumulated as snowpack over the high mountainous area and in the spring the river flow increased as a result of snowmelt. Summer was dry with almost no considerable precipitation.     Figure 3 illustrates monthly hydroelectric generation in the Dez hydropower plant. Table 1 shows the statistical characteristics of the precipitation over the Dez basin, the inflow to the dam reservoir and the hydropower generation time series.  Ht: Hydroelectric Energy (MWH) at month t; Qt: River Inflow (m 3 /s) at month t; Pt: precipitation (mm) at month t; S.D.: Standard Deviation.

ANFIS: Adaptive Neuro-Fuzzy Inference System
Jang (1993) [22] developed ANFIS as a joint of artificial neural network and the fuzzy inference system [23]. The learning ability of artificial neural networks (ANN) and the fuzzy reasoning create a valuable capability to fit a relationship between input and output spaces [24]. On the other hand, the ANFIS uses the training capability of ANN to assign and adjust the membership functions. The back-propagation algorithm enables the model to adjust the parameters until an acceptable error is reached [25]. Suppose that the system of fuzzy inference include x & y as inputs and z as output. Two if-then rules could be utilized for Sugeno model as follows: Rule one: if x and y = 1 A and 1 B , respectively, then Rule two: if x and y = 2 A and 2 B , respectively, then are considered as the labels of linguistic. Furthermore, 1 r and 2 r are the output function parameters [26]. The architecture of ANFIS is presented in Figure 4. It includes five layers; all are fixed nodes, except the first and fourth nodes, which are adaptive nodes.
It should be noted that i is the number of inputs and are the output of each layer.
Several memberships could be used for this purpose; among all Gaussian functions presented in the Equation (1), the following was utilized in this study: where i c and i  are set parameters with maximum and minimum of one and zero, respectively [22].
Layer 2: this layer is a rule node with AND/OR operator to get an output which called firing Layer 3: presents an average node computing the normalized firing strength as follows: Layer 4: this layer contains the consequent nodes for which the p , q and r parameters were tuned during the learning process: Layer 5: this layer contains the output nodes which compute the total average of output through a sum of entire input signals [27]: While the ANFIS has high capability to map the input to the output as a black-box model, it suffers from a long training time to assign the proper values to the parameters of membership function. To overcome this problem we use the optimization algorithm of grey wolf.

Grey Wolf Optimization (GWO)
The optimization algorithm of Grey wolf known as GWO is known as an advanced metaheuristic nature-inspired for an efficient optimization [28]. This algorithm was developed through imitating the foraging behavior of grey wolfs performing in groups of five-12 individuals which are at the top of food chain [29]. Grey wolves follow a social hierarchy strictly.
The leaders include a couple of female and male, called alpha ( ), who are in charge of decision making while hunting, resting and so on. Beta (  ) is the next level helping alpha in making decisions, while they should obey the alpha. The beta wolves can be male and female and the role of them is disciplining the group. They are the best candidate for substituting the alpha when they become older or die. The next level is called delta (  ) and play the role of scouts, sentinels, hunters and so on. The last level is called omega (  ), which are the weakest level. They act as babysitters.
While this level is the weakest, without omega wolves, internal fights may be observed in the group. Hunting, along with the social hierarchy, is a major social behavior of grey wolves. Muro et al. [30] expressed the three steps in the grey wolves hunting: 1. Identifying, following and approaching the prey; 2. Encircling the prey; 3. Attacking the prey.
These two social behaviors are considered in the GWO algorithm [29]. In mathematical modeling of the algorithm,  is considered as the fittest solution, and in the next steps,  ,  and  . The mathematical formulation of encircling could be presented as follows [28]: where, where  a presents the set of vectors over the iteration that change in value from 2 to 0 linearly. The The  leads the hunting, while  and  contribute in this task occasionally. For mathematical representation of hunting, it was assumed that the alpha, bata and delta include better knowledge on the prey's locations. Thus, the optimal solutions for the three positions can be registered. Consequently, the rest of the wolves will follow and update their postions accordingly.
When the prey stops, the grey wolves start to attack. The vector A is a random value in the interval   2 , 2 a a  . The 1  A leads to grey wolves' attack while 1  A force them to move away to find a better solution. Figure 5 shows the framework of the GWO algorithm.

Performance Criteria.
The assessment of the proposed model's efficiencies, including accuracy and agreement, was evaluated using statistical criteria, such as the confidence index (CI), root mean square error (RMSE), Nash-Sutcliffe Efficiency (NSE), coefficient of determination (R 2 ), index of agreement (d), relative absolute error (RAE) and mean absolute error (MAE).
The evaluation criteria of RMSE and MAE are common mean error indicators that indicated how close data points are to a best fit line (Equations (18) & (19)) [31].
According to Nash and Sutcliffe [32], the NSE is defined as the sum of the absolute squared differences of the observed and estimated data normalized by the variance minus one. (Equation (21)). As determined by [33], the range of NSE is from one to −∞. When NSE is less than 0, the mean observed value have been a better predictor than the model. It describes the plot of observed data versus estimated data, and how well they fit the 1:1 line.
Furthermore, according to Bravais-Pearson, the R 2 presents the squared value of the correlation coefficient describing how much of the observed dispersion is delivered by the prediction. The value of R 2 may vary from 1 and 0. The 0, and 1 values would present no correlation between observed and predicted data, and dispersion of the estimation data is equal to that of the observation, respectively [33] (Equation (20)).
The index of agreement d [34] prevail over the insensitivity of NSE and R 2 to differences in the means and variances of the observed and estimated data [35]. The index of agreement demonstrates the ratio of the mean square error and the potential error [36] (Equation (22)). The range of d similar to R 2 changes from 0 for the no correlation to 1, which is a perfect fit.
The RAE is a non-negative index that indicates a ratio of the overall agreement level between observed and estimated datasets. The range of RAE may change from 0 for a perfect fit to ∞, which means no upper bound. The Confidence index (CI) is the product of NSE and d, which ranges between 1 (perfect fit) and −∞. Lower than zero values means that the mean observed values have been a better predictor than the model.
The evaluation criteria were calculated based on the following equations: In which the Oi is observation value, Pi is the predicted model output, Ō is the average of observations, P is the average of model outputs and N is number of data.

Results
In this study, the inflow of the Dez dam and the average precipitation over the whole basin were utilized to forecast the hydropower generation. For this purpose, the time series divided into two subsets as the train and test subsets. 70% of data was assigned as the train and the remaining 30% for test phase.
Different input combinations were evaluated and used in the modeling process. The final selection of input combinations was based on the correlation analysis of variables in Table 3, the physical nature of variables and applicability of models presented in Table 2. Based on the availability of different measured parameters in the dam, one can choose which model is applicable for prediction of hydropower, and these different combinations strengthen the applicability of model in different data availability of the study. Some models were only based on inflow to the dam and rainfall such as: M1, M2, M3, M13, M14, M15, M18, M19 and M20. These models did not require the hydropower generation of the dam in previous time steps and, based on inflow and precipitation, can predict the hydropower generation in the plan. Some models used lagged values of hydropower generation of the dam in previous time steps as input vectors and these models did not require further information of inflow or precipitation in prediction of hydropower generation. These models, such as M5, M7 M10, M11 and M12, are lagged based models. The other models are based on combination of lagged values of hydropower generation, inflow and precipitation, such as M4, M6, M8, M9, M16 and M17. According to Table 2, the discharge, precipitation, and the hydropower generation with different lags were used to forecast the hydropower generation for the next month. The correlation coefficients between the input variables were calculated and are presented in Table 3; they oscillate between 0.01 and 0.67. It should be noted that Q is the inflow of the dam, but not the inflow of the turbine. Therefore, as the Dam is multipurpose, and the water stored in the dam is also used for irrigation, it is possible to use Qt to predict the Ht. All 20 input combinations were used for modeling by ANFIS and GWO-ANFIS to evaluate the capability of GWO in optimizing the ANFIS parameters, which shows better performance. The results of ANFIS modeling are presented in Table 4. Among the different input combinations, the first three models were not capable to reproduce satisfying results. Negative values were assigned to the NSE and CI, which show the poor application of models. The same procedure is visible in M13, M14, M15, M18, M19 and M20. However, the M4 to M11, M16 and M17 performed well. Among these combinations, M4 is the best and M8, M10 and M9 are the next in row. It should be noted that although the M4 was the best based on the evaluation criteria, according to Table 2, M17 was selected as the best model. This was because all the inputs of M17, i.e., Qt-3, Ht-2 and Ht-1, have at least a one-month lag. In addition, the results of M4 and M17 were not considerably different. This pattern was repeated for the test phase. Consequently, it can be concluded that, ANFIS was capable to forecast the hydropower generation satisfactorily.
In the next step, the coupled model of GWO-ANFIS was utilized for hydropower generation forecasting. Results are presented in Table 5. According to Table 5, the model performed well in all input combinations. As the d, NSE and CI values were positive in all the models, the new modeling technique of GWO-ANFIS provided a superior capability in forecasting hydropower generation, while the ANFIS results failed in nine models. In addition, based on the evaluation criteria, the accuracy of forecasting was higher for GWO-ANFIS.
The time series of observed and forecasted hydropower in train and test phases for M4, M8, M10 and M117 are presented in Figures 6 and 7. Both ANFIS and GWO-ANFIS performed well, while the GWO-ANFIS was superior due to less error. In addition, it can be observed that the M4 and M10 presented better input combinations, while for dam operation and reservoir management, M17 was more practical.
Although Figures 6 and 7 and Tables 4 and 5 show the observed and forecasted values and evaluation criteria for all models, the error distribution among models could not be discussed via these figures and tables. Therefore, the box plot of error during the train and test phases was plotted in Figure 8. In Figure 8, it can be observed that the GWO-ANFIS was superior to the ANFIS considerably in almost all input combinations. Nevertheless, the error of ANFIS in nine models was considerably higher than the GWO-ANFIS.     The meta-heuristic optimization algorithm of GWO-ANFIS showed an acceptable efficiency in the optimization of the unknown parameters in ANFIS. Although the number of optimization parameters in ANFIS and GWO-ANFIS was the same, the main complexity quantifier was the number of unknown parameters to be tuned for model training. The present research sought to ensure that the numerical complexity of the two modeling approaches was similar. Furthermore, the ANFIS models required the derivative calculation for unknown parameters, which increased the computational time and space necessary for training. While the GWO-ANFIS models did not need the derivative calculation, this would lead to less computation and faster convergence.

Conclusions
In this study, a coupled of adaptive neuro-fuzzy inference system and grey wolf optimization was utilized for one month ahead hydropower generation. For this purpose, 53 years of monthly data of inflow to the dam reservoir and the hydropower generation were used. Twenty input-output combinations were considered to evaluate the model robustness and to find the best input-output combination. Based on the results, GWO was capable to improve the ANFIS performance considerably. GWO-ANFIS performed well in all 20 combinations based on the evaluation criteria while the ANFIS failed in nine out of 20 combinations. Additionally, the box plot of error in all combinations shows the superiority of GWO-ANFIS. Overall, it can be concluded that, GWO-ANFIS is capable to forecast the hydropower generation satisfactorily, which makes it a suitable tool for policymakers. Furthermore, for the future research direction, it is important to mention that, not all the rules in the model architecture are essential; thus, it is necessary to reduce trained models complexity through eliminating the noncontributing rules which leads to the reduction of network's computational cost. To improve the proposed method, utilizing the other optimization algorithms for creating novel hybrid prediction models, as well as applying ensemble models in this application is suggested for the future research. In fact, the potential of ensemble machine learning models have not yet been fully explored in the prediction of hydropower generation, which leaves great room for future investigations. In addition, a limitation of our proposed model was that while the effective factors for which the model was implemented were the most critical factors, there may be other relevant factors that should be used. For instance, climate change and drought variations need to be separated from the general trend of the data set. Therefore, the addition of these concepts is left for future work.