Short-Term Hydro Generation Scheduling of the Three Gorges Hydropower Station Using Improver Binary-coded Whale Optimization Algorithm

The short-term hydropower generation scheduling (STHGS) is a complicated problem in the utilization of hydropower and water resources. An improved binary-coded whale optimization algorithm (IBWOA) is proposed in this paper to solve the complex nonlinear problem. The STHGS problem is divided into unit combination (UC) subproblem and economic load distribution (ELD) subproblem. For the UC subproblem, we use the sigmoid function (SF) to generate a binary array representing the start/stop state of the unit. The whale algorithm's search mechanism is optimized, and the inertia weight and perturbation variation strategy are introduced to improve the algorithm's optimization ability. Each generation solution is optimized by repairing the minimum uptime/downtime constraint and the spinning reserve capacity constraint. For ELD subproblem, the optimal stable load distribution table (OSLDT) is used to distribute the load quickly. The Mutation mechanism and the Locally balanced dynamic search mechanism compensate for the non-convex problems caused by start-stop constraints and stable optimal table methods. Finally, the proposal is applied to solve the STHGS of the Three Gorges Hydropower Station. When the water head is 75 m,88 m, and 107 m, the minimum water consumption calculated by the IBWOA algorithm is 1,058,323,464 m3, 892,524,696 m3, and 745,272,216 m3, respectively. Compared with the traditional whale optimization algorithm, the water consumption of the IBOWA algorithm corresponding to 75 m, 88 m, and 107 m water heads is reduced by 0.76%, 0.26%, and 0.05%, respectively. The comparison between the IBWOA algorithm and other heuristic algorithms shows that the IBWOA has good feasibility and high optimization accuracy.


Introduction
Hydropower stations have a lot of benefits to society and economy (Yi et al. 2019). A fair distribution of a load of hydropower units can increase the power generation and protect unit components' long-term stability. The purpose of short-term hydropower generation scheduling (STHGS) is to minimize the total water consumption of the unit and the startup/ shutdown costs of the unit while meeting the grid demands and other hydropower constraints. The STHGS is a complicated problem that mainly includes two parts (Peng et al. 2015): one is the external unit combination (UC) sub-problem (Amani et al. 2021), the other is the internal economic load distribution(ELD) sub-problem. The process to solve the UC problem is to formulate the start-stop rules for the unit and to open/close the unit under specific load requirements according to the characteristics of the unit (Li et al. 2018). The UC sub-problem needs to avoid frequent on/off operations, which can reduce the water consumption in the process of starting and closing the hydropower unit (Nilsson and Sjelvgren 1997). The process to solve the ELD problem is to allocate the load to the starting unit to obtain the minimum water consumption under the condition that the total load meets the requirements. The total water consumption of hydropower stations is minimized by considering the proper online and offline dispatching of each unit, the reasonable distribution of each operating unit's load, and the constraints of various equations and inequalities. (Wood and Wollenberg 1996). The operation of hydropower stations needs to meet a series of complex constraints, such as power balance constraints, unit operating conditions constraints, spinning reserve capacity constraints, and minimum uptime/downtime constraints (Finardi and Scuzziato 2013;Mohanta et al. 2017).
A variety of mathematical methods have been developed to solve the STHGS problem. Traditional algorithms include lagrangian relaxation (LR) (Cheng et al.2000), linear programming (LP) (Jabr et al. 2000), nonlinear programming (Pericaro et al. 2020), and dynamic programming (DP) (Pérez-Díaz et al. 2010;Zeng et al. 2019). However, these methods have some disadvantages in solving the STHGS problem. LR is challenging to find suitable Lagrange multipliers. LP is inefficient and cannot handle complex STHGS problems with nonlinear constraints. Although DP can find the optimal scheduling table of the STHGS problem, it suffers from the ''curse of the dimensionality'' when facing largescale units and multiple time scales (Zhao et al. 2012). Incremental dynamic programming algorithm(IDP) (Jukna 2014) and progressive optimality algorithm (POA) (Feng et al. 2018) can overcome this shortcoming; however, these algorithms require convex objective functions (Lu et al. 2013).
In order to deal with the complex problem of multi-constraint nonlinearity, a variety of heuristic optimization algorithms have been proposed. These are genetic algorithm (GA) (Bukhari et al. 2016), particle swarm optimization (PSO) (Fakhar et al. 2015), ant colony optimization (ACO) (Shi et al. 2004;Vaisakh et al. 2011), bee colony optimization (BCO) (Peng et al. 2015), and bat algorithm (BA) (Su et al. 2019;Ivanov et al. 2019). These algorithms have better performance than traditional mathematical methods in computational precision, efficiency, and reliability. However, GA suffers from high randomness and blindness and can easily produce premature phenomena (Shang et al. 2019). The ant colony algorithm can be combined with an equal incremental method (Hu et al. 2012), but the disadvantage of this method is that with the increase of hydropower units and parameter settings, the calculation speed becomes slower, and the algorithm is easy to converge prematurely. Wu (2015) adopt improver discrete particle swarm optimization (DPSO) to solve the UC problem, but the increase in the number of hydropower units would also lead to low global convergence efficiency. Hu et al. (2019) proposed social spider optimization (SSO), and Yang et al. (2020) proposed a discrete shuffled frog leaping algorithm(DSFLA) for solving STHGS. However, these algorithms require many parameters, which are more difficult to optimize in complex STHGS. Therefore, it is of great significance to propose a novel heuristic algorithm with high convergence accuracy and small parameter dependence to solve the STHGS problem.
Whale optimization algorithm(WOA) was proposed in 2016 (Mirjalili and Lewis, 2016). It has been applied in many different fields in recent years due to its advantages, such as fewer parameters, strong optimization ability, and fast optimization speed. Many improvements to WOA have proved effective. The global shrinkage probability is proposed to improve the search mechanism and avoid the local optimum (Tian et al. 2020). Nonlinear adaptive weight is introduced to improve the convergence speed of the algorithm (Zhang et al. 2020). In this paper, An improved binary-coded whale optimization algorithm (IBWOA) is proposed to solve the STHGS problem. The whale algorithm's search mechanism is improved, and the nonlinear inertia weight is introduced. For the UC problem, the improved sigmoid function is used to obtain the binary array of 0-1 to represent the start/ stop state of the unit. The UC subproblem is solved by repairing the minimum uptime/ downtime constraint and the spinning reserve capacity constraint. The ELD subproblem is solved by the stable optimal table obtained from a dynamic programming method. Finally, the locally balanced dynamic search mechanism is proposed to optimize the local solution and get the final load allocation scheme. In this paper, IBWOA is applied to the Three Gorges Hydropower Station, and the comparison with other algorithms shows that IBWOA has high effectiveness and feasibility.
The rest of this paper is organized as follows: Sect. 2 introduces the constraints and formulation of the economic operation model; Sect. 3 introduces the basic concepts of the WOA algorithm; Sect. 4 analyzes the shortcomings of the WOA algorithm and makes corresponding improvements; Sect. 5 constructs IBWOA to deal with STHGS problem; Sect. 6 takes Three Gorges Hydropower Station as an example for case application; Finally, conclusions are drawn in Sect. 7.

Objective Function
The emphasis of economic operation in hydropower stations is the optimal distribution of load. It means that load requirements should be formulated according to the user's electricity consumption, and reasonable load distribution of the unit should be formulated on the premise of safety to find the minimum water consumption of power generation. The formula is as follows: where W denotes total water consumption of power generation; Q i,t (H i,t , P i,t ) denotes the outflow of ith unit at time t when the output is P i,t and the water head is; u i,t and u i,t−1 are the online/offline state of the ith unit at time t and t-1, respectively; Q up i and Q down i are the water consumption of the ith unit when the unit startup and stop, respectively; Δt is the time interval; I is the total number of units; T is the total number of time; (1)

Constraints Condition
(1) Power balance constraint where Pd t is the load conditions undertaken by a hydropower station; P i,t and u i,t are output and the online/offline state of the ith unit at time t, respectively.
(2) Power generation limits constraint where N i,min and N i,max are the lower and upper output bounds of the ith hydropower unit, respectively.
(3) Spinning reserve constraint where LR min t and LR max t signify lower limit and upper limit of the spinning reserve capacity at time t, respectively.
(4) Minimum uptime/downtime constraint where T on i,t and T off i,t are the duration of uptime/downtime that the ith hydropower unit, respectively; T up i and T down i the shortest time limits of startup and shutdown that the ith hydropower unit, respectively.

Traditional WOA
The traditional WOA algorithm simulates the predation behavior of humpback whales. Humpback whales hunt their prey in three ways: search for prey, encircling prey, and bubble-net attacking method. The search for prey method means that one whale is randomly selected as the target, and all the whales are close to it so that the whale can hunt for its prey in a wide range. The encircling prey method means that all whales move towards individuals with the highest fitness, allowing all whales to approach their prey quickly. The bubble net attack method means that all whales move in a spiral direction toward their prey, which allows them to search all areas around their prey. Mathematical models of the three behaviors are established as follows:

Encircling Prey
The formula is as follows: (2) where t is the number of current iterations, M is the maximum number of iterations; X * (t) is the best individual in the current population; X(t) is the location of individual whales, r is random numbers between 0 and 1; a is parameters between 2 and 0.

Bubble-Net Attacking Method
Humpback whales feed by spiraling, and the formula is as follows: where D is the difference between the current individual and the optimal solution; b is control parameters; l is random Numbers between -1 and 1.

Search for Prey
The formula is as follows: where X rand is randomly selected individuals. If A ≥ 1 , all whales move randomly toward anyone whale. This method can make the algorithm escape from the current optimal solution temporarily.

Improved Search for Prey
The optimization ability of the algorithm is guaranteed due to three predation behaviors of WOA. However, these three behaviors affect each other. When the weight of the search for prey is larger, the convergence efficiency of the algorithm is lower. This algorithm will be precocious if the weights of the other two methods increase. These are not conducive to the global optimization of the algorithm.
According to the calculation formula, the whale algorithm will stop the search for prey mode when t is 2/M. However, the search for prey method and the encircling prey method would be equally weighted if we set the condition that A = 0. This method will make the algorithm lose optimization efficiency. So the improved search for prey condition theory is proposed. The formula is as follows: where q is search for prey probability; q 1 and q 2 are the maximum and minimum probability of search for prey, respectively, and q 1 ≥ q 2 ≥ 0.5 . A random number p in [0, 1] is generated during the algorithm operation. The value of A determines whether to conduct the search for prey when p < 0.5 . Otherwise, calculate q according to the number of iterations, and whales conduct the search for prey when p ≥ q . This method ensures that the algorithm has global search capability over the whole period.

Adaptive Nonlinear Inertia Weight
A standard method to improve intelligent optimization algorithms is inertia weight. This method can balance the early global optimization ability and the algorithm's late local optimization ability by changing the search space. The traditional inertia weight method makes the search space decrease linearly, but the optimization effect is usually not ideal. Therefore, an adaptive nonlinear inertia weight is proposed. The formula is as follows: where w 1 and w 2 are the maximum and minimum values of the weight parameters; X * (t) is the best individual position; X(t + 1) is the updated position of the individual.

Mutation Mechanism
WOA already has good search efficiency and few parameter requirements. The above adaptive inertia weight and the improved search for prey strategy have effectively balanced the algorithm's development and mining process. However, the two results obtained by the sigmoid function transform may have high fitness when solving a 0-1 problem. The STHGS problem is a complex problem with multiple constraints, so several steps follow to handle the conditions, which can cause the solution to be non-convex. A mutation mechanism is designed to increase the population diversity to avoid the algorithm falling into the local optimum. The mutation mechanism is designed to exchange all genes of the two mutation points (genes represent the unit's on-off schedule). This method does not violate the constraints and increases the diversity of the population, which avoids the algorithm falling into the local optimum. The formula is as follows: where M is the variables used for temporary storage; X t i 1 ,j and X t i 2 ,j represent the value of population j, time t, unit i 1 , and unit i 2 , respectively. A variation rate k p is set before the calculation. A random number between 0 and 1 is calculated for each unit after each iteration. If the random number is less than k p , the values of the unit at all times are exchanged with another random unit.

Adaptive Binary-Coded Theory
The UC subproblem is a discrete 0-1 assignment problem, but WOA is suitable for continuous space solutions. Therefore, an improved sigmoid function converts the value of the whale to 0 or 1 according to its probability. The formula is as follows: where y k i is the value corresponding to x k i , which ranges in [0, 1]; rand is the random number in [0, 1].

Introduction of IBWOA for the UC Sub-Problem
According to the analysis in Sect. 4.4, the solution needs to be binary encoded. The real value of the solution is mapped between 0 and 1 according to Eq. (19). The unit state is set to 0 or 1 according to Eq. (20). The matrix representation of the solution is as follows: where X k i is the value of whale; U k i is the start/stop state of the unit.

The Method for UC Sub-Problem
It is challenging to obtain feasible solutions if no constraints are imposed. Thus, two repair mechanisms are used, one is the minimum uptime/downtime constraint, and the other is the spinning reserve capacity constraint. The result of the algorithm is always a feasible solution by using these two repair mechanisms to be optimized within the feasible region.

A Repair Strategy for Minimum Uptime/Downtime Constraint
Because the algorithm's binary results in each iteration are random, each iteration is likely to break the minimum uptime/downtime constraint. Therefore, a minimum uptime/downtime repair strategy is proposed. In this method, the unit which can not meet the constraint will be forced to change its state to obtain the feasible solution that meets the requirement. As shown in Fig. 1, we set the minimum uptime/downtime time to 2 h. After the repair method, array (a) will be converted to array (b). Those units that can not meet the minimum uptime/downtime constraint are forced to change their states by Eq. (22). Otherwise, their states are updated by Eq. (23).
where rand is the random number between 0 and 1. If the rand is less than 0.5, start the unit. Otherwise, close the unit.

A Repair Strategy for Spinning Reserve Capacity Constraint
When the state of the unit is changed, the spinning reserve capacity constraint may be violated. Therefore, the priority list of unit startup/shutdown and dynamic repairing techniques are used to solve this problem. First, the hydropower units' priority table is determined according to the average water consumption in the stable operation region. The calculation formula of the average water consumption is as follows: where W i is the average water consumption of ith unit; L is the discrete number of stable operation region; P l is the load at the lth discrete point; Q i P l is the water consumption when the load is P l .
In the IBWOA algorithm, if the unit cannot meet the spinning reserve constraint after the uptime/downtime constraint is repaired, the spinning reserve constraint is repaired according to the following rules: Fig. 1 Minimum uptime/downtime constraint mechanism diagram Step 1: The load capacity of all of the committed units in each period is calculated, and the unit is checked whether it meets the current spinning reserve constraint according to Eq. (4).
Step 2: If the online unit's total output is greater than the sum of the power demand and the maximum spinning reserve capacity, the committed units that meet the minimum uptime time are searched in order according to the priority list of unit startup/shutdown. These committed units should be shut down until the load requirements are met.
Step 3: If the online unit's total output is less than the sum of the power demand and the minimum spinning reserve capacity, the uncommitted units that meet the minimum shutdown time are searched in reverse order. Then these uncommitted units should be opened until the load requirements are met.
Step 4. Suppose there is no unit meeting the minimum uptime/downtime time after the search. In that case, the corresponding unit is forcibly opened/shutdown to force the hydropower station to meet the spinning reserve constraint.

OSLDT for ELD Sub-Problem
The OSLDT is used to solve the problem of economic load distribution. The OSLDT is the optimal load distribution schedule calculated under a specific load requirement. However, it takes much time to solve the load distribution, and the constraint is very complicated when we combine the UC problem. In order to simplify the calculation, the OSLDT obtained by dynamic programming(DP) under cavitation vibration is prepared, which significantly improves the quality of the solution and reduces a lot of calculation time.

The Establishment of OSLDT
The OSLDT is formulated by the DP. When the assigned load is in the unstable operating zone of the unit, a large penalty function value is applied to avoid the distribution of output in this zone. The minimum water consumption and distribution scheme of each given load is recorded, and the stable optimal scheduling table is obtained. The state transfer equation is shown as follows: where Np i is the total output of ith; Zp i is the decision variable denoting output of new startup unit at the ith stage. The recursive equation of the ELD is shown as follows: where ZQ Np i refers the total water consumption of all of the online units when the total output is Np i ; Q i Zp i refers the water consumption of the new startup unit at stage I; c i is unit stable operation region. (25)

Distribution of Load
The stable optimal table is formulated by the dynamic programming method. The minimum water consumption and distribution scheme of each given load is recorded, and the stable optimal scheduling table is obtained.
where Nz j (k) represents the sum of loads allocated by the kth row stable optimal table for current scheduling in the jth period; Np i (k) represents the ith unit load in the stable optimal table at row k; P j i represents the load distribution of unit i in the jth period. N j de represents the total load required for the jth period.

Locally Balanced Dynamic Search Mechanism
Scheduling table satisfying load constraint can be solved quickly according to OLDT, and the obtained solution has high fitness, but the results may not be globally optimal. So the load of the unit still needs to be redistributed after the two repair strategies. When the load constraint is satisfied, the locally balanced dynamic search mechanism is used to optimize the load distribution. The formula is set up as follows: where Q s (i, j) represents the sum of the water consumption calculated by reducing the ith unit by one unit and adding the j unit by one unit; N i and N j represent the load of unit i and unit j, respectively; Q plan (i) represents the minimum water consumption that can be optimized by one unit of unit i.
The steps are as follows: 1. The first online unit in the unit sequence is found, and the load of the unit is increased by 1 unit. 2. Another online unit is found. In the unit sequence, the load of this unit is reduced by 1 unit. The water consumption of this scheduling plan is calculated and denoted as Q s (1,1) . 3. The previous unit is restored, and the next unit is found in the unit sequence. The load of the selected unit is reduced by 1, the water consumption of the scheduling scheme is calculated, which is denoted as Q s (1,2). 4. All online units are searched in the same way, and the option with the minimum water consumption is selected, denoted as Q plan (1).
5. All units are traversed to optimize step by step to get the minimum water consumption optimized for that stage 6. Scheduling table with minimum water consumption has been updated. 7. This method is applied continuously until the optimal load allocation table is obtained.

The Flowchart of IBWOA for STHGS
The IBWOA is applied to solve STHGS problems. The flowchart is shown in Fig. 2.   Fig. 2 The flowchart of the IWOA for solving the STHGS problem 6 Case Study

Introduction of Three Gorges Hydropower Station
The Three Gorges Hydropower Station is the largest hydropower station in the world. The number of units in this station is many and various, and the combination methods of unit operating conditions are also various. Therefore, the STHGS problem of the Three Gorges Hydropower Station is a representative high-dimensional nonlinear combinatorial optimization problem. There are 26 mixed-flow generators at the Three Gorges Hydropower Station. All of them have a maximum load is 700 MW. The five types of hydroelectric units have a total installed capacity of 18,200 MW. Table 1 shows the types and operation regions of each unit. Figure 3 shows the characteristic flow curves of five hydro units under 75 m, 88 m, and 107 m water heads.

Algorithm Parameter Setting
The STHGS was calculated by GA, PSO, ACO, WOA, and IBWOA, and each algorithm was running 20 times. The 75 m, 88 m, and 105 m represent the low, medium, and high water heads of the Three Gorges Hydropower Station. The general parameters of the algorithm are set as follows: the entire population number N e = 100 , the number of species per population N s = 26 , the maximum number of iterations M = 80. After 80 iterations of all the algorithms, the locally balanced dynamic search mechanism is used to iterate for the next 20 iterations. The parameters of different algorithms are set as follows: for GA, mutation rate p c =0.08 , crossover rate p c =0.9 ; for PSO, inertia weight w 1 =1 , w 2 =0.1 , learning factor c 1 = 1 , c 2 = 1 ; for ACO, initial pheromone Ap 1 =0.1 , pheromone volatilization rate =0.4 , parameter = 1 , parameter = 1 ; for WOA, b=2 ; for IBWOA, constant b=2 ; inertia weight Ww 1 =1 , Ww 2 =0.1 , random probability q 1 = 0.95 , q 2 = 1 , perturbation variation probability P m = 0.01.

Simulation Results and Discussion
The Proposed IBWOA algorithm was run 20 times in the STHGS model of the Three Gorges Hydropower Station. The schedule table is shown in Table 2. According to the data in Table 2, the opening or closing time of all units is greater than or equal to 4 h, which means that the repair strategy for minimum uptime/downtime has constrained the working hours of the unit. Meanwhile, the load distributions of these units are all greater than the minimum load of the stable operation region, which means that the load distribution of these units is in the stable operation region. Thus, the problem of unsatisfied output can be solved by using spinning reserve capacity constraints. These results prove two repair methods are effective.
To verify the effectiveness of the proposed IBWOA algorithm, GA, PSO, ACO, WOA, and IBWOA were run 20 times independently to solve the STHGS model. The parameter setting is shown in Sect. 6.2. Figure 4 shows the convergence characteristics of GA, PSO, ACO, WOA, and IBWOA under different water heads. The results of different algorithms are shown in Table 3. The convergence curves of different algorithms are shown in Fig. 4. As shown in Fig. 4, the water consumption calculated by IBWOA is smaller than that obtained by other algorithms under the three water heads. When the water head is 75 m, it is evident that the total water consumption of IBWOA descends fast in the preceding phase, and the calculated water consumption is the lowest. When the water head is 88 m or 107 m, the convergence rate of IBWOA, WOA and ACO are similar at the early stage of iteration. However, after 50 iterations, the total water consumption of ACO and WOA does not descends, while IBWOA is still optimized to get better results.
According to Table 3, The results show that the minimum water consumption corresponding to 75 m, 88 m and, 107 m water heads is 1,058,323,464 m 3 , 892,524,696 m 3 , 745,272,216 m 3 , respectively. Compared with the traditional WOA algorithm, the water consumption of the IBOWA algorithm corresponding to 75 m, 88 m, and 107 m water heads is reduced by 0.76%, 0.26%, and 0.05%, respectively. The results of IBWOA are all lower than those of other algorithms under different water heads, which proves its best optimization ability.
In order to verify the effectiveness of the locally balanced dynamic search mechanism, the pre-optimization results of the mechanism were compared with the post-optimization results. The optimization results are shown in Table 4. When the water head is 75 m, 88 m and 107 m, the minimum water consumption calculated by IBWOA is reduced by 360 m 3 , 208 m 3 , and 2,376 m 3 , respectively. Thus, the locally balanced dynamic search mechanism helps solve the STHGS problem, and the proposed IBWOA has a better solution in solving the STHGS problem.