Introduction

Hydroelectricity is one of the well-known forms of renewable energy currently utilized in the world. It is typically generated in hydroelectric power plants, where electricity is harnessed through the moving of water from a nearby dam reservoir. In addition to supplying water for hydroelectricity, dam reservoirs also contribute towards the supply of water for municipal and irrigation purposes (Dobson et al. 2019). Therefore, dam reservoirs play a very important role in current civilizations, hence their operation needs to be managed effectively. Policies for reservoir dam operation are generally determined in order to set the course towards achieving desired objectives such as the maximization of hydropower generation; and the minimization of operation costs, risks, and deficiencies particularly in terms of water release and storage (Asadieh and Afshar 2019; Ehteram et al. 2018; Motlagh et al. 2021; Sharifi et al. 2021). As there are often various different objectives in dam reservoir operations, optimization is required to search for optimum solutions that simultaneously maximizes benefits on all fronts, given a set of objective functions and constraints (Chong et al. 2021).

To achieve the optimization of dam reservoir operation, machine learning has been adopted by scientists and engineers, specifically through the usage of metaheuristic algorithms which are known simply as the branch of machine learning that search for the best feasible solution within the context of an optimization problem. Few recent comprehensive studies of reservoir simulation and optimization by implementing various techniques, such as machine learning and evolutionary algorithms are provided at (Ibrahim et al. 2021; Lai et al. 2022) with the mentioned of merits and demerits for the respective algorithms. The gravitational search algorithm (GSA) has been used to optimize the large-scale operation of the Dez reservoir in Iran (Moeini et al. 2017). GSA was found to be very useful in solving large-scale problems as the search space size is considerably and effectively reduced. The Jaya algorithm has also been studied for the optimization of dam reservoir operation (Chong et al. 2021; Kumar and Yadav 2018). Chong et al. compared the Jaya algorithm (JA) to several other metaheuristics including the genetic algorithm (GA) and particle swarm optimization (PSO) in terms of solving an optimization problem using a hedging policy for a single hydropower reservoir (Chong et al. 2021). JA was shown to produce better hydropower generation policies compared to the other metaheuristics without much parameter tuning. However, JA showed a lack of convergence speed. Kumar and Yadav showed that both the Jaya algorithm (JA) and the teaching learning-based optimization (TLBO) provided satisfactory solutions in their study where different dam reservoir optimization benchmark problems were tested, with JA determined as the superior algorithm (Kumar and Yadav 2018). Ehteram et al. (2018) studied the utilization of the shark algorithm (SA) in optimizing the operation of the Klang gate dam in Malaysia. SA provided solutions closer to the global solution and was deemed superior to the other algorithms tested which were GA and PSO. There have also been numerous hybrids of the PSO that have been developed and studied throughout the years. The study by Yaseen et al. (2018) utilized a hybrid of PSO and the artificial fish swarm algorithm (AFSA) to optimize dam reservoir operation, which produced performances of higher reliability, and lower vulnerability and resiliency compared to standard PSO, AFSA, and GA models. The parallel multi-objective PSO (PMOPSO) has been used by Niu et al. (2018) to optimize the operation of the Lancang cascade hydropower system in Southwest China and has been shown to provide good scheduling results while performing better than other tested algorithms including non-dominated sorting genetic algorithm II (NSGA-II) and multi-objective PSO (MOPSO). Wan et al. (2018) employed a hybrid of the progressive reservoir algorithm (PRA) and the PSO (PRA–PSO) to optimize dam reservoir operation and demonstrated that it performed better than PSO and the elitist-mutated PSO (EMPSO). However, it was found that the searching efficiency of PRA–PSO depends on progressive settings and the initial solution set. In a study on the optimization of operations at the Mula reservoir at the Godavari Basin, India, a hybrid of dynamic programming integrated PSO (DP-PSO) was studied and compared with another hybrid of dynamic programming integrated GA (DP-GA) (Bilal et al. 2020). DP-PSO was shown to be superior as DP narrows down the search space and enhances PSO, however it was found that DP-PSO is suitable for small-scale problems and deteriorates in performance as the size of problem increases. Chen et al. (2020) used PSO with an adaptive random inertia weight (ARIW-PSO) strategy to develop a multi-objective dam reservoir optimization model. ARIW-PSO was found to be superior and more efficient compared to the other tested models including GA, PSO, and adaptive particle swarm optimization (APSO). Asadieh and Afshar (2019) studied the usage of the charged system search (CSS) algorithm to optimize the Dez reservoir in Iran. It was shown that CSS is robust, and superior compared to the other tested models such as GA, PSO, and ant colony optimization (ACO). In another study, the gradient evolution (GE) algorithm was investigated for the optimization of single and multiple reservoir systems namely the Khersan-1 reservoir and Dez reservoir in Iran (Samadi-koucheksaraee et al. 2019). GE was demonstrated to have a higher capacity to optimize the reservoir systems and was deemed superior over other tested models namely linear programming (LP), nonlinear programming (NLP), and GA. Akbarifard et al. (2020) showed the superiority in performance of the moth swarm algorithm (MSA) over GA and PSO in optimizing the operation of the Karun-4 hydropower dam reservoir. Rao algorithms have been used for optimization of discrete four-reservoir system and continuous four-reservoir system in a study by Paliwal et al. (2021) in which the Rao-1 algorithm provided the most optimal solution with the least function evaluations. Motlagh et al. compared grey wolf optimization (GWO) with GA in optimizing operation at the Taleghan Dam. It was demonstrated that GWO is better than GA as it provided more optimal solutions in terms of volumetric reliability, vulnerability, and sustainability.

Through review of existing literature, it was found that there are several metaheuristics that have not yet been investigated or have been explored less abundantly, namely the whale optimization algorithm (WOA), the Levy-flight whale optimization algorithm (LFWOA), and the Harris hawk optimization algorithm (HHO). In the context of dam reservoir operation optimization, few studies from recent years were found that study the optimization of dam reservoir operation using WOA. The WOA has been hybridized with GA in the study by Mohammadi et al. (2019) and used to optimize the operation of two different multi-reservoir benchmark systems. The resulting hybrid whale-genetic algorithm displayed performances of high precision and convergence rate. The study by Donyaii et al. demonstrated the performance of an improved WOA in optimizing the Boostan Dam reservoir. The improved WOA produced the lowest computational duration and the fastest convergence rate, while having a lower number of errors, compared to other tested models in the study. Lai et al. (2021) have proposed WOA and LFWOA at Klang Gate Dam for the irrigation and flood mitigation purpose. The authors demonstrated the LFWOA was the most robust algorithms in terms of reliability, resilience, and shortage index. However, with regard to LFWOA, have yet to be utilized in the field of hydropower reservoir operation optimization. Meanwhile, limited studies have also been found on the usage of HHO in dam reservoir operation optimization. Sharifi et al. (2021) compared the performance of several evolutionary-based models, namely HHO, MSA, GA, PSO, seagull optimization algorithm (SOA), sooty tern optimization algorithm (STOA), and tunicate swarm algorithm (TSA), in optimizing the operation of the Halilrood multi-reservoir system. It was found that HHO was among the top performing models in the study in terms of objective value function, CPU run-time, and convergence rate. The usage of HHO in dam reservoir operation optimization has also been found in studies by Donyaii et al. (2021) and Nguyen et al. (2021). Although studies on WOA, LFWOA, and HHO in dam reservoir operation optimization are currently limited, these algorithms have been demonstrated to produce good performances in other fields. WOA has been used for parameter extraction of solar photovoltaic models, short-term prediction of natural gas consumption, and efficient terminal voltage control of proton exchange membrane fuel cells (Xiong et al. 2018; Qiao et al. 2020; Cao et al. 2020); LFWOA has been utilized for constrained engineering design, job shop scheduling, and structural damage identification (Chen et al. 2019; Liu et al. 2020; Huang et al. 2021); and HHO has been employed for optimal sink node placement; maximum power point tracking for photovoltaic systems; and prediction of soil compression coefficients (Houssein et al. 2020a; Mansoor et al. 2020; Moayedi et al. 2020). Given limited study, a research gap exists in which knowledge on the effectiveness and applicability of WOA, LFWOA, and HHO in hydropower reservoir operation optimization is currently scarce. In the present study, WOA, LFWOA, and HHO are investigated with regard to dam reservoir operation optimization given a time series data set of meteorological and hydrological parameters, and objective functions as well as constraints for a selected dam reservoir.

The effectiveness of dam reservoir operation optimization depends heavily on the metaheuristic utilized. By implementing more powerful and suitable metaheuristics, dam reservoir operators will be able to improve their ability in maximizing hydropower generation profit while minimizing costs, risks, and deficiencies (Asadieh and Afshar 2019; Ehteram et al. 2018; Motlagh et al. 2021; Sharifi et al. 2021). The present study was hence motivated by the importance of continuous research and testing in order to understand the applicability of different metaheuristics and possibly discover better performing metaheuristics for a particular task, which in this case is the optimization of dam reservoir operation. The primary contribution of the present study to the current body of knowledge is the investigation on the performance of three less extensively studied but promising metaheuristics in the field of dam reservoir operation optimization, namely the WOA, LFWOA, and HHO, given a time series data set of meteorological and hydrological parameters, and objective functions as well as constraints for a selected dam reservoir. The parameters that are optimized are the water release and water storage of the selected dam reservoir. The performance of the WOA, LFWOA, and HHO models are evaluated in terms of optimal values, reliability, resiliency, CPU run-time, and are compared analytically to determine the best performing model within the scope of the present study. The convergence rates of the WOA, LFWOA, and HHO models are also compared side-by-side. The findings from the present study may be of interest to any dam reservoir operator, regardless of geographic location, as the findings may be reproduced by utilizing the metaheuristics in the present study and replicating the objective functions, constraints, and parameter settings. The rest of the present study is organized as follows: Sect. 2 describes the methodology used to carry out the present study. Section 3 reports and discusses the results and findings of the present study. Section 4 concludes the overall study together with several recommendations on potential future works.

Methodology

Case study and data sets

Case study

Karun is one of Iran's major rivers that flows from the Zagros Mountains. It flows into the Khuzestan plain and then into the Persian Gulf. In recent decades, the electricity potential production of this has stimulated the interest of water resource operators, and significant efforts have been made to realize this potential. Among these actions has been the construction of a series of Karun dams for flood control and hydropower generation. Karun-4 is the tallest concrete dam in Southwest Iran, located downstream of the Armand and Bazoft rivers at 31° 35″ N and 50° 24′ E. The map of Karun-4 is depicted in Fig. 1. The Karun-4 has an efficiency of 80% and the characteristics are as following (Akbarifard et al. 2020):

  • Maximum and minimum storage volumes of this reservoir are 2279 and 1405 million cubic metres (MCM), respectively.

  • The power plant capacity (PPC) is 1000 MW

  • Annual potential energy production is 2107 MWh

Fig. 1
figure 1

Map of Karun-4 dam

Data sets

For a period of 106 months, the time series meteorological and hydrological data sets include reservoir inflow, reservoir storage, evaporation from the reservoir, precipitation on the reservoir, and water release through the power plant (from October 2010 to July 2019). Section 2.2 explains the target function of Karun-4 dam with the formulation of objective functions and constraints. For better understanding, Fig. 2 is illustrated in the schematic view of reservoir included with the variables in the formulations.

Fig. 2
figure 2

Schematic view of Karun-4 with variables involved in the formulations

Formulation of the optimal release from Karun-4

The objective functions and constraints of the Karun-4 reservoir are as follows: -

$${\text{Minimize}}\;F = \mathop \sum \limits_{i = 1}^{T} \left( {1 - \frac{P\left( t \right)}{{{\text{PPC}}}}} \right)$$
(1)
$$P_{t} = \min \left[ {\frac{g \times \eta \times r\left( t \right)}{{{\text{PF}}}} \times \left( {\frac{h\left( t \right)}{{1000}}} \right), \;{\text{PPC}}} \right]$$
(2)
$$\overline{H}_{t} = \frac{{\left( {H_{t} + H_{t + 1} } \right)}}{2}{-}{\text{TWL}}$$
(3)
$$H\left( t \right) = a + b\left( t \right) X S\left( t \right) + c X (S\left( t \right)^{2} ) + d X S\left( t \right)^{3}$$
(4)
$$S_{{{\text{min}}}} \le S\left( t \right) \le S_{{{\text{max}}}}$$
(5)
$$R_{{{\text{min}}}} \le R\left( t \right) \le R_{{{\text{max}}}}$$
(6)
$$S\left( {t + 1} \right) = S\left( t \right) + R\left( t \right) + Q\left( t \right) + {\text{spill}}\left( t \right) - {\text{loss}}\left( t \right)$$
(7)

where P(t) is the electricity produced by the power plant, PPC is total power plant capacity, g is the gravitational acceleration, T is a total number of power plant performance periods. In addition, power ŋ is the plant factor, h(t) is the water head (m), H(t) is water level in tank and TWL is the depth of water, S(t) is the reservoir storage (MCM), Q(t) is the reservoir inflow (MCM), loss(t) is the evaporation loss (MCM), \(S_{{{\text{min}}}}\) is the minimum storage (MCM), \(S_{{{\text{max}}}}\) is the maximum storage capacity (MCM), \(R_{{{\text{min}}}}\) is the minimum amount of water release (MCM), and \(R_{{{\text{max}}}}\) is the minimum amount of water release from the reservoir (MCM). The a, b, c, d is the coefficient in storage–depth relationship determined via fitting equations.

Reservoir optimization models

Previously, various techniques were used to obtain different results for the Karun-4 reservoir (Ehteram et al. 2017; Hosseini-Moghari et al. 2015; Bozorg-Haddad et al. 2015). In this study, the proposed WOA, LFWOA, and HHO algorithms are implemented in the Karun-4 reservoir to determine the best reservoir policy. The parameter settings for the proposed algorithms are shown in Table 1.

Table 1 Parameter setting for the proposed algorithms

Whale optimization algorithm (WOA)

The newly proposed metaheuristic, called the Whale algorithm, was inspired by the humpback whale algorithm (Mirjalili and Lewis 2016). The WOA describes the distinctive approach of humpback whales, in which the whales swirl above their prey in the water to create spherical bubbles that surround it.

  • Step 1: Encircling the Prey

A humpback whale's chasing ritual begins with circling its prey. It means that the current best solution is the target prey, and that each whale is trying to refine their location towards it. Equations 8 and 9 are the expressions.

$$\to _{D} = \left| {\to _{C} \cdot \to _{X} \left( t \right) - \to _{X} \left( t \right)} \right|$$
(8)
$$\to _{X} \left( {t + 1} \right) = {\text{int}} \left[ {\to _{{X^{*} }} \left( t \right) - \to _{A} \cdot \to _{D} } \right]$$
(9)
$$\to _{A} and \to _{C} {\text{are calculated as}}:$$
$$\to _{A} = 2\to _{a} .\to _{{r_{1} }} - \to _{a}$$
(10)
$$\to _{C} = 2\to _{{r_{2} }}$$
(11)

where \(\to _{D}\) = the separation between \(\to _{X}\) and \(\to _{{X^{*} }}\); \(\to _{a}\) = decrease linearly from 2 to 0 through iterations; \(\to _{{r_{1} }}\) and \(\to _{{r_{2} }}\) = random vectors in [0,1];\(\to _{A}\) and \(\to _{C}\) = coefficient vectors; t = current iterations;\(\to _{X}\) = best positions vector obtained so far; · = Multiplication of two vectors pairwise; int = integer number.

For discrete problems, the WOA search agents are down to the nearest integer number as shown in Eq. 12.

  • Step 2: Exploitation

Using the Bubble-net concept, the following techniques are demonstrated mathematically: (1) By reducing the encircling mechanism in Eq. 12. A random value of \(\to _{A}\) between [−a, a] and (2) To simulate whale spiral movement, Eqs. 12 and 13 create a logarithmic spiral equation between the current whale position and the prey.

$$\to _{{D^{I} = \left| {\to _{{X^{*} }} \left( t \right) - \to _{X} \left( t \right)} \right|}}$$
(12)
$$\to _{X} \left( {t + 1} \right) = {\text{int}} [ \to _{{D^{I} .}} e^{bl} \cdot \cos \left( {2\pi l} \right) + \to _{{X^{*} }} \left( t \right)$$
(13)

where \(\to _{{D^{I} }}\) = distance of ith whale to the prey; b = the definition of the shape of the logarithmic spiral; l = random number [−1.1].

The assumption of a 50% chance of selecting either the reduction encircling or the updating of the whales' new position during spiral model optimization is expressed as

$$\to _{X} \left( {t + 1} \right) = \left\{ {\begin{array}{*{20}l} {{\text{int}}\;\{ \to _{{X^{*} \left( t \right)}} - \to _{A} \cdot \to _{D } } \hfill & {{\text{if}}\;p < 0.5} \hfill \\ {{\text{int}}\;[ \to _{{D^{I} .}} e^{bl} \cdot \cos \left( {2\pi l} \right) + \to _{{X^{*} }} \left( t \right)]} \hfill & { {\text{if}}\;p \ge 0.5 } \hfill \\ \end{array} } \right.$$
(14)

where p = random number in [0,1].

  • Step 3: Exploration

Rather than using the most efficient search agent, humpback whales randomly search for prey and when \(\left| {\to _{A} } \right| \ge 1\), these equations change the location of a random search agent:

$$\to _{{D^{I} = \left| {\to _{C} .\to _{{X_{r} }} - \to _{X} \left( t \right)} \right|}}$$
(15)
$$\to _{X} \left( {t + 1} \right) = {\text{int}} \left[ {\to _{{X_{r} }} - \to _{A} \cdot \to _{D} } \right]$$
(16)

where \(\to _{{X_{r} }}\) = random position vector (selection of a random whale from the current population); Changes are made in the search patterns each time a random search has led to a better result, \(\to _{{X_{r} }}\) or to the latest search solution (\(\to _{{X^{*} }} )\).

Lévy flight WOA (LFWOA)

When the variance is high, use Lévy flight random walk. This parameter enables the algorithm to search globally. Yang and Deb (2009) improved the Cuckoo Search Algorithm using the Lévy flight trajectory. Using Lévy flight in algorithms can improve the trade-off between exploration and exploitation while avoiding local optimal optimization (Kamaruzaman et al. 2013). The WOA was combined with the Lévy flight enhancement technique in this paper to find the best reservoir policy at Karun-4 under constrained conditions. Various EvoloPy mathematical test functions were compared among the proposed algorithms. The Lévy flighting maximizes efficiency while avoiding local minimums (Zhou et al. 2018). Thus, the Lévy trajectory is employed to find the humpback whale's new positions, which can be written as follows:

$$\vec{X}\left( {t + 1} \right) = \vec{X}\left( t \right) + \mu \left[ {{\text{rand}} - \frac{1}{2}} \right] \oplus {\text{Levy}}$$
(17)

where \(\vec{X}\)(t) = the position vector \(\vec{X}\) at iteration t;\(\mu\) is a random number that is consistent with a uniform distribution; product ⊕ means entrywise multiplication; rand is random number in the range of [0,1].

It should be noted that sign [rand −1/2] only has three possible values: 1, 0, and −1. Equation 11 is the stochastic version of a random walk equation, and the length of the step of the search is better in the long term. The Lévy random walk offers a following distribution (Yang and Deb 2009):

$${\text{Levy}}\sim u = t^{ - \lambda } ,\quad {1} < \lambda \le {3}{\text{.}}$$
(18)

For a Levy random walk, the step length probability distribution is heavy-tailed. According to Fig. 3, steps of Levy flights are either small or large, with an equal probability.

$${\text{s}} = \frac{\mu }{{\left| v \right|^{1/\beta } }}$$
(19)

where s = step length of the Levy flight, which is Levy(λ); λ in Eq. 19 obeys the formulation that λ = 1 + β, where \(\beta = {1}.{5},\;\mu = {\text{N}}(0,\sigma_{\mu }^{2} );\quad v = N \left( {0, \sigma_{\mu }^{2} } \right)\) are both normal stochastic distributions in Eq. 13.

$$\sigma_{\mu } = \left[ {\frac{{\left( {1 + \beta } \right)X\sin (\pi X \beta /2}}{{\left( {1 + \frac{\beta }{2}} \right)X \beta X 2^{{\left( {\beta - 1} \right)/2}} }}} \right]^{{^{{{1}/\beta }} }} .$$
(20)
Fig. 3
figure 3

Lévy flights of fifty consecutive steps beginning at the origin are denoted by a bold point (Houssein et al. 2020b)

Harris hawks optimization (HHO) algorithm

The algorithm that is used to simulate hunting behaviour, for example, Harris hawks can track, surround, flush out, and catch a group of prey, like rabbits. Assume the hawk population consists of hawks that use seven distinct killing steps to capture the target rabbit (the answer to the optimization problem). If the prey's dynamic nature and escape behaviour prevent the hawk from capturing it, another tactic known as switching tactics will be used. The hawks will continue to attack the prey until it is captured. Hawks can exhaust and distract evading prey. In HHO, Harris hawks are candidate solutions, while the intended prey is the optimal or global solution. Thus, HHO has exploratory and exploitative phases (Heidari et al. 2019). The HHO (Islam et al. 2020) strategy phases are as follows:

Step 1: Phase of Exploration—They are in charge of monitoring and discovery during this phase. Harris hawks would often plunge their prey from higher altitudes. Equation 21 aids Harris hawks' search. If q < 0.5, the Harris hawks will perch near to the hunting area, but if it is more than 0.5, they will likely find a high tree and remain on it, where q is a nonnegative integer, ranging from 0 to 1.

$$X({\text{iter}} + 1)$$
$$\left\{ {\begin{array}{*{20}l} {X_{{{\text{rand}}}} \left( {{\text{iter}}} \right) - r_{1} X_{{{\text{rand}}}} \left( {{\text{iter}}} \right) - 2r_{2} \left( {{\text{iter}}} \right)} \hfill & {{\text{if}}\;q \ge 0.5} \hfill \\ {X_{{{\text{rabbit}}}} \left( {{\text{iter}}} \right) - X_{m} \left( {{\text{iter}}} \right) - r_{3} ({\text{LB}} + r_{4 } \left( {{\text{UB}} - {\text{LB}}} \right)} \hfill & {{\text{if}}\;q < 0.5} \hfill \\ \end{array} } \right\}$$
(21)

where X iter is the current applicant solution position (hawks), X rand is the hawk randomly selected from the population available. X rabbit denotes the rabbit's current position, iter denotes the current repetition, and r1, r2, r3, and r4 are random numbers between [0, 1]. LB and UB represent the minimum and maximum values of the Xm variables, which represent the current hawks' median location, as measured as follows:

$$X_{m} = \frac{1}{N}\mathop \sum \limits_{i = 1}^{N} X_{i} \left( {{\text{iter}}} \right)$$
(22)

where \(X_{i}\) denotes the position of each Hawk and N denotes the population size of hawks.

Step 2: Phase of Transition (from Phases of Exploration to Exploitation)Eq. 24 illustrates this phase. T denotes the maximum number of iterations and E0 denotes the initial energy. Exploration and exploitation have the potential to alter the running energy.

$$E = 2 E_{0} \left( {1 - \frac{{{\text{iter}}}}{T}} \right).$$
(23)

The iteration E varies randomly between −1 and 1, after which it is changing from −2 to 2, but it is decreasing during the process, as in Eq. 1.2. If |E| is greater than one, then the Harris hawks are in the stage of looking for prey. A likely explanation is that the Harris hawks are hunting rabbits when |E| is less than one (exploitation stage).

Step 3: Phase of Exploitation—Four solutions based on rabbit state escape and hawk monitoring plans have been achieved. Both the bait's running energy and the hawk's attack tactics have been adjusted. Hawks may use a soft or strong attack to hunt the lure. In this case, “r” stands for ability of bait’s “run”. Trapped if the bait's r < 0.5 or less. Moreover, if the bait's running energy |E| and r is greater and equal 0.5, the HHO performs a soft siege movement, and vice versa for hard siege. The bait's ability to run depends on both the escaping resources and the running chance. The trapping phase uses both the hunting escape and hawk siege strategies (Heidari et al. 2019).

Step 4: Soft siegeWhile the hawks gently surround it, the rabbit conserves energy and attempts to flee through some random deceptive jumps. The elaboration is modelled after the following rules:

$$X\left( {t + 1} \right) = \Delta X\left( t \right) - E\left| {JX_{{{\text{rabbit}}}} \left( t \right) - X\left( t \right)} \right|$$
(24)
$$\Delta X\left( t \right) = X_{{{\text{rabbit}}}} \left( t \right) - X\left( t \right)$$
(25)

where \(X\left( t \right)\) = the gap of the rabbit's position vector and its current location during iteration t; \(r_{5}\) = a random number inside (0,1); J = 2(1 − \(r_{5}\)) = the rabbit's random jump strength is constantly fluctuating throughout the escape process. Each iteration, the J value is changed randomly to simulate the movement of a rabbit.

Step 5: Hard siege—The rabbit is nearly depleted. A mysterious sneak attack is carried out by hawks. The position now has the following description:

$$X\left( {t + 1} \right) = X_{{{\text{rabbit}}}} \left( t \right) - E\left| {\Delta X\left( t \right)} \right|.$$
(26)

Step 6: Soft siege with continuous rapid dives—It can be concluded that the rabbit is still full of energy and keeps trying to get away; the fact that \(\left| E \right|\)≥ 0.5 and r ≤ 0.5 illustrates this. Soft siege must first be employed before the hawks can attempt a surprise pounce. Strategy 6 is better than Strategy 4 because of the initiation of the Lévy flight concept, which hawks use for making soft sieges, as shown below.

$$Y = X_{{\text{rabbit }}} \left( t \right) - E\left| {JX_{{{\text{rabbit}}}} \left( t \right) - X\left( t \right)} \right|.$$
(27)

The hawks' dive was conducted in a few attempts, with each movement compared to the previous dive to determine whether the diving attempt was good or bad. As a result, the hawks' dive based on Lévy flight is as follows:

$$Z = Y + S \times {\text{LF}}\left( D \right)$$
(28)

where D = dimension of the problem; S = random vector of size 1 × D; LF = the Lévy flight function can be demonstrated as follows:

$$LF\left( x \right) = 0.01 \times \frac{u X \sigma }{{\left| v \right|^{{\frac{1}{\beta }}} }}$$
(29)
$$\sigma = \left( {\frac{\Bigg\lceil {\left( {1 + \beta } \right) \times \sin \left( {\frac{{\pi \beta }}{2}} \right)}}{\Bigg\lceil {\frac{{\left( {1 + \beta } \right)}}{2}~ \times ~\beta ~ \times ~2~\frac{{\left( {\beta - 1} \right)}}{2}}}} \right)^{{\frac{1}{\beta }}}$$
(30)

where u and v are identical values lying in the range of (0,1) and β is an assumed constant equal to 1.5. Thus, the final updating rule of hawks in this strategy 6 is expressed below:

$$X \left( {t + 1} \right) = \left\{ {\begin{array}{*{20}l} Y \hfill & {{\text{if}}\;F\left( Y \right) < F\left( {X\left( t \right)} \right)} \hfill \\ Z \hfill & {{\text{if}}\;F\left( Z \right) < F\left( {X\left( {ty} \right)} \right)} \hfill \\ \end{array} } \right.$$
(31)

where Y and Z are calculated using Eqs. 27 and 28.

Step 7: Hard siege with continuous rapid dives—When \(\left| E \right|\)< 0.5 and r < 0.5 indicate energy loss. The hawks use the hard siege to close the distance between themselves and the rabbit. The strategy's updating rule is as below:

$$X \left( {t + 1} \right) = \left\{ {\begin{array}{*{20}l} Y \hfill & {{\text{if}}\;F\left( Y \right) < F\left( {X\left( t \right)} \right)} \hfill \\ Z \hfill & {{\text{if}}\;F\left( Z \right) < F\left( {X\left( {ty} \right)} \right)} \hfill \\ \end{array} } \right.$$
(32)
$$Y = X_{{\text{rabbit }}} \left( t \right) - E\left| {JX_{{{\text{rabbit}}}} \left( t \right) - X_{m} \left( t \right)} \right|$$
(33)
$$Z = Y + S \times {\text{LF}}\left( D \right).$$
(34)

Y and Z iterate until the optimal solution is found in Eqs. 20 and 21.

EvoloPy mathematical functions for validation

Three EvoloPy mathematical functions were used to demonstrate and validate the search performance of the proposed algorithms (WOA, LFWOA, and HHO), as shown in Fig. 4 and Table 2. There are useful metrics for evaluating the characteristics of optimization algorithms, such as the convergence rate and level of accuracy used in subsequent optimization (precision and robustness) for reservoir operation. There are two functions groups (Qaddoura et al. 2020; Khurma et al. 2020): unimodal Eqs. 35, 36 and multimodal Eq. 37.

$$F_{1} \left( x \right) = \mathop \sum \limits_{i = 1}^{n} \left( {\mathop \sum \limits_{j = 1}^{i} x_{j} } \right)^{2}$$
(35)
$$F_{2} \left( x \right) = \mathop \sum \limits_{i = 1}^{n} (x_{i} + 0.5)^{2}$$
(36)
$$F_{3} \left( x \right) = - 20\exp \left( { - 0.2\sqrt {\mathop \sum \limits_{i = 1}^{n} x_{i}^{2} \frac{1}{n}} } \right) - \exp \left( {\frac{1}{n}\mathop \sum \limits_{i = 1}^{n} cps\left( {2\pi x_{i} } \right)} \right) + 20 + e.$$
(37)
Fig. 4
figure 4

Flow chart of the case study

Table 2 Characteristic of EvoloPy test functions executed in proposed algorithms

Results and discussion

The best EvoloPy fitness findings obtained from WOA, LFWOA, and HHO are executed to the Karun-4 hydropower optimization operation. This execution step is to ensure that the hydropower optimization process utilizing the ideal fitness value to optimize and generate the ideal results for the respective proposed algorithms without any conflicts in comparison with previous case studies. The findings in Table 3 indicate that HHO produced the best optimal value of 0.000026, the least-worst optimal value of 0.001735, the best average optimal value of 0.000520, and the best standard deviation (SD) with a value of 0.000614. The best coefficient of variation (CV) is presented by WOA with a value of 0.090195, while the best CPU time is exhibited by LFWOA with a duration of 3.208 s.

Table 3 Analysis of 10 runs

Given the lowest SD, HHO is deemed as the most reliable model in achieving optimal reservoir operation at the Karun-4 hydropower reservoir. However, a notable point that can be taken is that HHO exhibits the poorest CV. This indicates that the HHO has the lowest resiliency, which means that it has the lowest capability to recover and return to normal operation in the case of a system failure (Sharifi et al. 2021; Donyaii et al. 2020). The most resilient model is determined to be WOA, as it has the best CV. The ranking mean criterion (Ahmed et al. 2021) was used to determine the best algorithm given a number of performance indicators. As can be seen in Table 4, HHO obtained the lowest overall ranking mean of 1.5, hence it is deemed as the best algorithm in this study, followed by LFWOA and then WOA. In general, despite having the lowest resiliency, HHO is determined as the most suitable and reliable model for the purpose of validating and optimizing the Karun-4 hydropower reservoir, based on the findings of the present study.

Table 4 Ranking mean of each algorithm based on performance indicators

The SD and CV of the algorithms in the present study are comparatively analysed with the results of the Karun-4 hydropower reservoir optimization using MSA, PSO, and GA, as reported in a similar study by Akbarifard et al. (2020). The comparative analysis is shown in Table 5. It can be found that HHO exhibits the lowest SD (0.000614), followed by MSA (0.0029). This indicates that the HHO optimization values are closest to the mean or expected values, hence providing good reliability, and making it the most reliable model within the comparison. With regard to CV, MSA is superior (0.192) with WOA coming in second (0.090195). This means that the MSA is the most resilient model for the case study of the Karun-4 hydropower reservoir optimization.

Table 5 Comparison of SD and CV of models in the present study and the study in Akbarifard et al. (2020)

Figure 5 shows the convergence rates of WOA, LFWOA, and HHO in obtaining the optimal value for the Karun-4 hydropower reservoir operation problem. LFWOA is shown to produce the most rapid convergence, followed by HHO and then WOA. However, it can be noted that the convergence rates of LFWOA and HHO are very similar. Although LFWOA has the better convergence rate, HHO produces more desirable optimal values, as shown in Table 3. Given that the rate of convergence is higher using LFWOA and HHO, it can be understood that the computational costs are lesser using these two algorithms as fewer iterations are typically needed to determine the optimum solution (Sharifi et al. 2021). The convergence rates are reflected in the CPU computation time, with LFWOA performing the best in this aspect, followed closely by HHO, and lastly WOA, as shown in Tables 3 and 4.

Fig. 5
figure 5

The convergence rates of the tested algorithms

Figure 6 portrays the water release trends of the tested algorithms in optimizing the operation of the Karun-4 hydropower reservoir. It is deduced that HHO releases the least water during the test period compared to the other algorithms, hence demonstrating the superior ability of HHO in computing the best optimal value and global solutions in order to produce optimal amounts of hydroelectricity using less water resources (Akbarifard et al. 2020).

Fig. 6
figure 6

Water release trends of tested algorithms

Figure 7 depicts the water storage trends of the tested algorithms in optimizing the operation of the Karun-4 hydropower reservoir. It is found that HHO stores more water throughout the test period in comparison to the other tested algorithms. Therefore, it is deduced that HHO performs better than the other tested algorithms in terms of optimizing the water storage of the Karun-4 hydropower reservoir.

Fig. 7
figure 7

Water storage trends of tested algorithms

Conclusion

A time series data set on the meteorological and hydrological parameters of the Karun-4 hydropower reservoir was used to study dam reservoir operation optimization using three under-studied metaheuristic algorithms, namely WOA, LFWOA, and HHO. Objective functions and constraints of the Karun-4 hydropower reservoir were also taken into consideration for the optimization process. Based on quantitative analysis, HHO is found to be the best metaheuristic for dam reservoir operation optimization in the present study. HHO exhibits the lowest RM with a value of 1.5 given that it produces the best optimal value (0.000026), the least-worst optimal value (0.001735), the best average optimal value (0.000520), and the best SD (0.000614). WOA produces the best CV (0.090195) while LFWOA produces the best CPU time (3.208 s). HHO is determined to be the most reliable metaheuristic due to it having the lowest SD, while WOA is determined to be the most resilient metaheuristic due to it having the lowest CV in the present study. When compared with the best metaheuristic from a similar study on the Karun-4 hydropower reservoir by Akbarifard et al. (2020), which is MSA, it is found that HHO produces a better SD compared to MSA, hence making it the more reliable metaheuristic for this case study. However, MSA is the more resilient metaheuristic as it produces a much better CV. With regard to the convergences rates, LFWOA converges the fastest, followed very closely by HHO. The optimized trends of water release and water storage illustrate the superiority of HHO compared to WOA and LFWOA, as it can be seen that HHO releases less water to generate hydropower while storing more water compared to the other tested metaheuristics during the test period.

In conclusion, the present study has contributed towards an investigation on the usage of WOA, LFWOA, and HHO in the optimization of dam reservoir operation, given the research gap in which these three metaheuristics have yet to be studied abundantly within the research field. The research gap has been addressed, as it is found that HHO produces the most desirable optimization results in the context of the present study, while WOA and LFWOA also produce comparable and good results especially in terms of CV and CPU time, respectively. It is intended that the present study will contribute to the current body of knowledge and aid in the on-going research to understand the utilization and suitability of different metaheuristics particularly in the field of dam reservoir operation optimization. Given the findings of this study, future research may focus on further developing HHO through hybridization or implementation of more advanced techniques, to improve its performance in dam reservoir operation optimization. This is also applicable to WOA and LFWOA as these metaheuristics have also evidently produced comparable results. However, the limitation of this study does not involve any investigation of the climate change impact on Karun-4 operation. Thus, other than hybridization of HHO, it would be further recommended by investigating the climatic scenarios at Karun-4 operation. In addition, other new or under-studied metaheuristics may also be possibly researched and tested on the Karun-4 hydropower reservoir data set, which can be obtained from Akbarifard et al. (2020).