Introduction

Increasing pollution loads necessitates the incorporation of water quality issues in water resource planning and management. Nowadays, the integration of water quality and quantity targets in reservoir–river systems planning is receiving more attention by researchers. de Azevedo et al. (2000) investigated multiple strategic planning alternatives for water quality and quantity management in a river basin. They used the MODSIM model for water allocation and a model named QUAL2E-UNCAS for water quality routing considering the parameters uncertainties. In their study, some performance measures such as reliability of water quality standard compliance, spatial and temporal uniformity of water quality as well as total reliability, total vulnerability, and total resiliency for quantitative assessment were used to compare the alternatives. The alternatives include various water release policies and corresponding levels of refinement.

Dai and Labadie (2001) introduced a model for water allocated called MODSIMQ which is an extended version of the MODSIM. The MODSIMQ incorporates the river water quality assessment model of QUAL2E. They used the Frank–Wolfe nonlinear programming to link the water quantity and quality simulation models and attain optimal water allocation policies considering water quality issues. Kerachian and Karamouz (2007) developed a stochastic model for water quantity and quality management in reservoir–river systems. In their model, the uncertainty of inflow to the reservoir was taken into account. They used the Nash bargaining theory to manage the conflict of interests of stakeholders. A water quality simulation model was developed and linked to the optimization model that simulates the thermal stratification cycle in the reservoir and the temporal and spatial variations of pollutants in downstream river.

Karamouz et al. (2006) presented a model based on the Nash bargaining theory for a reservoir–river operation system. They used a GA-based optimization model whose objective function was based on Nash theory. Also Water Quality for Reservoir–River Systems (WQRRS) and QUAL2E models are used for water quality considerations in reservoir and river, respectively. de Moraes et al. (2010) utilized coupled water quantity and quality simulation–optimization models to consider the hydrologic, agronomic and economic aspects of water allocation in a river basin in Brazil. They used the piece-by-piece method, which was introduced by Cai et al. (2001), to solve their optimization model.

Paredes–Arquiola et al. (2010) considered water quality and quantity issues in a basin-scale water resource management problem. They used two models of SIMGES and GESCAL to deal with the modeling of a reservoir–river system. These two models are parts of AQUATOOL which is a generalized decision-support system for water resources planning and management. A coupled water quality–quantity model was also proposed by Zhang et al. (2010). They divided the river basin into a network of reaches and tanks to analyze a water allocation optimization problem. In each tank, pollutant loads and water supply are evaluated and, in each river reach, water quality is simulated.

Nikoo et al. (2012a) developed a methodology for optimal allocation of water and waste load in rivers utilizing a fuzzy transformation method (FTM). The FTM, as a simulation model, was used in an optimization framework for constructing a fuzzy water and waste load allocation model. In this methodology, economic as well as environmental impacts of water allocation to different water users are considered.

Many researchers have developed operating rules for hydrosystems based on the results of optimization models. Mousavi et al. (2007) used fuzzy regression (FR) and adaptive network-based fuzzy inference system (ANFIS) to extract operating rules for reservoir. The results indicated that the FR model was better for extracting rules for long-term optimization models, while the ANFIS model was useful for medium-term implicit stochastic optimization models. Chaves and Chang (2008) developed reservoir operating rules using an artificial neural network named as ANN. Their ANN model benefits from genetic algorithm (GA) to identify its parameters. Karamouz et al. (2009) proposed a Bayesian stochastic genetic algorithm (BSGA) to define the lower and upper bounds of monthly releases from reservoir considering just the water quantity aspects. Using the obtained ranges for releases, the exact values of releases were defined considering the reservoir water quality. The WQRRS model was linked to the optimization model to define the exact values of monthly releases. Finally, a support vector machine (SVM) was utilized to extract the operating rules for real-time reservoir operation. Malekmohammadi et al. (2009) employed a variable length chromosome genetic algorithm (VLGA) for reservoir operation with the objectives of flood damage control and water supply to agricultural demands. They also used a Bayesian network (BN) to define the operating rules for cascade reservoirs.

Soltani et al. (2010) used an ANFIS-based model and a hybrid genetic algorithm to define the optimal reservoir operation policies considering some objectives related to the quantity and quality of water. An ANFIS-based model was employed to simulate the reservoir water quality and it was linked to a genetic algorithm to obtain the optimal water supply policies. The monthly reservoir operating rules were also proposed using ANFIS. Recently, an artificial immune recognition system (AIRS) was employed by Wang et al. (2011) to extract reservoir operating rules. They compared the extracted rules with those obtained using a radial basis function (RBF) neural network. The review of the previous works reveals that none of the existing soft computing techniques can outperform other models in all cases. Therefore, in our case study, five well-known techniques are used for developing water and waste load allocation rules and their results are compared.

In this paper, a stochastic dynamic programming (SDP), which incorporates the inflow uncertainty, is developed for reservoir operation management. Also, a nonlinear interval optimization model based on particle swarm optimization (PSO) and simulating annealing (SA) is developed for optimal water and waste load allocation in downstream river. This model incorporates the uncertainties of water demand and return flow quality of different water users. In the proposed model, called PSO-SA, a nonlinear interval number optimization method is utilized to consider the constraints and objective function uncertainty. Finally, an integrated model for long-term water and waste load allocation in reservoir–river systems is developed by embedding the SDP and nonlinear interval PSO-SA model. Using the results of the proposed methodology, five soft computing models, namely, fuzzy K-nearest neighbor (FKNN), BN, regression tree induction (named M5P), support vector regression (SVR) and an adaptive neuro-fuzzy inference system (ANFIS) are trained and validated to develop water and waste load allocation rules. In the proposed methodology, the SDP optimization model provides real-time operating rules for reservoir based on the values of reservoir water storage and inflow to the reservoir in each time step. Then the trained soft computing techniques provide the water and waste load allocation policies based on the reservoir release, which is obtained using the SDP model, return flow quality as well as monthly water demands of water users along the river. Therefore, a decision maker can use the methodology presented in this paper for real-time water and waste load allocation in reservoir–river system. The application of the methodology in the Dez reservoir–river system in the south-western part of Iran demonstrates that it is a useful tool for water and waste load allocation in reservoir–river systems under uncertainty.

Model framework

In this section, the framework of the proposed methodology for the long-term water and waste load allocation in reservoir–river systems is described. This methodology includes a stochastic reservoir operation optimization model and water and waste load allocation model in downstream river under uncertainty. An SDP is used for reservoir operation optimization to consider reservoir inflow uncertainty. Also a PSO-SA model is developed for nonlinear interval optimization of water and waste load allocation in downstream river.

In the PSO-SA water and waste allocation model, considering a large number of water quality and quantity constraints, a PSO model, which uses a dynamic penalty method for constraint handling, is developed. In each iteration of the PSO model, an SA optimization model is used to determine the lower and upper bounds of water quality constraints and objective function which are required in the nonlinear interval number optimization method. A flowchart of the proposed methodology is shown in Fig. 1.

Fig. 1
figure 1

A flowchart of the proposed methodology for water and waste load allocation in reservoir–river systems

As can be seen in Fig. 1, in the first step, the required data such as physical characteristics of reservoir, time series of inflow to the reservoir, water users’ demands, the quality of released water from reservoir as well as the quality of return flow of each water user are gathered. Also, a primary economic analysis is done to determine the potential benefit of each water user in the case of fully supplying its water demand. The results of this analysis are used in estimating crop production functions.

In the next step, the SDP-based reservoir operation optimization model is coupled with the PSO-SA model. Then, the optimal long-term policies for water and waste load allocations in reservoir–river system are determined by considering the uncertainties of reservoir inflow, water demands and quality of each return flow.

Finally, using the results of the proposed water and waste load allocation methodology, the soft computing models are trained and validated to develop water and waste load allocation rules. A trained soft computing model which provides the best performance can be utilized for real-time water and waste load allocation. In the following sections, the formulation and the structure of the SDP reservoir operation optimization model and the PSO-SA water and waste load allocation model are explained.

Stochastic dynamic programming (SDP) for reservoir operation

In reservoir–river systems, the amount of flow in downstream river is controlled by the upstream dam. On the other hand, the water and waste load allocation to the downstream water users depend on the volume of the water released from the upstream dam. Therefore, in such systems, the relationship between the reservoir operation and water and waste load allocation in downstream river should be considered. In this paper, an SDP reservoir operation model, which can be easily linked with the nonlinear interval PSO-SA water and waste load optimization model, is developed. The objective function of the SDP model is the maximization of the total net benefit of water users in downstream river. The main constraints of SDP reservoir operation model are related to the mass balance of water in reservoir, maximum capacity of outlets and their rating curves, as well as the maximum and minimum water storage of the reservoir. The decision variables of this model show the optimal policies for water release from reservoir and water and waste load allocation in downstream river considering the uncertainties of reservoir inflow, water demand and quality of each agricultural return flow. In other words, by coupling the SPD and PSO-SA models, the water release from reservoir is optimized in a way that water quality in downstream river does not violate the water quality standards. In this study, it is assumed that the thermal stratification of water in reservoir does not have any considerable effect on temporal variation of quality of outflow from the reservoir. The recursive function of the SDP model is as follows:

$$ f_{t} (S_{t} ,Q_{t} ) = \,{\text{Max}}\,[\,g(Q_{t} ,S_{t} ,R_{t} )\, + \,\alpha E_{{Q_{t + 1} |Q_{t} }} [\,f_{t + 1} (S_{t + 1} ,Q_{t + 1} )]\,]\,\,\,\,\,\,\forall \,S_{t} ,\,Q_{t} ,\,t \in \{ 1, \ldots ,T\} .$$
(1)

where \( R_{t} \) is the reservoir release during time step t [million cubic meters (MCM)], \( S_{t} \) the reservoir storage at the beginning of time step t (MCM), \( S_{t + 1} \) the reservoir storage at the beginning of time step t + 1 (MCM), \( Q_{t} \) the reservoir inflow during time step t (MCM), \( Q_{t + 1} \) the reservoir inflow during time step t + 1 (MCM), \( f_{t + 1} (S_{t + 1} ,Q_{t + 1} ) \) the total benefit of the reservoir–river system from the time step t + 1 to the end of the planning horizon ($), \( g(Q_{t} ,S_{t} ,R_{t} ) \) the benefit of the reservoir–river system during time step t ($), \( f_{t} (S_{t} ,Q_{t} ) \) the total benefit of the reservoir–river system from the time step t to the end of the planning horizon ($), \( \alpha \) the discount factor (in this paper is equal to 1), and \( E_{{Q_{t + 1} |\,Q_{t} }} \) is the conditional expectation operator.

In order to calculate \( g(Q_{t} ,S_{t} ,R_{t} ) \), we used PSO-SA model, which provides the optimal benefit of the system in each time step.

The PSO-SA model for water and waste load allocation in rivers

A nonlinear interval number programming is utilized in the PSO-SA model to incorporate the uncertainties of water demand and quality of return flow of each water user. In this model, the environmental impacts of water allocation are taken into account by controlling the water quality along the river and supplying the environmental demands.

A PSO model has been developed for water and waste load allocation. The PSO model uses a dynamic penalty method for constraints handling. The incorporation of uncertainties in water and waste load allocation model provides interval values for decision variables. For comparing the interval numbers in the process of handling constraints and updating local and global best solutions in the PSO model, a nonlinear interval number optimization method proposed by Jiang et al. (2008) and Nikoo et al. (2012b) is utilized. A simulated annealing (SA) optimization model has been also employed to calculate the lower and upper bounds of the interval numbers. This PSO-SA allocation model has the ability to link with the reservoir operation model. Figure 2 illustrates a flowchart of the nonlinear interval PSO-SA model.

Fig. 2
figure 2

A flowchart of the nonlinear interval PSO-SA model for water and waste load allocations in rivers under uncertainty

As can be seen in this flowchart, the nonlinear interval PSO-SA water and waste load allocation model consists of two main steps. In the first step, main procedures of PSO-SA model are described. In this step, for handling constraints, the SA optimization model is used to determine interval bounds of water quality at checkpoints and objective function due to uncertainties. Thus, in each iteration of PSO model, several SA models will be run depending on the number of particles and the number of constraints which are dealt with. In the second step, the optimum water and waste load allocation policies, and the total net benefit of each agricultural water user are calculated.

Figure 3 illustrates a schematic view of a reservoir–river system, which is considered to present the formulation of the water and waste load allocation model. The decision variables of this optimization model are the amounts of allocated water to water users and the diverted agricultural waste load to evaporation ponds. In this paper, the crop production function is used to determine the losses due to deficit irrigation. The uncertainty of water demand and return flow quality of each water user are also taken into account in this model. The objective function of the model is maximization of benefits of simultaneous water and waste load allocation:

$$ {\text{Max}}\,\,\,\,Z = B(X,U)\, = \sum\limits_{i = 1}^{n} {[({\text{CPD}}_{i} \times u_{i} \times (1 - k_{yi} \times [1 - \frac{{x_{i} }}{{u{}_{i}}}]) \times A{}_{i}} \,) - (c_{di} \times x_{di} )] $$
(2)
$$ \sum\limits_{i = 1}^{n} {(1 - \alpha_{i} )x_{i} } \, + \sum\limits_{i = 1}^{n} {x_{di} } \le \,\,X_{{}} - (1 - \alpha_{c} )d_{c} - {\text{E}}_{\text{d}} $$
(3)
$$ u_{1i} = [d_{\text{li}} \,,\,d_{\text{ui}} ]\,\,\,\,\,\,\,\,\,i = 1,\,2,\,..,n $$
(4)
$$ 0 \le x_{i} \le d_{\text{ui}}\quad \;\forall \,i = 1\,,\,2\,, \ldots ,\,n $$
(5)
$$ 0 \le x_{di} \le \alpha_{i} {\kern 1pt} d_{\text{ui}}\quad \;\forall \,i = 1,\,\,2\,, \ldots ,n $$
(6)
$$ {\text{c}}_{k} \, \le {\text{c}}_{\text{s}}\quad \;\forall k = 1,\,2,\, \ldots ,m $$
(7)
Fig. 3
figure 3

A schematic view of a reservoir–river system

Other constraints of this optimization model can be found in Nikoo et al. (2012b). Parameters and variables of the optimization model are defined as follows:

\( Z = B(X,U)\, \) :

Total benefit of water and waste load allocation in river system (benefit of allocation of water to the water users minus the cost of diversion of waste load to the evaporation ponds) ($),

\( X \) :

Available water for allocation to the agricultural sector (MCM),

\( n \) :

Number of water users,

\( m \) :

Number of water quality checkpoints,

\( U \) :

Vector of uncertain parameters,

\( B \) :

Total net benefit of water and waste load allocation ($),

\( k_{yi} \) :

Crop response factor for water user i,

\( c_{\text{di}} \) :

Unit cost of diversion of waste load to the evaporation pond for water user i ($),

\( {\text{CPD}}_{i} \) :

Average annual benefit of water user i using one unit of water [this ratio is called crop per drop (CDP)],

\( A{}_{i} \) :

Farm land area of water user \( i \) (ha),

\( u_{i} \,(i = 1,\,\,2\,,\;3) \) :

Uncertain water demands of agricultural water users i (MCM),

\( d_{\text{li}} \)/\( d_{\text{ui}} \) :

Lower/upper bound of water demand of water user i (MCM),

\( x_{i} \) :

Amount of water allocated to water user i (MCM),

\( x_{\text{di}} \) :

Amount of waste load diverted to evaporation pond by water user i (MCM),

\( d_{\text{c}} \) :

Monthly domestic water demand (MCM),

\( \alpha_{\text{c}} \) :

Ratio of generated waste load to allocated water to the domestic water user,

\( \alpha_{i} \) :

Ratio of generated waste load (return flow) to allocated water to agricultural water user i,

\( {\text{E}}_{\text{d}} \) :

Environmental water demand (MCM),

\( {\text{c}}_{k} \) :

Concentration of water quality indicator at checkpoint k (mg/L),

\( {\text{c}}_{\text{s}} \) :

Standard level for the concentration of water quality indicator (mg/L).

For more details about the nonlinear interval number optimization model, the reader is referred to Nikoo et al. (2012b).

Soft computing models

In this paper, the results of the optimization models are used to develop water and waste load allocation rules using five soft computing techniques of FKNN, M5P, SVR, BN and ANFIS. Details and applications of FKNN, M5P, ANFIS, SVR and BN models can be found in Keller et al. (1985), Etemad–Shahidi and Mahjoobi (2009), Mesbah et al. (2009), Bashi–Azghadi and Kerachian (2010); Bashi–Azghadi et al. (2010), Etemad–Shahidi and Ghaemi (2011) and Malekmohamadi et al. (2011).

Case study

The proposed methodology is used for water and waste load allocation in the Dez reservoir–river system in the south-western part of Iran. Figure 4 illustrates a view of the Dez reservoir–river system and its location in Iran.

Fig. 4
figure 4

The Dez reservoir–river system and its location in Iran

The Dez River is located downstream of the Dez Dam and after passing the Dezful City goes toward the south to join the Karoon River in the Band-e-Ghir region. The Dez River, with average flow of 8.5 MCM per month, supplies the agricultural demand of the Dez irrigation network, domestic water demand of the Dezful City and some villages as well as water demands of some agro-industrial units. The Dez Dam is a concrete arch dam with a total volume and height of 3,340 MCM and 190 m, respectively.

The minimum and maximum monthly inflow to the Dez Dam is 0.16 and 1.7 MCM in October and April, respectively. Results of a frequency analysis show that the average annual discharge of the Dez River is equal or more than 6,200 MCM with the probability of 0.8. Most of agricultural lands in the Dez water basin have modern irrigation and drainage networks. Since the groundwater quality in the study area is not appropriate, the agro-industrial water demands are supplied by the Dez Dam. The study area is composed of three large agro-industrial water users which are located from the Dez Dam to the Band-e-Ghir region (Fig. 4). The lower and upper bounds of water demands of the agro-industrial water users are shown in Fig. 5.

Fig. 5
figure 5

Lower and upper bounds of monthly water demands of agro-industrial units in the study area (MCM) (Nikoo et al. 2012b)

A considerable amount of allocated water to users returns to the system. This waste load contains high concentration of pollutants such as fertilizers, heavy metals, pesticides and total dissolved solids (TDS). The main water pollutant in the Dez reservoir–river system is TDS because the TDS concentration frequently violates the water quality standards. The lower and upper bounds of TDS concentration in return flow of water users are presented in Fig. 6.

Fig. 6
figure 6

Lower and upper bounds of monthly TDS concentration in waste load of agro-industrial water users in the study area (mg/L)

The main crop in agricultural lands in the study area is sugarcane. Therefore, the sugarcane’s yield response factors are considered in crop production function. Also, in this study, the monthly environmental and domestic water demands are constrained to be fully supplied. Based on the Dezab Consulting Engineers studies, the environmental water demand (instream flow) in the Dez River is 240 MCM per month (Dezab Consulting Engineers 2001). The return flow coefficients are considered to be 0.4 and 0.6 for agricultural and domestic water users, respectively. In this study, it is assumed that the water pollution due to return flow of an agro-industrial water user can be controlled by diverting a part of its return flow to an evaporation pond. The annual evaporation rate in the Dez reservoir–river system is about 2,400 mm.

Results and discussion

The optimal policies for water allocation and diversion of waste load to evaporation ponds can be developed using the proposed water and waste load allocation optimization model. These policies are defined to maximize the total benefit of the water and waste load allocation in the Dez reservoir–river system and minimize the range of variation of the total benefit.

The active water storage of the Dez reservoir is about 2,700 MCM. In the SDP model, the numbers of discretization of active reservoir water storage and inflow in each month are considered to be 50 and 6, respectively. The upper bounds of reservoir inflow in different classes are represented in Table 1.

Table 1 Upper bounds of reservoir inflow in different classes (MCM)

The main inputs of the proposed water and waste load allocation optimization model are a 40-year time series of monthly inflow (1970–2009) to the Dez Reservoir for calculating inflow transition probability matrix of the SDP model, lower and upper bounds of monthly water demands, lower and upper bounds of TDS concentration in waste load of water users and the rating curves of the reservoir outlets. In this study, the initial storage of the Dez Dam during the simulation period is considered to be 70 % of normal reservoir storage (i.e., 2,900 MCM). Also, the water quality is controlled at three checkpoints along the Dez River to maintain the TDS concentration at the standard level (1,000 mg/L).

As the quality of inflow to the Dez Reservoir is excellent, it is assumed that this reservoir acts like a completely mixed reactor and variations of water quality in different layers of the reservoir are not taken into account. The outputs of the proposed methodology are optimal policies for water and waste load allocation in Dez reservoir–river system by considering the main uncertainties. As an example, Fig. 7 shows the time series of reservoir inflow, downstream water demand and reservoir water releases during the first 240 months of the simulation period (1990–2009).

Fig. 7
figure 7

Time series of inflow, downstream water demand and optimal water release of the Dez Dam (January 1990 to December 2009)

The uncertainties of water demand and the quality of return flow of water users, which are considered as interval numbers, provide the upper and lower bounds of TDS concentrations at water quality checkpoints. As an example, time series of allocated water to different water users during the first 10 years of the planning horizon (1990–1999) are represented in Fig. 8. Also the time series of diverted waste load (return flow) of water users 1 and 3 to evaporation ponds during the period of January 1990 to December 1999 are illustrated in Fig. 9.

Fig. 8
figure 8

Time series of allocated water to different water users in the Dez reservoir–river system based on the results of the water and waste load allocation model (January 1990 to December 1999)

Fig. 9
figure 9

Time series of diverted waste load (return flow) to evaporation ponds by water users 1 and 3 during the period of January 1990 to December 1999

In order to investigate the effects of uncertainties on water quality along the Dez River, the TDS concentration of the Dez River in the second and third water quality checkpoints for the period of January 1990 to December 1999 are shown in Figs. 10 and 11, respectively. As shown in these figures, the water quality standard (i.e., 1,000 mg/L for TDS) is always satisfied using the proposed policies. It is seen that the uncertainties of system led to lower and upper bounds instead of a unique value for river water quality. Figure 12 illustrates the lower and upper bounds of the optimal total benefit of the reservoir–river system during the period of January 1970 to December 2009.

Fig. 10
figure 10

Lower and upper bounds of TDS concentration in the second water quality checkpoint during the period of January 1990 to December 1999

Fig. 11
figure 11

Lower and upper bounds of TDS concentration in the third water quality checkpoint during the period of January 1990 to December 1999

Fig. 12
figure 12

Lower and upper bounds of the total benefit of the reservoir–river system during the period of January 1970 to December 2009

To develop water and waste load allocation rules, five soft computing models, namely, FKNN, Regression tree Induction (named M5P), SVR, BN and ANFIS, are trained and verified using the results of optimization models. The operating rules for monthly outflow of the reservoir are directly provided by the SDP model. Each soft computing technique has eight inputs which are month number, water release from the reservoir during the month, water demands and waste loads of three water users. 75 and 25 % of input–output data sets are used for training and validating the models, respectively. In order to evaluate and compare the performances of the developed simulation models, five different statistical performance measures, namely, root mean relative error (RMRE), root mean square error (RMSE), Bias, correlation coefficient (CC) and scatter index (SI), are used:

$$ {\text{RMRE}} = \sqrt {\frac{1}{n}\sum\limits_{i = 1}^{n} {\left| {\frac{{o_{i} - p_{i}^{*} }}{{p_{i}^{*} }}} \right|} } $$
(8)
$$ {\text{RMSE}} = \sqrt {\frac{1}{n}\sum\limits_{i = 1}^{n} {\left( {\frac{{o_{i} - p_{i}^{*} }}{{p_{i}^{*} }}} \right)}^{2} } $$
(9)
$$ {\text{Bias}} = \frac{1}{n}\sum\limits_{i = 1}^{n} {(o_{i} } - p_{i}^{*} ) $$
(10)
$$ {\text{CC}} = \frac{{\sum\nolimits_{i = 1}^{n} {o_{i} p_{i}^{*} } }}{{(\sum\nolimits_{i = 1}^{n} {o_{i}^{2} \sum\nolimits_{i = 1}^{n} {p_{i}^{{*^{2} }} } } )^{{{\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 2}}\right.\kern-0pt} \!\lower0.7ex\hbox{$2$}}}} }} $$
(11)
$$ {\text{SI}} = \frac{{\sqrt {{\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 n}}\right.\kern-0pt} \!\lower0.7ex\hbox{$n$}}\sum\nolimits_{i = 1}^{n} {((o_{i} - O) - (p_{i}^{{*}} - P^{*}))^{2} } } }}{O} $$
(12)

where \( o_{i} \) and \( p_{i}^{*} \) are ith optimized and predicted values, respectively. \( n \) is the number of data in the validation data set. Also \( O \) and \( P^{*} \) denote the average optimized and predicted values in the validation stage, respectively.

A comparison among the performances of the trained FKNN, M5P, SVR, BN and ANFIS in the validation process for prediction of allocated water to water user 1 is presented in Table  2. As shown in this table, the performances of M5P and FKNN models are better than the other simulation models. Comparisons between the results of the FKNN and M5P models for estimating allocated water to water user 1 in the validation stage are shown in Fig. 13. As it is shown in this figure, in general, the M5P model outperforms the FKNN. The values of the statistical performance measures for evaluating the five simulation models trained for estimating the allocated water to water users 2 and 3 are also presented in Tables 3 and 4, respectively.

Table 2 Comparing the performances of the trained FKNN, M5P, SVR, BN and ANFIS in the validation process
Fig. 13
figure 13

Comparing the results of FKNN and M5P models trained for estimating allocated water to water user 1 in the validation stage

Table 3 Comparing the performances of FKNN, M5P, SVR, BN and ANFIS models trained for estimating water allocation to water user 2
Table 4 Comparing the performances of FKNN, M5P, SVR, BN and ANIS models trained for estimating water allocation to water user 3

As it is shown in these tables, the performances of M5P and SVR models are better than the other soft computing models in estimating the allocated water to water users 2 and 3. As an example, a comparison between the optimized and predicted water allocation to water user 1 using the M5P and FKNN models is shown in Fig. 14 for a test data set which has not been used in training of the models. As it is shown in this figure, M5P and FKNN models can successfully predict allocated water to water user 1.

Fig. 14
figure 14

Comparing the optimized and predicted allocated water to water user 1 using the trained M5P and FKNN models considering 50 data sets randomly selected from the validation data set

As mentioned in “Introduction”, the SDP optimization model provides real-time operating rules for reservoir operation, whereas the trained soft computing techniques provide the real-time water and waste load allocation policies based on the reservoir release, which is obtained using the SDP model, return flow quality as well as monthly water demands of water users along the river. For instance, Figs. 15 and 16 present the average monthly allocated water to each water user as well as the volume of diverted return flow to evaporation ponds based on the results of the FKNN-based water and waste load allocation rules.

Fig. 15
figure 15

The average monthly allocated water to different water users in the Dez reservoir–river system during the planning horizon

Fig. 16
figure 16

The average monthly diverted return flow to evaporation ponds by water users 1 and 3 during the planning horizon

Summary and conclusions

In this paper, a new methodology was introduced for optimization of water and waste load allocation in reservoir–river systems considering the existing uncertainties in reservoir inflow, waste loads and water demands. In the proposed methodology, an SDP model was used to optimize reservoir operation considering the inflow uncertainty and another model called PSO-SA was developed and linked with the SDP model for optimizing water and waste load allocation in downstream river. As the run-time of the proposed water and waste load allocation model can be considerable [run-time of the proposed optimization model in C++ environment is about 25 h (with operating system: Windows XP; CPU: Intel®Core™2 Duo at 2.5 GHs; SIMM: 2 GB)], some soft computing techniques, namely, M5P, FKNN, BN, SVR and an ANFIS, were trained and validated using the results of the optimization model to develop real-time water and waste load allocation rules. Results of applying the methodology to the Dez reservoir–river system in the south-western part of Iran demonstrated its efficiency and applicability. The results also showed that in our case study, the M5P, SVR and FKNN can outperform other soft computing models and they can accurately be used for developing real-time water and waste load allocation rules in the Dez reservoir–river system. In future works, the methodology introduced in this paper can be extended to incorporate more uncertainties and multiple water quality indicators.