Introduction

The techniques used in making discharge measurements at gauging stations (in rivers, canals, etc.) are important. The use of portable instrument like kinds of weirs, flumes, floats, and volumetric tank are common. The US Geological Survey makes thousands of stream flow measurements each year. Discharges measured range from a trickle in ditch to a flood on the Amazon. Several methods are used (Rantz 2005).

A weir is a simple device for discharge measurement and flow control in open channels, such as canals and flumes. Many researchers have studied the head–discharge relations for flows over sharp-crested weirs and broad-crested weirs with a simple cross-section shape, such as rectangular, triangular, trapezoidal, truncated triangular, and others (French 1987; Ranga Raju 1993; Boiten and Pitlo 1982). Some useful empirical discharge equations for these weirs have been proposed. Compound broad-crested weir is an overflow structure, used for hydraulic engineering applications. Broad-crested weir may consist of various cross-sections depending on the flow requirements. There is a unique relationship between the unit discharge (the flow rate per unit width) and the upstream water depth relatively measured to weir crest, which is exploited for the purpose of flow measurement (Boiten 2002).

The recent works (Gonzalez and Chanson 2007) mainly focused on hydraulic behavior, flow conditions, and the discharge coefficient for different types of weirs. Ramamurthy et al. (1988) carried out a set of laboratory experiments to investigate the effect of upstream weir rounding.

Hager and Schwalt (1994) performed a set of laboratory experiments to investigate the flow characteristics of broad-crested weir with a sharp upstream corner. Based on the recent work (Sarker and Rhodes 2004), rectangular broad-crested weir with measurements of free-surface profile over a laboratory-scale, was performed and compared with numerical procedures by aiding computer software. According to their study (Sarker and Rhodes 2004), for a given value of flow rate (or discharge), the upstream water depth was sufficiently predicted then the rapidly varied flow over the crest and a stationary wave profile in the supercritical flow downstream were also observed. Gonzalez and Chanson (2007) conducted experiments for a near fully scaled broad-crested weir and a comprehensive analysis of velocity/pressure measurements were implemented for various configurations. They (Gonzalez and Chanson 2007) reported that the results showed the rapid flow distribution at the upstream end of weir while an overhanging crest design may affect the flow field.

Azimi and Rajaratnam (2009) presented a comprehensive analysis for flow over weirs of finite crest length with square edged or rounded entrance. According to their work (Azimi and Rajaratnam (2009)), a robust correlation was observed for the discharge coefficient (C d) while the Weber number is greater than 1, then a good correlation was observed for the C d for a weir with rounded entrance. Bilhan et al. (2010) performed two different artificial neural network (ANN) techniques to lateral outflow over rectangular-side weirs located on a straight channel. They (Bilhan et al. 2010) reported that the ANN technique could be employed successfully for the determination of discharge coefficient. According to their work, the feed-forward neural network (FFNN) model is found to be better than the radial basis neural network.

To date, the application of genetic programming (GP) in hydraulic engineering has been limited. The artificial intelligence techniques used by Salmasi et al. (2011) include artificial neural networks and genetic programming; to predict friction factor in pipes (f) by systematically changing the values of Reynolds numbers, R e, and relative roughness, e/D, and solving the Colebrook–White equation for the value of f by using the successive substitution method. The implementation of GP offers another explicit formulation for the friction factor. Estimation of energy dissipation of flows on stepped chutes, carried out by Salmasi (2010) using ANN. Azamathulla et al. (2008; 2010) apply linear genetic programming to scour below submerged pipeline. In another study, Azmathulla and Ghani (2009) used genetic programming for longitudinal dispersion coefficients in streams. Model tree approach for estimation of critical submergence for horizontal intakes in open channel flows was used by Ayoubloo et al. (2004).

The aim of this paper is to predict the discharge coefficient of compound broad-crested weir, by using the conventional regression-based equations and two different soft-computing techniques (GP and ANN). Among the alternative algorithms, the applicability, ability, and accuracy of the GP and ANN procedures were also examined by using various performance indicators. Comparison of results from the GP and ANN procedures clearly shows the ANN technique is less efficient in comparison with the GP algorithm while the GP algorithm yields sufficiently accurate results for the determination of discharge coefficient (C d).

Artificial neural network model

A neural network is a powerful data modeling tool that is able to capture and represent complex input/output relationships. The motivation for the development of neural network technology stemmed from the desire to develop an artificial system that could perform “intelligent” tasks similar to those performed by the human brain. Neural networks resemble the human brain in the following two ways:

  1. 1.

    A neural network acquires knowledge through learning.

  2. 2.

    A neural network’s knowledge is stored within inter-neuron connection strengths known as synaptic weights.

The true power and advantage of neural networks lies in their ability to represent both linear and nonlinear relationships and in their ability to learn these relationships directly from the data being modeled. Traditional linear models are simply inadequate when it comes to modeling data that contains nonlinear characteristics.

The most common neural network model is the multilayer perceptron (MLP). This type of neural network is known as a supervised network because it requires a desired output in order to learn. The goal of this type of network is to create a model that correctly maps the input to the output using historical data so that the model can then be used to produce the output when the desired output is unknown. A graphical representation of an MLP is shown in Fig. 1. Block diagram of a two hidden layer multilayer perceptron. The inputs are fed into the input layer and get multiplied by interconnection weights as they are passed from the input layer to the first hidden layer. Within the first hidden layer, they get summed then processed by a nonlinear function (usually the hyperbolic tangent). As the processed data leaves the first hidden layer, again it gets multiplied by interconnection weights, then summed and processed by the second hidden layer. Finally, the data is multiplied by interconnection weights then processed one last time within the output layer to produce the neural network output (Fig. 1).

Fig. 1
figure 1

Structure of artificial neural network

The MLP and many other neural networks learn using an algorithm called back propagation. With back propagation, the input data is repeatedly presented to the neural network. With each presentation, the output of the neural network is compared to the desired output and an error is computed. This error is then fed back (back propagated) to the neural network and used to adjust the weights such that the error decreases with each iteration and the neural model gets closer and closer to producing the desired output. This process is known as “training”. Then we can analyze the outputs of model.

For implementation of the ANN technique, among the total 195 data sets, 156 sets (of about 80% of total) were randomly selected as “training data”, while the remaining 39 sets (of about 20% of total) were employed for “testing data”. The values of discharge coefficient were predicted in two cases, first regarding the dimensionless parameter, H 1/L (H 1 = y c  + V 2/2g = total energy head above the weir (m) and L = weir crest length (m)), then regarding both the dimensionless parameters, H 1/L and H 1/p (p = weir height). The best prediction for ANN procedures is determined by trial-and-error procedure in which momentum coefficient assumed to be 0.8 and number of iteration was 100,000.

Genetic programming

Genetic programming, a branch of the genetic algorithm, is a method for learning the most “fit” computer programs by means of artificial evolution (Johari et al. 2006). The GP optimizes both the coefficients and constants in a function and the function type itself. A possible function is determined by given mathematical operators, such as +, −, ×, sin, exp, etc. Each function implicitly includes an assignment to a variable, which facilitates the use of multiple program outputs in GP, whereas in tree-based GP those side effects need to be incorporated explicitly. The GP encodes a function as a tree with nodes and branches, and then optimizes functions based on natural principles. The GP procedure is similar to that of a genetic algorithm, which generates solutions as a parent population, and then improves solutions by selection, crossover, and mutation processes. The general procedure and primary components of GP are briefly described as follows (Koza 1992).

  1. I.

    Generate initial parent population.

  2. II.

    Evaluate fitness of all alternatives.

  3. III.

    Select two parent alternatives for reproduction according to their fitness. Those with higher fitness are assigned greater probabilities to mate.

  4. IV.

    Crossover to reproduce offspring and determine whether mutation occurs.

  5. V.

    Repeat steps 3–4 until the pre-determined population size is attained.

  6. VI.

    Use the offspring population as a new generation and return to step 2 unless the stop criterion is met.

The main advantage of GP for the modeling process is its ability to produce models that build an understandable structure, i.e., a formula or equation. Thus, for “data rich, theory poor” instances, GP may offer advantages over other techniques since GP can self-modify, through the genetic loop, a population of function trees in order to finally generate an “optimal” and physically interpretable model (Muttil and Chau 2006).

The fitness of GP algorithm is evaluated by the following expression (Eq. 1):

$$ f = \sum\nolimits_{{j = 1}}^{{j = N}} {\left| {{X_j} - {Y_j}} \right|} $$
(1)

where X j  = value returned by a chromosome for the fitness case j and Y j  = expected value for the fitness case j. This configuration has been tested for the proposed GP model and has been found sufficient (Azamathulla et al. 2008; 2010).

Methodology

Discharge coefficient (C d)

Typical flow characteristics above a broad-crested weir can be represented by Fig. 2. As shown in this figure, H 1 = y c + V 2/2g = total energy head above the weir (m), H 1= maximum water level at the upstream weir (m), P and L = weir height (m) and crest length in flow direction, respectively, y c = critical flow depth above the weir (m), and V 2/2g = kinetic head (m).

Fig. 2
figure 2

Flow characteristics above a broad-crested weir

Regarding Fig. 2, the discharge above the weir is evaluated from the following expression

$$ q = \left( {2/3} \right)\sqrt {{\left( {2/3} \right)g{{\left( {{H_1}} \right)}^3}}} $$
(2)

where q = discharge per unit width (unit discharge) (m3/s/m), and g = acceleration due to gravity (m s−2).

Experimental observations indicate the unit discharge–total head (qH 1) relationship slightly differs from Eq. 2, depending on the weir geometry flow conditions. Therefore, Eq. 2 can be rearranged by inserting the discharge coefficient (C d) into Eq. 2, as follows:

$$ q = {C_{\text{d}}}(2/3)\,\sqrt {{(2/3)g\,{{\left( {{H_1}} \right)}^3}}} $$
(3)

where C d = discharge coefficient which is a function of the weir height (P), length of weir crest (L), crest width (b), upstream corner shape, and upstream total head (H 1).Finally, the total discharge, Q, is computed from:

$$ Q = 1.704\,{C_{\text{d}}}\,b\,{\left( {{H_1}} \right)^{{3/2}}} $$
(4)

where Q = total discharge (m3s−1) and b = crest width (m).

Experimental setup

The experiments were carried out in the hydraulic laboratory of Tabriz University in Iran. The experimental measurements were performed in a horizontal rectangular channel with 250 mm width and 700 mm height; the length of channel is 12 m with the front side of glass and the bottom and back side of black PVC.

For observations, 15 physical models of broad-crested weirs with height P = 10, 13, and 16 cm; crest length L = 30, 35, and 40 cm; width b = 6, 8, and 12 cm; and step height of model cross-section was z = 9 cm, were used. These models were located at 5 m, from the downstream of inlet. The upstream corners of all models rounded with the radius of curvature are r 1, r 2, and r 3. The required dimensions of 15 physical models tested, are synthesized in Table 1. Definition sketch of 15 physical models tested in the theoretical analysis (plan view and longitudinal profile) is shown in Fig. 3.

Table 1 Models used for experiments
Fig. 3
figure 3

Definition sketch of models used in theoretical analysis: plan view (up); longitudinal profile A-A (down)

The tail water submergence was adjusted by a flap gate located at the channel end with length 12 m from the inlet section. The discharge was measured with a 53° notch to the nearest 0.1 mm in head. Surface profiles were observed with a precise point gauge (±0.1 mm).

The main objective of this experimental investigation is to determine the potential effects of width of the lower weir crest (b), and step height of broad-crested weir of rectangular compound cross-section (z) on the value of discharge coefficient (C d). The observed values from the experiments were performed by comparing the C d values on different physical models with varying values of b and constant values of remaining parameters, z, P, and L (please see Table 5).

Results

The values of C d for three widths of lower weir crest were also plotted as a function of H 1/L, while keeping the constant values of parameters, z, p, and L, and shown in Figs. 4 and 5.

Fig. 4
figure 4

C d versus H 1/L for varying b and constant z, p, and L values

Regression analysis

For testing and evaluation of results, the following equations (Eqs. 5 and 6) were derived for linear and nonlinear regression, respectively:

$$ {C_{\text{d}}} = a + b\left( {\frac{{{H_1}}}{L}} \right)\;{ + }\;c\left( {\frac{{{H_1}}}{p}} \right) $$
(5)
$$ {C_{\text{d}}} = a{\left( {\frac{{{H_1}}}{L}} \right)^b}{\left( {\frac{{{H_1}}}{p}} \right)^c} $$
(6)

Equations 5 and 6 can be formed in the following expressions from the Statistical Package for Social Science (SPSS) software version 17.

$$ {C_{\text{d}}} = 0.{748} + 0.{343}\left( {\frac{{{H_1}}}{L}} \right) + 0.005\left( {\frac{{{H_1}}}{p}} \right){R^{{2}}} = 0.887 $$
(7)
$$ {C_{\text{d}}} = { 1}.0{21}{\left( {\frac{{{H_1}}}{L}} \right)^{{0.{134}}}}{\left( {\frac{{{H_1}}}{p}} \right)^{{0.0{12}}}}{R^{{2}}} = 0.{947} $$
(8)

Equations 7 and 8 clearly indicates that Eq. 8 for nonlinear regression is more efficient in comparison with Eq. 7 for linear regression analysis.

ANN modeling with two input parameters (H 1/L and H 1/p)

The development of any ANN model involves three basic steps: the generation of data required for training, the training of the ANN model, and the evaluation of the ANN configuration leading to the selection of an optimal configuration. The ANN software program employed was Qnet2000. Qnet is a back propagation neural modeling system that is designed to exploit the ever-increasing power of PC hardware and operating systems (Qnet 2000).

Fig. 5
figure 5

C d versus H 1/L for varying p and constant z, b, and L values

The procedure used for the development of our ANN model is outlined below:

  1. 1.

    The parameters used for preparing the input data file are H 1/L, H 1/P, and C d. These parameters resulting in a total of 195 input data points.

  2. 2.

    Several ANN models were then trained and tested with the information about each inputs and the generated corresponding value of discharge coefficient (C d) as the output.

  3. 3.

    The trained ANN models were then used to predict the values of C d based on known input values.

  4. 4.

    The optimum ANN model which produces the best results based on some preset measures was then selected and validated using a larger dataset.

For implementation of the ANN technique, among the total 195 data sets, 156 sets (of about 80% of total) were randomly selected as “training data”, while the remaining 39 sets (of about 20% of total) were employed for “testing data”. Among various ANN configurations, the optimal ANN algorithm was selected with regarding their performances in accuracy of the prediction. In the analysis two performance indicators (determination coefficient (R 2) and root mean square error (RMSE)) are presented as follow:

$$ {R^{{2}}} = {\left( {\frac{{\mathop{\sum }\nolimits xy}}{{\sqrt {{\mathop{\sum }\nolimits {x^2}}} \mathop{\sum }\nolimits {y^2}}}} \right)^2} $$
(9)
$$ {\text{RMSE}} = {\left[ {\frac{{\mathop{\sum }\nolimits {{\left( {X - Y} \right)}^2}}}{n}} \right]^{{1/2}}} $$
(10)

Table 2 shows the values of two performance indicators (R 2 and RMSE) for various ANN configurations, regarding both training and testing phases. As shown in Table 2, among all configurations, the maximum values of the R 2 and RMSE for testing phase are observed as 0.927 and 0.0446, which was performed by hype secant/sigmoid function of ANN architecture with five hidden nodes. Three layers FFNN architecture of two input variables is shown in Fig. 6.

Table 2 Different design of neural network for two input parameters
Fig. 6
figure 6

Three-layer feed-forward artificial neural network architecture

The comparison test of results indicates the relative effect of the dimensionless parameters H 1/p and H 1/L on the discharge coefficient are 31.8% and 69.2%, respectively. The values of RMSE are determined as 0.0562 and 0.0446, for training and testing phases, respectively. The performance of the ANN algorithm regarding the observed values is shown in Fig. 7.

Fig. 7
figure 7

Observation data of experiment versus simulated data by ANN with two input parameters (H 1/L and H 1/p)

ANN modeling with one input parameter (H 1/L)

For the alternative design case, the input parameter is selected as the dimensionless parameter H 1/L. Table 3 shows the values of two performance indicators (R 2 and RMSE) for various ANN configurations, with regarding both training and testing phases. As shown in Table 3, among all configurations, the maximum values of the R 2 and RMSE for testing phase are observed as 0.916 and 0.0482, which was performed by sigmoid function of ANN architecture with four hidden nodes. Three-layer FFNN architecture of one input variable is shown in Fig. 8. The performance of the ANN algorithm regarding the observed values is also shown in Fig. 9.

Table 3 Design of neural network for case of one parameter
Fig. 8
figure 8

Three-layer feed-forward ANN architecture for one input variable

Fig. 9
figure 9

Experimental data against simulated data by ANN with one input parameter (H 1/L)

Genetic programming results

In the GP algorithm, four basic arithmetic operators (+, −, ×, /) and some basic mathematical functions (ln(x), log(x), e x, …) were used. The best functional setting and default parameters used in the GP modeling are listed in Table 4.

Table 4 Parameters of optimized GP model

The equilibrium discharge coefficient can be defined as a function of its independent parameters, by the following expressions:

$$ \matrix{{*{20}{c}} {{C_{\text{d}}} = 0.741 + 0.372\,({H_1}/L)} \\ {{R^{{2}}} = 0.{887},{\text{RMSE}} = 0.{1}0{8}} \\ } $$
(11)
$$ \matrix{{*{20}{c}} {{C_{\text{d}}} = 0.6435 + ({H_1}/L) - 0.778\,{{({H_1}/L)}^2}} \\ {R{\,^{{2}}} = 0.{952},\;{\text{RMSE}} = 0.0{65}} \\ } $$
(12)

It should be noted that the relative effect of the dimensionless parameter, H 1/p on the discharge coefficient, is not regarded for the GP algorithm (linear and nonlinear equations). Correlation coefficients used for linear regression and linear GP technique are the same form; whereas correlation coefficient of nonlinear GP algorithm is higher than nonlinear regression.

From the comparison test of regression equations (linear and nonlinear) and GP algorithm, it was observed that the dimensionless parameter, H 1/L is the prior parameter effecting on the values of discharge coefficient. Figures 10 and 11 represent the variations of observed data with simulated data for linear and nonlinear modes, respectively.

Fig. 10
figure 10

Experimental data versus simulated data by GP (linear)

Fig. 11
figure 11

Experimental data against simulated data by GP (nonlinear)

Summary and conclusion

The paper presents series of laboratory experiments to investigate the potential effects of length of crest in flow direction, and step height of broad-crested weir of rectangular compound cross-section on the discharge coefficient (C d). For this purpose, 15 different physical models of broad-crested weirs with rectangular compound cross-sections were examined for a wide range of discharge values. The results of examination for computing discharge coefficient were yielded by using multiple regression equations based on the dimensional analysis; then, the results obtained were also compared with genetic programming and artificial neural network techniques to investigate applicability, ability, and accuracy of these procedures. Comparison of results from the GP and ANN procedures clearly indicates that the ANN technique is less efficient in comparison with the GP algorithm for the determination of discharge coefficient.

The ANN model with two independent parameters involves a neural network with one hidden layer and five neurons in that layer. The trained network was able to predict the response with R 2 and RMSE, 0.9271 and 0.0446, respectively (Table 2). The testing performance of the proposed GP model revealed a high generalization capacity with R 2 = 0.952 and RMSE = 0.065. This study shows that C d is more sensitive to weir H 1/L than H 1/p in compound broad-crested weirs (Eqs. 11 and 12).

The observations claim that the developed GP model can be efficiently used to accurately predict the discharge coefficient in comparison with the alternative ANN procedure and the conventional regression techniques.