Integrated Software Development and Case Studies for Optimal Operation of Cascade Reservoir within the Environmental Flow Constraints

: Reservoir optimal operation considering aquatic ecological protection is a hot topic in current research. This paper proposes an improved minimum monthly average runo ﬀ method (IMMR) for calculating environmental ﬂow and an improved invasive weed optimization algorithm (IIWO) for optimizing complex problems. An integrated software consists of three modules, which is developed in this paper, i.e., IIWO convergence test module, environmental ﬂow calculation module, and cascade reservoir operation module. Three test functions are included in the IIWO convergence test module. The minimum monthly average runo ﬀ method (MMR), IMMR, Tennant Method, Q90, and Q95 are included in the environmental ﬂow calculation module. The IIWO and invasive weed optimization algorithm (IWO) are included in the cascade reservoir operation module. Wujiang River Basin in China is studied as a case in this paper. The results show that the environmental ﬂow of cascade reservoir calculated by IMMR is 1871 m 3 / s, the maximum and the minimum are calculated by T-O and T-M, respectively. The power generation of cascade reservoir calculated by IWO is less than IIWO. The conclusions that IIWO has better convergence than IWO in solving cascade reservoir model, and the water volume of environmental ﬂow has no obvious inﬂuence on cascade reservoir operation are drawn.


Introduction
The development and utilization of clean renewable energy is the basic requirement to reduce environmental problems and realize sustainable development [1]. Hydropower, as a renewable energy, has developed rapidly in China in recent decades [2]. However, due to the lack of management, the phenomenon of surplus water occurs frequently and the utilization rate of water is low. Moreover, due to the influence of reservoir construction, the connectivity between upstream and downstream of the river is reduced, and the water ecological protection problem is prominent [3]. Reservoir optimal operation considering ecological protection has become a hot topic in current research [4,5].
The problem of reservoir optimal operation has been studied for a long time by many researchers. In general, the research on reservoir optimal operation has gone through the process from single reservoir to multiple reservoirs [6,7]. According to the location of each reservoir, multi-reservoir is subdivided into cascade reservoir, parallel reservoir, and complex reservoir. Cascade reservoir is the most common type for a river basin. The optimization techniques for solving the problem of reservoir optimal

Cascade Reservoir Optimal Operation Model under the Constraint of Environmental Flow
Cascade reservoir refers to reservoir groups consisting of two or more reservoirs on a river. There are hydraulic connections between the cascade reservoir. The hydraulic connections can be defined by Equation (1).
where Q i in is the inflow of the i-th reservoir. Q i−1 r is the water release of the (i-1)-th reservoir. Q i∼i−1 itv is the interval inflow between the i-th reservoir and the (i-1)-th reservoir.
Hydrological methods (such as Tennant method) are the most widely used method to calculate environmental flow. Since flow data is the basic data when using hydrological methods, according to Equation (1), the environmental flow in the downstream of each cascade reservoir increases successively from upstream to downstream due to the existence of interval inflow.
Cascade reservoir can realize joint optimal operation through hydraulic connections. Taking the maximum power generation of cascade reservoir as an example, it can be expressed mathematically by Equation (2).
subject to Equation (1) and the following constraints Q min r,i,t ≤ Q i r,t ≤ Q max r,i,t , t = 1, 2, · · · , T Q min r,i,t = Q EF,i,t + Q min other , t = 1, 2, · · · , T Z min i,t ≤ Z i t ≤ Z max i,t , t = 1, 2, · · · , T N min i,t ≤ N i t ≤ N max i,t , t = 1, 2, · · · , T where E c is the power generated by the cascade reservoir hydroelectric plants; Num is the number of cascade reservoir in the system; T is the number of periods; k i is the efficiency coefficient of the i-th hydroelectric plant; Q e,i,t is the power generation flow of the i-th hydroelectric plant at period t; h i,t is the effective head of the i-th hydroelectric plant at period t; ∆t is the number of hours at period t; Q i in,t and Q i r,t are, respectively, the inflow and water release of the i-th reservoir at period t; V i t+1 and V i t are, respectively, the water storage of the i-th reservoir at period t+1 and period t; Q min r,i,t and Q max r,i,t are, respectively, the minimum and the maximum water release of the i-th reservoir at period t; Q EF,i,t is the environmental flow of the i-th reservoir at period t; Q min other is the minimum flow to meet the other water demand; Z min i,t and Z max i,t are, respectively, the minimum and the maximum water levels of the i-th reservoir at period t; and N min i,t and N max i,t are, respectively, the minimum power output and the installed capacity of the i-th hydroelectric plant at period t (MW).

Improved Minimum Monthly Average Runoff Method (IMMR)
It is necessary for the environmental flow to maintain a healthy ecosystem and sustain aquatic life. The environmental flow is different in different periods. The minimum monthly average runoff method (MMR) has been frequently used to analyze the environmental flow. It can be shown as Equation (8). where n is the number of years, and Q ij is the monthly average runoff in month j of the i-th year. As shown in Equation (8), the environmental flow calculated by MMR is a constant. This is not consistent with the characteristics of environmental flow. The IMMR is proposed to adapt to the periodicity of river, which consists of the following three steps.

Divide into Different Years
The years are divided into high flow years, normal flow years, and low flow years. These three types are usually divided by different guarantee rates. However, there is a certain subjectivity as to how much the guarantee rate meets the requirements of the division. Thus, a method called Percentage From Mean (PFM) is used to overcome the defect.
where µ is the percentage from mean; Q i is the average runoff in the i-th year; and Q a is the multi-year average runoff.

Division of Different Periods in One Year
Similar to the first step, the PFM is also used to divide the different periods in one year. The dividing equation is shown as Equation (10).
where µ j is the percentage from mean of month j, and Q j is the multi-year average runoff of month j. The division criteria for different years and different periods in one year are presented in Table 1.

IMMR for Environmental Flow
Similar to Equation (8), the equation of IMMR for environmental flow is presented as Equation (11).
where b = 1,2,3 represent high flow year, normal flow year, and low flow year, respectively. Q b (b = 1, 2, 3) represent flood season, flat period, and dry season, respectively. Min(Q ab ) is the minimum monthly average runoff in a-th year of b. n b is the number of years of b.

Invasive Weed Optimization Algorithm (IWO)
IWO is a numerical stochastic optimization algorithm, which is inspired from colonizing weeds. The IWO algorithm mainly includes four steps: initializing a population, reproduction (as shown in Equation (12)), spatial dispersal, and competitive exclusion (retain pre-determined maximum populations of weeds whose fitness value is better than others). In the third step, the seeds generated in the second step are randomly distributed in the space of feasible region as a normal distribution with mean equal to zero (as shown in Equation (13)). As well, the variance of the normal distribution is calculated by Equation (14).
where Seed(i) is the number of seeds reproduced by the i-th weed; int (X) is the integral function expressing the integer part of the real number X (i.e., the largest integer smaller than X); F(i) is the individual fitness value of the i-th weed; F max and F min are, respectively, the maximum and the minimum fitness values of the population; Seed max and Seed min are the maximum and minimum numbers of seeds that can be reproduced by weed, respectively; X i is the position of the i-th weed; X i,s is the position of the s-th seed reproduced by the i-th weed; N 0, σ 2 iter is a normal distribution with a zero mean and a standard deviation of σ iter , which is the standard deviation at the present time step; w is a nonlinear modulation index (w = 3); σ ini and σ fin are previously defined initial and final standard deviations (σ ini > σ fin ); and iter max is the maximum number of iterations.
IWO has a "global-local" optimization mechanism according to Equations (13) and (14), but it still has a defect in solving high-dimensional, nonlinear, and multi-constrained problems. The shortcoming of IWO is that it is easy to fall into local optimum. Therefore, it is necessary to improve IWO for solving large and complex problems more effectively.

Improvement of Spatial Dispersal Formula
Since trigonometric functions have periodic properties, Equation (14) is improved to Equation (15).
by comparing Equations (14) and (15), IIWO has the features of periodic optimization and has better performance, since it breaks through the constraint of local optimization, and achieves global optimization more easily. Figure 1 shows a pseudo simulation diagram of the optimization process of IWO and IIWO. Its purpose is to show the difference between IWO and IIWO more vividly.
Sustainability 2020, 12, x FOR PEER REVIEW 5 of 16 where Seed(i) is the number of seeds reproduced by the i-th weed; int (X) is the integral function expressing the integer part of the real number X (i.e., the largest integer smaller than X); F(i) is the individual fitness value of the i-th weed; Fmax and Fmin are, respectively, the maximum and the minimum fitness values of the population; Seedmax and Seedmin are the maximum and minimum numbers of seeds that can be reproduced by weed, respectively; Xi is the position of the i-th weed; Xi,s is the position of the s-th seed reproduced by the i-th weed; (0, s ) is a normal distribution with a zero mean and a standard deviation of σiter, which is the standard deviation at the present time step; w is a nonlinear modulation index (w = 3); σini and σfin are previously defined initial and final standard deviations (σini > σfin); and itermax is the maximum number of iterations. IWO has a "global-local" optimization mechanism according to Equations (13) and (14), but it still has a defect in solving high-dimensional, nonlinear, and multi-constrained problems. The shortcoming of IWO is that it is easy to fall into local optimum. Therefore, it is necessary to improve IWO for solving large and complex problems more effectively.

Improvement of Spatial Dispersal Formula
Since trigonometric functions have periodic properties, Equation (14) is improved to Equation (15).
by comparing Equations (14) and (15), IIWO has the features of periodic optimization and has better performance, since it breaks through the constraint of local optimization, and achieves global optimization more easily. Figure 1 shows a pseudo simulation diagram of the optimization process of IWO and IIWO. Its purpose is to show the difference between IWO and IIWO more vividly.

Selection of Spatial Dispersal Rules
According to the principle of IWO, four dispersal rules are theoretically included in the process of spatial dispersal, which are for iterations, weeds, seeds, and eigenvector, respectively. The four rules can be seen in Figure 2.

Selection of Spatial Dispersal Rules
According to the principle of IWO, four dispersal rules are theoretically included in the process of spatial dispersal, which are for iterations, weeds, seeds, and eigenvector, respectively. The four rules can be seen in Figure 2. The rules for iterations, weeds, and seeds are isotropic realizations of IWO. Under these three rules, the same normal random variable has been used for each dimension. Thus, it is bad for the diversity of the population, and it is difficult to find the global optimal solution. However, the rule for eigenvector is an anisotropic realization, because a new normal random variable is generated for each dimension. As well, in this way the diversity of the population can be increased. In theory, this rule can be used to find the global optimization more possibly.
The Schaffer function is used to compare these four rules in this paper. As well, the optimization results are shown in Figure 3.  Figure 3 shows that the dispersal rule for eigenvector is indeed better than the other three dispersal rules in finding the global optimization. Therefore, it is essential to take "eigenvector" as the dispersal rule in solving high-dimensional, nonlinear, and multi-constrained problems.

Development of Integrated Software
The software is developed based on Visual Basic 6.0. Its development environment is on an Intel(R) Xeon(R) machine with an E5620 CPU @2.40GHz, RAM of 4.00GB, and a 64-bit operating system. The operation results are output to EXCEL. The software supports the version of Microsoft Office from 07 to 16. The rules for iterations, weeds, and seeds are isotropic realizations of IWO. Under these three rules, the same normal random variable has been used for each dimension. Thus, it is bad for the diversity of the population, and it is difficult to find the global optimal solution. However, the rule for eigenvector is an anisotropic realization, because a new normal random variable is generated for each dimension. As well, in this way the diversity of the population can be increased. In theory, this rule can be used to find the global optimization more possibly.
The Schaffer function is used to compare these four rules in this paper. As well, the optimization results are shown in Figure 3. The rules for iterations, weeds, and seeds are isotropic realizations of IWO. Under these three rules, the same normal random variable has been used for each dimension. Thus, it is bad for the diversity of the population, and it is difficult to find the global optimal solution. However, the rule for eigenvector is an anisotropic realization, because a new normal random variable is generated for each dimension. As well, in this way the diversity of the population can be increased. In theory, this rule can be used to find the global optimization more possibly.
The Schaffer function is used to compare these four rules in this paper. As well, the optimization results are shown in Figure 3.  Figure 3 shows that the dispersal rule for eigenvector is indeed better than the other three dispersal rules in finding the global optimization. Therefore, it is essential to take "eigenvector" as the dispersal rule in solving high-dimensional, nonlinear, and multi-constrained problems.

Development of Integrated Software
The software is developed based on Visual Basic 6.0. Its development environment is on an Intel(R) Xeon(R) machine with an E5620 CPU @2.40GHz, RAM of 4.00GB, and a 64-bit operating system. The operation results are output to EXCEL. The software supports the version of Microsoft Office from 07 to 16.  Figure 3 shows that the dispersal rule for eigenvector is indeed better than the other three dispersal rules in finding the global optimization. Therefore, it is essential to take "eigenvector" as the dispersal rule in solving high-dimensional, nonlinear, and multi-constrained problems.

Development of Integrated Software
The software is developed based on Visual Basic 6.0. Its development environment is on an Intel(R) Xeon(R) machine with an E5620 CPU @2.40GHz, RAM of 4.00GB, and a 64-bit operating system. The operation results are output to EXCEL. The software supports the version of Microsoft Office from 07 to 16.
The integrated software consists of three modules, i.e., the IIWO convergence test module, the environmental flow calculation module, and the cascade reservoir operation module.

IIWO Convergence Test Module
In this module, three functions are used to test the convergence of IIWO: Schaffer, Shubert, and Rastrigrin (as shown in Table 2). Table 2. Optimization test functions.

Name
Formula Sketch Sustainability 2020, 12, x FOR PEER REVIEW 7 of 16

IIWO Convergence Test Module
In this module, three functions are used to test the convergence of IIWO: Schaffer, Shubert, and Rastrigrin (as shown in Table 2). Table 2. Optimization test functions.

Name
Formula Sketch Schaffer function is a two-dimensional complex function, which has countless minima points and gets the minimum value of 0 at (0, 0). In this module, both independent variables (i.e., x1 and x2) in this function have a range of values [−10, 10]. Sin() is sine function.
Shubert function is also a two-dimensional complex function, which has 760 local extreme points. This function gets the minimum value of −186.7309 at (−1.42513, 0.80032). In this module, both independent variables (i.e., x1 and x2) in this function also have a range of values [−10, 10]. Cos() is cosine function. i is an integer.

Environmental Flow Calculation Module
Five methods for calculating environmental flow have been integrated in this module. They are IMMR, MMR, Tennant, Q90, and Q95 respectively. In addition, five flow conditions are included in the Tennant method. The five flow conditions of Tennant method are outstanding, excellent, good, fair or degrading, and poor or minimum. The specific contents of the five flow conditions are shown in Table 3. In this module, three functions are used to test the convergence of IIWO: Schaffer, Shubert, and Rastrigrin (as shown in Table 2). Table 2. Optimization test functions.

Name
Formula Sketch Schaffer function is a two-dimensional complex function, which has countless minima points and gets the minimum value of 0 at (0, 0). In this module, both independent variables (i.e., x1 and x2) in this function have a range of values [−10, 10]. Sin() is sine function.
Shubert function is also a two-dimensional complex function, which has 760 local extreme points. This function gets the minimum value of −186.7309 at (−1.42513, 0.80032). In this module, both independent variables (i.e., x1 and x2) in this function also have a range of values [−10, 10]. Cos() is cosine function. i is an integer.

Environmental Flow Calculation Module
Five methods for calculating environmental flow have been integrated in this module. They are IMMR, MMR, Tennant, Q90, and Q95 respectively. In addition, five flow conditions are included in the Tennant method. The five flow conditions of Tennant method are outstanding, excellent, good, fair or degrading, and poor or minimum. The specific contents of the five flow conditions are shown in Table 3. Table 3. Five flow conditions of Tennant method.

Name
Formula Sketch Schaffer function is a two-dimensional complex function, which has countless minima points and gets the minimum value of 0 at (0, 0). In this module, both independent variables (i.e., x1 and x2) in this function have a range of values [−10, 10]. Sin() is sine function.
Shubert function is also a two-dimensional complex function, which has 760 local extreme points. This function gets the minimum value of −186.7309 at (−1.42513, 0.80032). In this module, both independent variables (i.e., x1 and x2) in this function also have a range of values [−10, 10]. Cos() is cosine function. i is an integer.

Environmental Flow Calculation Module
Five methods for calculating environmental flow have been integrated in this module. They are IMMR, MMR, Tennant, Q90, and Q95 respectively. In addition, five flow conditions are included in the Tennant method. The five flow conditions of Tennant method are outstanding, excellent, good, fair or degrading, and poor or minimum. The specific contents of the five flow conditions are shown in Table 3. Schaffer function is a two-dimensional complex function, which has countless minima points and gets the minimum value of 0 at (0, 0). In this module, both independent variables (i.e., x 1 and x 2 ) in this function have a range of values [−10, 10]. Sin() is sine function.
Shubert function is also a two-dimensional complex function, which has 760 local extreme points. This function gets the minimum value of −186.7309 at (−1.42513, 0.80032). In this module, both independent variables (i.e., x 1 and x 2 ) in this function also have a range of values [−10, 10]. Cos() is cosine function. i is an integer.
Rastrigrin function is a typical nonlinear multimodal function, whose peak shape is characterized by fluctuation and jump. This function gets the minimum value of 0 at (0, 0, . . . , 0). In this module, D is the dimension of the function. Here, D is set to 2, and the independent variables (i.e., x i ) have a range of values [−5.12, 5.12]. Here, π = 3.1415926.

Environmental Flow Calculation Module
Five methods for calculating environmental flow have been integrated in this module. They are IMMR, MMR, Tennant, Q90, and Q95 respectively. In addition, five flow conditions are included in the Sustainability 2020, 12, 4064 8 of 16 Tennant method. The five flow conditions of Tennant method are outstanding, excellent, good, fair or degrading, and poor or minimum. The specific contents of the five flow conditions are shown in Table 3. IWO and IIWO are both integrated in this module. The parameters of IWO and IIWO are shown as follows: P ini = 20, P fin = 90, Seed max = 5, Seed min = 2, σ ini = 2, σ fin = 0.001, iter max = 60, w = 3 (in Equation (14)), and n = 3 (in Equation (15)). The environmental flow calculated by each method mentioned above is used as the constraint of water release to optimize both single reservoir and cascade reservoir operation, respectively.
The runoff forecasting accuracy is relatively low under current conditions. Runoff forecast results are constantly being revised. Due to the uncertainty of the inflow, the theoretical results of reservoir optimal operation cannot be applied to actual scheduling well, especially to the cascade reservoirs. A rolling correction mechanism is developed in this module to adapt to the change of runoff forecast.
Taking one year as an operation cycle as an example, the formulation and revision processes of its operation curve are as follows: Step 1. Generate initial operation curve. The initial operation curves are generated using IIWO according to the forecast results of monthly runoff during one year. Here, the maximization of the generated power is served as the objective function; Step 2. Revise the initial operation curve. Ignore the months that have completed operation, and the remaining months are used as a new operation cycle. Operation curves of the remaining months are regenerated using IIWO based on the revised runoff forecast results.

Case Studies
We analyze the operation of a cascade reservoir in Wujiang River Basin, located in Guizhou Province in China (shown in Figure 4). As well, Wujiang cascade reservoir is mainly for power generation. Wujiang River is a tributary of the Yangtze River, with a basin area of 87,900 km 2 . We consider here two cascade reservoirs in the upper reaches of Wujiang River, i.e., Hongjiadu Reservoir and Dongfeng Reservoir.
Hongjiadu Reservoir represents a carry-over storage, while Dongfeng Reservoir is an incomplete annual regulation reservoir. The flood season for each reservoir is from June to September every year. The characteristic parameters of each reservoir are shown in Table 4.
The starting water levels of Hongjiadu and Dongfeng reservoirs are set at 1084 m and 960 m, respectively. Meanwhile, for each reservoir, the starting and ending water levels are the same.

Case Studies
We analyze the operation of a cascade reservoir in Wujiang River Basin, located in Guizhou Province in China (shown in Figure 4). As well, Wujiang cascade reservoir is mainly for power generation. Wujiang River is a tributary of the Yangtze River, with a basin area of 87,900 km 2 . We consider here two cascade reservoirs in the upper reaches of Wujiang River, i.e., Hongjiadu Reservoir and Dongfeng Reservoir.   Hongjiadu Reservoir represents a carry-over storage, while Dongfeng Reservoir is an incomplete annual regulation reservoir. The flood season for each reservoir is from June to September every year. The characteristic parameters of each reservoir are shown in Table 4.
The starting water levels of Hongjiadu and Dongfeng reservoirs are set at 1084 m and 960 m, respectively. Meanwhile, for each reservoir, the starting and ending water levels are the same.
The runoff data of Wujiang River Basin from 1977 to 2015 are used to calculate the environmental flow. Due to the interval inflow between Hongjiadu and Dongfeng reservoirs, the environmental flow of both reservoirs are calculated. The methods for calculating environmental flow are all used here. The environmental flow of both Hongjiadu and Dongfeng is used as the two reservoirs discharge constraints, respectively. The runoff data of high flow year (1990), normal flow year (2000), and low flow year (1995) (shown in Figure 5(a) and Figure 5(b)) are used as the inflow data to optimize both the single reservoir (Hongjiadu) and the joint operation model of the cascade reservoir, respectively. The above three cases are solved by IIWO. Meanwhile, in order to compare the efficiency of IWO and IIWO, when using the runoff data of high flow year, IWO is also used to solve this case.
The monthly runoff forecast results of 2019 (shown in Figure 5(c)) are used as the inflow data to optimize the joint operation model of the cascade reservoir. Meanwhile, taking the environmental flow calculated by IMMR as water release constraint, the cascade reservoir operation curves are rolled over based on the revised monthly runoff forecast results of 2019. This case is solved by IIWO.  The runoff data of high flow year (1990), normal flow year (2000), and low flow year (1995) (shown in Figure 5a,b) are used as the inflow data to optimize both the single reservoir (Hongjiadu) and the joint operation model of the cascade reservoir, respectively. The above three cases are solved by IIWO. Meanwhile, in order to compare the efficiency of IWO and IIWO, when using the runoff data of high flow year, IWO is also used to solve this case. cases are solved by IIWO. Meanwhile, in order to compare the efficiency of IWO and IIWO, when using the runoff data of high flow year, IWO is also used to solve this case.
The monthly runoff forecast results of 2019 (shown in Figure 5(c)) are used as the inflow data to optimize the joint operation model of the cascade reservoir. Meanwhile, taking the environmental flow calculated by IMMR as water release constraint, the cascade reservoir operation curves are rolled over based on the revised monthly runoff forecast results of 2019. This case is solved by IIWO.

IIWO Convergence Test
After 60 iterations, Schaffer, Shubert, and Rastrigrin functions finally converge to 0.00057, −186.553, and 0.005834, respectively. Convergences of IIWO to Schaffer, Shubert, and Rastrigrin are shown in Figure 6. This figure shows that, in the early stage of the optimization process, the algorithm can quickly converge to a value close to the optimal value. In the middle and late optimization stages, although the algorithm converges to a certain local optimal solution repeatedly in different iteration periods, it can escape the local optima and gradually reach the global optimum in the subsequent iterations. All in all, IIWO has a good convergence when dealing with complex functions.

Environmental Flow Calculation
The division results of different periods in one year calculated by IMMR are as follows: The flood season is from June to September; the dry season is from November to April; and the flat period The monthly runoff forecast results of 2019 (shown in Figure 5c) are used as the inflow data to optimize the joint operation model of the cascade reservoir. Meanwhile, taking the environmental flow calculated by IMMR as water release constraint, the cascade reservoir operation curves are rolled over based on the revised monthly runoff forecast results of 2019. This case is solved by IIWO.

IIWO Convergence Test
After 60 iterations, Schaffer, Shubert, and Rastrigrin functions finally converge to 0.00057, −186.553, and 0.005834, respectively. Convergences of IIWO to Schaffer, Shubert, and Rastrigrin are shown in Figure 6. This figure shows that, in the early stage of the optimization process, the algorithm can quickly converge to a value close to the optimal value. In the middle and late optimization stages, although the algorithm converges to a certain local optimal solution repeatedly in different iteration periods, it can escape the local optima and gradually reach the global optimum in the subsequent iterations. All in all, IIWO has a good convergence when dealing with complex functions. This figure shows that, in the early stage of the optimization process, the algorithm can quickly converge to a value close to the optimal value. In the middle and late optimization stages, although the algorithm converges to a certain local optimal solution repeatedly in different iteration periods, it can escape the local optima and gradually reach the global optimum in the subsequent iterations. All in all, IIWO has a good convergence when dealing with complex functions.

Environmental Flow Calculation
The division results of different periods in one year calculated by IMMR are as follows: The flood season is from June to September; the dry season is from November to April; and the flat period includes May and October.
The environmental flows of Hongjiadu and Dongfeng calculated by different methods are shown in Figure 7 and Table 5.  Figure 7 shows that the environmental flow of Dongfeng is greater than that of Hongjiadu during the same period. The interval inflow between Hongjiadu and Dongfeng is the reason for the above result. Meanwhile, as we can see, the environmental flow in April calculated by Q90 and Q95 is less than the results of other methods. This is inconsistent with the rule that the environmental flow in flat period is larger than that in dry season. In addition, the environmental flow in flood season is much greater than other methods. In other words, there are limitations in calculating environmental flow by using Q90 or Q95 alone. The environmental flow calculated by IMMR is slightly lower than the result of T-G during the flood season, but larger than that of T-G during the dry season. Meanwhile, the environmental flow calculated by IMMR in most months is greater than the results of T-F, and the results of IMMR in every month are all larger than the results of T-M. The environmental flow calculated by IMMR in different months reflects the characteristics that the environmental flow in different periods is different, and the monthly environmental flow calculated by IMMR is between the results for other methods. Therefore, IMMR is more reasonable than MMR in calculating environmental flow.   Hongjiadu  495  491  837  764  888  710  533  355  178  Dongfeng  1376  1360 2031 1877 1988 1590 1193 795  398  Total  1871  1851 2868 Hongjiadu  495  491  837  764  888  710  533  355  178  Dongfeng  1376  1360  2031  1877  1988  1590  1193  795  398  Total  1871  1851  2868  2641  2876  2300  1726  1150  576 In Table 5, and T-E. Overall, IMMR is reasonable in calculating the water volume of environmental flow during the year. Figure 7 shows that the environmental flow of Dongfeng is greater than that of Hongjiadu during the same period. The interval inflow between Hongjiadu and Dongfeng is the reason for the above result. Meanwhile, as we can see, the environmental flow in April calculated by Q90 and Q95 is less than the results of other methods. This is inconsistent with the rule that the environmental flow in flat period is larger than that in dry season. In addition, the environmental flow in flood season is much greater than other methods. In other words, there are limitations in calculating environmental flow by using Q90 or Q95 alone. The environmental flow calculated by IMMR is slightly lower than the result of T-G during the flood season, but larger than that of T-G during the dry season. Meanwhile, the environmental flow calculated by IMMR in most months is greater than the results of T-F, and the results of IMMR in every month are all larger than the results of T-M. The environmental flow calculated by IMMR in different months reflects the characteristics that the environmental flow in different periods is different, and the monthly environmental flow calculated by IMMR is between the results for other methods. Therefore, IMMR is more reasonable than MMR in calculating environmental flow.

Operation Results in Different Years
The impacts of the environmental flow calculated by different methods on both single-reservoir operation and cascade reservoir operation are shown in Figure 8.

Operation Results in Different Years
The impacts of the environmental flow calculated by different methods on both single-reservoir operation and cascade reservoir operation are shown in Figure 8.
It is worth pointing out that there are three hollow data points in Figure 8. All of them occur under the condition that the environmental flow calculated by T-O is used as the water release constraints. These three points mean that the inflow cannot meet the discharge constraints for all months. At least, using IIWO (or IWO) cannot find the optimal reservoir operation scheme that can satisfy all monthly environmental flow constraints. Figure 8a shows that, for a single reservoir, its power generation decreases with the increase of environmental flow as the whole. The result is similar to other research results in this field [36]. However, although the environmental flow calculated by IMMR is more than that by MMR, the optimal operation result using the environmental flow calculated by IMMR as the water release constraint is a little more than the result of MMR. Meanwhile, the optimal operation result of Q95 is more than the result of T-E while the environmental flow calculated by Q95 is more than T-E. These indicate that the effect of environmental flow on reservoir optimal operation is not only influenced by the water volume of environmental flow during the year, but also influenced by the distribution of the environmental flow during the year. Furthermore, under the condition of similar water volume of environmental flow during the year, the closer the distribution of the environmental flow is to the natural runoff process, the greater the power generation of the reservoir optimal operation will be. The environmental flow with similar distribution pattern during the year is strictly subject to the rule of decreasing power generation with the increase of water volume of environmental flow. Moreover, we can also figure out that IMMR is more reasonable than MMR in calculating the environmental flow. In addition, according to the results of high flow year, there is no significant difference between IWO and IIWO in the efficiency of solving single-reservoir optimal operation model. It indicates that IWO and IIWO have similar abilities in solving the problems with lower dimension.
The hollow data point that appears in Figure 8a indicates that the low flow year of Wujiang River Basin cannot meet the environmental flow calculated by T-O. In other words, T-O is not applicable to this drainage basin.
The results of cascade reservoir optimal operation for high flow year solved by IIWO and IWO in Figure 8b have a significant gap, especially for the case that the environmental flow calculated by T-O is used as water release constraint, IWO cannot find a feasible solution that can satisfy the constraint of environmental flow. These indicate that IWO has fallen into local optimality obviously when solving the cascade reservoir optimal operation model. Therefore, the ability of IWO in solving It is worth pointing out that there are three hollow data points in Figure 8. All of them occur under the condition that the environmental flow calculated by T-O is used as the water release constraints. These three points mean that the inflow cannot meet the discharge constraints for all months. At least, using IIWO (or IWO) cannot find the optimal reservoir operation scheme that can satisfy all monthly environmental flow constraints. Figure 8a shows that, for a single reservoir, its power generation decreases with the increase of environmental flow as the whole. The result is similar to other research results in this field [36]. However, although the environmental flow calculated by IMMR is more than that by MMR, the optimal operation result using the environmental flow calculated by IMMR as the water release constraint is a little more than the result of MMR. Meanwhile, the optimal operation result of Q95 is more than the result of T-E while the environmental flow calculated by Q95 is more than T-E. These indicate that the effect of environmental flow on reservoir optimal operation is not only influenced by the water volume of environmental flow during the year, but also influenced by the distribution of the environmental flow during the year. Furthermore, under the condition of similar water volume of environmental flow during the year, the closer the distribution of the environmental flow is to the natural runoff process, the greater the power generation of the reservoir optimal operation will be. The environmental flow with similar distribution pattern during the year is strictly subject to the rule of decreasing power generation with the increase of water volume of environmental flow. Moreover, we can also figure out that IMMR is more reasonable than MMR in calculating the environmental flow.
In addition, according to the results of high flow year, there is no significant difference between IWO and IIWO in the efficiency of solving single-reservoir optimal operation model. It indicates that IWO and IIWO have similar abilities in solving the problems with lower dimension.
The hollow data point that appears in Figure 8a indicates that the low flow year of Wujiang River Basin cannot meet the environmental flow calculated by T-O. In other words, T-O is not applicable to this drainage basin.
The results of cascade reservoir optimal operation for high flow year solved by IIWO and IWO in Figure 8b have a significant gap, especially for the case that the environmental flow calculated by T-O is used as water release constraint, IWO cannot find a feasible solution that can satisfy the constraint of environmental flow. These indicate that IWO has fallen into local optimality obviously when solving the cascade reservoir optimal operation model. Therefore, the ability of IWO in solving high-dimensional problems is lower than that of IIWO. Moreover, these also show that IIWO is more feasible in solving cascade reservoir optimal operation model.
At the macro level, Figure 8b also shows that the environmental flow calculated by different methods have no obvious influence on the cascade reservoir optimal operation (it means the different water volumes of environmental flow during the year and the power generation of the cascade reservoir have no obvious rivalry). As well, whether in the high flow year, normal flow year, or low flow year, the phenomena all show the same. There is no decrease in the generated energy of cascade reservoir with the increase of the water volume of environmental flow during the year, which is inconsistent with the results of other literatures. For example, a research result of cascade reservoir (i.e., the Nuozadu, Jinghong, and Ganlanba reservoirs) in Lancang River Basin in China, shows that the generated energy of cascade reservoir decreases with the increase of the water volume of environmental flow during the year [37]. According to our analysis, the reasons for this result in this paper can be summarized as the following two aspects. The first is that the interval inflow between Hongjiadu and Dongfeng is rich and cannot be ignored compared with the main river runoff (i.e., the inflow of Hongjiadu). The second is that Hongjiadu Reservoir, used as a carry-over storage, has good regulating performance. Hongjiadu has the function of runoff compensation regulation for Dongfeng Reservoir. As well, as a result of the existence of the runoff compensation regulation, the environmental flow calculated by different methods, used as the water release constraints, has inconspicuous influence on the generated energy of cascade reservoir.
Although at the macro level the environmental flow calculated by different methods has no obvious influence on the generated energy of cascade reservoir, the different distributions of the environmental flow during the year have some small effects on the generated energy of cascade reservoir at the micro level. The effects of different environmental flows on the generated energy of cascade reservoir are similar to the effects on single reservoir. That is, the closer the distribution of the environmental flow is to the natural runoff process, the greater the generated energy of cascade reservoir will be. Taking the environmental flow calculated by MMR and IMMR as an example, the generated energy of cascade reservoir using the latter environmental flow as water release constraints is larger than that using the former.

Rolling Correction of Cascade Reservoir Operation Curves
According to the initial forecast runoff data of 2019 and the revised forecast runoff data, the initial operation curves and the revised operation curves of Hongjiadu and Dongfeng are shown in Figure 9.
is larger than that using the former.

Rolling Correction of Cascade Reservoir Operation Curves
According to the initial forecast runoff data of 2019 and the revised forecast runoff data, the initial operation curves and the revised operation curves of Hongjiadu and Dongfeng are shown in Figure 9.  Figure 9 shows that under the condition that the starting and ending water levels of reservoir have been determined during the operation period, and the change of forecast runoff will significantly affect or change the reservoir operation plan. Especially in the current power market environment, this will greatly affect the benefit of hydropower station. Therefore, it is necessary to continue the in-depth research on medium and long-term runoff forecast. The accuracy of medium and long-term runoff forecast must be improved. As a result, the stability of reservoir power  Figure 9 shows that under the condition that the starting and ending water levels of reservoir have been determined during the operation period, and the change of forecast runoff will significantly affect or change the reservoir operation plan. Especially in the current power market environment, this will greatly affect the benefit of hydropower station. Therefore, it is necessary to continue the in-depth research on medium and long-term runoff forecast. The accuracy of medium and long-term runoff forecast must be improved. As a result, the stability of reservoir power generation will be improved and the competitiveness of hydropower stations in the power market will be increased.

Conclusions
An integrated development software is introduced in this paper. Two innovations are proposed and included in the software (i.e., IMMR and IIWO). The global optimal convergence performance of IIWO is preliminarily verified by optimizing three commonly used multi-peak test functions. This paper applies IMMR, MMR, Tennant, Q90, and Q95 to calculate the environmental flow of Wujiang River Basin, respectively, and discusses the results of environmental flow calculated by different methods. This paper applies IIWO and IWO to both single-reservoir operation and cascade reservoir operation with the environmental flow as water release constraint, as well as discusses the results of reservoir optimal operation therewith. From the above, we can draw the following conclusions.
The environmental flow calculated by IMMR adapts to the character of natural runoff well. It can maintain a healthy water ecosystem with a better standard compared with the results of Tennant method. Meanwhile, taking the environmental flow calculated by IMMR as water release constraint, the generated energy of both single reservoir and cascade reservoir is satisfactory compared to other results. At the same time, taking the results of environmental flow and reservoir optimal operation into consideration, T-G and Q95 also adapt to this basin.
IIWO has global optimization capability and can converge to the global optimal solution in optimizing the high-dimensional multimodal complex function. Comparing with IWO, IIWO has a better efficiency in solving the model of cascade reservoir optimal operation. The generated energy of single reservoir is affected by both the volume of environmental flow and the distribution of environmental flow during the year. Generally, the power generation decreases with the increase of the volume of environmental flow under the condition that the annual distribution of the environmental flow is similar. Furthermore, the more the annual distribution of ecological flow with a similar volume of environmental flow during the year is close to natural runoff, the greater the power generation will be. The environmental flow calculated by different methods has an inconspicuous effect on the power generation of cascade reservoir at the macro level. However, at the micro level, similar to single reservoir, the more the annual distribution of ecological flow is close to natural runoff, the greater the power generation will be.
Although the calculation of environmental flow, the influence of environmental flow on reservoir operation, and the rolling correction of reservoir operation are studied in this paper, the following questions need further in-depth study.
The problem of medium and long-term runoff forecast should be deeply studied to improve the accuracy of forecast runoff and the competitiveness of hydropower in the electricity market.
In order to choose a specific method for calculating environmental flow for a specific basin, a quantitative evaluation method should be studied to balance the relationship between power generation benefits of reservoir and water ecosystem protection benefits. Meanwhile, the performance of the system when applied in more reservoirs (i.e., more than 2 reservoirs) should be further studied.

Conflicts of Interest:
The authors declare no conflict of interest.