## Abstract

The subtropical monsoon climate zone features abundant water resources but with uneven temporal and spatial distribution, so seasonal water shortages are frequent. In order to reduce the water shortage and water spill in this region, a nonlinear optimization model for the joint operation of a system of a reservoir and two pumping stations is developed in this paper. In this model, the water supply of the reservoir and pumping volume of the pumping stations in each period are two types of decision variables, which are subjected to the annual available water in the reservoir, water rights of the two pumping stations and the operation rule of the reservoir. However, modern intelligent algorithms may fail in dealing with constraints of if-statements like the operation rule of the reservoir in this model. In light of the shortcoming of the classical genetic algorithm, a modified genetic algorithm is proposed by comparing the different methods for dealing with constraints. The modified algorithm shows a better adaptability to the operation rule. The modified genetic algorithm may provide a reference for similar modern intelligent algorithms to solve optimal water resources allocation for systems of multiple reservoirs and multiple pumping stations.

## HIGHLIGHTS

A modified method for the genetic algorithm is proposed to solve the optimal water allocation model for a system of reservoir and pumping stations.

The method can deal with the constraints of if-statements.

The method shows a better adaptability to the operation rule of a reservoir, compared with other methods.

## INTRODUCTION

In recent years, many scholars have conducted research on theories and methods for the optimal water allocation of reservoirs (Taghian *et al.* 2014; Kumari & Mujumdar 2015; Ahmad *et al.* 2018; Khosrojerdi *et al.* 2019; Zarei *et al.* 2019). The dynamic programming method, which has good applicability in multi-stage decision-making processes, has been widely used in the optimization of reservoir operation (Shi *et al.* 2015; Zhao *et al.* 2017; Gong *et al.* 2019; Ma *et al.* 2020). However, dynamic programming may cause the ‘curse of dimensionality’ in complicated multidimensional problems (Ahmad *et al.* 2014; Yang *et al.* 2016; Ji *et al.* 2017). The genetic algorithm, a typical meta-heuristic algorithm, features outstanding global searching capability and strong robustness (Ngoc *et al.* 2014), so it has been extensively applied in optimizing the operation of reservoirs.

However, the genetic algorithm has shortcomings such as the existence of the premature phenomenon and a slow rate of convergence. Therefore, many scholars have tried to improve this algorithm. An adaptive genetic algorithm with simulated binary crossover was proposed by Han *et al.* (2012). To solve the complex self-adaptive GA (genetic algorithm)-aided multi-objective ecological reservoir operation model, an improved self-adaptive GA (Hu *et al.* 2014) was employed through incorporating simulated binary crossover and self-adaptive mutation. Then an improved nondominated sorting genetic algorithm II (NSGA-II) algorithm was developed by considering variables' sensitivity to improve its search efficiency (Xu & Chen 2020). What is more, it is reported that combined or hybrid genetic algorithm techniques show better results than simply the genetic algorithm (Hossain & El-Shafie 2013). Therefore, the combination of the genetic algorithm and other algorithms is also widely used for the optimal water allocation of reservoirs. Ehteram *et al.* (2017) proposed a new hybrid algorithm by merging the genetic algorithm with the krill algorithm. Azizipour & Afshar (2017) proposed an adaptive hybrid genetic algorithm and cellular automata method for solving implicit stochastic optimization of reservoir operation problems. Rani & Srivastava (2016) proposed the DP–GA (dynamic programming and genetic algorithm) approach, which was found to outperform both GA and DP in terms of lower computational requirement and the quality of the solution, respectively.

At present, the improvements of the genetic algorithm mainly concentrate on modifications of individual coding methods, selection operators, crossover operators and mutation operators, but rarely make efforts in the modification of iterative processes. Moreover, modern intelligent algorithms, such as the genetic algorithm and particle swarm algorithm, have difficulty in solving optimization problems with equality constraints and constraints of if-statements, because of the limit of random sampling (Birhanu *et al.* 2014; SaberChenari *et al.* 2016). However, in an optimization model of a reservoir, the water balance function is a typical equality constraint while the operation rule of the reservoir is a typical constraint of if-statements, both of which are inevitable.

A nonlinear optimization model for the joint operation of a reservoir and two pumping stations was developed in this study for the purpose of minimizing the water shortage. According to the characteristics of this nonlinear optimization model, different iterative procedures with different fitness functions based on the principle of the genetic algorithm were established and compared with each other.

## METHODOLOGY

### Generalization of the system

The system of a reservoir and two pumping stations is commonly used in the hilly regions of southern China and south-east Asia, which is shown in Figure 1. In the system, the reservoir provides water for the irrigation area and the replenishment pumping station lifts water from the outside river to replenish the reservoir, while the irrigation pumping station lifts water from the inside river directly for irrigation through canals. The conjunctive utilization of local runoff, transit runoff and irrigation return flow can be realized through the joint operation of this system.

In the figure: is the water supply of the reservoir for irrigation in period *i*, is the pumping volume of the irrigation pumping station in period *i*, is the pumping volume of the replenishment pumping station in period *i*, is the water demand of irrigation in period *i*, is the inflow of the reservoir in period *i*, is the water spill of the reservoir in period *i*, and is the evaporation of the reservoir in period *i*.

### Mathematical model

#### Objective function

*F*is the sum of the squared water shortage,

*N*is the total number of periods, and

*i*is the period number (

*i*= 1, 2,…,

*N*).

#### Constraints

- (1)
- (2)
- (3)
- (4)
Operation rule of the reservoir

*i*, is the lower bound of water storage in period

*i*, and is the upper bound of water storage in period

*i*.

### Genetic algorithm

The genetic algorithm is adopted to solve the above model and the basic procedure is that of generating the initial populations and then carrying out iterative calculations through selection, crossover and mutation operations until the termination criterion is met. In this study, three types of methods to deal with the constraints are compared when using the genetic algorithm, which include the penalty function method, the limited search space method and the modified method proposed in this paper.

#### Penalty function method

The penalty function method (Knypiński 2019) is to select , , and as iteration variables. The feasible ranges for , , and are [0, ], [0, ], [0, ] and [0, ], respectively. This method uses the penalty functions to deal with the constraints, transforming a constrained problem into an unconstrained one. Furthermore, the lower and upper bounds of the water storage of the reservoir in each period should be satisfied by introducing the penalty functions as Equations (14) and (15):

#### Limited search space method

#### Modified method

Unlike the penalty function method and the limited search space method, the modified method is only to select and as iteration variables. The feasible ranges of and are [0, ] and [0, ], respectively. The other two variables, and , can be derived in the iteration processes according to the operation rule of the reservoir. The specific steps of the modified method are as follows:

- (1)
Set parameters including crossover rate and mutation rate;

- (2)
Randomly initialize the populations which consist of and ;

- (3)Determine the and according to the operation rule of the reservoir: the temporary water storage of the reservoir can be calculated using Equation (20), without considering the water replenishment and water spill
*PS*._{i}

In each iteration, this method checks the water storage of the reservoir at the end of each period, and determines the value of water replenishment and spill according to the operation rule. So there is no need to establish the constraint penalty functions for the constraint of the operation rule.

- (5)
Seek the optimal solution: If , then .

- (6)
Enter the next generation after selection, crossover and mutation operations and repeat steps (3)–(5) until the termination condition is met.

The specific procedure is shown in Figure 2.

In the figure: *V*_{0} is the initial water storage, *G* is the number of iterations, *L* is the size of the population, *M* is the number of genes, *a* is the crossover rate, and *b* is the mutation rate.

## CASE STUDY

The optimization model developed in this study was applied in the system of Pingshan reservoir, East-Pingshan pumping station and West-Pingshan pumping station, which is located in the Liuhe district of Nanjing, China, as shown in Figure 3.

The main function of the system is to supply irrigation water. In the system, the Pingshan reservoir and East-Pingshan station directly supply water for the irrigation area while the West-Pingshan station replenishes the Pingshan reservoir with water before the water level of the reservoir goes below the lower boundary limit. The main characteristics of Pingshan reservoir, West-Pingshan station and East-Pingshan station are shown in Tables 1 and 2.

Dead storage capacity (10^{4} m^{3})
. | Active capacity (10^{4} m^{3})
. | Catchment area (km^{2})
. | Irrigation area (hm^{2})
. |
---|---|---|---|

50 | 120 | 7.59 | 0.77 |

Dead storage capacity (10^{4} m^{3})
. | Active capacity (10^{4} m^{3})
. | Catchment area (km^{2})
. | Irrigation area (hm^{2})
. |
---|---|---|---|

50 | 120 | 7.59 | 0.77 |

Name . | Design flow (m^{3}/s)
. | Annual total pumping water volume (10^{4} m^{3})
. | Operating hours (h/d) . |
---|---|---|---|

East-Pingshan station | 0.48 | 200 | 22 |

West-Pingshan station | 0.70 | 200 | 22 |

Name . | Design flow (m^{3}/s)
. | Annual total pumping water volume (10^{4} m^{3})
. | Operating hours (h/d) . |
---|---|---|---|

East-Pingshan station | 0.48 | 200 | 22 |

West-Pingshan station | 0.70 | 200 | 22 |

The operation cycle of the system in this study is one year, which is divided into 20 periods: the flood season from June to September is also the peak period of irrigation for paddy fields, which is divided by ten days, and the rest of the year is divided into monthly periods. The data of inflow, evaporation and water demand of each period at the 50% (median water supply) and 75% (general drought year) probability of exceedance are shown in Tables 3 and 4, respectively. In addition, because the annual variation of evaporation is small, this paper uses annual average evaporation in the calculation.

Period . | Oct. . | Nov. . | Dec. . | Jan. . | Feb. . | Mar. . | Apr. . | May . | Early . | Mid . | . |
---|---|---|---|---|---|---|---|---|---|---|---|

Jun. . | Jun. . | ||||||||||

Inflow | 14 | 30 | 11 | 2 | 10 | 13 | 10 | 23 | 8 | 36 | |

Evaporation | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 1 | |

Water demand | 21 | 33 | 2 | 1 | 2 | 5 | 7 | 19 | 8 | 118 | |

Period . | Late . | Early . | Mid . | Late . | Early . | Mid . | Late . | Early . | Mid . | Late . | Total . |

Jun. . | Jul. . | Jul. . | Jul. . | Aug. . | Aug. . | Aug. . | Sep. . | Sep. . | Sep. . | ||

Inflow | 7 | 22 | 16 | 17 | 21 | 12 | 14 | 5 | 11 | 4 | 286 |

Evaporation | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 31 |

Water demand | 29 | 57 | 49 | 73 | 69 | 45 | 41 | 7 | 1 | 5 | 592 |

Period . | Oct. . | Nov. . | Dec. . | Jan. . | Feb. . | Mar. . | Apr. . | May . | Early . | Mid . | . |
---|---|---|---|---|---|---|---|---|---|---|---|

Jun. . | Jun. . | ||||||||||

Inflow | 14 | 30 | 11 | 2 | 10 | 13 | 10 | 23 | 8 | 36 | |

Evaporation | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 1 | |

Water demand | 21 | 33 | 2 | 1 | 2 | 5 | 7 | 19 | 8 | 118 | |

Period . | Late . | Early . | Mid . | Late . | Early . | Mid . | Late . | Early . | Mid . | Late . | Total . |

Jun. . | Jul. . | Jul. . | Jul. . | Aug. . | Aug. . | Aug. . | Sep. . | Sep. . | Sep. . | ||

Inflow | 7 | 22 | 16 | 17 | 21 | 12 | 14 | 5 | 11 | 4 | 286 |

Evaporation | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 31 |

Water demand | 29 | 57 | 49 | 73 | 69 | 45 | 41 | 7 | 1 | 5 | 592 |

Period . | Oct. . | Nov. . | Dec. . | Jan. . | Feb. . | Mar. . | Apr. . | May . | Early . | Mid . | . |
---|---|---|---|---|---|---|---|---|---|---|---|

Jun. . | Jun. . | ||||||||||

Inflow | 9 | 26 | 8 | 0 | 8 | 11 | 8 | 20 | 2 | 32 | |

Evaporation | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 1 | |

Water demand | 26 | 39 | 3 | 3 | 3 | 4 | 5 | 12 | 3 | 122 | |

Period . | Late . | Early . | Mid . | Late . | Early . | Mid . | Late . | Early . | Mid . | Late . | Total . |

Jun. . | Jul. . | Jul. . | Jul. . | Aug. . | Aug. . | Aug. . | Sep. . | Sep. . | Sep. . | ||

Inflow | 0 | 19 | 9 | 15 | 13 | 11 | 11 | 2 | 11 | 0 | 215 |

Evaporation | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 31 |

Water demand | 33 | 61 | 55 | 84 | 76 | 55 | 53 | 10 | 2 | 7 | 656 |

Period . | Oct. . | Nov. . | Dec. . | Jan. . | Feb. . | Mar. . | Apr. . | May . | Early . | Mid . | . |
---|---|---|---|---|---|---|---|---|---|---|---|

Jun. . | Jun. . | ||||||||||

Inflow | 9 | 26 | 8 | 0 | 8 | 11 | 8 | 20 | 2 | 32 | |

Evaporation | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 1 | |

Water demand | 26 | 39 | 3 | 3 | 3 | 4 | 5 | 12 | 3 | 122 | |

Period . | Late . | Early . | Mid . | Late . | Early . | Mid . | Late . | Early . | Mid . | Late . | Total . |

Jun. . | Jul. . | Jul. . | Jul. . | Aug. . | Aug. . | Aug. . | Sep. . | Sep. . | Sep. . | ||

Inflow | 0 | 19 | 9 | 15 | 13 | 11 | 11 | 2 | 11 | 0 | 215 |

Evaporation | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 31 |

Water demand | 33 | 61 | 55 | 84 | 76 | 55 | 53 | 10 | 2 | 7 | 656 |

Using the genetic algorithm, the three aforementioned methods for dealing with the constraints, including the penalty function method, the limited search space method and the modified method, were adopted to solve this nonlinear optimization model for the joint operation of a reservoir and two pumping stations. The value of the penalty factor () was 50. The value of initial water storage (*V*_{0}) was 110 (10^{4} m^{3}). And the values of GA parameters were as follow: the number of iterations (*G*) was 500, the size of the population (*L*) was 100, the number of genes (*M*) was 20, the crossover rate (*a*) was 0.6, and the mutation rate (*b*) was 0.05.

## RESULTS AND DISCUSSION

As shown in Table 5, both the penalty function method and the modified method could obtain the final objective function value, but the limited search space method failed. This was because when the limited search space method was used to handle the constraints, each population of the genetic algorithm required repeated crossover and mutation operations to produce a set of feasible solutions that met the constraints, instead of only performing crossover and mutation once per generation.

Probability . | Methods . | Objective function value . | Water shortage (10^{4} m^{3})
. | Water spill (10^{4} m^{3})
. |
---|---|---|---|---|

50% | Penalty function method | 37 | 21 | 113 |

Modified genetic algorithm | 4 | 4 | 6 | |

75% | Penalty function method | 169 | 43 | 19 |

Modified genetic algorithm | 114 | 28 | 0 |

Probability . | Methods . | Objective function value . | Water shortage (10^{4} m^{3})
. | Water spill (10^{4} m^{3})
. |
---|---|---|---|---|

50% | Penalty function method | 37 | 21 | 113 |

Modified genetic algorithm | 4 | 4 | 6 | |

75% | Penalty function method | 169 | 43 | 19 |

Modified genetic algorithm | 114 | 28 | 0 |

From Table 5, it is indicated that the modified method is significantly better than the penalty function method from the perspective of the final optimal results. At the 50% probability of exceedance, the total water shortage obtained with the modified method is reduced by 80.9% and the total water spill is reduced by 94.7% compared against the penalty function method. At the 75% probability of exceedance, the total water shortage obtained with the modified method is reduced by 34.9% and the total water spill is reduced by 100% compared against the penalty function method. This is because the modified method makes full use of the storage capacity of the reservoir and reduces the pumping water of the pumping station, thereby reducing the water spill.

The inappropriate situation that the water replenishment and spill occurs at the same period, appeared in the operation processes obtained with the penalty function method as shown in Figures 4 and 5. However, this kind of water replenishment and spill is unacceptable in the actual reservoir management. The traditional genetic algorithms including the penalty function method and search space limitation method select *X _{i,} Y_{i,} Z_{i}* and

*PS*as iteration variables. Before the iteration, all the iteration variables are generated, and then the water storage is calculated according to the water balance equation. Therefore, it is difficult to meet the constraints of if-statements like the operation rule of the reservoir, and the unreasonable situation that the water replenishment and spill will occur at the same time.

_{i}Different from traditional genetic algorithms, the modified genetic algorithm selects *X _{i}* and

*Y*as iteration variables, reducing the model dimension from four dimensions to two dimensions. What is more, when dealing with the constraint of the operation rule of the reservoir, the modified genetic algorithm calculates the temporary water storage according to Equation (20) first, and then determines the volume of water replenishment and spill according to Equations (9)–(13), and finally revises water storage. Therefore, the modified genetic algorithm can avoid unreasonable water replenishment and spill. As a result, this method shows better adaptability to the operation rule as well as solving the problem with equality constraints and constraints of if-statements which traditional genetic algorithms cannot solve.

_{i}## CONCLUSION

This paper proposes a nonlinear optimization model for the joint operation of a system of a reservoir and two pumping stations. One such system in Nanjing, China, was selected for a case study. It compares the impact on results between the traditional genetic algorithm which uses the penalty function and limited search space method to deal with the constraints and the modified genetic algorithm which uses the water supply and the water volume of the irrigation pumping station as the iteration variables. The results show that the modified genetic algorithm reduces water spill and water shortage, and solves the constraints of if-statements like the operation rule of the reservoir.

## ACKNOWLEDGEMENT

This work was supported by the National Natural Science Foundation of China (NSFC) [grant number 52079119].

## DATA AVAILABILITY STATEMENT

All relevant data are included in the paper or its Supplementary Information.