Applying an Exponentially Weighted Moving Average control chart using flow history and assured energy levels to small hydroelectric power plants

Small hydroelectric power plants make up 6 GW of installed capacity in Brazil. However, electricity generation at the plants has been below their expected Assured Energy Levels (AELs) recently. This paper analyzes the flow history of 24 plants using exponential moving average control charts in an attempt to verify whether climate change or land use and occupation could have changed the average annual flow available in the basin over time. The graphs showed neither a decreasing or increasing trend in average flows, but rather showed a recurring number of out-of-control points, which proves the sensitivity of assured energy to hydrological variations and the need to evaluate the use of daily average flow rates for calculating and analyzing the energy generated by small power plants.


INTRODUCTION
Brazil is a country in which 65% of the electricity matrix is composed of hydroelectric power plants (Agência Nacional de Energia Elétrica, 2018). About 6 GW come from the 1,120 Small Hydroelectric Plants (SHP) distributed throughout the national territory. The first power plants appeared at the beginning of the 20th century. These power plants depend on hydrological variations. Currently, it is estimated that 23% of the small power plants in operation in Brazil were built more than 30 years ago (Agência Nacional de Energia Elétrica, 2018).
According to Brazilian legislation, these plants must have a maximum of 30 MW of installed power to be considered small hydroelectric power plants and, as an incentive, receive some exemptions when commercializing, distributing and transmitting energy (Ferreira et al., 2016). In particular, hydroelectric power plants with installed power less than 5 MW are classified as micro and mini distributed generation. These types benefit from other types of incentives as discussed by Gucciardi Garcez (2017). In both cases, they can also actuate in the regulated energy market where prices and the amounts of energy traded are set or limited by the government. They also actuate in the free market where prices follow the principles of free competition.
The sale of generated energy is determined by Assured Energy Levels (AELs), fixed amounts of energy that the generator guarantees to produce, and so it can be negotiated in purchase and sales contracts. Assured energy is calculated by considering hydrological factors and water supply variations that are either expected or occasional. This characteristic may raise questions about its applicability, either from trying to establish a fixed amount of generation for an intermittent source, or given the changes that hydrologic cycles suffer. As an example, in 2011 about 45% of small power plants had their AELs reduced because they did not reach the energy goals (Brasil, 2016). This was further aggravated during a period of intense drought in Brazil, between 2012-2016, that affected even large power plants.
In Brazil, there is a hydrological risk sharing mechanism, known as the Energy Reallocation Mechanism (MRE), that encompasses all large hydroelectric power plants and, optionally, most small hydroelectric power plants. When all the hydroelectric plants participating in the energy reallocation mechanism taken together do not generate the AEL attributed for the Brazilian system, they are exposed to the short-term free contracting market. However, as there was a large discussion about the possibility of non-hydrological factors impacting hydroelectric plants considering that the losses would be enormous for the sector in 2015. The Brazilian government allowed the hydrological risk of hydroelectric plants to be renegotiated with consumers via Law 13.203/2015 andANEEL Normative Resolution No. 684/2015. This study seeks to determine if the current model for calculating AELs is defective or if the changes in the hydrological regime are already so intense as to compromise small hydroelectric generation.
Many studies correlate land use changes with changes in hydrological cycles. Vanzela et al. (2010), for example, state that land cover is a decisive element in surface runoff and sediment transport, and that land cover can indirectly influence the quality and availability of water from springs. Fritsch (2013) and Guimarães (2000) evaluated the effects of land use and occupation on maximum flow levels.
Climate change is another aspect that impacts the availability of water in a hydrographic basin and creates uncertainties in hydroelectric generation (Wang et al., 2014;Kling et al., 2015;Shen et al., 2018;Chilkoti et al., 2017). It may change the consistency of a time series so much that it is not possible to apply conventional prediction and survey models to AELs (Queiroz et al., 2016). Climate change impacts the energy market (Mideksa & Kallbekken, 2010) and reduces the volume of reservoirs by increasing temperatures, and consequently intensifying water evaporation (Mohor et al., 2015) or even interfering in how water is used (Ribeiro Junior et al., 2016). Both land use & occupation and climate change can influence hydrological cycles since urbanization can mitigate or aggravate the effects of climate change (Pumo et al., 2017). Run-of-the-river hydroelectric plants (RORs) are most susceptible to these effects (Queiroz et al., 2016) to such a degree that the hydroelectric generation sector is one of the major stakeholders in climate modeling, according to Amorim & Chaffe (2019).
The Exponentially Weighted Moving Average chart (EWMA) is used to easily and quickly detect even small changes in the mean of a series, and can also weigh the importance of current data and historical data in the analysis (Montgomery, 2004;Lucas & Saccucci, 1990). Its use has already been successfully verified in the operation and monitoring of sewage treatment plants (Orssatto et al., 2015) and in several studies focusing on water quality (Ribeiro et al., 2018;Henning et al., 2014;Cruz et al., 2014).
This study uses an EWMA to perform an analysis on the flow history of 24 small power plants that did not consistently generate electricity in accordance with their respective AELs, in order to identify if there were changes in the available flow, and to determine whether the current debate on the methodology for calculating AELs should be directed to the method itself or to the changes in the hydrological cycle.

Exponentially Weighted Moving Average Chart (EWMA)
The EWMA control chart was introduced by Roberts (1959) and seeks to incorporate past behavior into the present by assigning different weights to each previous observation of the same statistic, which in this study is the water flow, as shown in Equation 1 (Montgomery, 2004;Lucas & Saccucci, 1990).
or, in the same way, Vasconcellos et al.

3/9
If the whole expression is developed, By generalizing (4) we arrive at (5): where 0 Z is the the average process level, which in this study is given by the long-term water flow.
Thus, for EWMA charts, the higher the value of the smoothing constant, the lower the influence that the old data have on determining i Z . The EWMA control chart has a Central Line representing the mean, and two other lines delimiting the Upper Control Limit (LSC) and Lower Control Limit (LIC). The limits can be determined as shown below.
in Equations 6 and 7 approaches the unit, so that the following simplification is possible: where L is the control level, or the distance between the mean and the control limits measured in standard deviation units. In order to determine the damping constant and control level values, a desired value for the Average Run Length in the control (ARL 0 ) must first be set for the expected number of samples to be observed until the first false alarm occurs on the control charts. Knowing this value and the change in the mean to be detected, it is possible to resort to the study of Lucas & Saccucci (1990) to stipulate the optimal values for λ and L.
Each point calculated by Equation 5 represents the weighted exponential moving average of the flow in that moment i. Sample points between LSC and LIC are equivalent to not rejecting the hypothesis that the process is "under statistical control", otherwise, they are said to be "out of control". When a process is out of control it has a pattern of non-random variability that may have been originated by the occurrence of special causes, that are events that occur casually in irregular periods such as large droughts or extreme water flows. The decrease in the available water flow over time, on the other hand, can be visually verified in the trend of the points on the EWMA control chart.
These points are of special interest for reviewing AELs, since, according to Decree No. 2,655 / 1998, this review is carried out every five years, or in the event of material facts. The reduction limit is 5% for each review and 10% of the total amount of the original concession. This was done to try to provide the entrepreneur a certain level of predictability in relation to the risks of the business. However, concessionaires have to compensate for possible deviations above these limits.

Assured energy
Large hydroelectric power plants are dispatched centrally in Brazil via the National System Operator seeking to optimize generation. Small plants with an installed capacity less than 30 MW are not subject to the National System Operator, since they do not have large reservoirs and are essentially ROR plants. These hydroelectric plants are called non-centralized dispatched plants.
The calculation methodology for determing the AELs for plants of this type is defined by Equation 10 under Ordinance nº 463/2009 from the Ministry of Mines and Energy. It is based on the conventional equation for generated energy, where a history of average monthly flows with at least 30 years is accounted for in the sum. The great difference between the conventional equation for generated energy and the AEL equation is due to the limitation made in the periods of forced and programmed plant unavailability, internal consumption, and losses up to the connection point. Additionally, the monthly average flow is deducted from the flow for consumption uses and the remaining flow, a minimum water flow that must be maintained in the river to guarantee its functions during the drought period. The AEL is given as an average MW (MWa), that is the ratio between the total generation in MWh of the plant, and the time in hours of the analyzed period.

Sample definition and dataset acquisition
The criteria for selecting the small power plants studied in this paper are as follows: • Power plants participating in the MRE; • Power plants with more than 36 months of commercial operation in May 2014. Power plants with less than 36 months of operation were excluded, since during this initial period the plant is in a phase of adaptation and adjustment; RBRH, Porto Alegre, v. 25, e36, 2020 4/9 Applying an Exponentially Weighted Moving Average control chart using flow history and assured energy levels to small hydroelectric power plants These data were associated with the location of each small hydroelectric power plant in order to identify a sample that is not generating what is consistent with its AEL, whether greater or lesser.
In order to determine the location of the hydroelectric power plants in the sample, data obtained through the geographic location platform of the Brazilian Environment Ministry (I3Geo) were used. Some data complementation was necessary with the locations of the plants' own stations in the data platform on hydrometric stations of the National Water Agency (ANA), Hidroweb, and information from processes of the plants' own basic projects, filed with the Brazilian Electricity Regulatory Agency (ANEEL).
The EG/GF index was used to represent generation, calculated by the ratio between the generated electrical energy (EG) measured in the period, along with the AEL (GF). When the EG/GF ratio is lower than 1.0, generation is lower than that stipulated in the AEL, and when the ratio is higher than 1.0 generation is higher than that stipulated in the AEL. The EG/GF index is very similar to the Generation Scaling Factor (GSF), a parameter of the MRE that measures the ratio between the energy produced by the set of generators and the sum of the AELs on a monthly basis.
Through consultation of the hydroelectric power plants' basic projects, it was possible to identify the base stations used. From the selection of the fluviometric stations and the respective historical series of the region of interest, which are available in the databases of the National Water Agency (ANA), an analysis of the water flow data was performed.
It should be noted that there were periods with observational failures or without information due to problems with the recording devices and/or with the station operation. Thus, the water flow data collected were submitted to a data analysis before being used. For most hydrological problems, this analysis is statistical, which consists of identifying and correcting these errors, i.e., filling in the gaps according to the period in which they occur (Tucci, 2012).
The methodology used to fill gaps is a simplified version of the arithmetic mean method that was suggested by (Tucci, 2012), which is normally used to fill monthly or annual series for flows or precipitations. This method seeks to homogenize the information period and the statistical analysis of the data. This method was chosen due to its simplicity and statistical reliability. It should be noted that it is necessary to select neighboring stations that are preferably inserted in the same hydrographic sub-basin as the base station to apply this method.
After filling in the series, it is necessary to analyze the consistency of the series within a regional scale, i.e. to verify the degree of homogeneity of the available data for a given station in relation to the observations recorded at neighboring stations, which are located in a climatologically similar region. However, it was not necessary to conduct the correlation study between the stations in this study, since this information was already available in the respective basic projects (Tucci, 2012).
The transposition method used in this study is based on the specific flow that considers them equal in homogeneous basins, subject to the same fluviometric regime and with similar geological, land coverage and topographic characteristics. Thus, the series at the site of the hydroelectric power plant is obtained from the following equation (Tucci, 2012): At the end of the data collection the sample of 40 hydroelectric power plants was restricted to 30 due to the availability of information. When the data analysis and calculation of the water flow series was finalized, the results pointed out 24 plants that could be analyzed.
The SHPs, the SPI and the EG/GF index for these 24 plants are all shown in Table 1. The names of the plants were not revealed to preserve the privacy of the owners.
The historical series of each of the power plants have different extensions, although they all adhere to the minimum period of 30 years. Figure 1 shows the data interval for each of the 24 power plants in the sample. Power plant 1 is denoted by Q_US1, power plant 2 by Q_US2, and so on.

Preparation of EWMA control charts
The Minitab software program was used to prepare the EWMA control charts. It requires the following input data: the water flow history series; the size of the subgroup, which, in this case, corresponds to the 12 months of the year; the weight (λ) of the EWMA; and the parameter for the test (L). The subgroup considered was each year of the historical flow series. An ARL 0 = 1,000, λ = 0.246, and L = 3.2 were adopted, given the description in MME Ordinance No. 463 from 3 December 2009, that establishes a 5% maximum deficit risk for AELs, thus affecting these values, according to Lucas & Saccucci (1990).

RESULTS AND DISCUSSIONS
Apart from SHP 19, as shown in Figure 2, we were unable to identify a decreasing or increasing water flow trends at the plants. Thus, the premise that climate change or land use & occupation may be impacting energy generation in this group of plants is not justifiable, at least not on an annual scale, since the flow rate has not changed on average. This does not necessarily imply that climate change and land use do not interfere with the long-term flow of water from the hydroelectric plant, since the daily distribution of this flow may still have been altered, reaching, for example, spill peaks that cannot be used by the waterway reservoir, in turn interfering in its operation. This is something that an annual or even monthly scale would not be able to identify.
It is not possible to identify changes in the hydrologic regime when one moves the scale of calculation for AELs. This raises the question of whether it is better to calculate the AELs using a daily analysis scale and more interactive processes that would consider minimum flow rates, variation in performance, and load losses depending on the flow rate and fall height.
Doing so would result in accounting for influence variables, minimizing errors, and making it possible to better identify changes in the hydrologic regime.
One challenge is the low availability of hydrological data in Brazil, that often presents failures on the daily level, which the current methods lack tools to fill. To overcome this problem and improve the reliability of the results, several hydrological models, such as the MGB-IPH, have already begun to use remote sensing data and in situ data assimilation techniques (Paiva et al., 2013).
Another factor that deserves analysis is the variability of the flow, which, with the exception of SHP 5 ( Figure 3) and SHP 16 (Figure 4), resulted in out-of-control points represented by darker square points that exceeded the lower (LCL) or upper limits (UCL). SHP 13 had the most extreme results, as shown in Figure 5.
The other power plants did not show great differences between them, and were therefore omitted. However, the percentage of out-of-control points in the historical series for each plant is shown in Figure 6. Seven plants had less than 5% of points out-of-control, nine between 5% and 15%, and  RBRH, Porto Alegre, v. 25, e36, 2020 6/9 Applying an Exponentially Weighted Moving Average control chart using flow history and assured energy levels to small hydroelectric power plants   eight with more than 15%. The gray dashed line in the graph in Figure 6 shows the median value of the percentage of out-of-control points. This reaffirms the importance of the hydrologic risk in studying the characterization of an AEL calculation model. Currently, this calculation is based on an average water flow value for small power plants with non-centralized dispatches, and it is therefore natural to find values both above and below what is stipulated. A solution that can differentiate this oscillation from other aspects still needs to be analyzed to provide greater security for the system. As was previously mentioned, despite the out-of-control points presented, the AEL can be reduced by a maximum of 10%, a security measure given to the entrepreneur, and the potential risk assumed by the granting authority. Figure 7 shows the distribution of out-of-control points along the data intervals delimited by the arrows. We can see that there is no pattern allowing us to establish a common critical period for the power plants, although it is possible to distinguish