Introduction

Predicting the discharge in the natural streams is one of the main parameter in the flood engineering problems (Greco et al. 2004). Calculating the discharge in the streams especially in the flooding leads to better management of hydraulic structure operation such as gated spillways operation. Discharge estimation n rivers helps to calculate the downstream water surface elevation that is an important parameter in river engineering projects such as river intake design, defining the height of dams and also determining the area of floodplains (Te Chow 2009). River hydraulic modeling by commercial software such as Mike and Hec Ras and so on needs to have an accurate value of flow discharge or head-discharge curve (Knight and Shamseldin 2005). The concept of the compound open channel is the accurate approach for modeling the natural streams which is developed recently. As shown in the Fig. 1 the compound open channels cross section includes a main channel and floodplains. The normal value of discharges flows in the main channel and when the flood occurs additional discharge flows in the floodplains. Because of covering the floodplains by flow in flooding conditions, the floodplains usually are covered by vegetation so usually it is rougher than the main channel (Myers 1987; Yang et al. 2014; Khatua et al. 2012; Ackers 1993; Wormleaton and Hadjipanos 1985). As shown in the Fig. 1 the main channel and floodplains roughness shows by nmc and nfp sequentially. This difference between the roughness leads to create a momentum transferring and appearance an interaction area between main channel and floodplains (Myers 1987; Ackers 1993; Al-Khatib et al. 2012). Flow structure in compound open channel is fully turbulence and 3D dimensionality especially in flooding condition, so calculating the discharge by classical formulas such as Manning and Chezy makes to appearance the incredible error in river engineering studies (Wormleaton and Hadjipanos 1985; Stephenson and Kolovopoulos 1990).

Fig. 1
figure 1

Compound open channel cross section

Several ways as analytical approaches and artificial intelligent (AI) techniques have been proposed to achieve more accuracy in rivers discharge prediction. In this regards the Single-Channel Method, Divided-Channel Method, and Coherence Method can be mentioned as analytical approaches (Yang et al. 2014; Bousmar et al. 2004; Huthoff et al. 2008; Yonesi et al. 2013; Al-Khatib et al. 2012; Mohanty and Khatua 2014; Hosseini 2004; Naot et al. 1993; Al-Khatib et al. 2013; Liao and Knight 2007; Atabay and Knight 2006). Recently by advancing the data mining approaches, some artificial intelligence models such as artificial neural network; Genetic Programing, and M5 tree models was applied to predict the flow discharge in compound open channel. Based on the scientific reports the performances of the Artificial intelligence (AI) models are better than the analytical approaches (Sahu et al. 2011; Seckin 2004; Unal et al. 2010; Zahiri and Azamathulla 2014). Using the AI model AI models together numerical methods in a computer simulation of the hydraulic phonemes leads to increase the accuracy of the numerical modeling (Parsaie and Haghiabi 2015). Sahu et al. (2011) predicted the discharge in compound open channel by using the neural network technique and state that the ratio of the depth of the flow in the main channel to the depth of the flow in the floodplains \( \left( {D_{r} } \right) \), ratio of the area of the main channel to the floodplains \( \left( {A_{r} } \right) \) and ratio of the hydraulic radius of the main channel to the floodplains \( \left( {R_{r} } \right) \) are the most influence parameters for predicting the flow discharge in the compound open channel. Zahiri and Azamathulla (2014) by applying the genetic programing technique on the single-channel method results proposed an equation to predict the discharge in compound open channel. In this paper another types of AI models which is named support vector machine (SVM) is used for predicting the flow discharge in the compound open channel.

Support vector regression

SVMs are set of related supervised learning methods used for classification and regression. In many applications a non-linear classifier provides better accuracy. In SVR, the input x is first mapped onto an m-dimensional feature space using some fixed (nonlinear) mapping, and then a linear model is constructed in this feature space. The naive way of making a non-linear classifier out of a linear classifier is to map our data from the input space X to a feature space F using a non-linear function \( \varphi :x \to f \). In the space F the discriminate function is:

$$ f\left( x \right) = w^{T} \varphi (x) + b $$
(1)

Using mathematical notation, the linear model (in the feature space) f (x, w) is given by

$$ w = \sum\limits_{i = 1}^{n} {\alpha_{i} x_{i} } $$
(2)
$$ f\left( {x,w} \right) = \sum\limits_{j = 1}^{n} {\alpha_{i} x_{i} \varphi_{i} \left( x \right) + b} $$
(3)
$$ {\text{f}}\left( {\text{x}} \right) = \sum\limits_{{{\text{i}} = 1}}^{\text{n}} {\alpha_{\text{i}} {\text{x}}_{\text{i}}^{\text{T}} {\text{x}} + {\text{b}}} $$
(4)

In the feature space, F this expression takes the form:

$$ f\left( x \right) = \sum\limits_{i = 1}^{n} {\alpha_{i} \varphi \left( {x_{i} } \right)^{T} \varphi (x) + b} \quad 0 \le \alpha_{i} \le C $$
(5)
$$ k\left( {x,x^{\prime } } \right) = \varphi \left( x \right)^{T} \varphi (x^{\prime } ) $$
(6)
$$ {\text{f}}\left( {\text{x}} \right) = \sum\limits_{{{\text{i}} = 1}}^{\text{n}} {\alpha_{\text{i}} {\text{k}}\left( {{\text{x}},{\text{x}}_{\text{i}} } \right) + {\text{b}}} $$
(7)

There are many kernel functions in SVM, so how to select a good kernel function is also a research issue. However, for general purposes, there are some popular kernel functions.

  1. (i)

    Linear kernel: \( k\left( {x_{i} , x_{j} } \right) = x_{i}^{T} x_{j} \)

  2. (ii)

    Polynomial kernel: \( k\left( {x_{i} , x_{j} } \right) {\kern 1pt} = {\kern 1pt} \left( {\gamma x_{i}^{T} x_{j} + r} \right)^{d} ,\quad \gamma > 0 \)

  3. (iii)

    RBF kernel: \( k\left( {x_{i} , x_{j} } \right) = { \exp } \left( { - \gamma \left\| {x_{i} - x_{j} } \right\|} \right)^{ 2} ,\quad \gamma > 0 \)

  4. (iv)

    Sigmoid kernel: \( k\left( {x_{i} , x_{j} } \right) = { \tanh } \left( {\gamma x_{i}^{T} x_{j} + r} \right), \quad \gamma > 0 \)

Here C, γ and r and d are kernel parameters. It is well known that SVM generalization performance (estimation accuracy) depends on a good setting of meta-parameters parameters C, \( \gamma \) and r and the kernel parameters. The choices of C, \( \gamma \) and r control the prediction (regression) model complexity. The problem of optimal parameter selection is further complicated because the SVM model complexity (and hence its generalization performance) depends on all three parameters. Kernel functions are used to change the dimensionality of the input space to perform the classification.

Analytical approach

The Divided Channel method (DCM) is the accurate analytical approach which divides the cross section into the main channel and floodplains. In this the method the discharge is calculated for each subsection and total discharge of the compound channel section is calculated by adding the subsections discharge. The discharge in subsections calculates by Eq. (8). As shown in this equation the classical equation such as manning is used for calculating the discharge and i subscription is related to the discharge in each sub sections. The separation line between the main channel and floodplains as shown in the Figs. 1 may be considered as vertical, diagonal or horizontal in this paper the divided channel method with horizontal division lines which are included within the calculation of wetted perimeter (DCM (h–i)) is considered (Huthoff et al. 2008).

$$ Q_{t} = \left( {\sum\limits_{i = 1}^{N} {\frac{{A_{i} R_{i}^{\frac{2}{3}} }}{{n_{i} }}} } \right)S_{0}^{\frac{1}{2}} $$
(8)

where N is the number of the subsections, \( S_{0} \) is the longitudinal slope of the compound open channel, \( A_{i} \) is the area, \( R_{i} \) is the Hydraulic radius, and n i is the roughness coefficient (Manning coefficient) of the subsections.

Model development

Developing the SVM model as similar to other neural network models is based on data set. To this purpose 202 data set related to the flow discharge in compound open channel which published in the creditable journals was collected. Some of the resources that data derived from the are given as follow (Naot et al. 1993; Sahu et al. 2011; Seckin 2004; Unal et al. 2010; Yonesi et al. 2013; Tang et al. 1999; Knight et al. 1984). For developing the SVM model, the collection data divides in two groups, training and testing data. The range of the data collection gives as gives in the Table 1. The main parameters which are influences on the flow discharge in the compound open channel gives in the Eq. (9).

$$ Q_{cmp} = f\left( {f_{fp} ,f_{mc} ,A_{fp} ,A_{mc} ,R_{fp} ,R_{mc} ,S,h,\left( {H - h} \right)} \right) $$
(9)

where \( f_{fp} \) and \( f_{mc} \) is the roughness of main channel and floodplains, A fp and A mc is the area of main channel and floodplains, R fp and R mc is the hydraulic radius of main channel and floodplains, S is the longitudinal slope of compound open channel, H is the depth of flow in the main channel and h is the depth of the flow in the floodplains. Based on the researches which implement the neural network techniques to predict the flow discharge in the compound open channel, developing the AI models based on the dimensionless parameter leads to prepare an optimal structure of the model. Based on these researches the most popular dimensionless parameters aregiven in the Eq. (10).

$$ Q = f(f_{r} ,A_{r} ,R_{r} ,S,H_{r} ) $$
(10)

where S is the longitudinal slope of the compound open channel, \( n_{r} \) is defined as \( \frac{{f_{mc} }}{{f_{fp} }} \), \( A_{r} \) is defined as \( \frac{{A_{mc} }}{{A_{fp} }} \), R r is defined as \( \frac{{R_{mc} }}{{R_{fp} }} \), D r is defined \( \frac{H - h}{H} \), and Q m is the measured discharge. For developing the SVM the n r , A r , R r , S and D r is considered as inputs parameters and Q m is considered as outputs parameter.

Table 1 Range of data collection related to the discharge

Results and discussion of SVM

The Divided Channel method (DCM) ascommon analytical approach is used to calculate the discharge of flow in compound open channel. The performance of the DCM model shows in the Fig. 2 and to assess the performance of the DCM by error indices such as correlation coefficient (R 2) and root mean square (RSME)of error was applied. It should be noted that all the data collection (202 data set) is used for assessing the performance of the DCM method. As shown in the Fig. 2, the results of the DCM method in low values of the discharge especially values which are less than the 0.1 (cms) is more than the measured data and it is related to increase the area of the flow cross section in compare to hydraulic radius. The accuracy of the DCM method in the values between the 0.2 and 1 is suitable. By increasing the value of the discharge [values more than the 1(cms)] due to increase the intensity of the momentum transferring between the main channel and floodplains, usually the accuracy of the other analytical approaches are decreases but as shown in the Fig. 2 the performance of the DCM method is suitable and it is related to the considering the effect of the momentum transferring in the method development. As shown in the Fig. 2, the correlation coefficient of the DCM method is equal to (0.87) and RMSE is (0.05) and in overall the performance of the DCM is suitable.

Fig. 2
figure 2

Results of the divided channel method

Developing the SVM model based on the data set requires evaluating the quality of the data collection. Because of AI models development such as almost types of neural network models are based on the data set. The data distribution has influence impact on the performance of the AI models. To prepare a suitable ANN model by high reliability it is necessary to collect data which is regular distribution on the range of the data collection. Another way addition to the collecting the regular data is selecting the suitable data from the data collected for training process which becomes as suitable proxy for all data collection. To this purpose randomly selection may be considered. Although to evaluate the distribution of the data some indices such as minimum, maximum, average skewness, and standard division are present but to better understand the distribution of data, the histogram of data was plotted in the Fig. 3. As shown in the Fig. 3, about 95 % of data has a value less than the 0.4 (cms) and less than the 5 % of data has a values more the 0.4 (cms). To prepare the SVM model based on the collected data and by considering the Fig. 3 as distribution of the data, about 85 % (172) of the data are considered for training process and other data about 15 % (30) of data is used in thetesting stage. Four types of the kernel function which are mentioned in the support vector regression section such as Linear, secondary Polynomial, Radial Basis Function (RBF), and Sigmoid was used in development process of the SVM. The best performance of the SVM model has been found to be related to the RBF as the kernel function. The results of the SVM model in the training and testing stages shows in the Figs. 4, 5. As shown in the Figs. 4, 5, the accuracy of the SVM model is so suitable by training correlation coefficient 0.94 (i.e. \( R_{train}^{2} \)) and RMSE = 0.035 and testing correlation coefficient 0.99 (i.e. \( R_{test}^{2} \) = 99)and RMSE = 0.0001. During the SVM model process obtained 0.00005 for the gamma coefficient, epsilon is equal to 0.1 and C = 1. As shown in the Figs. 4, 5, the performance of the SVM model to predict the low values of the discharges especially discharge values less than the 0.5 (cms) is so suitable. By attention to the distribution of the discharge data (Fig. 3) and performance of the SVM model Figs. 4, 5, it is seems that the performance of SVM model for prediction the discharge values especially in the near to the maximum values 0.8 (cms) is suitable. To assess the performance of SVM model addition to plot the SVM results vs measured data, the error distribution and histogram of the error is plotted. As shown in the Figs. 4, 5 the accuracy of the SVM model to predict the Maximum values of the discharge.

Fig. 3
figure 3

Histogram of discharge values of collected data

Fig. 4
figure 4

The performance of the SVM model in training stage

Fig. 5
figure 5

The performance of the SVM model in testing stage

Conclusions

Prediction of flow discharge in the natural stream flows is the main parameter in the flood management problems. The compound channel concept is the accurate approach for the simulation of the river problems. Predicting the flow discharge in compound open channels by classical formulas such as Manning and Chezy lead to appearance the incredible error in compare to the measured data, so researcher revised these approaches and proposed more advanced analytical approaches such as Divided Channel method. Although the revised approaches have been increased the accuracy of flow discharge calculation but flood management needs to implement more accurate approaches in the river engineering problems. Recently by advancing the AI models in water engineering problems, the artificial neural network models have been used widely for flow discharge prediction. Based on the results of this study, the maximum accuracy (correlation coefficient) of the analytical approaches is about 0.87 but a new model of the ANN such as support vector machine can easily obtain the accuracy about 0.99. The main points of the AI models developing are preparing a suitable set data collection which has suitable distribution along the range of the data collection. In addition to have a suitable data collection, considering the suitable kernels functions and correct setting the coefficients which uses in the kernel functions is necessary.