1 Introduction

In recent decades, due to ever-increasing human population and an increase in water demand as well as limitation in water resources, management and optimal use of water resources is of paramount importance. One of the challenges of reservoir managers, planners, and operators is to extract and adopt policies for optimal operation of reservoirs. In this regard, it is possible to determine the best rate of released water in both drought and flood conditions.

Existing techniques for the operation of reservoirs can be grouped as: simulation and optimization techniques. WEAP and MODSIM are examples of commonly used simulation techniques. Optimization techniques employ mathematical programming techniques such as linear programming (LP), non- linear programming (NLP), dynamic programming (DP), stochastic dynamic programming (SDP), and evolutionary algorithms such as genetic algorithm (GA), simulated annealing (SA), tabu search (TS), etc. Recently, many or the aforementioned techniques have been developed and applied in various aspects of water resources systems such as reservoir operation (Fallah-Mehdipour et al. 2011, 2013a), hydrology (Orouji et al. 2013), project management (Bozorg Haddad et al. 2010a; Fallah-Mehdipour et al. 2012a), cultivation rules (Bozorg Haddad et al. 2009; Fallah-Mehdipour et al. 2013b), pumping schedules (Bozorg Haddad et al. 2011), hydraulic structures (Bozorg Haddad et al. 2010b), water distribution networks (Seifollahi-Aghmiuni et al. 2011, 2013), operation of aquifer systems (Bozorg Haddad and Mariño 2011), site selection of infrastructures (Karimi-Hosseini et al. 2011), and algorithmic developments (Shokri et al. 2013). However, a few of these works dealt with the development and application of fixed length gene genetic programming (FLGGP), especially in the field of hydropower reservoir operation.

Nonlinear programming (NLP) and genetic algorithm (GA) are well-known among methods used to extract reservoir operation policies. Rosenthal (1981) used the NLP cut-Newton technique under conditions of stochastic inflows for optimizing the utilization of water reservoir systems and evaluated it as an appropriate method. Yeh (1985) compared the efficiency of nonlinear programming methods in reservoir management. Wardlaw and Sharif (1999) firstly used GA to optimize a four-reservoir system and then applied the algorithm for a ten-reservoir system. Results showed that GA is advantageous as a replacement for stochastic dynamic programming (SDP) due to its high capability and convenient application in complex problems. Moreover, Chen (2003a) extracted operation rule curves for reservoir systems by GA and concluded that GA is very efficient in solving nonlinear problems.

To extract optimal operation rule using NLP and GA methods, it is necessary to define a mathematical relation that connects the reservoir water release volume to other operation parameters such as reservoir storage volume and river inflow volume. For this reason, to determine an optimal relationship between release, storage, and inflow volume for reservoir operation, all possible relationships should be examined. However, this is very time-consuming. Hence, development of methods, other than previous methods, is necessary to extract an optimal reservoir operation relationship. Among those methods, evolutionary programming techniques are used in this study.

Evolutionary programming is a subset of evolutionary algorithms introduced for simulation in the 1960s (Fogel 1964; Fogel et al. 1966) and used in various problems of optimization in recent years (Fogel 1991; Yao et al. 1999). Genetic programming (GP) is among these methods. It has been reported that GP is sufficiently accurate to be considered in practical applications (Chen 2003b, c). In recent years, this model has been used successfully in various fields (Azamathulla et al. 2009; Hakimzadeh et al. 2013; Barati et al. 2014). Sivapragasam et al. (2007) studied the effect of accuracy of flow forecasting and planning horizon for the optimal amount of water release needed to supply irrigation in reservoir operation. For this purpose, GP has been used to forecast flow and relations needed for flow forecast have been extracted by Sivapragasam et al. (2007). Results of flow forecasting equations were then compared by root mean square error (RMSE). Izadifar and Elshorbagy (2010) predicted real-time evaporation and transpiration by an artificial neural network (ANN), GP, and statistical methods (multivariate regressions) in Alberta, Canada. The potential of evaporation and transpiration rate was calculated by HYDRUS-1D software. Based on these results, predicting evaporation and transpiration by GP and multiple regressions had less error than HYDRUS-1D that requires additional parameters. Orouji et al. (2013) employed hydrological techniques such as a developed Muskingum method and GP models for routing river floods and compared their results to Saint- Venant equations, which is a numeric hydrograph method based on numerical hydraulic properties. Results showed the preference of GP to other hydrological methods and also revealed that although GP requires fewer input variables than Saint-Venant equations, there is no significant difference between in their results. Thus, Orouji et al. (2013) recommended the use of GP due to its simplicity and high accuracy in routing river floods. Fallah-Mehdipour et al. (2012b) used GP for the first time in the development of operation rule curves of a one-reservoir system to meet agricultural needs and regarded it as an effective method in reservoir operation.

According to the tree structure of GP, this method can provide a link between input and output sets. For this reason, the method can only be used in single-reservoir systems and extraction of static operation rules. It is not possible to use GP in extraction of dynamic operation rules and multi-reservoir systems because more than one mathematical relation must be extracted. In this study, a GP method is developed to remove the limitations of standard GP. This method is termed GP with fixed length gene genetic programming (FLGGP) and the main aim of its development is to use it in the extraction of dynamic operation rules. In this study, the FLGGP method is used in both static and dynamic operation approaches. The reason for its usage in the development of a static operation rule is to compare its capabilities to the standard GP method and determine whether FLGGP is an appropriate replacement for GP in the extraction of dynamic operation rules and multi-reservoir systems.

Thus, the purpose of this study is to develop real-time rule curves for Karun3 one-reservoir system in Iran, using several methods and procedures aimed at reducing deficits of hydroelectric supplies. Hence, this paper uses operation methods such as NLP, GA, FLGGP, and operation rule NLDR in real-time operation considering both approaches of dynamic and static operation rules. For the static operation rule, one rule curve is extracted for all months of the year in the course of operation of the one-reservoir system. While in the new approach (dynamic approach of operation rules) for each month of the year (12 months), specific rule curves are extracted for each month. To evaluate the results of each of the above-mentioned methods, a total deficiency function is used as the target function and performance evaluation criteria. Then, the performance of each approach is compared.

2 Techniques and Data Used

This section discusses the modeling operation of one-reservoir system aimed at meeting hydroelectric needs, concepts of NLDR, optimal methods of reservoir optimization, criteria of performance evaluation, and description of the study area.

2.1 Modeling of Reservoir System Operation

One of the most important equations in modeling the operation of a reservoir is the continuity equation based on the conservation of mass:

$$ {S}_{t+1}={S}_t+{Q}_t+{\mathrm{Re}}_t+S{p}_t-E{v}_t\left(\frac{A_t+{A}_{t+1}}{2000}\right),\forall t=1,\dots,\;T $$
(1)

in which t = period index; T = number of operational periods; S t = storage volume of reservoir at the beginning of period (month) t per 106 m3; S t + 1 = storage volume of reservoir at the end of period t per 106 m3; Q t = inflow to reservoir during period t per 106 m3; Re t = release from reservoir during period t (decision variable) per 106 m3; Sp t = outflow from reservoir during period t per 106 m3; Ev t = evaporation from reservoir during period t per mm; A t = level of reservoir at beginning of period t per 106 m2; A t + 1 = level of reservoir at end of period t per 106 m2.

In this study, reservoirs are operated to supply hydroelectric needs. Thus, characteristics of the nonlinear model are highly increased and subsequent complexities of problem-solving are increased.

Powerhouse production capacity is calculated from the following equation:

$$ {P}_t=g\times {e}_t\times \frac{Q{p}_t}{PF}\times \frac{{\overline{H}}_t-{\overline{TW}}_t}{1000},\forall t=1,\dots,\;T $$
(2)

where P t = powerhouse produced power of reservoir during period t per 106 watt; g = gravitational acceleration per m/s2; e t = powerhouse output of reservoir during period t; Qp t = discharge of released water from reservoir during period t per m3/s; PF = powerhouse functional coefficient of reservoir; \( {\overline{TW}}_t \) = tail water of reservoir during period t per meter; and \( {\overline{H}}_t \) = average water level of reservoir at beginning and end of period t per meter.

The objective function to optimize the operation of a hydroelectric reservoir system is defined as the minimization of the difference between power production of powerhouse and maximum of production power (installed capacity):

$$ Min\;Def={\displaystyle \sum_{t=1}^T\left(1-\frac{P_t}{PPC}\right)}, \forall t=1,\dots,\;T $$
(3)

in which Def = index of total deficiency and PPC = installed capacity per 106 watt.

2.2 Nonlinear Decision Rules (NLDR)

The rate of reservoir release in nonlinear decision rules is a function of decision-making parameters such as reservoir storage volume and stream inflow, and this function could be in nonlinear form. Equation (4) shows this function for the static operation rules and equation (5) shows the relationship for dynamic operation rules.

$$ {\mathrm{Re}}_t=f\left({S}_t,{Q}_t,{D}_t\right),\forall t=1, \dots,\;T $$
(4)
$$ {\mathrm{Re}}_{m,n}={f}^{\hbox{'}}\left({S}_{m,n},{Q}_{m,n},{D}_{m,n}\right),\forall m=1, \dots,\;M\kern0.24em and\kern0.24em n=1, \dots,\;N $$
(5)

in which f(…) and f '(…) can be any type of nonlinear function; D t = downstream needs during period t; m = month index; M = number of months of the year, which is equivalent to 12; n = year index; and N = number of years of operation, which in this study is 10 years.

Rule S2Q2 is one of the nonlinear decision rules that are shown in relations (6) and (7) to exploit both static and dynamic operation rules respectively.

$$ {\mathrm{Re}}_t={a}_1.{S_t}^2+{a}_2.{S}_t+{a}_3{Q_t}^2+{a}_4{Q}_t+{a}_5 $$
(6)
$$ {\mathrm{Re}}_{m,n}={a}_{m,1}.{S_{m,n}}^2+{a}_{m,2}.{S}_{m,n}+{a}_{m,3}{Q_{m,n}}^2+{a}_{m,4}{Q}_{m,n}+{a}_{m,5} $$
(7)

where all a m = constant factors yielded from the optimization model. In this paper, a NLDR is employed for the real-time operation in both of static and dynamic operation of a reservoir system.

2.3 Genetic Programming (GP)

GP is a new iterative search algorithm which is based on Darwin’s evolutionary theory of evolution, originally presented by Koza (1992, 1994) and Banzaf et al. (1998). By considering the functional relationships that can be extracted by using GP in different fields, many studies have reported the use of these optimization tools in various disciplines including water resources.

A step-by-step process of GP is as follows: (1) Sets that can be used to select variables and operators in the search process, are introduced. These sets are known as terminal (T) and functions (F) sets. For example, T can be presented as T = {x, 1, 2, − 1, − 2, …} and F can be presented as F = {÷,×,+,−, exp, sin, cos, log, …}; (2) Chromosomes are created by selecting a random initial response set from terminal and functions sets. Figure 1 shows a sample of two extracted chromosomes of F and T sets; (3) An objective function is calculated corresponding to each chromosome and, if necessary, a penalty function is applied on the values of the objective function; (4) Genetic operators (crossover and mutation) are applied and they produce offsprings; and (5) An iterative development process is applied on the children at subsequent iteration until either a certain number of iterations is reached or the objective function variation is almost zero. Then the near-optimal solution can be reported.

Fig. 1
figure 1

Mathematical relationships of GP: (a) first chromosome and (b) second chromosome

2.4 Fixed Length Gene Genetic Programming (FLGGP)

The developed FLGGP algorithm is based on the GP method and therefore it can be considered as a subset of GP. Accordingly, FLGGP has many similarities with GP: iterative and random search process, selection, crossover and mutation operators, and definition of T and F sets. The main difference is structure of this method with GP. In FLGGP, the number of genes per chromosome is related to the number of input variables and each section of these chromosomes is related to one input variable. In this method, as in the GP method, each gene introduces one member of T and F sets.

The number of genes per chromosome can be obtained according to equation (8) to obtain:

$$ \mathrm{Number}\ \mathrm{of}\ \mathrm{genes}\ \mathrm{per}\ \mathrm{chromosome} = 4\times \left(\mathrm{number}\ \mathrm{of}\ \mathrm{input}\ \mathrm{variables}\right)+3 $$
(8)

For example, if a function h has two input variables X and Y to be considered, according to equation (8) the number of genes per chromosome will be equal to 11 and each chromosome will produce the expression \( h={\left[{a}_1\left( \log \left({(x)}^{b_1}\right)\right)+{a}_2\left( \exp \left({(y)}^{b_2}\right)\right)\times \sin (c)\right]}^d \). As seen in this equation, 11 genes of coefficient in set {a 1, b 1, a 2, b 2, c, d}, {log, exp, sin} functions, and {+,×} operators, exist in this chromosome. The above-mentioned equation is a polynomial expression that could be represented exponentially and by power due to types of functions (linear or nonlinear). So the equation will include even linear statements which are commonly considered in GA and only its coefficients are optimized.

Figure 2 displays the location of different genes on a chromosome in FLGGP. Genes 1–4 are related to the first term of the aforementioned h expression, namely \( {a}_1\left( \log \left({(x)}^{b_1}\right)\right) \), while genes 5–8 are related to the second term of h, namely \( {a}_2\left( \exp \left({(y)}^{b_2}\right)\right) \). In addition, genes 9 and 10 are related to third term of h, namely sin(c) and gene 11 is related to the power of the equation, namely d. Also, gene numbers 1, 3, 5, 7, 9, and 11, which contain {a 1, b 1, a 2, b 2, c, d} variables, are random numbers and during the crossover and mutation processes can only be changed to other random numbers. Genes 2, 6, and 10 are of the F set that in the crossover and mutation processes can be changed to other functions such as {sin, cos, exp, log, φ}. Function φ means that the mentioned genes do not take a specific function. Gene numbers 4 and 8 are formed by members of the T set that during crossover and mutation processes can be changed to other members of the T set such as {+,−,×,÷}. It should be noted that x and y input variables will be constant and unchanged in the FLGGP formulation. Similarly, by increasing the number of input variables, corresponding genes will be added to initial formulations and according to Equation (8), the number of genes per chromosome will be increased.

Fig. 2
figure 2

Mathematical relationship of \( h={\left[{a}_1\left( \log \left({(x)}^{b_1}\right)\right)+{a}_2\left( \exp \left({(y)}^{b_2}\right)\right)\times \sin (c)\right]}^d \) in the form of FLGGP chromosome

2.5 Performance Indices of Reservoir System

To evaluate the performance of methods employed in this study, reservoir performance indices are used. Those indices are: reliability, resiliency, and vulnerability (Hashimoto et al. 1982). Reliability is divided into two categories: Time-based reliability and volumetric reliability.

Time-based reliability includes the number of periods that produced power in a reservoir system is more than or at least equal to an expected power divided to the total installed capacities in all reservoirs, which is shown in Equation (9).

$$ RT=\frac{1}{T}\underset{t=1}{\overset{T}{Nu}}\left({P}_t\ge \alpha .PPC\right)\forall t=1, \dots,\;T $$
(9)

in which RT = time-based reliability of system; α = percentage of expected target threshold power production (in this study, α is considered to be equal to 100 %); and \( \underset{t=1}{\overset{T}{Nu}}\left({P}_t\ge \alpha .PPC\right) \) = number of periods in which power is equal to or more than α percent of a reservoir’s installed capacity.

Volumetric reliability denotes the total power produced by one reservoir compared to the maximum possible power production by that reservoir during the entire operation period. It can be calculated by using the following equation:

$$ RV=\frac{1}{T}\frac{{\displaystyle \sum_{t=1}^T{P}_t}}{\alpha .PPC},\forall t=1, \dots,\;T $$
(10)

where RV = volumetric reliability of the entire reservoir system.

Resiliency is defined as how fast a reservoir comes out of a failure. Resiliency can be calculated by using Equation (11):

$$ \phi =\frac{\underset{t=1}{\overset{T-1}{Nu}}\left({P}_t<\alpha .PPC\ \Big|\ {P}_{t+1}\ge \alpha .PPC\right)}{\underset{t=1}{\overset{T}{Nu}}\left({P}_t<\alpha .PPC\right)},\forall t=1, \dots,\;T $$
(11)

in which ϕ = resiliency of multi-reservoir system; \( \underset{t=1}{\overset{T-1}{Nu}}\left({P}_t<\alpha .PPC\ \Big|\ {P}_{t+1}\ge \alpha .PPC\right) \) = number of series of failures; and \( \underset{t=1}{\overset{T}{Nu}}\left({P}_t<\alpha .PPC\right) \) = total number of failures during the period of operation.

Vulnerability is defined as average shortage (failure) intensity of the produced power from the installed capacity. Vulnerability can be calculated by using Equation (12):

$$ \eta =\left(\underset{t=1}{\overset{T}{Max}}\frac{{\left(\alpha .PPC\hbox{-} {P}_t\kern0.5em \Big|\kern0.5em \alpha .PPC\ge P\right)}_t}{\alpha .PPC}\right),\;t=1, \dots,\;T $$
(12)

where η = total vulnerability of multi-reservoir system.

2.6 Study Area

To develop operational rules for a one-reservoir system, Karun3 reservoir is considered. Karun3 reservoir is located at a latitude 31°: 48′ and longitude about 50°: 05′ (Fig. 3), with an average yearly inflow of 9906 × 106 m3. The purpose of establishing Karun3 two-arcs concrete dam with a height of 205 m is to establish a powerhouse with a capacity of 2280 megawatt for an annual production of 4172 gig watt hours of electric energy, control the frequency, and increase the stability of the global power circuit. Table 1 shows characteristics of the reservoir and powerhouse.

Fig. 3
figure 3

Geographic location of dam and lake of Karun3 reservoir in Karun river

Table 1 Characteristics of reservoir and powerhouse

Figure 4 shows a 10-year average (1991–2000) for monthly inflows entering the reservoir and the average height of evaporation from reservoir surface in various months. In this study, monthly reservoir operational periods are considered.

Fig. 4
figure 4

Monthly inflow average and monthly evaporation average of Karun3 reservoir

2.7 Development of Methods Used in This Study

In this study, the optimization operation is carried out within the Karun3 one-reservoir system, using both static and dynamic operation rules. To extract rule curves of both static and dynamic operation, an NLDR rule is used. For the static operation rule, one rule curve is extracted for all months of the year in the course of operation of the one-reservoir system. While in the dynamic approach of operation rules for each month of the year (12 months), specific rule curves are extracted for each month.

NLP, GA, GP, and FLGGP optimization techniques are used when considering a real-time operation rule. Functions related to release rates for both static and dynamic approaches are respectively represented as:

$$ {\mathrm{Re}}_t=h\left({S}_t,{Q}_t\right),\;t=1, \dots,\;T $$
(13)
$$ R{e}_{m,n}=k\left({S}_{m,n},{Q}_{m,n}\right),\;m=1, \dots,\;M\kern0.24em and\kern0.24em n=1, \dots,\;N $$
(14)

in which h(…) and k(…) can be any type of nonlinear function. In this study, the total deficiency function as well as the criteria for efficiency evaluation are used to optimize the operation of reservoirs and evaluation of results of the optimization methods used.

2.8 Application of Methods of Reservoir Operation

LINGO software (Manual of LINGO software, 2004) has been used in the NLP method. LINGO tries to obtain a global optimal solution. However, LINGO is not able to come up with a feasible solution in some nonlinear optimization models and yields only a local optimum solution. Moreover, the GA toolbox in MATLAB (R2009a) (Overman 2011) has been employed for optimal reservoir operation. Table 2 shows the applied parameter of GA. Similarly, to develop real-time operation rules, both NLP and GA are used. It should be noted that numbers presented in Table 2 were obtained after a sensitivity analysis by means of a series of short runs, and for each case 10 conditions and in various combinations were examined, and finally these numbers are optimal amounts that provide better results in these short runs. The F set for the GP method uses functions and for FLGGP method it uses functions.

Table 2 Characteristics of GA, GP, and FLGGP in reservoir operation

3 Results and Discussion

This section discusses results obtained in the extraction of a rule curve for Karun3 one-reservoir system. Table 3 shows values of the target objective function (total deficiency function) for Karun3. It can be seen that in the extraction of a static operation rule, GP with a target function of 0.249 and then FLGGP with a target function of 0.252 give a better performance than NLP and GA. In contrast, the performance of the two methods (FLGGP and GP) are very close to each other. This indicates that FLGGP can be used as an appropriate alternative of GP in the extraction of a dynamic operation rule. In addition, FLGGP with the target function of 0.220 has the highest suitability in the extraction of a dynamic operation rule. It is noteworthy that GP has not been used in the extraction of a dynamic operation rule because of its limitations in yielding the operation rules for such a system.

Table 3 Values of objective function in real-time operation of Karun3 reservoir system

A comparison of two approaches of extraction of static and dynamic operation rules (Table 3) shows that the extraction of a dynamic operation rule is superior to the static approach in all optimization methods considered. For example, performance of the NLP method in the extraction of a dynamic operation rule with the target function of 0.238 is superior to the approach of extraction of a dynamic operation rule with the target function of 0.261.

Table 4 shows values of performance assessment criteria for both static and dynamic operation approaches in Karun3 reservoir. Results show that:

Table 4 Values of performance indices in real-time operation of Karun3 reservoir system
  1. 1.

    Values of time-based reliability are the highest in the first approach (static operation rule) when using GP. In contrast, the NLP method gives the best results in the second approach (dynamic operation rule).

  2. 2.

    Values of volumetric reliability of several optimization methods considered are very close to each other in both approaches.

  3. 3.

    The resiliency index is the highest in the static approach when using the GP method. Other methods show a little difference in computed values of the resiliency index. In addition, use of the dynamic operation rule in the NLP method showed a higher resiliency index than the FLGGP method.

  4. 4.

    The vulnerability index of both static and dynamic approaches in the FLGGP method has the least (the most suitable) value.

  5. 5.

    A comparison of static and dynamic operation rules indicates the superiority of the dynamic approach in all performance assessment criteria, excluding the vulnerability index.

Figures 5 and 6 show changes in power production at Karun3 one-reservoir powerhouse system for extraction of both static and dynamic operation rules. According to Fig. 5, GP and FLGGP have more capabilities than other optimization methods considered in the extraction of a static operation rule. Moreover, Fig. 6 shows that power production with the FLGGP method is greater than with two other methods and has less deficiency at different periods of operation. According to Figs. 5 and 6, in the NLP method, the number of times for reaching the installed capacity (PPC) is more than in other methods. However, the severity of failures is much higher than other methods so that in some periods the power production was even equal to zero. In contrast, in the evolutionary methods, the intensity of failures is much lower than NLP, which is an advantage to these methods.

Fig. 5
figure 5

Fluctuation of power generation in real-time operation of Karun3 reservoir system using static operation rule approach: (a) NLP, (b) GA, (c) GP, and (d) FLGGP

Fig. 6
figure 6

Fluctuation of power generation in real-time operation of Karun3 reservoir system using dynamic operation rule approach: (a) NLP, (b) GA, and (c) FLGGP

4 Concluding Remarks

NLP, GA, GP, and FLGGP optimization methods were employed for the extraction of operation rules for Karun3 reservoir using static and dynamic operation rules. For the real-time operation of Karun3 with the approach of a static operation rule, the GP method with a target function of 0.249 was superior to the FLGGP method with a target function of 0.252, NLP method with a target function of 0.261, and GA with a target function of 0.267. Also, for the real-time operation with a static operation rule approach, the FLGGP method can be proposed as a suitable replacement in a dynamic operation rule and/or systems having more than one sub-set (such as a multi-reservoir system) due to its acceptable performance compared to those of the GP method. Results of the real-time operation with the approach of dynamic operation rule indicates that the FLGGP method with a target function of 0.220 is superior to the NLP method with a target function of 0.238, and GA method with a target function of 0.246.

A comparison of dynamic and static operation rules demonstrated that results of the dynamic operation rule are more advantageous than with the static approach. Therefore, the approach of dynamic operation rule is recommended to be used to operate the reservoirs system. Also, with respect to this study and its limitations, the following suggestions can be offered for the future studies:

In this study, the purpose of the reservoir operation is hydropower. It is recommended that for a more comprehensive study, other purposes including agricultural, municipal and industrial sectors could be considered, and uncertainty of discharge in the operation of the reservoir with different purposes could be discussed. Moreover, in this study, only the average reservoir hydropower plant was studied. If secondary and other types of energy are calculated and examined, results that are more comprehensive would be achieved. In addition, the functional coefficient of the reservoir plant for all periods was considered to be equal, which in reality is not the case, and therefore, given peak consumption periods, the functional coefficient varies with time.