Introduction

Side orifices are classified as divert structures installed on the main channel wall to conduct the flow into the side channel. Such structures are broadly utilized in drainage networks, sewage disposal systems and other hydraulic goals. In general, a side weir is used in wastewater treatment plants to disturb inflow to the location of the treatment process such as sedimentation tanks and aeration ponds. Due to the importance of divert structures, many experimental, analytical and numerical studies have been carried out on the hydraulic behavior of them.

For instance, Ramamurthy et al. (1987), Gill (1987), Swamee et al. (1993) and Ojha and Subbaiah (1997) examined the hydraulic behavior of gates and side orifices. Hussein et al. (2010) conducted an experimental study on the behavior of the passing flow through rectangular channels with circular side orifice. They provided a relationship for calculating discharge coefficient of circular sharp-edged side orifices. Hussein et al. (2010) formula is presented as a function of Froude number and the ratio of the circular side orifice diameter to width of the main channel. This equation forecasted discharge values of the side orifice with ± accuracy. Hussein et al. (2011) carried out an experimental study on the characteristics of the flow in the main channel with a rectangular sharp-edged side orifice. They also investigated the parameters affecting the flow passing through rectangular side orifices. Hussein et al. (2011) provided a relationship for calculating discharge coefficient of side orifices as a function of Froude number and the ratio of width of rectangular side orifice to width of the main channel. Hashid et al. (2015) experimentally studied the hydraulic behavior of the flow in channels with circular side intake. They considered the effects of the main channel width to the circular side intake as well as flow Froude number on discharge coefficient of such divert structures and proposed an equation for determining discharge capacity of such intakes.

In recent years, different artificial intelligence techniques have been used for modeling and pattern cognition of various hydraulic phenomena. For example, Emiroglu et al. (2010), based on neuro-fuzzy ANFIS techniques, provided a relationship for calculating discharge coefficient of labyrinth side weirs located on a rectangular channel in subcritical flow conditions. Their proposed relationship predicts discharge coefficient values of such structures in terms of weir geometric characteristics and flow hydraulic parameters. Kisi et al. (2012) using different neural network algorithms and gene expression programming as well as linear and nonlinear regressions predicted properties of the divert flow passing over labyrinth side weirs. By analyzing the modeling results, they exhibited that the artificial neural network model has higher accuracy in predicting discharge coefficient of this type of side weirs compared to other algorithms. Azamathulla and Ahmad (2013) by means of the gene expression programming model predicted the passing flow through rectangular side gates. They analyzed the results to prove that the gene expression programming model is significantly capable to model discharge coefficient of such hydraulic structures.

Additionally, Ebtehaj et al. (2015) simulated the discharge coefficient of rectangular side orifices using group method of data handling. They carried out a sensitivity analysis in order to identify effective input parameters. Also, Khoshbin et al. (2016) estimated the discharge coefficient of rectangular side weirs by means of a hybrid artificial intelligence technique. They optimized ANFIS network using genetic algorithm and singular value decomposition method. Azimi et al. (2017a) identified the most influenced input parameters on discharge coefficient of side weirs located on trapezoidal channels in subcritical flow conditions.

They also presented an equation for calculating discharge coefficient of side gates. In addition, Azimi et al. (2017b) implemented computational fluid dynamics as well as a hybrid ANFIS-Genetic Algorithm model to approximate discharge coefficient of rectangular side orifices. They showed that the artificial intelligence model estimates discharge coefficient values with higher accuracy.

On the one hand, reviewing of previous studies shows that the use of various artificial intelligence techniques is increasing every day, so that we necessarily need to develop an optimized artificial intelligence hybrid model for estimating discharge coefficient of circular and rectangular side orifices. On the other hand, in order to enhance the performance of the ANFIS network, different techniques were utilized (Azimi et al. 2017c, 2018; Gharabaghi et al. 2018). Thus, for the first time, the ANFIS network is optimized by the firefly algorithm for modeling discharge coefficient of circular and rectangular side orifices in this study. Then, the superior model and the most effective input parameter are identified.

Methods and materials

ANFIS network

The ANFIS network is a combination of the fuzzy system and the artificial intelligence networks which has the advantages of the both simultaneously. The fuzzy part creates a relationship between inputs and outputs, and the parameters related to the membership part are determined by the educational algorithms of the neural network. Thus, the characteristics of both fuzzy and neural models are hidden into this system. Using linguistic concepts, this system creates and concludes a nonlinear relationship between inputs and outputs. The proper structure of ANFIS is selected appropriate to input data, membership degree as well as rules and functions of the output membership function. The designed sample of the ANFIS model with two inputs is presented in Fig. 1. In the first layer (input), the dependence level of each input to different fuzzy domains is determined. By multiplying each node input values to each other, weight of rules (wi) in the second layer is obtained. In the third layer, the calculation of the relative weight of rules is operated. The fourth layer is the layer of rules created by performing operation on this layer input signals. The final layer is the output of the network (f) whose objective is to minimize the difference between the outputs obtained from the network and the real output (Jang et al. 1997).

Fig. 1
figure 1

ANFIS structure for model with two inputs

The ANFIS network has m input properties and n rules, and each rule is expressed as follows:

$$R_{i} :{\text{if}}\left( {x_{1} \;{\text{is}}\;f_{i1} } \right)\; {\text{and}}\; \left( {x_{j} \;{\text{is}}\;f_{ij} } \right)\;{\text{and}} \ldots \left( {x_{m} \;{\text{is}}\;f_{im} } \right)\;{\text{then}}\;{\text{output}} = f_{i}$$
(1)

where xj is the jth input, fij is the membership function of the rule on xj and fi is the rule output. gij membership functions which has Gaussian form are defined as follows:

$$g_{ij} \left( x \right) = \exp \left[ { - \frac{1}{2}\left[ {\frac{{x - c_{ij} }}{{\sigma_{ij} }}} \right]^{2} } \right]$$
(2)

The multiplication is used as the “AND” operator. So we have:

$$\mu_{i} = \mathop \prod \limits_{j = 1}^{m} g\left( {ij} \right)\left( {x_{j} } \right)$$
(3)

where μi denotes the activated degree of the rule. The output of the system is also presented by the center of gravity relationship as follows:

$$f\left( x \right) = \frac{{\mathop \sum \nolimits_{i = 1}^{n} \mu_{i} f_{i} }}{{\mathop \sum \nolimits_{i = 1}^{n} \mu_{i} }}$$
(4)

Five important and effective factors in modeling ANFIS are type of input fuzzy sets, the number of input fuzzy sets, type of output fuzzy sets, optimization procedure and the number of iterations. Input fuzzy sets are in different shapes including triangular, trapezoidal, Gaussian, etc. In addition, the number of iterations considered for learning the network is equal to 5000. The method used to create fuzzy inference system (FIS) in this study is fuzzy c-means clustering (FCM) which compared to other methods requires less number of parameters and has had a successful performance in recent studies. In optimization of the ANFIS network, two optimization methods including back-propagation (BP) and hybrid, where the latter is a combination of BP and least square (LS), are classical algorithms for learning the network. In addition to using the hybrid method, in this study the firefly algorithm which is a new and powerful meta-heuristic algorithm in solving nonlinear problems is utilized. FA is used to optimize the membership function factors (c and σ) for various inputs. In the following, the performance of this algorithm is discussed.

Firefly algorithm

The firefly algorithm (FA) was proposed for the first time by Yang (2010). The main idea of this algorithm is inspired from the light relationship between fireflies. This algorithm is one of the swarm intelligence manifestations in which cooperation and probably competition of simple and low intelligence members create a higher degree of intelligence that is obtainable by none of the components. The firefly algorithm is presented based on the following rules (Yang 2010):

  1. (1)

    All fireflies are sexless, meaning they move in a more attractive and transparent way, regardless of their sex. In general, a firefly absorbs other fireflies.

  2. (2)

    The attraction degree of a firefly is proportional to its brightness. Brightness may also decrease by increasing the distance from other fireflies. Now if there is no more attractive firefly, then it moves randomly.

  3. (3)

    Brightness of a firefly is determined by the value of the objective function.

The firefly algorithm is a population-based evolutionary algorithm inspired from the behavior of fireflies in finding food and their social intelligence. In nature, fireflies move randomly and each of them that find better bait emits more light and attracts others. As the distance between two fireflies increases, their attraction percent decreases. In other words, distance has an inverse relationship with velocity and attraction. This algorithm consists of two basic parts: variations of light intensity and movement toward the brighter firefly. Light intensity depends on the value of the cost function. Thus, in minimization problems, the brighter firefly attracts fireflies with less light, and assume that n is the number of fireflies, xi is the ith particle location and f(xi) is the cost function. So, brightness of each firefly is equal to the cost function value:

$$I_{i} = f\left( {x_{i} } \right), \quad 1 \le i \le n$$
(5)

Each firefly has a light feature representing how much it is strong. This feature is a relative value changing by changing the distance between firefly i and firefly j. The attraction function is defined as follows:

$$\beta \left( r \right) = \beta_{0} e^{{ - \gamma r^{2} }}$$
(6)

where β0 is the attraction level in terms of r = 0 andγ represents the light attraction coefficient. The movement of firefly i with the location xi toward firefly j with the location xj (with more light) is calculated as follows:

$$x_{i} \left( {t + 1} \right) = x_{i} \left( t \right) + \beta_{r} \left( {x_{j} - x_{i} } \right)$$
(7)

Generally, the flowchart related to the firefly algorithm is as follows:

  1. 1.

    The determination and initialization of fireflies (initial population).

  2. 2.

    Obtaining the cost function for each individual of the population in its location.

  3. 3.

    Random allocation of light intensity to each individual of the population.

  4. 4.

    The determination of the best (brightest) individual of the population through the calculation of the cost function of the whole population.

  5. 5.

    The movement of other individuals of the population toward the best individual and updating light intensity.

  6. 6.

    The examination of iteration conditions, if iteration conditions are provided, move toward the next stage, otherwise move toward step 4.

  7. 7.

    End of the algorithm.

The performance of the firefly algorithm completely depends on the number of the initial population, the attraction function and the attraction coefficient. As the light attraction coefficient is greater, the attraction speeds of population individuals toward the brightest individual increases. In Fig. 2, the flowchart of the firefly algorithm is drawn.

Fig. 2
figure 2

Flowchart of firefly algorithm used in this study

Training of adaptive neuro-fuzzy inference system using hybrid algorithm

In each iteration, the system movement continues in a forward path until it reaches to the calculation of the matrix expressed in the least square error approach. Having model outputs and using the hybrid method, parameters are calculated. It should be noted that all learning data should be applied and also premise parameters remain fixed. Then, consequent parameters remain fixed and premise parameters are adjusted by a decreasing gradient.

Training of adaptive neuro-fuzzy inference system using firefly algorithm

In order to learn the adaptive neuro-fuzzy inference system (ANFIS) using the firefly algorithm, first the problem environment or the range of variables which should be optimized and the fitness functions are determined. In this study, root mean square error (RMSE) is used as the fitness function for evaluating the performance of the ANFIS system learned by the firefly algorithm. Each firefly consists of a set of antecedent and subsequent parameters. Assuming three input variables as vector (x1, x2, x3) and an output variable as (z) and using three fuzzy sets with Gaussian-type membership functions, the following relationship holds:

$$\begin{aligned} & R_{s} :{\text{IF}}\; x_{1} \;{\text{is}}\;F_{1}^{i} \left( {\sigma_{1i} ,c_{1i} } \right)\;{\text{and}}\;x_{2} \;{\text{is}}\;F_{2}^{j} \;\left( {\sigma_{2j} ,c_{2j} } \right)\;{\text{and}}\;x_{3} \;{\text{is}}\;F_{3}^{l} \left( {\sigma_{3l} ,c_{3l} } \right) \\ & \quad {\text{and}}\;x_{4} \;{\text{is}}\;F_{4}^{h} \left( {\sigma_{4h} ,c_{4h} } \right)\;{\text{THEN}}\;y_{s} = P_{s} x_{1} + q_{s} x_{2} + k_{s} x_{3} + t_{s} x_{4} + r_{s} \\ \end{aligned}$$
(8)

Parameters which need to be set , c, p, q, k, t, r) are coded in a chain of real numbers. In order to initiate the modeling process, the initial population of fireflies is determined randomly. Each firefly can be mapped to a set of ANFIS parameters. According to the light intensity related to each firefly, the attraction of each one is computed and compared with others and fireflies with less light move toward fireflies with more light. In the following, the fitness function value is calculated. This process continues until it reaches a determined iteration value or the least value of the desired fitness function.

Experimental model

In this study, to validate the results of the numerical models, the experimental values obtained by Hussein et al. (2010) and Hussein et al. (2011) are used. The experimental model is composed of a rectangular channel with length, width and height of 9.15, 0.5 and 0.6, respectively. They installed rectangular and circular orifices at a distance of 5 m from the main channel inlet on the side wall. In Fig. 3, the schematic of the experimental model for the rectangular and circular orifices is depicted.

Fig. 3
figure 3

Schematic of experimental model for rectangular and circular side orifices (Hussein et al. 2010 and Hussein et al. 2011)

Discharge coefficient of side orifices

Hussein et al. (2010) and Hussein et al. (2011) considered the discharge coefficient of rectangular side orifices as a function of the length and width of rectangular side orifices or the diameter of circular orifices (D), width of the main channel (B), the bed elevation of the side orifice from the main channel bed (W), velocity in the main channel (V1), flow depth in the main channel (Ym), density of fluid (ρ), viscosity of flow (μ) and the gravitational acceleration (g):

$$C_{d} = f_{1} \left( {L,b,B,W,V_{1} ,Y_{m} ,\rho ,\mu ,g} \right)$$
(9)

The flow Froude number is \(F_{r} = V_{1} /\sqrt {g.Y_{m} }\) and density, viscosity and the gravitational acceleration are considered constant. In addition, values of B, W and Ym with respect to length of the rectangular side orifice are dimensionless. Thus, Eq. (9) is written as follows:

$$C_{d} = f_{2} \left( {\frac{B}{D},\frac{W}{D},\frac{{Y_{m} }}{D},F_{r} } \right)$$
(10)

In addition, the influence of the shape of the side orifice is investigated in this study. The parameter φ is introduced for taking into account the effects of the side orifice shape. For the rectangular side orifice, the values of the parameter φ for the rectangular and circular side orifices are considered equal to 1 and 2, respectively. Therefore, the combination of the input parameters are written as follows:

$$C_{\text{d}} = f_{2} \left( {\frac{B}{D},\frac{W}{D},\frac{{Y_{\text{m}} }}{D},F_{\text{r}} ,\emptyset } \right)$$
(11)

Thus, for modeling the discharge coefficient of side orifices, the dimensionless parameters of Eq. 11 are utilized. In Fig. 4, the combinations of the input parameters of different artificial intelligence are shown in two cases including Nos. 1 and 2. These two different combinations are made to identify the influence of the shape factor in modeling discharge coefficient. In order to detect the most effective parameter in each combination, the influence of the dimensionless input parameters is removed one by one and then by modeling runs.

Fig. 4
figure 4

Combinations of different artificial intelligence models

In this study, the Monte Carlo simulations are used for examining the abilities of the numerical models. These simulations are a broad classification of computational algorithms which uses random sampling for calculating numerical results. The main idea of this method is based on solving problems which might be actual in nature using random decision-making. The Monte Carlo methods are usually implemented for simulating physical and mathematical systems which are not solvable by means of other methods. In general, the Monte Carlo simulations are used by means of the probable distribution for solving different problems such as optimization and numerical integration. Furthermore, the k-fold cross-validation method is utilized for examining the proficiency of the mentioned models. In the k-fold cross-validation method, the main sample is divided into k subsamples with the same size randomly. Among k subsamples, one subsample is used as the validation data and the remaining as the test data of the model. Then, the method repeats k times (equal to the number of layers) so that each k subsample is used exactly once as the validation data once. The results obtained from the mentioned k layers are averaged and provided as an approximation. The advantage of this method is the random repetition of subsamples in the test and learning process for all observations. In this paper, the k value is assumed 5. The schematic of the k-fold cross-validation method is depicted in Fig. 5.

Fig. 5
figure 5

Dealing with observational data in k-fold cross-validation method

Results and discussions

Criteria for examining accuracy of numerical models

In this study, in order to study accuracy of artificial intelligence models, the mean absolute error (MAE), root mean square error (RMSE), correlation coefficient (R) and mean absolute percent error (MAPE) statistical indices are used as follows:

$${\text{RMSE}} = \sqrt {\frac{1}{n}\mathop \sum \limits_{i = 1}^{n} \left( {R_{{\left( {\text{Predicted}} \right)i}} - R_{{\left( {\text{Observed}} \right)i}} } \right)^{2} }$$
(12)
$${\text{MARE}} = \frac{1}{n}\mathop \sum \limits_{i = 1}^{n} \left[ {\frac{{\left| {\left( R \right)_{{\left( {\text{Predicted}} \right)i}} - \left( R \right)_{{\left( {\text{Observed}} \right)i}} } \right|}}{{\left( R \right)_{{\left( {\text{Observed}} \right)i}} }}} \right] \times 100$$
(13)
$$R = \frac{{\mathop \sum \nolimits_{i = 1}^{n} \left( {\left( R \right)_{{\left( {\text{Observed}} \right)i}} - \overline{\left( R \right)}_{{\left( {\text{Observed}} \right)}} } \right)\left( {\left( R \right)_{{\left( {\text{Pridicted}} \right)i}} - \overline{\left( R \right)}_{{\left( {\text{Pridicted}} \right)}} } \right)}}{{\sqrt {\mathop \sum \nolimits_{i = 1}^{n} \left( {\left( R \right)_{{\left( {\text{Observed}} \right)i}} - \overline{\left( R \right)}_{{\left( {\text{Observed}} \right)}} } \right)^{2} \mathop \sum \nolimits_{i - 1}^{n} \left( {\left( R \right)_{{\left( {\text{Pridicted}} \right)i}} - \overline{\left( R \right)}_{{\left( {\text{Pridicted}} \right)}} } \right)^{2} } }}$$
(14)
$${\text{SI}} = \frac{\text{RMSE}}{{\overline{\left( R \right)}_{{\left( {\text{Observed}} \right)}} }}$$
(15)

In the above equations, \(\left( R \right)_{{\left( {\text{Observed}} \right)i}}\), \(\left( R \right)_{{\left( {\text{Pridicted}} \right)i}}\), \(\overline{(R)}_{{\left( {\text{Observed}} \right)i}}\) and n are experimental values, results predicted by numerical models, the average of experimental values and the number of experimental measurements, respectively. The introduced statistical indices do not provide a simultaneous comparison of the average and variance of models. Thus, the Akaike information criterion is introduced to compare the predicted discharge coefficient with the experimental one as follows:

$${\text{AIC}} = n \cdot \log \left[ {\frac{1}{n}\mathop \sum \limits_{i = 1}^{n} \left( {C_{{d\left( {\text{Observed}} \right)i}} - C_{{d\left( {\text{Predicted}} \right)i}} } \right)^{2} } \right] + 2k$$
(16)

where k is equal to the number of the estimated parameters used in the numerical model. ACI is considered as a criterion for proper adaptation of a statistical model. In addition, this index is implemented as a suitable tool for choosing the model describing complexity and accuracy of the numerical model simultaneously.

Examination of different generations of fuzzy inference system

In this section, different generations of the fuzzy inference system are studied. The ANFIS model has three different fuzzy inference systems including grid partitioning (GP), subtractive clustering (SC) and fuzzy c-means clustering (FCM). In Table 1 and Fig. 6, the results of different statistical indices for these three generations are presented. In addition, the scatter plots for these generations are shown in Fig. 7. According to the modeling results, the value of the correlation coefficient for GP, SC and FCM is obtained as 0.677, 0.676 and 0.683, respectively. As shown, FCM simulates discharge coefficient values with higher accuracy compared to two other generations. Furthermore, the values of RMSE, SI and MARE for FCM are calculated to be 0.024, 0.038 and 0.025, respectively. Thus, this generation is used for simulating the discharge coefficient of side orifices in the following.

Table 1 Results of statistical indices for different generations of fuzzy inference system
Fig. 6
figure 6

Comparison of different statistical indices for different generations of fuzzy inference system

Fig. 7
figure 7

Scatter plots for different generations of fuzzy inference system

Selection of optimized membership function

In fuzzy inference systems, the selection of the membership function is one of the most important parts of the modeling. In the following, the selection of the membership function is discussed. In Table 2, the results of different statistical indices for membership functions 2–10 are arranged. In addition, the changes in the ANFIS model versus different statistical indices are illustrated in Fig. 8. According to the modeling results, by increasing the membership function of the ANFIS model, accuracy increases significantly. In this study, the optimized membership function is considered equal to 5 and this function is chosen for the numerical model. For example, the values of R and SI for the membership function are obtained 0.832 and 0.29, respectively. Also, the changes of the other statistical indices for the membership functions greater than 5 are negligible. The ACI value for this membership function is calculated − 1318.94. Thus, the optimized number of the membership function is considered 5.

Table 2 Results of different statistical indices for ANFIS model membership functions
Fig. 8
figure 8

Changes in ANFIS model membership function versus different statistical indices

ANFIS models

As discussed in the previous sections, in this study six different models were developed for the ANFIS and ANFIS-FA models. Then, the influence of each input parameter was eliminated for finding the most effective input parameter as well as the superior model. The results of different statistical indices are shown in Table 3. Also, the comparison of different statistical indices for six ANFIS models is shown in Fig. 9. For instance, ANFIS1 approximates discharge coefficient values in terms of all input parameters (B/D, W/D, Ym/D, Fr, φ). For this model, the values of MARE and RMSE are calculated to be 0.019 and 0.018, respectively. In addition, the values of MARE and RMSE for this model are calculated to be 0.832 and 0.029, respectively. Among all ANFIS models, ANFIS1 has the highest accuracy. Then, five distinct ANFIS models (ANFIS2–ANFIS6) are developed through the elimination of the input parameters. For ANFIS2, the influence of the shape parameter (φ) is eliminated and this model simulates discharge coefficient values in terms of B/D, W/D, Ym/D, Fr. For this model, the values of RMSE, MARE and AIC are calculated to be 0.021, 0.025 and − 1132.66, respectively. For simulating discharge coefficient of side orifices using ANFIS3, the influence of Fr is neglected. In other words, this model is a function of (B/D, W/D, Ym/D, φ). For this model, the values of R, SI and ACI are calculated as 0.777, 0.032 and − 1147.39, respectively. Furthermore, the values of RMSE and MARE for ANFIS3 are 0.020 and 0.020, respectively. ANFIS4 simulates discharge coefficient values in terms of (B/D, W/D, Fr, φ), and the influence of the parameter Ym/D for this model is removed. For ANFIS4, R and SI are computed to be 0.783 and 0.032, respectively. As shown, among the models with four input parameters, this model estimates discharge coefficient values with higher accuracy. In addition, the values of MARE and AIC for the mentioned model are obtained as 0.021 and − 1151.52, respectively. For ANFIS5, the influence of the parameter W/D is removed. In other words, this model estimates objective function values in terms of (B/D, Ym/D, Fr, φ). Based on the modeling results, this model has the lowest accuracy among all ANFIS models. For instance, MARE and AIC for the mentioned model are 0.025 and − 1101.24, respectively. In addition, the values of R and RMSE for ANFIS5 are computed to be 0.698 and 0.024, respectively. Furthermore, the ACI, SI and R values for ANFIS6 are approximated as − 111.05, 0.036 and 0.710, respectively. This model computes discharge coefficient values in terms of (W/D, Ym/D, Fr, φ), and the influence of the parameter B/D is eliminated. Furthermore, the values of RMSE and MARE for this model are calculated to be 0.023 and 0.026, respectively. The scatter plots for different ANFIS models are illustrated in Fig. 10. Therefore, based on the sensitivity analysis conducted on the ANFIS models, ANFIS1 is detected as the superior model. This model simulates discharge coefficient values in terms of all input values. Furthermore, the ratio of main channel width to side orifice dimensions (length or diameter) is identified as the most effective parameter.

Table 3 Results of different statistical indices for six models
Fig. 9
figure 9

Comparison of different statistical indices for six ANFIS models

Fig. 10
figure 10

Scatter plots for six ANFIS models

ANFIS-FA models

In the following, the ANFIS-FA hybrid models are studied. As discussed above, the first model is a function of all input parameters and the five remaining (ANFIS-FA2 to ANFIS-FA6) are a function of four input parameters. Based on the modeling results, ANFIS-FA1 estimates objective function values with the highest accuracy compared to the other hybrid models. The results of different hybrid statistical indices are listed in Table 4. Furthermore, the comparison of these statistical indices is shown in Fig. 11. In addition, the scatter plots for these models are illustrated in Fig. 12. For example, for ANFIS-FA1, the values of RMSE, MARE and SI are calculated to be 0.017, 0.017 and 0.027, respectively, whereas the R value for the mentioned model is computed equal to 0.850. Based on the results obtained from the hybrid numerical models, ANFIS-FA1 simulates discharge coefficient values with higher accuracy. Furthermore, for this model the values of R, RMSE and AIC are obtained 0.808, 0.019 and − 1169.42, respectively. However, SI and MARE for this model are computed 0.030 and 0.022, respectively. Among the hybrid models with four input parameters, ANFIS-FA2 has the highest accuracy. For ANFIS-FA, the values of SI, R and ACI are 0.032, 0.785 and − 1153.17, respectively. In addition, the values of RMSE and MARE are also approximated to be 0.020 and 0.020, respectively. Among the models with four input parameters, after ANFIS-FA2, ANFIS-FA4 has the highest correlation with the observational values. For example, MARE and SI for this model are computed as 0.019 and 0.031, respectively. Also, the values of RMSE and AIC for the mentioned model are obtained to be 0.020 and − 1158.37, respectively. According to the modeling results, ANFIS-FA5 has the lowest accuracy among all hybrid models. The values of R, Si and AIC for ANFIS-FA5 are calculated 0.693, 0.037 and − 1103.06, respectively. For ANFIS-FA6, the values of RMSE and MARE are also 0.020 and 0.021, respectively, while AIC is calculated to be − 1154.84. In addition, for this model the value of R is obtained equal to 0.788.

Table 4 Results of different statistical indices for six ANFIS-FA models
Fig. 11
figure 11

Comparison of different statistical indices for six ANFIS-FA models

Fig. 12
figure 12

Scatter plots for six ANFIS-FA models

According to the results of the hybrid numerical models, ANFIS-FA1 which calculates discharge coefficient values in terms of all input parameters is introduced as the superior model. In addition, the ratio of main channel width to side orifice diameter is detected as the most effective input parameter.

Conclusions

In this study, using the ANFIS model and the firefly algorithm a hybrid algorithm was developed for estimating discharge coefficient of such hydraulic structures. For validation of the results, the k-fold cross-validation method with k = 5 was used. In order to examine the numerical model abilities, the Monte Carlo simulations were used. Then, the most effective parameters on discharge coefficient of side orifices are identified. Then, 6 ANFIS models and 6 ANFIS-FA models were developed. By conducting a sensitivity analysis, the superior models for each of ANFIS and hybrid models were introduced. The superior models predicted discharge coefficient values with reasonable accuracy. For example, the ANFIS superior model calculated the values of R and SI to be 0.029 and 0.832, respectively. In addition, the values of RMSE, MARE and SI for the hybrid superior models were computed 0.017, 0.017 and 0.027, respectively. Compared to the corresponding models, all hybrid models simulated discharge coefficient values with higher accuracy. According to the results of the hybrid models, ANFIS-FA1 which predicted discharge coefficient values in terms of all input parameters was detected as the superior model. Furthermore, the ratio of main channel width to side orifice diameter (B/D) was identified as the most effective input parameter.