Evaluating the Impact of Streamﬂow Rating Curve Precision on Firm Energy of Hydropower Plants

: In Brazil, the correct measurement of the individual ﬁrm energy of a plant is important, since it inﬂuences directly the determination of its assured energy which is used to establish contracts between power plants and distribution companies, free consumers, and traders. With increasing technological development and greater reliability in the use of automated techniques for monitoring, the use of the Acoustic Doppler Current Proﬁler (ADCP), has become a reality in Brazil. The ADCP has many advantages over the traditional techniques used for monitoring ﬂows in gage stations of the national hydrometeorological network. In this context, the purpose of this work is to evaluate the impact of the streamﬂow rating curve measurement on the evaluation of the ﬁrm energy of a hydropower plant. A linear optimization model based on dynamic programming was used to calculate the ﬁrm energy and it was considered possible measurement errors in the plant’s inﬂow values and in the parameters of its polynomials that deﬁnes the upward and downward elevation. The results pointed that the two considerations had an impact on the calculated ﬁrm energy: the inﬂow measurements and the streamﬂow rating curve. Therefore, it is shown the importance of an accurate measurement of inﬂows for the evaluation of the plant’s ﬁrm energy. The proposed model considered an Approximate Hydraulic Production Function (AHPF) to perform a linear approximation by of the The in to evaluate impacts in the calculus of a ﬁrm caused variations in parameters of plant’s the of the determination of plant’s ﬁrm in the and the new technologies for the measurement of The show that even small variations considered in the parameters of Itapebi’s ﬂow polynomial downstream level, and in Itapebi’s afﬂuent incremental ﬂow values, in variation in percentages in Itapebi’s ﬁrm energy value. These results conﬁrm the importance of an accurate precision of a streamﬂow rating curve. impact of rating curve ﬁrm


Introduction
The National Water Resources Policy, 9433 Law of 1997 [1], defines that the management of water resources must always provide the multiple uses of water. From this perspective, the management of the generation of energy by hydropower plants gains great importance in Brazil since it currently represents 64.9% of the Brazilian electric generation matrix [2].
To guide the conditions and procedures to be observed by concessionaires and authorized hydroelectric power generation in Brazil, a joint rule was published between the National Water Agency (ANA) and the National Electric Energy Agency (ANEEL) [3] which foresees the need for installation, operation, and maintenance of hydrometric stations aiming at the pluviometric, limnimetric, fluviometric, sedimentometric, and water quality monitoring associated with hydropower plants.
According to the ANA-ANEEL Joint Resolution March 2010 [3], ANA assumes that the function of guiding the agents of the electric sector on the procedures of collecting, treatment, and storing this hydrometric data, as well as sending this information in a compatible format with the National Water Resources Information System (SNIRH), aims to disseminate data from hydrological monitoring.
It is also important to highlight that government or environmental agencies' regulations defines the environmental flow methodology conditions to the energy production by hydropower plants. There is a large number of recorded methodologies for environmental flow implementation worldwide [4]. In Brazil the hydrologically based is adopted. In Brazil's Federal rivers, which exceed the limit of a State of the country, the environmental flow is defined by the National Water Agency, equal to 70% of the Q95 [5]. On the other hand, states rivers have the limit of environmental flows defined individually, in which the river belongs and it can be a percentage of a flow duration curve (Q90 or Q95) or 7-day low flow event (Q7, 10).
Some studies [6,7] demonstrate the strategic importance of regulating a sustainable hydropower operation in the energy production process aiming at maintaining the environmental flow variability, following the natural seasonality of the river flow on the riverine ecosystem. This seasonality in the environmental flow [8] is important to provide suitable habitat conditions for several river's species such as fishes or macroinvertebrates community and to mitigating the ecological impacts of hydropower plants. Recently [9] discussed how changing the natural flow regime due to hydropower operation may affect different aspects of the fluvial ecosystem at a global-scale perspective, based on the literature investigation.
Such rules are extremely important to define criteria and procedures for data collection and knowledge of the hydrological regimes of the basin where the enterprise is located and, thus, allow the definition of operating rules aiming the optimal use of the hydraulic potential of hydropower plants reservoirs.
In this context, the potential of energy of a hydropower plant is directly related to the streamflow of the watercourse. Thus, the technique chosen to conduct hydrometric monitoring became important to plan power generation in Brazil, where the accuracy of the results of field observations depends directly on the technique of measurement adopted.
The recent study developed by [10] analyzes the current scenario of hydrological monitoring in Brazil and comments on the economic aspects and time costs in campaigns for the acquisition of hydrological data in the field, depending on the type of measurement adopted.
Traditionally, in Brazil, the flows monitoring in gage stations of the national hydrometeorological network is performed by traditional techniques with the Current Meter [11], in which the cross section of the watercourse is subdivided into several subsections, where point velocities are measured using the Current Meter and the areas of the subsections are obtained by measuring the depth and width of each subsection ( Figure 1B). Integrating these measurements into the width of the watercourse, the streamflow is obtained. However, with increasing technological development and greater reliability in the use of automated techniques for monitoring, the use of ADCP (Acoustic Doppler Current Profiler) has become a reality in Brazil. This equipment uses the principle of the Doppler effect to measure the speed of the water. This technique is known as hydroacoustics ( Figure 1A).
As shown in Figure 1A, the ADCP has many advantages over the Current Meter Figure shown in Figure 1B, among which we can mention (a) reduction of the flow measurement time; (b) greater detail of the velocity variation in the cross-section of the watercourse, making a sweep of the velocity distribution, in comparison with the spot measurements of the Current Meter and consequently has a better precision in the flow calculation; (c) possibility of measuring the flow in flood conditions, avoiding putting the hydrometer's safety at risk [12].
Several studies were developed to evaluate the accuracy of the different flow measurement methods [13][14][15].
In addition to the precision of the measurement method used to calculate the flow in the field (ADCP or hydrometric vane), the rating curve also has a great influence on the value of the generation of the historical flow series of the fluviometric stations [16]. Therefore, it is worth noting that the accuracy of the rating curve depends, among other factors, on the accuracy of the flow measurement method adopted. In other words, the calibration of the curve depends on the flow values measured in the field.
Hamilton in [17] demonstrates that for certain ranges of flow values, the measurement method with ADCP shows better precision in the results.

The Study Aim: Firm Energy
In Brazil, the sale rules of electricity determine ascertains that each hydropower plant has a generation limit for the establishment of contracts. Due to the fact that hydroelectric generation is strongly influenced by hydrological factors, this limit cannot correspond to the installed capacity of the plant. For a better understanding, some definitions from Brazilian system are necessary, [18][19][20] • Firm Energy of the System: According to the National Power System Operator (ONS), the firm energy of the system can be defined as being the highest possible value of energy capable of being supplied continuously by the system. This supply must occur without any deficit and considering the system configuration and market characteristics constant. It should also be considered a repetition of the flow of the historical record; • Firm Energy of a hydropower Plant: Defined as the contribution of this plant to the system's firm energy that corresponds to its average production over the critical period; • Critical Period: Longer time interval in which the reservoirs of the system's set of plants are depleted to the maximum. Reservoirs must start full (storage greater than 98% of Maximum Storable Energy) and without intermediate total refills. In addition, the system must be submitted to its firm energy, considering the configuration of its generators, its interconnections and its set of storage reservoirs constant; • Maximum Storable Energy: Defined as the total storage capacity of all reservoirs that compose the system. It can be evaluated as being all the energy produced when the reservoirs of the system are completely depleted (from maximum to minimum storage); • Assured Energy: Defined as the maximum energy production that can be maintained almost continuously by hydropower plants over the years. Therefore, the occurrence of each one of the thousands of possibilities of flow sequences statistically created is simulated, and a certain risk of not meeting the load is admitted, i.e., in a certain percentage of the simulated years, rationing is allowed within a limit considered acceptable by the system. In the current regulation, this risk is 5%. The Assured Energy of a hydropower plant is the fraction allocated to it of the system's assured energy. • Energy Reallocation Mechanism (MRE): Financial mechanism that aims to share the hydrological risks that affect generators, in the quest to guarantee the optimization of the system's hydroelectric resources. The purpose is to ensure that all participating generators sell the assured energy that has been allocated to them. Regardless of their actual energy production, as long as the MRE plants, as a whole, have generated enough energy to do so.
The individualized firm energy of hydropower plants is used as a factor to apportion the overall assured energy of a system to the hydropower plants that comprise it. Therefore, we must measure the individual firm energy of a plant, since it directly influences the determination of its assured energy, which is used to establish contracts between distributors, free consumers and traders.

The Study Place: Itapebi Hydropower Plant
The Itapebi hydropower plant is located in the municipality of Itapebi-BA and belongs to the Jequitinhonha River basin, which has a drainage area of approximately 70,315 km 2

The Study Contributions
To validate the importance of an accurate measurement of inflow values, this work has two main objectives: • To evaluate the impact on the calculation of firm energy of a hydropower plant caused by a possible measurement error in the plant's affluent incremental flow; • To evaluate the impact in the calculation of firm energy of a hydropower plant caused by a possible change in parameters of the plant's downstream level flow polynomial.
As secondary contributions of this work, we can highlight: • Application of Dual Deterministic Dynamic Programming for the calculation of firm energy; • Application of the linear approach by parts of the hydroelectric generation in the calculation of firm energy; • Real case study in a large Brazilian hydropower plant.

Materials and Methods
The calculation of firm energy is a complex problem due to its size and the interconnection of cascading plants in the same hydrographic basin. This section presents the methodology used to model and solve this problem to calculate firm energy value from a plant in the Brazilian system.
As described in Section 1.1, the firm energy of a hydropower plant corresponds to the maximum demand that can be met continuously in the event of recorded historical flows. In this section, a linear optimization model based on dynamic programming is presented to calculate the firm energy of the system and individualized hydropower plants as in [21]. The mathematical formulation of the Linear Problem (LP) objective function and constraints of a given stage (t) is in Sections 2.2-2.7. Each stage (t) is related to a time t with a corresponding LP. The input parameters of this subproblem are the so-called state variables, which for calculation, the firm energy are stored in the reservoirs at the beginning of the scenario and the deficit is found in the previous stage.
Due to the Brazilian system size and the study in terms of the operation problem, the linear optimization model presented does not include all of the system's hydropower pants operational restrictions. Also, because of the elevated computational effort to solve this problem as a single linear problem, dynamic programming was chosen. Therefore, Dual Deterministic Dynamic Programming (DDDP) will be used to solve the problem. The description of DDDP is in Section 2.1.
All performed simulations considered a full configuration of hydropower plants in the Brazilian power system. All necessary data are available from Monthly Energy Operation Program (PMO) of January 2021 [20]. Monthly, the National System Operator (ONS)-the Brazilian Independent System Operator (ISO)-prepares and publishes the PMO with collaboration of all agents of the Brazilian power system. After that, the ONS provides all operation dispatch for the hydropower plants. To demonstrate hydropower's firm energy behaviour, we will discuss the impact on the hydropower plant, as shown in Section 1.2. It is essential to mention that all simulations time horizon started in January 1938 and ended in December 2018 with month periodicity. Moreover, the incremental flows were considered equal to the flows recorded in this period by the PMO [20]. All the results of these simulations are presented in Section 3.

Dual Deterministic Dynamic Programming
Dual Deterministic Dynamic Programming (DDDP) uses Benders Decomposition, which consists of dividing the problem into several stages. Each stage depends on the subsequent stage and, it is not necessary to discretize the entire state space of the problem. Thus, information obtained in the current period goes on to later periods allowing influences and interferences between them. For the problem solved in this article, each stage represents a period of time of the simulation period.
The objective is to obtain a possible solution to each stage's subproblem by iteration and to build a linear approximation corresponding to the future impact function linked to the state variables related to these solutions. As the iterative process evolves and several points are visited, the model of future impact functions is progressively constructed.
The solution through an iteration of DDDP is composed of two processes, forward and backward. The forward process starts at the first stage and ends at the last stage. In this process, there is a direct recursion which is solved through linear programming techniques without including information about the future impact.
In the backward process, the opposite path is followed. Starting at the last stage and ending at first. At each new stage, a constraint is generated for the future impact of the decision taken in the present concerning the previous stage, constructed through cuts from Benders (1). This restriction will bring important information about the future impact of the decision taken at the present stage and, consequently, optmize the problem. The Figure 3 shows the PDD flowchart.
is the future impact of the decision taken in the present concerning the previous stage, constructed through cuts from Benders λ * 2 is the Lagrange multiplier E t is the derivative of the problem constraint, which has the state variable, in the state variable w * t+1 is the value of the objective function found in stage t + 1 x u * t is the value found for the state variable in stage t for scenario u In Step 3, presented in Figure 3, the value of the lower limit (Zinf) and upper limit (Zsup) is calculated. The lower limit of the DDDP in an iteration k (Zin f k ) is given by the optimal value found in the solution of the first stage of this iteration, Equation (2). The Zsup of the forward solution T−1 in an iteration k ∈ Z is given by Equation (3).
Also, in Figure 3, in Step 4, it is verified if the absolute difference between the upper and lower limits is less than a predetermined tolerance, Equation (4). Therefore, this solution's set is optimal and achieves algorithm convergence. Otherwise, the backward process begins, which will create a Benders cut for each previous recursive stage.
Step 5 corresponds to the backward process, in which the restrictions for the following stages are formed based on the optimal solutions obtained by the forward process (Step 2).
where: ∈ R is the the tolerance limit adopted iter is the number of a given iteration Zsup iter is the upper limit of iteration k Zin f iter is the lower limit of iteration iter The next step is a new iteration, returning to the forward process in Step 2. However, now the Bender cuts created will be included. They will be restrictions on the problem. After this forward process has been finalized, a new optimal solution is found for the decision variables. Moreover, however, this iterative process continues.
As the iterative process evolves, the modelling of future impact functions is progressively improved by accumulating Bender cuts. Until the difference between the lower limit (Zinf) and the upper limit (Zsup) is equal to the tolerance adopted. This point corresponds to the convergence of the process. The next subsections present the modelling of each stage's linear problems to be solved by the DDDP.

Objective Function
The objective function of each Linear Problem (LP) comprises the monthly energy deficit, the hydropower plant's spillage, and an estimate of the future impact of the decision made. This estimate comes from the Benders cuts by solving the Dual Deterministic Dynamic Programming (DDDP) problem. Equation (5) shows the complete objective function.
Min(de f t + K slack where: NH is the number of hydropower plants in the system under study t is the period of time de f t is the energy deficit value in period t slack t is the value of the slack variable in period t K slack pen is the penalty constant for the slack variable K s pen is the constant penalty of spilled flow s j t is the spilled flow from plant j in time period t α t is the estimated future impact for time period t + 1 In addition to the point above, the variable slack t decision variable accompanied by its penalty K slack pen must be inside the objective function. This variable, together with de f t , allows the problem to be decoupled into several subproblems. They must respect the constraint presented by Equation (6).
de f t is the energy deficit value in period t de f t−1 is the energy deficit value in period t−1 slack t is the value of the slack variable in period t Since the variable slack t is highly penalized in the objective function, it is expected that its optimal value is equal to zero for all t. As a result, the deficit for all stages will be equal to the deficit that occurred in the first month. Which does not have the restriction of Equation (6). Since de f t is in the objective function, it will be minimized. In this way, the calculation of the firm energy of the system will be done as presented by Equation (7).
where: EFIRM is the firm energy of the system EFIRM MAX is the constant equal to the upper limit for firm energy. In this study, it was considered to be the sum of the installed powers of all hydropower plants in the system. de f t=1 is the energy deficit value in period t = 1 With the optimal solution of the system's firm energy defined, the values found for the system's stored volume can be used to find the critical period. As described in Section 1.1, it is the most prolonged time interval in which the reservoirs of the system's set of plants start full and end empty without refilling. After defining this critical period, the firm energy of a hydropower plant can be calculated. It will be the average between the power generations of this plant during this period, as shown in Equation (8).
where: EFIRM i is the firm energy of hydropower plant j GH j cp is the hydroelectric generation of plant j during the critical period NEPC is the number of stages of the critical period

Future Impact
The linear approximation by parts of the future impact estimate of the decision taken (Benders cut) of stage t is presented in Equation (9). The Benders cut is formed by the set of (hyper) linear planes that provide a convex region of solution.
where: NH is the number of hydropower plants in the system under study t is the period of time K is the set with all cuts α t is the estimated future impact for time period t λ WB j,k,t+1 is the coefficient of cut k that multiplies the stored volume of hydropower plant j, given by the Lagrange multiplier of the water balance equation of plant i in time period t + 1 λ EB j,k,t+1 is the coefficient of cut k that multiplies the energy deficit of period t + 1, given by the Lagrange multiplier of the equation to meet demand in time period t + 1 v j t+1 is the stored volume of plant j at the end of time period t de f t+1 is the energy deficit value in the period at the end of the time period t + 1 t+1 k is the independent coefficient of cut k at stage t + 1

Energy Balance
Equation (10) presents the restriction of meeting the system's demand or energy balance. The sum between the hydroelectric energy generated and a possible energy deficit must be equal to the upper limit of the system's firm energy, which will be considered to be the sum of the installed powers of all hydropower plants in the system. NH ∑ j=1 gh j t + de f t = EFIRM MAX (10) where: NH is the number of hydropower plants in the system under study t is the period of time gh j t is the hydroelectric generation of plant j in time period t de f t is the energy deficit value in period t EFIRM MAX is the constant equal to the upper limit for firm energy. In this study, it was considered to be the sum of the installed powers of all hydropower plants in the system.

Water Balance
For each plant in the system, the plant volume stored at the end of stage t must be equal to the sum of its initial volume with the affluent incremental volume and the outflow volume of the upstream plants minus the outflow volume of the plant in question. The affluent incremental volume comes from the lateral volume between the plant and its upstream plants. In addition, the outflow volume is given by the sum between the turbined and spillage volumes. For the first stage, t = 1, all stored volumes are considered equal to the plants' maximum storage volume. In addition, the affluent incremental volume will be equal to the historical flows of the plant. The formulation of this water balance is presented in Equation (11).
where: J is the set of all hydropower plants in the system C is the unit conversion constant, from m 3 /s to hm 3

Hydraulic Production Function
The generation of a hydropower plant is proportional to the difference between the upstream and downstream quotas. The upstream quota is given by a fourth-degree polynomial depending on the volume stored in the reservoir. The downstream quota is also given by a polynomial of the fourth degree, however, depending on the outflow of the plant (turbined flow plus spilled flow). In this context, study [22] evaluates techniques of fitting a hydraulic turbine efficiency curve. In addition, studies in [23,24] evaluate techniques for predicting and prevent undesired spillage.
In the Brazilian system, the polynomials that define the upward and downward elevation were obtained in the past by adjusting a fourth-degree polynomial from values measured at each plant. For non-existing plants, these polynomials are estimated. Therefore, the hydroelectric generation of the plant can be calculated by a function that can be modelled by fourth-degree polynomials depending on the plant's storage, turbination, and spilling.
However, with this representation, the optimization problem would become nonlinear due to the introduction of the higher degree polynomial in the problem. As non-linear problems are more complex to be solved, Diniz and Maceira [25] proposed an approximation of hydroelectric generation called the Approximate Hydraulic Production Function (AHPF). The objective is to perform a linear approximation by parts of the nonlinear hydroelectric generation function, ensuring the convexity of the viable region defined by the function and maintaining the modeling of the problem as linear.
For the study, the linear approach by parts of the hydroelectric generation adopted was the strategy of discretizing the state space presented in [26]. The discrete values of the volume stored in the reservoir, the turbine flow and the spilled flow are determined. In addition, the storage volume is discretized in N v values between the maximum and minimum stored volume, the turbine flow in N q values between the maximum and minimum turbine flow and the spilled flow in N s values between zero and the maximum spilled flow. You get N = N v N q N s discretized points and each n point (V x , Q y , S z ) determines a value hydroelectric generation (GH n ), given by Equation (12).
With this, N points (V x , Q y , S z , GH n ) are determined and from these points through a Convex Hull algorithm a convex surface bounded by the points is constructed. In the work [27], the Qhull library [28] that performs this procedure in an optimized way was used. Obtaining a set of P hyperplanes that represent the points discretized as a convex region. The Equation (13) presents the restriction of hydroelectric generation.
where: J is the set of all hydropower plants in the system Pj is the set of all hyperplanes obtained for plant j v j t+1 is the stored volume of plant i at the end of time period t q j t is the flow turbined by plant j in time period t s j t is the flow spilled from plant j in time period t γ p 0 j is the constant parameter of hyperplane p for plant j γ p v j is the hyperplane parameter p associated with the stored volume of plant j γ p q j is the hyperplane parameter p associated with the turbine flow of plant j γ p s j is the parameter of the hyperplane p associated with the spilled flow of the plant j Finally, a constant (K AHPF ) is calculated to multiply the coefficients found for the AHPF. This constant is determined by minimizing the sum of the mean square error, as presented in [25]. The objective is to reduce the error made by the convexification of the HPF. Thus, the final formulation used was that presented in Equation (14).

Operating Limits of Variables
Finally, Equations (15)- (20) show the operational limits of the problem variables.
where: V j min is the minimum storage volume of plant j V j max is the maximum storage volume of plant j Q j max is the maximum flow that can be turbined by plant j S j max is the maximum flow that can be spilled by plant j

Applied Dual Deterministic Dynamic Programming
As presented in the previous sections, the calculation of firm energy can be formulated as an optimization problem represented by Equations (5)  When the algorithm starts the parameter that represents the number of iterations (iter) is set equal to one. In the first stage (t = 1), all the stored volume of the hydropower plants (v j 1 ) is set equal to the maximum storage volume of the respective plant (V j max ). After solving the first stage of the problem, the value of the lower limit Z in f is calculated according to Equation (21). For each stage after the first, the initial volume of each reservoir is equal to the final volume calculated in the previous stage. At the end of each stage, the variable Z sup (upper limit) is increased by the value corresponding to the immediate cost, Equation (22). Moreover, at the end of the forward process Z sup will be equal to the sum of the immediate costs, Equation (23). where: Z iter in f is the lower limit of iteration iter IC iter t is the immediate cost in period t of iteration iter Z iter sup is the upper limit of iteration iter NT is the total number of stages in the problem NH is the number of hydropower plants in the system under study t is the period of time iter is the number of a given iteration de f t is the energy deficit value in period t slack t is the value of the slack variable in period t K slack pen is the penalty constant for the slack variable K s pen is the constant penalty of spilled flow s j t is the spilled flow from plant j in time period t α t is the estimated future impact for time period t + 1 After the last stage, if the absolute difference between Z in f and Z sup is less than a predetermined tolerance, Equation (4), the algorithm converges and the iteration process ends. Otherwise, the backward algorithm in Figure 5 is invoked. At the end of the backward process, the forward process will be invoked again, starting a new iteration.  Figure 5 details the backward process, which is responsible for adding the restrictions given by Equation (9) in the LP. It is noteworthy that at the beginning of the backward process the parameter that represents the time (t) is equal to the last stage (NT). Therefore, the coefficient λ WB j,k,t is given by the Lagrange multiplier of water balance equation of plant j (11), and the coefficient λ EB j,k,t is given by the Lagrange multiplier of energy balance (10). Finally, the independent coefficient t k is given by Equation (24). where: NH is the number of hydropower plants in the system under study t is the period of time λ WB j,k,t is the coefficient of cut k that multiplies the stored volume of hydropower plant j λ EB j,k,t is the coefficient of cut k that multiplies the energy deficit of period t v j t+1 is the stored volume of plant j at the end of time period t de f t+1 is the energy deficit value in the period at the end of the time period t + 1 t k is the independent coefficient of cut k at stage t

Results
To evaluate the impact on the calculation of firm energy of a hydropower plant caused by a possible streamflow rating curve measurement error, the problem presented in Section 2 is simulated five times. Table 1 summarize the considerations made in each one of these simulations. The first simulation considered the system parameters without any change. They were considered equal to the data read from the Monthly Energy Operation Program (PMO) of January 2020 [20]. The second and third simulations considered small variations in Itapebi's affluent incremental flow values. The values of these variations were chosen to evaluate whether minor errors in the measurement of this parameter would impact the firm energy of the plant. Finally, the fourth and fifth simulations considered small variations in the parameters of Itapebi's downstream level flow polynomial. These variations were performed before the calculus of the AHFP, presented in Section 2.6. Because of that, these variations impact the coefficients found for the AHFP of the plant. The objective is to evaluate if small errors in the measurement necessary for the definition of these parameters impact the firm energy of the plant.
For all the five simulations, the time horizon started in January 1938 and ended in December 2018 with month periodicity. The first result of these simulations is the determination of the critical period. All the simulations found the same critical period started in June 1949 and ended in March 1950, as shown in Figure 6. There was no other critical period found in the entire period, and the optimal solutions were all found after 53 iterations of the DDDP algorithm. Figure 6 also shows the evolution of the system's stored volumes to observe their behavior during the critical period, highlighted in red. To see the critical period in more detail, the time horizon presented in Figure 6 comprehend only 72 months instead of the 960 months of the time horizon. Figure 6 shows the emptying behavior of the reservoirs during the critical period.

Discussion
As presented in Section 1, in Brazil, a correct measurement of the individual firm energy of a plant is important. Since it directly influences the determination of its assured energy, it is used to establish contracts between distributors, free consumers, and traders. As also discussed in Section 1, the value of the flow measured in a watercourse is influenced by the adopted method. In this context, the objective of this work is evaluate the impact of possible errors in flow measurements in the calculation of the firm energy of a hydropower plant. For the study, we chose the Itapebi plant.
Two evaluations were carried out. First, the impact on the calculation of firm energy of a hydropower plant caused by a possible measurement error in the plant's affluent incremental flow values. Second, the impact in the calculation of firm energy of a hydropower plant caused by a possible measurement error in parameters of the plant's downstream level flow polynomial. The results for these two considerations are in Section 3.
Even small variations considered in the parameters of Itapebi's downstream level flow polynomial and in Itapebi's affluent incremental flow values resulted in a percentual variation of Itapebi's firm energy value. Itapebi's firm energy value had both positive and negative variations depending on the simulated scenario, which indicates that even positive or negative errors in measurement affect this value. The maximum positive variation found was 1.69% for the scenario considering a positive variation of 5% in Itapebi's downstream level flow polynomial. The negative variation of −0.29% was found when considering the Itapebi's affluent incremental flow values 0.2% lower.
Although the linear model presented does not englobe all the operational restrictions of the plants of the system, the proposed model was applied satisfactorily for the study carried out. With the results, we found the importance of an accurate measurement of flow for the hydropower plants in Brazil was confirmed, once small error impacts plant's firm energy. These results highlight the importance of the development of new technologies that can improve streamflow rating curve precision found in the literature, as presented in Section 1.

Conclusions
This article presented a linear optimization model to solve the problem of calculating the firm energy of hydropower plants. Also, due to the complexity of the problem, the article presents a Dual Deterministic Dynamic Programming to solve this linear optimization model. The proposed model considered an Approximate Hydraulic Production Function (AHPF) to perform a linear approximation by parts of the non-linear hydroelectric generation function. The AHPF is considered in the model to evaluate impacts in the calculus of a hydropower plant firm energy caused by variations in parameters of plant's downstream level flow polynomial.
The main motivation for the article is evidenced by the importance of the correct determination of plant's firm energy in the Brazilian system, and the new technologies available for the measurement of the streamflow rating curve. The results show that even small variations considered in the parameters of Itapebi's flow polynomial downstream level, and in Itapebi's affluent incremental flow values, resulted in variation in percentages in Itapebi's firm energy value. These results confirm the importance of an accurate precision of a streamflow rating curve.
Thus, it can be said that the proposed model was applied satisfactorily, being validated with a real case and meeting the objective. This work shows the impact of streamflow rating curve precision on the firm energy of hydropower plants. Therefore, future works should compare the impacts of different methods of measurements, such as the Acoustic Doppler Current Profiler (ACDP), on the firm energy of hydropower plants.  Data Availability Statement: Publicly available datasets were analyzed in this study. This data can be found here: ref. [20].