Side weirs have many possible applications in the field of hydraulic engineering. They are also considered an important structure in hydro systems. In this study, the support vector machine (SVM) technique was employed to predict the side weir discharge coefficient. The performance of SVM was compared with other types of soft computing techniques such as artificial neural networks (ANN) and adaptive neuro fuzzy inference systems (ANFIS). While ANN and ANFIS models provided a good prediction performance, the SVM model with a radial basis function kernel function outperforms them. The best SVM model was developed with a gamma coefficient and epsilon of 15 and 0.3, respectively. The SVM yielded a coefficient of determination (*R*^{2}) equal to 0.96 and 0.93 for the training and testing data. Sensitivity analyses of the ANN, ANFIS and SVM models showed that the Froude number and ratio of weir length to the flow depth upstream of the weir are the most effective parameters for the prediction of the discharge coefficient.

## INTRODUCTION

Modeling hydraulic structures has received much attention in recent years due to their effects on hydro-system performances. Weirs are the most common structures, which are used in most water engineering projects including hydro power systems, irrigation and drainage networks and sewage networks. A side weir is a hydraulic structure placed on the side of the channel, and sometimes it has been used as a water surface control structure in dams and irrigation projects, whereas the main task of this structure is to remove the excess flow from hydro systems (Haddadi & Rahimpour 2012; Bagheri *et al.* 2014). Side weirs have many possible uses in the field of hydraulic engineering, and have been investigated as an important structure in water resource projects as well. A study on the hydraulic properties of side weirs has been conducted using physical and numerical modeling (Namaee & Shadpoorian 2015). In the field of physical modeling, researchers have attempted to improve the performance of side weirs by proposing various forms for the weir crest. All different forms have been compared with the standard side weir, which has a rectangular shape. Based on physical modeling research, by improving the shape of the side weir crest, the side weir discharge coefficient can be increased about three times (Singh *et al.* 1994; Coşar & Agaccioglu 2004; Borghei & Parvaneh 2011; Emiroglu & Kaya 2011; Kabiri-Samani *et al.* 2011; Kaya *et al.* 2011; Rahimpour *et al.* 2011). Due to the high cost of physical modeling and laboratory equipment, investigators have been encouraged to use numerical approaches to determine the properties of this type of weir (Parsaie *et al.* 2015a, 2015b). Numerical studies of side weirs include two main parts, the first is to solve the governing equation, which is usually a differential equation, by discrete methods such as finite difference, finite volume and finite element. This field of numerical studies is called computational fluid dynamic (CFD) modeling. The other part is related to implementing soft computing approaches, which have been widely used for modeling and prediction of hydraulic phenomena. Researchers using the CFD techniques have attempted to define the water surface profile, velocity distribution and flow pattern along the length of the weir. Another approach in the field of numerical modeling is using the soft computing techniques. Using soft computing techniques helps to model the hydraulic properties accurately. The side weir discharge coefficient has been predicted by the adaptive neuro fuzzy inference system (ANFIS), the group method of data handling, gene expression programing and the multilayer perceptron (MLP) artificial neural network (ANN) (Emiroglu *et al.* 2011a, 2011b; Emiroglu & Kisi 2013; Ebtehaj *et al.* 2015a, 2015b). In addition to accurate modeling, the merit of ANN models is that they can be used to improve the accuracy of numerical solutions (Parsaie & Haghiabi 2014, 2015a, 2015b). Based on this work, ANNs have high ability for modeling systems which are based on the data set and for this reason they have become one of the most popular modeling tools (Abrahart *et al.* 2004; Govindaraju & Rao 2013). The idea of ANN development came from the neural system of the human brain. Choosing a sufficient number of neurons ensures the suitable performance of the model for modeling the phenomena based on the range of the relative available data set, but this characteristic does not guarantee the suitable performance of the model for predicting the phenomena outside the data range. Based on the reports, increasing the complexity of a model does not ensure a better predictive power whereas sometimes adding more complexity (increasing the number of neurons) may reduce the performance of the model (Cartwright 2015). This can be assessed from two aspects, on the other hand, any decrease in the performance of the model on a validation data set can be considered as indicative that the ANN has been over-fitted. The ANN training should not be performed too far with regard to the specific number of ANN parameters. One of the stopping criteria may be adjusted using the cross validation procedure. Alternatively, the model can be considered as over-parameterized: i.e. the available data set is insufficient for training the parameters of the designed model. The complexity of the designed model (number of parameters may have to be adjusted) with regard to the model results at the training stage should be balanced against its performance in modeling the unseen available data set. There is no direct way to determine the optimal structure (number of hidden layers and neurons) for the ANN and there is a risk of selecting ‘over-parameterized’ models: i.e. models so complex that they cannot be considered reliable when applied further than the training data set (Gaume & Gosset 2003). In this study, the support vector machine (SVM) technique is used to predict the discharge coefficient of standard rectangular side weirs. The SVM model was chosen because of its high ability in pattern recognition (Azamathulla & Wu 2011; Azamathulla & Zahiri 2012; Najafzadeh & Azamathulla 2013; Tayfur 2014; Zahiri & Azamathulla 2014; Najafzadeh & Sattar 2015). To evaluate the performance of SVM, other types of soft computing techniques (i.e. ANN and ANFIS) are developed.

## MATERIAL AND METHODS

*L*is the side weir length, is the diversion angle of the flow,

*P*is the weir height and

*S*is the longitudinal slope of the channel.

_{0}Row . | Author . | Equation . |
---|---|---|

1 | Nandesamoorthy & Thomson (1972) | |

2 | Subramanya & Awasthy (1972) | |

3 | Yu-Tech (1972) | |

4 | Ranga Raju et al. (1979) | |

5 | Hager (1987) | |

6 | Cheong (1991) | |

7 | Singh et al. (1994) | |

8 | Jalili & Borghei (1996) | |

9 | Borghei et al. (1999) | |

10 | Emiroglu et al. (2011a, 2011b) |

Row . | Author . | Equation . |
---|---|---|

1 | Nandesamoorthy & Thomson (1972) | |

2 | Subramanya & Awasthy (1972) | |

3 | Yu-Tech (1972) | |

4 | Ranga Raju et al. (1979) | |

5 | Hager (1987) | |

6 | Cheong (1991) | |

7 | Singh et al. (1994) | |

8 | Jalili & Borghei (1996) | |

9 | Borghei et al. (1999) | |

10 | Emiroglu et al. (2011a, 2011b) |

### SVM

*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 the data from the input space

*X*to a feature space

*F*using a non-linear function . In the space

*F*, the discriminant function is: Using mathematical notation, the linear model (in the feature space)

*f(x, w)*is given by: In the feature space,

*F*, this expression takes the following form: 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.

I. Linear kernel:

II. Polynomial kernel:

III. RBF kernel:

IV. Sigmoid kernel:

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, γ* and *r* and the kernel parameters. The choices of *C, γ* 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 input space to perform the classification (Azamathulla & Wu 2011; Parsaie *et al.* 2015a, 2015b).

### ANN

Then the result of is passed through the transfer function. Various types of transfer function have been proposed, the most well-known are given below.

I. Gaussian:

II. Sigmoidal:

III. Tansing:

This process (preparation of a neuron in the network) is carried out on all the neurons in the first hidden layer. In order to develop the second hidden layer, the output of the first hidden layer is considered for the neurons. This process is continued until the ANN structure based on the desire of the designer has been formed. As noted during the ANN preparation a network could have one or more hidden layers in this type of neural network named MLP. The MLP is a common type of ANN which is used widely for modeling and predicting engineering problems. The values of the weights and biases are defined during the training process which is called the learning stage. Learning means justifying the values of weights and biases so that the output of the network has minimum error in comparison with the observed values. Several algorithms have been proposed for training the ANNs, such as the Levenberg–Marquardt algorithm, but recently modern optimization algorithms such as the genetic algorithm (GA) and the particle swarm optimization (PSO) have been proposed (Parsaie & Haghiabi 2015a, 2015b).

### ANFIS

Where, *A _{1}*;

*A*and

_{2}*B*;

_{1}*B*are the MFs for inputs

_{2}*x*and

*y*; respectively;

*p*;

_{1}*q*;

_{1}*r*and

_{1}*p*;

_{2}*q*;

_{2}*r*are the parameters of the output function. The ANFIS architecture is presented in Figure 3(b). In the first layer, all input variables give the grade of membership with membership function, in layer 2, all the membership grades are multiplied together, in layer 3, all the membership grades are normalized, normalized and in layer 4 the contribution of all the rules is computed. In the last layer the output variable is computed as the weighted average of membership grade (Riahi-Madvar

_{2}*et al.*2009).

### Model development

Preparation of the SVM, ANN and ANFIS include choosing the type of the kernel function called the transfer function in ANN and the membership function in ANFIS, and then setting the internal parameters of the kernel function. Adjusting the internal parameters of the kernel function and in other words, training these methods, can be considered as an optimization problem. This problem can be solved using conventional methods such as the quadratic approach in SVM, the Levenberg–Marquardt technique in ANN and the hybrid algorithm in ANFIS. Recently, advanced optimization such as GA or PSO methods have been implemented for this purpose. Designing the structure of ANNs is a trial and error process. To avoid the ‘over-parameterization’ of ANN, designing the ANN structure is conducted step by step. This means that at the beginning of the design process a small number of neurons and a specific transfer function are considered. Then the model is trained and the results of the model are assessed. After verifying the proper operation of the transfer function, in the next step with regard to the performance of the model, for stages of preparation (training, validation and testing), one or more neurons may be added or removed. For assessing the model performance the results of the model are compared with observed data. It is notable that, to avoid over-training, in all iterations part of the data set is considered for model validation. Validation is a stage between model training and testing for avoiding model over-training. Developing the SVM model is similar to the ANN and ANFIS and is based on data sets. Therefore, 477 data sets related to the side weir discharge coefficient published in creditable journals were collected, the ranges of which are given in Table 2. Data were derived from a number of resources (Subramanya & Awasthy 1972; Singh *et al.* 1994; Borghei *et al.* 1999; Emiroglu *et al.* 2011a, 2011b; Bagheri *et al.* 2014). To prepare the SVM, ANN and ANFIS models, the data set is divided into three groups: training, validation and testing. The validation data set is considered for avoiding the over-fitting (over-learning) of the ANN model. A random approach is considered when assigning a data set for each stage of model development.

Data range . | Fr_{1}
. | P/h_{1}
. | L/b . | L/h_{1}
. | Cd . |
---|---|---|---|---|---|

Min | 0.09 | 0.03 | 0.21 | 0.19 | 0.09 |

Max | 0.84 | 2.28 | 3.00 | 10.71 | 1.75 |

Avg | 0.43 | 0.76 | 1.13 | 3.87 | 0.50 |

STDEV | 0.18 | 0.43 | 0.85 | 3.06 | 0.17 |

Data range . | Fr_{1}
. | P/h_{1}
. | L/b . | L/h_{1}
. | Cd . |
---|---|---|---|---|---|

Min | 0.09 | 0.03 | 0.21 | 0.19 | 0.09 |

Max | 0.84 | 2.28 | 3.00 | 10.71 | 1.75 |

Avg | 0.43 | 0.76 | 1.13 | 3.87 | 0.50 |

STDEV | 0.18 | 0.43 | 0.85 | 3.06 | 0.17 |

## RESULTS AND DISCUSSION

*R*

^{2}) and root mean square error (RMSE) were used to assess the accuracy of empirical formulae (see Table 3). As shown in Table 3 and Figure 4, the Emiroglu formula with

*R*

^{2}= 0.64 and RMSE = 0.03 is the most accurate one among the empirical formulae.

Author . | R^{2}
. | RMSE . |
---|---|---|

Nandesamoorthy & Thomson (1972) | 0.01 | 0.00 |

Subramanya & Awasthy (1972) | 0.01 | 0.00 |

Yu-Tech (1972) | 0.01 | 0.00 |

Ranga Raju et al. (1979) | 0.01 | 0.00 |

Hager (1987) | 0.01 | 0.01 |

Cheong (1991) | 0.01 | 0.01 |

Singh et al. (1994) | 0.07 | 0.01 |

Jalili & Borghei (1996) | 0.06 | 0.01 |

Borghei et al. (1999) | 0.11 | 0.02 |

Emiroglu et al. (2011a, 2011b) | 0.64 | 0.03 |

Author . | R^{2}
. | RMSE . |
---|---|---|

Nandesamoorthy & Thomson (1972) | 0.01 | 0.00 |

Subramanya & Awasthy (1972) | 0.01 | 0.00 |

Yu-Tech (1972) | 0.01 | 0.00 |

Ranga Raju et al. (1979) | 0.01 | 0.00 |

Hager (1987) | 0.01 | 0.01 |

Cheong (1991) | 0.01 | 0.01 |

Singh et al. (1994) | 0.07 | 0.01 |

Jalili & Borghei (1996) | 0.06 | 0.01 |

Borghei et al. (1999) | 0.11 | 0.02 |

Emiroglu et al. (2011a, 2011b) | 0.64 | 0.03 |

### Results of ANN

### Results of ANFIS

*Fr*

_{1}and

*P/h*

_{1}have more membership functions compared with other parameters. The coefficient of determination of the ANFIS model was 0.98 and 0.86 for the preparation and testing stages, respectively. Overall, as shown in Figures 9 and 10, the ANFIS model's ability is suitable for predicting values of in the training and testing stages and this model has a suitable performance to predict the maximum values of the as well. Comparing the structure and performance of the ANFIS model with the ANN shows that the size of the ANFIS structure is smaller than the ANN and the accuracy of the ANFIS is better than the ANN as well.

Parameter . | No. . | MF . | AND method . | OR method . | Defuzz Method . | Agg Method . | Type . | R^{2}
. | RMSE . | ||
---|---|---|---|---|---|---|---|---|---|---|---|

Fr_{1} | 7 | gaussmf | prod | max | wtaver | max | Sugeno | train | test | train | test |

P/h_{1} | 6 | gaussmf | prod | max | wtaver | max | |||||

L/b | 3 | gaussmf | prod | max | wtaver | max | 0.96 | 0.86 | 0.060 | 0.085 | |

L/h_{1} | 4 | gaussmf | prod | max | wtaver | max |

Parameter . | No. . | MF . | AND method . | OR method . | Defuzz Method . | Agg Method . | Type . | R^{2}
. | RMSE . | ||
---|---|---|---|---|---|---|---|---|---|---|---|

Fr_{1} | 7 | gaussmf | prod | max | wtaver | max | Sugeno | train | test | train | test |

P/h_{1} | 6 | gaussmf | prod | max | wtaver | max | |||||

L/b | 3 | gaussmf | prod | max | wtaver | max | 0.96 | 0.86 | 0.060 | 0.085 | |

L/h_{1} | 4 | gaussmf | prod | max | wtaver | max |

### Results of SVM

*et al.*(2015a, 2015b) were considered. As mentioned in the SVM model introduction section, the four most well-known kernel functions: Linear, Polynomial, RBF and Sigmoid were tested. During the SVM model development, it was found that the RBF function had the best performance compared to other types of kernel functions. Results of the SVM model are shown in Figures 11 and 12. The standard error indices were calculated to define SVM performances during model development. As stated in the model development section, training the SVM model could be considered as an optimization problem; therefore, the developed SVM model was prepared using the quadratic optimization approach. During the SVM model development, 0.3 and 15 were obtained for the sigma and gamma coefficients, respectively. During the SVM model training 0.96 was obtained for the correlation coefficient and 0.02 for the RMSE, and when testing the model, the correlation coefficient was 0.93 and the RMSE was 0.03. To give more information about the SVM model performance, the error distribution and histogram were plotted during both stages of model development. The histogram of the error shows that error distribution through all the data are close to symmetric. The error histogram also shows that most error ranges are around zero, which means that the model accuracy is suitable especially during the training stage. Comparison of the SVM model with empirical formulae shows that it performs better than the ANN and ANFIS models.

### Sensitivity analysis of effective parameters

The most effective parameters for prediction of the side weir discharge coefficient by ANN, ANFIS and SVM were defined by a simple approach. This approach describes the effect of each parameter on the model performance of predicting the output. At first all the parameters with regard to Equation (2) were considered as inputs for the ANN, ANFIS and SVM, and then one of the input parameters was removed from the input parameters and again the model with the same structure was prepared. It is notable that preparation of the models was considered with regarding to the model development. Preparation of the models was undertaken as described in the section on model development. In other words, designing the ANN structure was based on the step by step approach and the data set was divided into three groups for training, validation and testing. After adjusting the model structure, the sensitivity analysis of the models to define the most effective parameters began. The performance of the models in the absence of each input parameter was assessed using the calculation of error indices including the and RMSE. Removing one of the input parameters caused a change in model performance. Depending on the degree of change in performance, the effect of each parameter was assessed. The results of the sensitivity analysis of ANN, ANFIS and SVM are given in the Tables 5–7. As seen in Tables 5–7, the absence of the Froude number () and ratio of weir length to the upstream flow depth () caused a dramatic decrease in the accuracy of the models, so it was found that these are the most important parameters for modeling the discharge coefficient of a side weir. Another scenario regarding the prediction of the discharge coefficient using these two important parameters ( and ) was considered. This idea has been put into practice for three models (ANN, ANFIS and SVM) and the results of modeling using these two effective parameters for each model are given in the last row of Tables 5–7. These results show that by using these two important effective parameters, the discharge coefficient of a side weir could be predicted accurately.

Model . | Absent . | Inputs . | Output . | R^{2}
. | RMSE . |
---|---|---|---|---|---|

ANN | – | 0.89 | 0.057 | ||

0.78 | 0.075 | ||||

0.64 | 0.168 | ||||

0.86 | 0.073 | ||||

0.42 | 0.23 | ||||

0.85 | 0.096 |

Model . | Absent . | Inputs . | Output . | R^{2}
. | RMSE . |
---|---|---|---|---|---|

ANN | – | 0.89 | 0.057 | ||

0.78 | 0.075 | ||||

0.64 | 0.168 | ||||

0.86 | 0.073 | ||||

0.42 | 0.23 | ||||

0.85 | 0.096 |

Model . | Absent . | Inputs . | Output . | R^{2}
. | RMSE . |
---|---|---|---|---|---|

ANFIS | – | 0.86 | 0.06 | ||

0.81 | 0.08 | ||||

0.76 | 0.25 | ||||

0.84 | 0.11 | ||||

0.54 | 0.34 | ||||

0.83 | 0.08 |

Model . | Absent . | Inputs . | Output . | R^{2}
. | RMSE . |
---|---|---|---|---|---|

ANFIS | – | 0.86 | 0.06 | ||

0.81 | 0.08 | ||||

0.76 | 0.25 | ||||

0.84 | 0.11 | ||||

0.54 | 0.34 | ||||

0.83 | 0.08 |

Model . | Absent . | Inputs . | Output . | R^{2}
. | RMSE . |
---|---|---|---|---|---|

SVM | – | 0.96 | 0.032 | ||

0.94 | 0.046 | ||||

0.77 | 0.091 | ||||

0.86 | 0.056 | ||||

0.63 | 0.12 | ||||

0.91 | 0.057 |

Model . | Absent . | Inputs . | Output . | R^{2}
. | RMSE . |
---|---|---|---|---|---|

SVM | – | 0.96 | 0.032 | ||

0.94 | 0.046 | ||||

0.77 | 0.091 | ||||

0.86 | 0.056 | ||||

0.63 | 0.12 | ||||

0.91 | 0.057 |

## CONCLUSION

Prediction of the discharge coefficient in side weirs is an important element of hydraulic structure studies. Side weirs are the most common structure in hydro systems. Therefore, predicting the discharge coefficient of this structure plays an important role in hydro-system management. Results of this study showed that calculating the side weir discharge coefficient with empirical formulae leads to apparently incredible errors in calculation. Based on the obtained results, the SVM model with an RBF kernel function has a suitable capability to predict the side weir discharge coefficient. The SVM model also provides better prediction performance than the ANN and ANFIS models.