Optimal Flood-Control Operation of Cascade Reservoirs Using an Improved Particle Swarm Optimization Algorithm

: Optimal reservoir operation is an important measure for ensuring ﬂood-control safety and reducing disaster losses. The standard particle swarm optimization (PSO) algorithm can ﬁnd the optimal solution of the problem by updating its position and speed, but it is easy to fall into a local optimum. In order to prevent the problem of precocious convergence, a novel simulated annealing particle swarm optimization (SAPSO) algorithm was proposed in this study, in which the Boltzmann equation from the simulated annealing algorithm was incorporated into the iterative process of the PSO algorithm. Within the maximum ﬂood peak reduction criterion, the SAPSO algorithm was used into two ﬂoods in the Tianzhuang–Bashan cascade reservoir system. The results shown that: (1) There are lower maximum outﬂows. The maximum outﬂows of Tianzhuang reservoir using SAPSO algorithm decreased by 9.3% and 8.6%, respectively, compared with the measured values, and those of Bashan reservoir decreased by 18.5% and 13.5%, respectively; (2) there are also lower maximum water levels. The maximum water levels of Tianzhuang reservoir were 0.39 m and 0.45 m lower than the measured values, respectively, and those of Bashan reservoir were 0.06 m and 0.46 m lower, respectively; and (3) from the convergence processes, the SAPSO algorithm reduced the convergence speed in the early stage of convergence and provided a superior objective function value than PSO algorithm. At the same time, by comparing with GA algorithm, the performance and applicability of SAPSO algorithm in ﬂood operation are discussed further. Thus, the optimal operation model and SAPSO algorithm proposed in this study provide a new approach to realizing the optimal ﬂood-control operation of cascade reservoir systems.


Introduction
Floods are among the most frequent natural disasters worldwide.According to the 2020 Global Natural Disaster Assessment Report [1], 313 natural disasters (excluding epidemic diseases) occurred in 2020, of which 193 (or 61.66%) were floods.Furthermore, floods caused 6171 deaths in 2020 (accounting for 41% of all deaths caused by disasters), affected 33.22 million people (accounting for 34% of all natural disaster victims), and caused direct economic losses of USD 51.5 billion.Reservoirs have therefore been constructed to serve as important water-conservancy projects that provide flood control and disaster risk reduction while also playing important roles in water supply, irrigation, navigation, and aquaculture.Scientific and reasonable reservoir operation schemes can ensure the effective in the Upper Yellow River, China; Yaseen et al. [48] applied hybrid bat algorithm-PSO to optimize power production and irrigation supply of a multi-purpose reservoir system in the state of Karnataka, India; Trivedi et al. [49] put forward a time-variant elitist mutation multi-objective PSO to derivation and performance evaluation of optimal operating policies for a reservoir; Ma et al. [12] proposed the spark-based parallel PSO method via cloud computing for the cascade eight-reservoir system in the Yuanshui basin in China; and Mahdi et al. [50] proposed and evaluated an integrated framework to optimize reservoir operation using PSO in which hydropower loss and economic loss of irrigation supply were minimized, while ecological degradations at downstream river were alleviated.
However, while the PSO algorithm is widely used, it has proven easy for it to fall into a locally optimal solution, which makes the optimal solution worse than other algorithms in some cases.In contrast, the SA algorithm accepts the new state with a specified probability; that is, even if there are multiple local optimal solutions to a problem, it can effectively prevent the result from falling into a local extreme point.In this manner, the SA algorithm can compensate for the shortcomings of the PSO algorithm.In this study, a simulated annealing particle swarm optimization (SAPSO) algorithm was therefore proposed to realize optimal flood-control operation of cascade reservoir systems by introducing the Boltzmann equation from the SA algorithm into the iterative process of the PSO algorithm, effectively addressing the tendency of the latter to fall into a locally optimal solution.
The remainder of this study is organized as follows: Section 2.1 describes the optimal cascade reservoir flood-control operation model; Section 2.2 presents the PSO algorithm, SA algorithm, SAPSO algorithm, and procedure for determining the optimal cascade reservoir operation scheme using the proposed SAPSO algorithm; Section 3 introduces the study area, data processing, and parameter setting; Section 4 illuminate and discusses the results of a case study application of the proposed SAPSO algorithm; and Section 5 provides a summary of the conclusions.

Methods
The development of the optimal reservoir flood-control operation strategies can be generally described in the following two-step process: (1) Choose an optimization criterion to develop a corresponding objective function, then establish an optimal flood-control operation model for the given input data and constraints [51].(2) Use optimization algorithms to solve the model and obtain the optimal reservoir operation scheme [52].Thus, this section consists of the construction of the optimal cascade reservoir flood-control operation model and the solution of this model using SAPSO algorithm.

Optimal Cascade Reservoir Flood-Control Operation Model
The objective function and constraints for the proposed optimization model are described in this section.The meanings and units of parameters and variables in this section are listed in Table 1.

Objective Function
There are three main flood-control optimization criteria for reservoirs [53]: (1) maximum reduction in flood peak, (2) minimum flood duration, and (3) minimum flood loss or flood-control cost.The maximum reduction in the flood peak was defined in this study as the objective function to determine the optimal outflows of a cascade reservoir system.
The objective of the maximum reduction in the flood peak criterion is to reduce the flood peak to the extent possible to ensure the flood-control safety of the dam or reservoir area.A general form of this objective function in the case of a cascade reservoir system can be written as [54] min (1)

Constraints
This study identified four constraints on the proposed cascade reservoir flood-control operation model: the water balance, hydraulic connection, storage capacity, and outflow.All variables in all constraints were positive only.
(1) The water balance constraint is given by (2) The hydraulic connection constraint is given by (3) The storage capacity constraint is defined as (4) The outflow constraint is given by

PSO Algorithm
The PSO algorithm is an intelligent scheme categorized as a metaheuristic optimization algorithm.It was first proposed in 1995 by Dr. James Kennedy, an American social psychologist, and Dr. Russell Ebethart, an electrical engineer, who were inspired by artificial life and evolutionary computation theory [55].The PSO algorithm was developed based on the paradigm of swarm intelligence as inspired by the social behavior of animals such as fish and birds when seeking food.The PSO algorithm was first designed to solve nonlinear continuous optimization problems and has been widely used in job scheduling, decision making, pattern recognition, real-time robot path design, and other applications because of its numerous advantages.These advantages include structural simplicity, easy implementation, the need for fewer parameters that must be tuned, and low computational requirements that allow the algorithm to be implemented on a low-cost processor platform.
A swarm in PSO consists of a set of particles that represent a population of candidate solutions.Any particle has a specific position in a search space composed of all possible solutions to the problem.The PSO algorithm attempts to find the best particle from among all possible solutions in this space.The first step is to initialize sizepop particles randomly in the dim-dimensional search space, each of which has associated attributes, such as fitness (calculated using the objective function), position, and velocity.The fitness of a particle describes the distance from the position of the particle to the global optimal solution.When solving the maximization problem, the greater the fitness value of a particle, the better the solution it provides, whereas the opposite is true for the minimization problem.Each particle changes its position after each iteration based on the velocity updates.This change is influenced by two "best" values: the one known as "Pbest" or personal best describes the best solution achieved by a given particle and the other, known as "Gbest" or global best, describes the best solution achieved by any particle among the entire set of particles in the solution space.The velocity and position of each particle were used to reposition the particle using the following equations: x k+1 jh = x k jh + v k+1 jh (7) where x jh k and v jh k describe the position and velocity of the jth particle in the hth spatial dimension at iteration k; w is the inertial weight; c 1 and c 2 are learning factors, which are non-negative constants; rand 1 and rand 2 are two independent random numbers taken in the range of (0, 1); Pbest jh k is the personal best position of the jth particle in the hth spatial dimension at iteration k; and Gbest h is the global best position in the hth spatial dimension in each iteration among the entire set of particles.
When the positions of all particles have been updated, the algorithm determines whether the Pbest and Gbest values have changed; if so, it continues to search for new positions through continuous iteration following the above method until the maximum number of iterations is reached, or the searched optimal solution satisfies the requirements.

SA Algorithm
The SA algorithm is a probabilistic optimization method introduced by Kirkpatrick et al. [56] and inspired by the physical annealing of solids or thermodynamic systems.In this method, the current state, energy equation, and ground state of a thermodynamic system are analogous to the current scheduling solution, objective function, and global optimum solution of the optimization problem.The SA algorithm uses the probabilitybased Metropolis acceptance rule to explore the search universe and leap away from the local optimum, which sets the probability of accepting weak solutions [56,57].This rule is defined by where p k is the acceptance probability in the kth iteration; E k is the objective function value in the kth iteration; E g is the historical optimal objective function value; K bo is the Boltzmann coefficient; and T k is the annealing temperature in the kth iteration, which is initially set to a large value and then reduced to a small value via the following temperaturecontrol function: where α is the annealing coefficient, and its value interval is (0.8, 1.0).Thus with a gradual decrease in T k , the acceptance probability of the inferior solution will approach 0.

SAPSO Algorithm
When the PSO algorithm is used to find the optimal solution for a model, the particles always chase the current optimal solution, which makes their speed close to zero and can cause the solution to fall into a local extreme point.To overcome this problem of precocious convergence, it is necessary to allow the algorithm to jump out of a local optimization and into other feasible regions when precocious convergence occurs.As the SA algorithm can accept a new state with a specified probability during the search process, even if there are multiple local optimal solutions to a problem, the algorithm can effectively prevent the final result from falling into a local extreme point.However, the SA algorithm has the disadvantages of a slow search speed in the later stages as well as low accuracy.Considering their advantages and disadvantages, the SAPSO algorithm was constructed in this study by combining the SA and PSO algorithms.Thus, the Boltzmann equation of the SA algorithm was incorporated into the iterative process of the PSO algorithm to effectively avoid the premature defects associated with the PSO algorithm while retaining its advantageously short local convergence time.The procedure of SAPSO algorithm is as follows: Step 1: Let the iteration number k = 1, and set the initial population and parameters, including the initial population size sizepop, the spatial dimension of the population dim, initial position x jh k , initial speed v jh k , maximum number of iterations N, w, c 1 , c 2 , T k , α, and other parameters, in which j = 1,2, . . ., sizepop, h = 1,2, . . ., dim. Step where f itness(Pbest j k ) is the fitness value of Pbest j k , and f itness(Gbest) is the fitness value of Gbest.Then, the fitness value TF of Pbest j k is calculated as follows: Step 4: Update Gbest via the Metropolis method as follows: where rand is a random numbers taken in the range of (0, 1).
Step 5: Update the speeds and positions of the particles respectively using Equations ( 6) and (7).
Step 6: Apply the temperature control function given by Equation ( 9) to obtain a new temperature T k + 1 .
Step 7: Step 2 to continue the iterative calculation; otherwise, end the iterative calculation.

Procedure for Determining Optimal Operation Using the SAPSO Algorithm
When using the SAPSO algorithm to obtain the optimal operation model for a cascade reservoir system, the outflow of each reservoir is taken as the decision variable.A particle defines a specific outflow scheme.The procedure for solving the optimal cascade reservoir operation scheme using the SAPSO algorithm is as follows: Step 1: Let the iteration number k = 1, and set the population parameters.The spatial dimension of the population dim is defined as the product of the number of reservoirs M and the number of operation periods T; that is, dim = m × T. The appropriate initial population size sizepop is then set along with the maximum number of iterations N, w, c 1 , c 2 , T k , α, and other parameters.Step 2: Randomly generate the initial population, that is, the initial outflow hydrographs, as follows: where q k jh , q jhmax , and q jhmin are the outflow, upper limit of the outflow, and lower limit of the outflow, respectively, for the hth spatial dimension in the jth particle, where j = 1,2, . . ., sizepop, and h = 1,2, . . ., dim.
Step 3: Ascertain whether the population satisfies the constraint conditions by calculating the fitness value as follows: where fun is the objective function of the optimal cascade reservoir flood-control operation model proposed in this study; q k j is the outflow of the jth particle at iteration k.
Step 4: Update the best historical position of the individual (Pbest j k ) and group (Gbest).
Compare fitness j with Pbest j k ; because the objective function employed in this study was used to find the minimum, when fitness j < Pbest j k , replace Pbest j k with fitness j , and when Pbest j k < Gbest, replace Gbest with Pbest j k .
Step 5: Same as the Step 3 of the SAPSO algorithm, where fitness in Equation ( 10) is replaced by fun.
Step 6: Same as the Step 4 of the SAPSO algorithm.
Step 7: Update the speeds and positions of the particles respectively using Equations ( 6) and (7), where x k jh and x k+1 jh in Equations ( 6) and ( 7) are replaced by q k jh and q k+1 jh , respectively.
Step 8: Same as the Step 6 of the SAPSO algorithm.
Step 9: Let k = k + 1.If the iteration number k ≤ N, go to Step 3 to continue the iterative calculation; otherwise, output the optimal solution Gbest.
The procedure for determining optimal operation using the SAPSO algorithm is illustrated in Figure 1.

Study Area
The Tianzhuang-Bashan cascade reservoir system was selected for the case study in this research.Bashan Reservoir is located in the middle to upper reaches of the main stream of the Yi River in the Huaihe River basin, China, and the Tianzhuang Reservoir is the only large reservoir in the upper reaches of the Yi River; these two reservoirs form the cascade reservoir system shown in Figure 2.They are both large, type II reservoirs with multi-year regulations used mainly to provide flood control and irrigation in combination with aquaculture, power generation, water supply, etc.The basic parameters of the reservoirs are listed in Table 2.

Case Study 3.1. Study Area
The Tianzhuang-Bashan cascade reservoir system was selected for the case study in this research.Bashan Reservoir is located in the middle to upper reaches of the main stream of the Yi River in the Huaihe River basin, China, and the Tianzhuang Reservoir is the only large reservoir in the upper reaches of the Yi River; these two reservoirs form the cascade reservoir system shown in Figure 2.They are both large, type II reservoirs with multiyear regulations used mainly to provide flood control and irrigation in combination with aquaculture, power generation, water supply, etc.The basic parameters of the reservoirs are listed in Table 2.  Two control discharges and a high-volume discharge state were established for each reservoir to ensure safety downstream.For the Bashan Reservoir, when the water level Z ≤ 179.02 m, the control discharge is 2000 m 3 /s; when 179.02 m < Z ≤ 179.90 m, the control discharge is 3120 m 3 /s; and when Z >179.90 m, the spillway sluices are completely opened.For the Tianzhuang Reservoir, when the water level Z ≤ 311.78 m, the control discharge is 600 m 3 /s; when 311.78 m < Z ≤ 312.33 m, the control discharge is 1000 m 3 /s; and when Z > 312.33 m, the spillway sluices are completely opened.

Data Processing and Parameter Setting
Data were collected describing two floods of the Tianzhuang-Bashan cascade reservoir system on 31 July 1964 and 13 August 1974, including the water level, storage capacity, and outflow data for both reservoirs.Based on these data, the inflow for each reservoir was calculated using the water balance equation given by Equation (2).According to the observations, the duration of the outflow from Tianzhuang Reservoir to Bashan Reservoir through river routing is 6 h, so t' in Equation ( 3) was set to 6 h.At the same time, the relationships between the water level and storage capacity and between the water level  Two control discharges and a high-volume discharge state were established for each reservoir to ensure safety downstream.For the Bashan Reservoir, when the water level Z ≤ 179.02 m, the control discharge is 2000 m 3 /s; when 179.02 m < Z ≤ 179.90 m, the control discharge is 3120 m 3 /s; and when Z >179.90 m, the spillway sluices are completely opened.For the Tianzhuang Reservoir, when the water level Z ≤ 311.78 m, the control discharge is 600 m 3 /s; when 311.78 m < Z ≤ 312.33 m, the control discharge is 1000 m 3 /s; and when Z > 312.33 m, the spillway sluices are completely opened.

Data Processing and Parameter Setting
Data were collected describing two floods of the Tianzhuang-Bashan cascade reservoir system on 31 July 1964 and 13 August 1974, including the water level, storage capacity, and outflow data for both reservoirs.Based on these data, the inflow for each reservoir was calculated using the water balance equation given by Equation (2).According to the observations, the duration of the outflow from Tianzhuang Reservoir to Bashan Reservoir through river routing is 6 h, so t' in Equation ( 3) was set to 6 h.At the same time, the relationships between the water level and storage capacity and between the water level and outflow of the each reservoir were also obtained.In summary, the collected data met the modeling requirements for the optimal cascade reservoir operation model.
According to [58] and based on the results many tests of the PSO and SAPSO algorithms, the parameters of the two algorithms were determined and applied in this study as shown in Table 3 to demonstrate the abilities of the proposed SAPSO algorithm.

Results
First, the optimal operation model of the Tianzhuang-Bashan cascade reservoir system was established according to the procedure in Section 2.1.In Equation (1); M equals 2, q 1 (t) and q 2 (t) are the inflows of Tianzhuang and Bashan Reservoir, respectively; and R 2 (t) is the inflow from Tianzhuang Reservoir to Bashan Reservoir, obtained by subtracting the outflow of Tianzhuang Reservoir at t − 6 h from the inflow of Bashan Reservoir.Then, the PSO and SAPSO (https://github.com/regicsf2010/SAPSO,accessed on 10 September 2021) algorithms were compiled using the MATLAB software to solve the optimal operation schemes for the 31 July 1964 and 13 August 1974 floods.The results were compared with the measured values as shown in Figures 3-6.The maximum outflows and water levels are listed in Tables 4 and 5, respectively.(1) Comparing the maximum outflows shown for the two floods in Tables 3 and 4, the measured maximum outflows of the two reservoirs were the largest, followed by those under the operation scheme obtained using the PSO algorithm, followed by those under the operation scheme obtained using the proposed SAPSO algorithm.The maximum outflow of Tianzhuang Reservoir when operated according to the PSO-obtained solution decreased by 6.  (1) Comparing the maximum outflows shown for the two floods in Tables 3 and 4, the measured maximum outflows of the two reservoirs were the largest, followed by those under the operation scheme obtained using the PSO algorithm, followed by those under the operation scheme obtained using the proposed SAPSO algorithm.The maximum outflow of Tianzhuang Reservoir when operated according to the PSO-obtained solution decreased by 6.2% and 5.7% compared with the measured values in the 31 July 1964 and the 13 August 1974 floods, respectively; the maximum outflow of Bashan Reservoir when operated according to the PSO-obtained solution decreased by 8.1% and 9.2% compared with the measured values in the 31 July 1964 and 13 August 1974 floods, respectively.Notably, the maximum outflow of Tianzhuang Reservoir when operated according to the SAPSO-obtained solution decreased by 9.3% and 8.6% compared with the measured values in the 31 July 1964 and 13 August 1974 floods, respectively; the maximum outflow of Bashan Reservoir when operated according to the SAPSO-obtained solution decreased by 18 respectively.Thus, both the PSO and SAPSO algorithms reduced the maximum outflow of the two reservoirs, with the proposed SAPSO algorithm providing superior performance.
(2) For both floods, the measured maximum water levels of the two reservoirs were the largest, followed by those of the PSO-obtained operation scheme, then by those of the SAPSO-obtained operation scheme.The maximum water levels of Tianzhuang Reservoir when using the PSO-based strategy were 0.31 m and 0.32 m lower than the measured values during the 31 July 1964 and 13 August 1974 floods, respectively, and those of Bashan Reservoir were 0.03 m and 0.34 m lower than the measured values, respectively.The maximum water levels of Tianzhuang Reservoir when using the SAPSO-based strategy were 0.39 m and 0.45 m lower than the measured values during the 31 July 1964 and 13 August 1974 floods, respectively, and those of Bashan Reservoir were 0.06 m and 0.46 m lower than the measured values, respectively.Thus, it can be observed that the maximum water levels obtained when using the optimal operation schemes based on the PSO and SAPSO algorithms were smaller than the measured values, with the maximum water level of the latter being the smallest.
(3) The convergence processes for the SAPSO and PSO algorithms are shown in Figures 7 and 8, respectively.It can be seen that in the process of obtaining the optimal operation schemes for the 31 July 1964 and 13 August 1974 floods, the PSO algorithm fell into a local optimal solution at 1676 and 1338 iterations, respectively.However, the SAPSO algorithm tended to be stable and reached a minimum at 5690 and 5993 iterations, respectively.The minimum values of the PSO and SAPSO algorithms objective functions for the 31 July 1964 flood were 4.77 × 10 9 and 4.65 × 10 9 , respectively, while those for the 13 August 1974 flood were 1.36 × 10 10 and 1.34 × 10 10 , respectively.Thus, the minimum values of the objective function obtained using the proposed SAPSO algorithm were less than those obtained using the PSO algorithm.In summary, SAPSO algorithm can not only effectively avoid the problem of falling into a local optimal solution in the later stage of the optimization process when using the PSO algorithm but also provide superior objective function values.
SAPSO-obtained solution decreased by 9.3% and 8.6% compared with the measured values in the 31 July 1964 and 8 13 August 1974 floods, respectively; the maximum outflow of Bashan Reservoir when operated according to the SAPSO-obtained solution decreased by 18.5% and 13.5% compared with the measured value in the 31 July 1964 and 13 August 1974 floods, respectively.Thus, both the PSO and SAPSO algorithms reduced the maximum outflow of the two reservoirs, with the proposed SAPSO algorithm providing superior performance.
(2) For both floods, the measured maximum water levels of the two reservoirs were the largest, followed by those of the PSO-obtained operation scheme, then by those of the SAPSO-obtained operation scheme.The maximum water levels of Tianzhuang Reservoir when using the PSO-based strategy were 0.31 m and 0.32 m lower than the measured values during the 31 July 1964 and 13 August 1974 floods, respectively, and those of Bashan Reservoir were 0.03 m and 0.34 m lower than the measured values, respectively.The maximum water levels of Tianzhuang Reservoir when using the SAPSO-based strategy were 0.39 m and 0.45 m lower than the measured values during the 31 July 1964 and 13 August 1974 floods, respectively, and those of Bashan Reservoir were 0.06 m and 0.46 m lower than the measured values, respectively.Thus, it can be observed that the maximum water levels obtained when using the optimal operation schemes based on the PSO and SAPSO algorithms were smaller than the measured values, with the maximum water level of the latter being the smallest.
(3) The convergence processes for the SAPSO and PSO algorithms are shown in Figures 7 and 8, respectively.It can be seen that in the process of obtaining the optimal operation schemes for the 31 July 1964 and 13 August 1974 floods, the PSO algorithm fell into a local optimal solution at 1676 and 1338 iterations, respectively.However, the SAPSO algorithm tended to be stable and reached a minimum at 5690 and 5993 iterations, respectively.The minimum values of the PSO and SAPSO algorithms objective functions for the 31 July 1964 flood were 4.77 × 10 9 and 4.65 × 10 9 , respectively, while those for the 13 August 1974 flood were 1.36 × 10 10 and 1.34 × 10 10 , respectively.Thus, the minimum values of the objective function obtained using the proposed SAPSO algorithm were less than those obtained using the PSO algorithm.In summary, SAPSO algorithm can not only effectively avoid the problem of falling into a local optimal solution in the later stage of the optimization process when using the PSO algorithm but also provide superior objective function values.

The comparison of outflows
From the three outflow hydrographs shown in Figures 3-6, it can be observed that when the flood waters were rising, the optimal operation schemes obtained using PSO and SAPSO algorithms increased the outflow ahead of time compared to the measured operation scheme; this is quite obvious for the Bashan Reservoir in particular.For example, during the 31 July 1964 and 13 August 1974 floods, the operation schemes using either algorithm increased the outflow 4 h and 7 h earlier, respectively.Increasing the outflow in advance can ensure the maximum available reservoir storage capacity and reduce the maximum outflow under the same flood conditions; this is also the main reason why the maximum outflows under the two optimal operation schemes were smaller than the measured values.Comparing the three outflow hydrographs, those corresponding to the two optimization schemes show that the outflows as the floods rose were larger than the measured values, the peak outflow times appeared earlier than for the measured outflows, and the outflows as the floods receded were smaller than the measured values.Comparing the outflow hydrographs obtained using the two optimization algorithms, the SAPSO-based outflow hydrographs were smoother than the PSO-based outflow hydrographs whether the floods were rising or receding, and except for the maximum outflow, the PSO-obtained outflows were smaller than the SAPSO-obtained outflows.In addition, the fluctuations of the PSO-obtained outflow hydrographs were quite serious, indicating that they fell into local optimal solutions during optimization.
Comparing the water-level hydrographs shown in Figures 3-6, the water levels obtained using the operating strategies based on the two optimization algorithms were consistently lower than the measured values until reaching the maximum water level; this is particularly obvious for the 13 August 1974 flood at Bashan Reservoir.After achieving the maximum water level, the water levels of the two algorithms intersected with the measured values at a later time for the 13 August 1974 flood than for the 31 July 1964 flood; this was caused by the combined influence of the maximum inflow and the algorithm-derived operating strategy.The appearance times of the highest water levels obtained using the operating strategies derived using the two optimization algorithms were mostly consistent with the measured value.However, the measured water levels at the ends of the two floods were lower than those obtained when using the evaluated optimal operation methods; this indicates that the two optimization algorithms more effectively utilized flood resources.

The Comparison of Outflows
From the three outflow hydrographs shown in Figures 3-6, it can be observed that when the flood waters were rising, the optimal operation schemes obtained using PSO and SAPSO algorithms increased the outflow ahead of time compared to the measured operation scheme; this is quite obvious for the Bashan Reservoir in particular.For example, during the 31 July 1964 and 13 August 1974 floods, the operation schemes using either algorithm increased the outflow 4 h and 7 h earlier, respectively.Increasing the outflow in advance can ensure the maximum available reservoir storage capacity and reduce the maximum outflow under the same flood conditions; this is also the main reason why the maximum outflows under the two optimal operation schemes were smaller than the measured values.Comparing the three outflow hydrographs, those corresponding to the two optimization schemes show that the outflows as the floods rose were larger than the measured values, the peak outflow times appeared earlier than for the measured outflows, and the outflows as the floods receded were smaller than the measured values.Comparing the outflow hydrographs obtained using the two optimization algorithms, the SAPSObased outflow hydrographs were smoother than the PSO-based outflow hydrographs whether the floods were rising or receding, and except for the maximum outflow, the PSO-obtained outflows were smaller than the SAPSO-obtained outflows.In addition, the fluctuations of the PSO-obtained outflow hydrographs were quite serious, indicating that they fell into local optimal solutions during optimization.
Comparing the water-level hydrographs shown in Figures 3-6, the water levels obtained using the operating strategies based on the two optimization algorithms were consistently lower than the measured values until reaching the maximum water level; this is particularly obvious for the 13 August 1974 flood at Bashan Reservoir.After achieving the maximum water level, the water levels of the two algorithms intersected with the measured values at a later time for the 13 August 1974 flood than for the 31 July 1964 flood; this was caused by the combined influence of the maximum inflow and the algorithm-derived operating strategy.The appearance times of the highest water levels obtained using the operating strategies derived using the two optimization algorithms were mostly consistent with the measured value.However, the measured water levels at the ends of the two floods were lower than those obtained when using the evaluated optimal operation methods; this indicates that the two optimization algorithms more effectively utilized flood resources.
Based on the study by Farzin et al. [59], the GA was used in the flow analysis.Comparison of routings with three outflow hydrographs for each flood and each reservoir indicated that the SAPSO algorithm reaches an improved routing.The results were so similar because of the accurate sensitivity analysis considered in various algorithms for the objective function and different parameters.Although the changes of outflows can be seen clearly in Figures 9 and 10, the appearance times of maximum outflow using the three algorithms were mostly consistent.An interesting fact is that the GA's outflow hydrographs of Bashan reservoir show a highly variable outflow peak compared with the performance of PSO and SAPSO algorithms.The reason of this fact is that the GA uses probabilistic transition rules to guide the search direction but does not use deterministic search rules, and the search process does not directly act on variables.Derrac et al. [60] suggested that multiple comparisons tests must be used when a statistical comparison of the results is reported among various algorithms.However, this study prefers to compare the performance of SAPSO and PSO algorithms, while the GA was only chosen as another algorithm for simple comparison.

The Computational Performance
From the optimization results, SAPSO generally improves the operation policy.From the convergence processes, the dynamic probability optimization of the SA algorithm reduces the convergence speed in the early stage of convergence, which may be related to the fact that the dynamic discovery probability changes the balance between global and local search in the evolution process of the algorithm.In terms of algorithm complexity, the dynamic probability optimization does not change the complexity of the proposed algorithm, so the optimization time is basically not affected.In intelligent algorithms, the optimization results can be further improved by increasing the population size or the number of iterations, but it also occupies more computer memory and prolongs the optimization time.
It can be seen that in the process of obtaining the optimal operation schemes for the 31 July 1964 and 13 August 1974 floods, the PSO algorithm fell into a local optimal solution at 1676 and 1338 iterations, respectively.However, the SAPSO algorithm tended to be stable and reached a minimum at 5690 and 5993 iterations, respectively.The probabilistic optimization mechanism of the SA algorithm determines that it has a significant performance in overcoming the "prematurity" of PSO.At the same time, it ensures that the PSO algorithm can still maintain good population diversity in the later stage of evolution, so the SAPSO algorithm does not easily fall into local optimal solution.After a certain number of iterations, the SAPSO algorithm can converge to the global optimal solution.
Water 2022, 14, x FOR PEER REVIEW 15 of 20 Based on the study by Farzin et al. [59], the GA was used in the flow analysis.Comparison of routings with three outflow hydrographs for each flood and each reservoir indicated that the SAPSO algorithm reaches an improved routing.The results were so similar because of the accurate sensitivity analysis considered in various algorithms for the objective function and different parameters.Although the changes of outflows can be seen clearly in Figures 9 and 10, the appearance times of maximum outflow using the three algorithms were mostly consistent.An interesting fact is that the GA's outflow hydrographs of Bashan reservoir show a highly variable outflow peak compared with the performance of PSO and SAPSO algorithms.The reason of this fact is that the GA uses probabilistic transition rules to guide the search direction but does not use deterministic search rules, and the search process does not directly act on variables.Derrac et al. [60] suggested that multiple comparisons tests must be used when a statistical comparison of the results is reported among various algorithms.However, this study prefers to compare the performance of SAPSO and PSO algorithms, while the GA was only chosen as another algorithm for simple comparison.

The computational performance
From the optimization results, SAPSO generally improves the operation policy.From the convergence processes, the dynamic probability optimization of the SA algorithm reduces the convergence speed in the early stage of convergence, which may be related to the fact that the dynamic discovery probability changes the balance between global and local search in the evolution process of the algorithm.In terms of algorithm complexity, the dynamic probability optimization does not change the complexity of the proposed algorithm, so the optimization time is basically not affected.In intelligent algorithms, the optimization results can be further improved by increasing the population size or the number of iterations, but it also occupies more computer memory and prolongs the optimization time.
It can be seen that in the process of obtaining the optimal operation schemes for the 31 July 1964 and 13 August 1974 floods, the PSO algorithm fell into a local optimal solution at 1676 and 1338 iterations, respectively.However, the SAPSO algorithm tended to be stable and reached a minimum at 5690 and 5993 iterations, respectively.The probabilistic optimization mechanism of the SA algorithm determines that it has a significant performance in overcoming the "prematurity" of PSO.At the same time, it ensures that the PSO algorithm can still maintain good population diversity in the later stage of evolution, so the SAPSO algorithm does not easily fall into local optimal solution.After a certain number of iterations, the SAPSO algorithm can converge to the global optimal solution.

Conclusions
Taking the maximum reduction of the flood peak as the objective function, a cascade reservoir system flood-control operation optimization model was constructed and solved using the SAPSO algorithm proposed in this study.The proposed approach was then applied to formulate an optimal operation scheme for the Tianzhuang-Bashan cascade reservoir system.The following conclusions were drawn from this study: (1) The maximum outflows and water levels of the optimal operation schemes obtained using the SAPSO algorithm were smaller than the measured values and those of the optimal operation scheme obtained using the PSO algorithm.Therefore, the SAPSO algorithm was not only able to provide an operation scheme that maximized safety

Conclusions
Taking the maximum reduction of the flood peak as the objective function, a cascade reservoir system flood-control operation optimization model was constructed and solved using the SAPSO algorithm proposed in this study.The proposed approach was then applied to formulate an optimal operation scheme for the Tianzhuang-Bashan cascade reservoir system.The following conclusions were drawn from this study: (1) The maximum outflows and water levels of the optimal operation schemes obtained using the SAPSO algorithm were smaller than the measured values and those of the optimal operation scheme obtained using the PSO algorithm.Therefore, the SAPSO algorithm was not only able to provide an operation scheme that maximized safety in the downstream flood control areas, but it also took into account the flood-control safety of the reservoirs themselves as well as their upstream areas.(2) The optimal operation schemes obtained using the PSO and SAPSO algorithms both increased the outflow in advance of the flood.Indeed, the outflow hydrographs for the two optimization schemes indicated that the outflows as the floods rose were larger, the peak outflows appeared earlier, and the outflows as the floods receded were smaller compared to the measured values.Except for the maximum outflow, the outflows provided by the PSO-based scheme were generally smaller than those provided by the SAPSO-based scheme.Furthermore, the water levels obtained using the PSO-and SAPSO-based schemes were lower than the measured values when the floods rose, whereas those at the end of flood regulation were higher than the measured values.In summary, the two optimization algorithms were not only able to ensure the safety of the reservoirs and downstream flood control areas but also realized the effective utilization of flood-water resources.(3) Comparing the convergence processes of the SAPSO and PSO algorithms, it was determined that the SAPSO algorithm effectively avoided the problem of falling into a local optimal solution during the later stages of the optimization process, as occurred when using the PSO algorithm, and provided a superior objective function value.
Therefore, the cascade reservoir flood-control optimal operation model and SAPSO algorithm proposed in this study provide a new approach that can be confidently applied to the flood-control optimization of cascade reservoir systems.It is well known that the availability of the new proposed algorithm depends on the applicability and performance in

Figure 1 .
Figure 1.The flowchart of the procedure for determining optimal operation using the SAPSO algorithm.

Figure 1 .
Figure 1.The flowchart of the procedure for determining optimal operation using the SAPSO algorithm.

Figure 4 .
Figure 4. Operation hydrographs of Bashan Reservoir for the 31 July 1964 flood.

Figure 6 .
Figure 6.Operation hydrographs of Bashan Reservoir for the 13 August 1974 flood.

Figure 6 .
Figure 6.Operation hydrographs of Bashan Reservoir for the 13 August 1974 flood.

Figure 7 .
Figure 7. Convergence processes for the 31 July 1964 flood using the (a) SAPSO and (b) PSO algorithms.Figure 7. Convergence processes for the 31 July 1964 flood using the (a) SAPSO and (b) PSO algorithms.

Figure 7 .Figure 8 .
Figure 7. Convergence processes for the 31 July 1964 flood using the (a) SAPSO and (b) PSO algorithms.Figure 7. Convergence processes for the 31 July 1964 flood using the (a) SAPSO and (b) PSO algorithms.

Figure 8 .
Figure 8. Convergence processes for the 13 August 1974 flood using the (a) SAPSO and (b) PSO algorithms.

Figure 10 .
Figure 10.Outflow hydrographs for the 13 August 1974 flood using the SAPSO, PSO, and GA algorithms.

Figure 10 .
Figure 10.Outflow hydrographs for the 13 August 1974 flood using the SAPSO, PSO, and GA algorithms.

Table 1 .
Meanings and units of the parameters and variables.
i (t) Storage capacity of reservoir i at time t m 3 t' Time when the outflow from reservoir i arrives at reservoir i + 1 h V i (t) max Upper bound of the storage capacity of reservoir i at time t m 3 V i (t) min Lower bound of the storage capacity of reservoir i at time t m 3q i [V i (t)]Maximum outflow capacity of reservoir i when the storage capacity is V i (t) m 3 /s 2: Calculate the fitness value fitness j of each particle, and update the best historical position of the individual (Pbest j k ) and group (Gbest).Compare fitness j with Pbest j k ; if the objective function is used to find the minimum, when fitness j < Pbest j k , replace Pbest j k with fitness j , and when Pbest j k < Gbest, replace Gbest with Pbest j k ; if the objective function is used to find the maximum, when fitness j > Pbest j k , replace Pbest j k with fitness j , and when Pbest j k > Gbest, replace Gbest with Pbest j k .Step 3: Use the Boltzmann equation, Equation (8), to calculate the acceptance probability of Pbest j k at the current temperature T k as follows:

Table 2 .
Basic parameters of the two reservoirs.

Table 2 .
Basic parameters of the two reservoirs.

Table 4 .
Comparison of operating results for the 31 July 1964 flood.

Table 5 .
Comparison of operating results for the 13 August 1974 flood.
.5% and 13.5% compared with the measured value in the 31 July 1964 and 13 August 1974 floods,