# A Gradient-Based Cuckoo Search Algorithm for a Reservoir-Generation Scheduling Problem
## 4 Gradient Cuckoo Search for Reservoir Scheduling
### Gradient-Based Search Strategy  
In the random search phase, new solutions are randomly generated from the heuristics algorithms. However, after many numerical experiments, it is found that the performances of the heuristic algorithms fail to meet the requirements. On the one hand, the variance of the calculation results is large, indicating that the algorithms are not very stable. On the other hand, the converging speed of the algorithm is quite slow when dealing with the complex cascade reservoirs problem. Hence in this section, a gradient-based search strategy is designed especially for LHGS. For a random generated solution, the water level is adjusted by a small gradient \(\Delta l_{i,t}\) as shown in Figure 1, which would result in the power generation of the entire cascade reservoir changing. Figure 1: Adjustment in water level by a small gradient. If we change the end water level of reservoir \(i\) by \(\Delta l\) at time period \(t\), the power generation of reservoir \(i\) at time period \(t\) is:  
\[\left\{ \begin{array}{l}Z_{i,t}^{adjust}=Z_{i,t}+\Delta l\\ \Delta Q_{i,t}=\left(V_{i}(Z_{i,t}+\Delta l)-V_{i}(Z_{i,t})\right)/\Delta T_{t} \\ \Delta H_{i,t}=\Delta l/2-Zd_{i}(Q_{i,t}+\Delta Q_{i,t})+Zd_{i}(Q_{i,t})\\ \Delta P_{i,t}=k_{i}(Q_{i,t}+\Delta Q_{i,t})(H_{i,t}+\Delta H_{i,t})-k_{i}Q_{ i,t}H_{i,t}\end{array} \right. \tag{21}\]  
where \(V_{i}(Z)\) is the fitting function of water level and storage curve of reservoir \(i\); and \(Zd_{i}(Q)\) is the fitting function of the downstream water level and outflow curve of reservoir \(i\). Then the power generation of reservoir \(i\) at the next time period \(t+1\) can be given by:  
\[\left\{ \begin{array}{l}\Delta Q_{i,t+1}=\left(V_{i}(Z_{i,t})-V_{i}(Z_{i,t}+ \Delta l)\right)/\Delta T_{t+1}\\ \Delta H_{i,t+1}=\Delta l/2-Zd(Q_{i,t+1}+\Delta Q_{i,t+1})+Zd(Q_{i,t+1})\\ \Delta P_{i,t+1}=k_{i}(Q_{i,t+1}+\Delta Q_{i,t+1})(H_{i,t+1}+\Delta H_{i,t+1}) -k_{i}Q_{i,t+1}H_{i,t+1}\end{array} \right. \tag{22}\]  
When the outflow of reservoir \(i\) is changed and the water level of the downstream reservoirs remains the same, the inflow of all reservoirs in the downstream reservoir would be changed by the outflow of reservoir \(i\). For one of the reservoirs downstream, the power generation at time period \(t\) is:  
\[\left\{ \begin{array}{l}\Delta Q_{j,t}=\Delta Q_{i,t}\\ \Delta H_{j,t}=Zd_{j}\big{(}Q_{j,t}\big{)}-Zd_{j}\big{(}Q_{j,t}+\Delta Q_{j,t} \big{)}\\ \Delta P_{j,t}=k_{j}\big{(}Q_{j,t}+\Delta Q_{j,t}\big{)}\left(H_{j,t}+\Delta H _{j,t}\right)-k_{j}Q_{j,t}H_{j,t}\end{array} \right. \tag{23}\]  
The power generation of the next reservoir \(i+1\) at time period \(t+1\) is:  
\[\left\{ \begin{array}{l}\Delta Q_{j,t+1}=\Delta Q_{i,t+1}\\ \Delta H_{j,t+1}=Zd_{j}\big{(}Q_{j,t+1}\big{)}-Zd_{j}\big{(}Q_{j,t+1}+\Delta Q _{j,t+1}\big{)}\\ \Delta P_{j,t+1}=k_{j}\big{(}Q_{j,t+1}+\Delta Q_{j,t+1}\big{)}\big{(}H_{j,t+1} +\Delta H_{j,t+1}\big{)}-k_{j}Q_{j,t+1}H_{j,t+1}\end{array} \right. \tag{24}\]  
For the solution adjustment, we need to adjust this to the better direction. Instead of a time-consuming fitness calculation of the incremental power generation \(\Delta E\), we only need to determine whether the incremental power generation \(\Delta E\) is positive. If \(\Delta E\) > 0, the adjustment will be made to give a better solution. Otherwise the previous solution is kept without change. In this paper, we determine whether \(\Delta E\) is positive from the calculation of the partial derivative of power generation \(E\) with respect to the gradient \(\Delta l\), as given below. For the reservoir \(i\) at time period \(t\) shown in Equation (25), the partial derivative of power output is:  
\[\left\{