Next Article in Journal
Changes in the Biological Activities of Gracilaria verrucosa Extracted Using Different Extraction Solvents
Previous Article in Journal
Special Issue on Biochemical Composition of Food
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Flow Prediction of a Measurement and Control Gate Based on an Optimized Back Propagation Neural Network

1
Hydrology and Water Resources Monitoring and Early Warning Center of Ningxia Hui Autonomous Region, Yinchuan 750002, China
2
Ningxia Institute of Water Resources Research, Yinchuan 750021, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2023, 13(22), 12313; https://doi.org/10.3390/app132212313
Submission received: 23 October 2023 / Revised: 7 November 2023 / Accepted: 12 November 2023 / Published: 14 November 2023
(This article belongs to the Topic Advances in Artificial Neural Networks)

Abstract

:
The measurement and control gate, as a new type of measurement and control equipment, has been widely used for water quantity control in irrigation areas. However, there is a lack of methods for calibrating the flow inside the measurement box at present. This paper establishes a flow prediction model based on a back propagation (BP) neural network and its optimization algorithm by using 450 sets of sample data obtained from the indoor gate overflow test and verified the effectiveness and accuracy of the prediction model by using another 205 sets of sample data. The results show that the gate flow prediction model based on a BP neural network and its optimization algorithm has self-adaptability to different flow patterns, and its prediction accuracy is significantly higher than that of the traditional water measurement method. Compared to the unoptimized BP model, the BP model optimized by the genetic algorithm (GA) or particle swarm optimization (PSO) has higher prediction accuracy and better error distribution. Both GA and PSO algorithms can be used to optimize the initial weights and thresholds of the BP flow prediction model. However, by comprehensively analyzing the prediction accuracy, error distribution, and running time, the PSO algorithm has better optimization performance compared to the GA algorithm. The prediction model can provide a reference for flow rate calibration and the anomaly rejection of measurement and control gates in the irrigation area.

1. Introduction

Irrigation area water measurement technology is a core technology in irrigation area water monitoring and information construction [1]. Accurate flow measurement can improve the water supply capacity of all levels of channels and reduce water loss, which is the foundation of scientific water allocation and the modern management of irrigation areas [2,3]. In recent years, Ningxia has vigorously carried out modernization transformation of irrigation areas and installed over 4000 sets of measurement and control gates, involving more than 20 domestic and foreign manufacturers. The measurement and control gate is a new type of measurement and control facility that integrates flow measurement and control. It adopts the principle of the ultrasonic time difference method for real-time flow measurement. The Ningxia Yellow Diversion Irrigation Area has the largest number of measurement and control gates in China and the measurement accuracy problem is the most prominent in this area. However, due to the large number of manufacturers involved, there are significant differences in the flow measured by different types of equipment. In addition to the Ningxia Yellow Diversion Irrigation Area, other irrigation areas in China also suffer from the problem that the measurement accuracy of the measurement and control gate cannot be calibrated [4]. There is an urgent need to find a way to calibrate and adjust the flow measured by the measurement box.
The integrated measurement and control gate is designed based on the gate outflow principle. However, the traditional gate overflow formula requires selecting different flow calculation formulas based on different water flow patterns in practical applications. When the flow pattern changes rapidly or when it is difficult to distinguish between different flow patterns, this will lead to a large deviation between the calculated value and the measured value. In order to improve the accuracy of water measurement in irrigation areas, researchers have improved traditional flow calculation formulas or calibrated them for specific channels. Liu et al. [5] calibrated the water level–flow relationship of the main canal in Heping Irrigation District, Qing’an County, Heilongjiang Province, by using the uniform flow formula of the open channel. They also compared the calculated values with the measured flows and verified the correctness of the calibrated water level–flow relationship curve. Liu et al. [6] improved the “six-point method” of cross-section flow measurement for large channels in irrigation areas. They obtained the “one-point method” flow formula for the surface flow velocity at the center vertical line, which is applicable to wide shallow trapezoidal channels. The improved formula improves the efficiency of flow measurement and can obtain instantaneous flow. Deng et al. [7] compared three commonly used river flow calculation methods using the measured flow velocity and flow data from the Feilaixia Hydrological Station. They proposed that adding a velocity observation point in the river section can significantly improve the calculation accuracy of the traditional water level-flow method. Qin et al. [8] proposed a free outflow flow coefficient formula for the gate hole of Huaidian Gate in Huaihe River Basin on the basis of comparing five different functional forms of gate flow calculation formulas. This calculation formula adopts a segmented function form, which can improve the adaptability and calculation accuracy of traditional flow coefficient calculation formulas. Guan et al. [9] established a unified flow calibration model for flat gates and verified the effectiveness of the model by using the Flow-3D three-dimensional simulation model and field measurement data of large-scale control gates. The above flow calculation models or flow coefficient calibration models are for specific flow patterns or fixed structure channels, and their scope of application is relatively limited.
In actual irrigation areas, it is difficult to accurately distinguish the various flow patterns of water flow, and corresponding flow calculation formulas cannot be selected in a timely manner, which will result in significant calculation errors. The existing research has shown that neural networks can effectively solve the above problems [10,11,12]. Zhang [13] investigated the application of different artificial neural networks and their optimization models for flow prediction in channel systems. The research shows that the optimization model of the BP neural network is not affected by the change in flow pattern, and has high flow prediction accuracy and convergence speed, which can be used to calculate the flow of the main channels in the Ganfu Plain irrigation area. Li et al. [14] established a prediction model of diversion capacity for Weishan sluice based on the GA-RBF neural network. They concluded that the GA-RBF model has the characteristics of high prediction accuracy and strong adaptability. The data samples chosen in the above studies for the training and testing of neural network models are limited, and the generalization ability of the prediction model needs to be verified. Therefore, it is necessary to verify the generalization and prediction accuracy of neural network models through a large amount of experimental data.
In this paper, taking the widely used box culvert-type integrated measurement and control gate in Ningxia Yellow Diversion Irrigation Area as an example, a large number of overflow tests with different gate openings and flow discharges were conducted at Ningxia Tianxianglin Water Conservancy Measurement Facility Inspection Co., Ltd. (located in Wuzhong, China). The gate discharge was predicted using the traditional gate overflow formula and the neural network prediction model. The predictive performance of traditional flow calculation methods and neural network prediction methods, as well as the predictive performance of three different neural network models, were compared. The reasons for errors in different neural network models were analyzed. This study can provide an efficient and fast method for precise control of the integrated measurement and control gate and the prediction of gate flow.

2. Flow Gauging Test of the Integrated Measurement and Control Gate

The irrigation flow gauging test is limited by many factors. For example: the flow gauging test directly affects farmland irrigation; irrigation gates cannot be arbitrarily raised and lowered; the upstream water flow cannot be freely controlled; the water flow pattern needs some time to stabilize after the gate opening change; flow measurement equipment is greatly affected by environmental factors and large measurement errors can lead to low accuracy of the flow calculation model; and there is a lack of a professional testing institution and testing platform for the integrated measurement and control gates. Due to the above reasons, there are few reports of indoor flow gauging tests, and most scholars mainly use numerical simulation to conduct flow gauging tests [15,16]. The numerical simulation results need to be verified with actual measurement data, so there is an urgent need to conduct indoor flow gauging tests to provide data support for subsequent research.
The flow gauging test in this study was conducted at the measurement and control integrated gate testing center of Ningxia Tianxianglin Water Conservancy Measurement Facility Inspection Co., Ltd. This testing center is the only professional testing institution for integrated measurement and control gates in China. The experimental platform consists of three parts: a water supply system, a flow measurement section, and a return water system. The water supply system consists of three sets of water pumps, with a discharge range of 100~2600 m3/h. Discharge can be controlled by the frequency conversion system, and the flow measurement equipment is the internationally advanced Siemens electromagnetic flow meter. The flow measurement section can be equipped with pool flow disturbance devices, water inlet obstacles, and different types of integrated gates for measurement and control, as well as different sizes of guide channels and energy dissipation grids behind the flow measurement equipment. The return water system consists of water pumps, a rectangular pool, a flow measurement section, return water channels, and a stilling pool. The testing platform for the integrated measurement and control gate is shown in Figure 1.
The flow measurement device is a box culvert integrated measurement and control gate flow meter produced by a certain company, as shown in Figure 2. The opening size of the measurement box is 600 mm × 600 mm, the maximum water retaining height is 1500 mm, the width of the frame is 862 mm, the overall height is 2088 mm, and the length of the measurement box is 707 mm. Based on the 16 pairs of ultrasonic probes arranged in the flow measurement box, the ultrasonic time difference method is used to calculate the layer velocity of water flow in each layer of the flow measurement box, and then the flow speed area method is used to calculate the total discharge. A total of 30 gate flow measurement tests were conducted using the flow measurement device under different operating conditions, with a discharge variation range of 110~2500 m3/h and a gate opening variation range of 100~590 mm. In order to ensure the accuracy of the data and the stability of the water flow through the gate and to eliminate the measurement error caused by changes in the gate opening, each gate opening and given discharge were stabilized for 30 min, and 15 sets of data were continuously obtained. A total of 450 data sets were obtained as training samples for all working conditions. Subsequently, nine sets of gate overflow tests were conducted within the same range of flow and gate opening variations, and a total of 135 sets of data were obtained as prediction samples.

3. Establishment of the Flow Prediction Model

3.1. Traditional Water Measurement Method

Traditional water measurement methods are basically empirical formula methods. Based on the specific situation of the main canals in various plain irrigation areas, Reference [13] re-determined the relationship between water level and flow rate and obtained a suitable method for determining the water flow pattern in plain irrigation areas and corresponding flow calculation formulas. In the practical application of gates in plain irrigation areas, there are relatively few states of the free outflow with the gate fully open and submerged outflow with the gate fully open; therefore, they are collectively referred to as weir flow. The main flow pattern includes free outflow with gate control (FOG), submerged outflow with gate control (SOG), and weir flow (WF).
The traditional water measurement method uses the least-squares method mentioned for flow calculation in the Reference [13], which includes two steps: selecting the flow calculation formula and determining the flow coefficient. The first step is to determine the flow pattern based on the gate opening (E), upstream water level (H), and downstream water level (h). The second step is to substitute the known parameters into the calculation formulas for different flow patterns and use the least-squares method to fit the flow coefficient.
The flow calculation formula for free outflow with gate control and submerged outflow with gate control is as follows:
Q = M B E Z
where B is the gate width; E is the gate opening; Z is the difference between the upstream water level and the downstream water level; and M is the flow coefficient.
The flow coefficient M in Equation (1) can be expressed as a higher-order polynomial, and it takes the form:
M X = k 1 X n + k 2 X n 1 + k 3 X n 2 + + k n X + k 0
where k1, k2, k3, and kn are the undetermined coefficients and k0 is the undetermined constant, X = E/Z. By fitting the M-X curve, each undetermined coefficient can be obtained.
The flow calculation formula for weir flow can be expressed as
Q = a H n
where a and n are the undetermined coefficients, which can be obtained by directly fitting the Q-H curve.
The division of some flow patterns in the training samples is shown in Table 1. The fitting of different flow patterns using the least-squares method is shown in Figure 3. Due to the large number of training samples, we only selected 5 sets of data for each flow pattern and presented them in Table 1. In Figure 3, the data for all flow patterns are presented.
The calculation formula for the flow coefficient of the free outflow with gate control is as follows:
M = 0 . 0004 X 6 0 . 0028 X 5 + 0 . 0085 X 4 0 . 013 X 3 + 0 . 0101 X 2 0 . 0034 X + 0 . 0007
The calculation formula for the flow coefficient of the submerged outflow with gate control is as follows:
M = 9 × 10 8 X 6 + 10 6 X 5 7 × 10 5 X 4 + 0 . 0009 X 3 0 . 0046 X 2 + 0 . 0109 X 0 . 0088
The flow calculation formula for weir flow is as follows:
Q = 10 6 H 3 . 0769

3.2. Neural Network Flow Prediction Methods

BP neural networks are multi-layer feed-forward neural network algorithms, which have been widely used in various subject areas [17]. The BP neural network structure includes input, hidden, and output layers. Training is performed by passing sample information forward and propagating sample errors backward, and the thresholds and weights are continuously optimized and adjusted based on the feedback error data. Training stops when the total error of the training samples is lower than the set error value or when the specified number of training times is reached. The trained BP neural network model has a nonlinear relationship from input factors to output results. The output results can be calculated directly by importing the parameter values of the impact factors. In this paper, three influencing factors, namely gate opening, upstream water level, and downstream water level, are used as input factors. The number of neurons in the input layer is 3. The flow is used as the output layer, and the number of neurons in the output layer is 1.
The initial weight and threshold are important factors that affect the calculation accuracy and stability of BP neural networks. Since the initial weights and thresholds are randomly generated in the BP neural network, unreasonable initial weights and thresholds will reduce the generalization ability of the BP neural network. The prediction results will exhibit a phenomenon of “overfitting”, where the training result will have a small error while the prediction result will have a large error. Existing studies have shown that the genetic algorithm (GA) [18] and particle swarm optimization (PSO) [19] are two commonly used efficient optimization methods for BP neural networks. The GA method solves the optimal initial weights and thresholds by simulating the genetic process of organisms in nature. After that, the BP neural network is trained with samples based on the optimal initial weights and thresholds. This combination is called the GA-BP neural network model. Similarly, the PSO method solves the optimal initial weights and thresholds by simulating the predatory behavior of bird populations in nature. Then, the optimal solutions are substituted into the BP neural network for network training. This combination is called the PSO-BP neural network model. The specific implementation steps of the GA-BP neural network model and the PSO-BP neural network model are shown in Figure 4. The constraint condition for discharge flow is 110~2500 m3/h, and the constraint condition for gate opening is 100~590 mm. The number of nodes in the hidden layer of the BP neural network is 5, the network training accuracy is set to 0.0001, the upper limit of network training is set to 5000 times, the error threshold is 10−6, and the learning rate is 0.01. The genetic algebra of the GA-BP neural network model is set to 50, the population size is 5, the evolution algebra is 100, the crossover probability is 0.4, and the mutation probability is 0.01. The learning factor of the PSO-BP neural network model is 4.494, the number of population updates is 30, the population size is 5, the inertia weight is 0.6, and the maximum iteration number is 2000. The maximum and minimum boundaries are 1 and −1, respectively. The training of the BP neural network is carried out using the built-in neural network toolbox of MATLAB2019b software. The optimization of initial weights and thresholds of the BP neural network by the GA algorithm and the PSO algorithm is implemented through programming in MATLAB.

4. Comparative Analysis of the Prediction Results

The flow prediction results of the traditional water measurement method, the BP neural network model, the GA-BP neural network model, and the PSO-BP neural network model under different flow patterns are shown in Figure 5. Under the condition of free outflow with gate control, the traditional water measurement method has a large deviation from the predicted samples 16 to 30, and the rest of the sample points are closer to the measured flow. This is due to the large deviation between the fitted flow coefficient curve and the given M value at X = 1.0. The predicted flows of the BP model, GA-BP model, and PSO-BP model are all near the measured flow under this flow pattern. Under the condition of submerged outflow with gate control, due to the fact that some of the given M values are in a discrete state, the fitting accuracy of the flow coefficient curve is poor. Therefore, the predicted flows of the traditional water measurement method seriously deviated from the measured flows. The predicted flows of the three neural network models are all close to the measured flows under this flow pattern. Under the weir flow condition, although the fitting degree of the flow coefficient curve is good, the predicted flows of the traditional water measurement method are still significantly smaller than the measured flows. The predicted flows of the three neural network models show fluctuating changes in the prediction samples from 1 to 15 and leveling off from 16 to 30. Overall, the predicted flows of the three neural network models have a small deviation from the measured flows under this flow pattern. Figure 5d shows the flow prediction results of the BP model, GA-BP model, and PSO-BP model in the case of a combination of the three flow patterns. It can be seen that the predicted flows of the three neural network models can well fit the trend of the measured flows and have good self-adaptability. In addition, the predicted flows of the three neural network models vary near the measured flows, and there are no obvious discrete predicted sample points. In summary, the neural network prediction model has a much higher predictive ability for the flows under different flow patterns than the traditional water measurement method and has a self-adaptive ability for different flow patterns.
The relative error can reflect the credibility of the predicted results, which can be calculated by the following equation:
Relative   error = Q i Q i Q i × 100 %
where Qi is the measured flow and Q i is the predicted flow.
The changes in the relative errors between the predicted results of the BP, GA-BP, and PSO-BP models and the measured results are shown in Figure 6. In Figure 6, the relative error range of the traditional method is too large compared to the neural network prediction method, so we labeled the curve as an orange dash, and we show its axes on the right side. As shown in Figure 6, the prediction accuracy of the traditional methods is too low and cannot be used for flow prediction under combined flow patterns. The maximum error reaches 111.36%, 1492.74%, and 39.43% for FOG, SOG, and WF flow patterns, respectively. Therefore, we focused on analyzing the prediction accuracy of three neural network models. Under the condition of the free outflow with gate control, the relative errors of the GA-BP and PSO-BP models fluctuate within the ±5% range, and the relative error of the BP model fluctuates within the range of 1.46% to 18.22%. Under the condition of submerged outflow with gate control, the relative errors of the GA-BP and PSO-BP models become larger. The error range of the GA-BP model is −8.5~16.5%, the error range of the PSO-BP model is −12.4~10.1%, and the error range of the BP model is −25~10%. Under the weir flow condition, the error ranges of the BP, GA-BP, and PSO-BP models are −10.6~12.1%, −7.9~11.1%, and −0.4~11.2%, respectively. In the case of a combination of the three flow patterns, the error ranges of the GA-BP model and the PSO-BP model are relatively close to each other, ranging from −10.7% to 15.7% and −11.4% to 12.2%, respectively. The error range of the BP model is relatively large, ranging from −13.9% to 21.4%. In summary, both the GA-BP model and the PSO-BP model have higher prediction accuracy than the BP model. Both genetic algorithms and particle swarm algorithms can be used to optimize the initial weights and thresholds of a BP neural network model.
To further understand the error distributions of the three models under different flow patterns, the error distribution statistics of the three models are given in Figure 7. Under conditions of free outflow with gate control and submerged outflow with gate control, the error distributions of the GA-BP and PSO-BP models are characterized by an approximately normal distribution, while the BP model has more outliers with relative errors of 15% and above. Under the weir flow condition, the BP model has 14 samples distributed at 10% and above. The GA-BP and PSO-BP models do not have outliers with large relative errors, but the PSO-BP model has a more concentrated distribution of errors. In the case of a combination of the three flow patterns, when the relative error is within −10~10%, the number of samples predicted by the GA-BP and PSO-BP models is significantly greater than that of the BP model. The BP model has more outliers with relative errors of 15% and above. In summary, the GA algorithm and PSO algorithm improve the error distribution of the BP model, narrow the error distribution range of the BP model, and stabilize more samples within an acceptable range. The PSO algorithm has a better optimization effect on the error distribution of the BP model than the GA algorithm, making the error distribution more concentrated.
For the flow predicted by different neural network models, the coefficient of determination R2 and the mean absolute percentage error (MAPE) were used to evaluate the flow prediction accuracy, which can be expressed as in Equations (8) and (9). A higher R2 indicates a better regression of the model and a smaller value of MAPE indicates a higher prediction accuracy [21]. The evaluation indicators for the prediction results of the three methods are shown in Table 2.
R 2 = 1 i = 1 n Q i Q i 2 / i = 1 n Q i Q i ¯ 2
MAPE = 1 n i = 1 n Q i Q i Q i × 100 %
where n is the number of test samples and Q ¯ i is the average value of the measured flow.
From the perspective of the regression effect, the R2 of the GA-BP and PSO-BP models is higher than that of the BP model under different flow patterns. The R2 of the GA-BP and the PSO-BP models is relatively close under the conditions of free flow with gate control and the combined flow patterns. The R2 of the PSO-BP model is higher than that of the GA-BP model under the conditions of submerged outflow with gate control and weir flow. From the perspective of prediction accuracy, overall, the MAPE and maximum relative error of the PSO-BP model are lower than those of the GA-BP model, and the BP model has the largest MAPE and maximum relative error. In summary, the particle swarm algorithm is slightly better than the genetic algorithm in optimizing the BP neural network for gate flow prediction. However, since the prediction results of the GA-BP and PSO-BP models are affected by their respective parameter settings, which are quite different, it is impossible to accurately evaluate the optimization effects of the particle swarm optimization and genetic algorithm on the BP neural network. From the evaluation indicators of the prediction results, the GA-BP and PSO-BP models significantly improve the prediction accuracy of the BP model and enhance the generalization ability of the BP model, which can be used for the flow prediction of dry and branch canals in the irrigation areas. From Table 2, it can be seen that the relevant statistical indicators of traditional methods are significantly inferior to those of neural network models, which reflects the superiority of the model proposed in this paper.
The optimization effect of particle swarm optimization is better than that of the genetic algorithm. The main reason is that the two algorithms have different principles: (1) the crossover probability and mutation probability in the GA-BP model are fixed. The genetic algorithm requires different search capabilities in the early global search stage and the later local search stage. Fixed parameter settings cannot self-adaptively meet the search capability requirements of genetic algorithms at different times; (2) the crossover and mutation operations of genetic algorithms in the population evolution process will randomly introduce new individuals. The quality of new individuals will directly affect the convergence speed of the algorithm, and this process is blind. Excellent individuals will accelerate the population’s movement towards the optimal position during the evolutionary process, while undesirable individuals will slow down their movement speed; and (3) the particle swarm of the particle swarm algorithm will follow the optimal particle movement under global conditions. The entire population of the genetic algorithm moves towards the optimal position during the evolution process. Therefore, the PSO algorithm has a faster convergence speed than the GA algorithm.

5. Application Analysis of the Prediction Model

To verify the calibration effect of the neural network model on the layer velocity of the measurement box of the integrated measurement and control gate, the flow measurement device was used to conduct gate flow measurement tests again under seven working conditions. The variation range of flow is 400~1500 m3/h, and the variation range of gate opening change is 100~400 mm. The 10 sets of data were continuously obtained for each working condition, and a total of 70 sets of data were obtained as prediction samples. The flow of the measurement box was predicted using a trained PSO-BP neural network model. The PSO-BP model predicted the flow, the theoretically calculated flow from the flow velocity of each layer in the measurement box, and the measured flow were compared, and their relative errors with the measured flow rate were calculated, as shown in Figure 8. There are a total of 10 layers of flow velocity inside the measurement box. Based on the size of the measurement box, the flow calculation formula inside the measurement box can be described as:
Q c = 0.025 v 1 + v 10 + 0.025 + 0.5 / 14 v 2 + v 9 + 0.5 / 7 × v 3 + v 4 + v 5 + v 6 + v 7 + v 8 × 0.6
where Qc is the theoretically calculated flow from the flow velocity of each layer in the measurement box and v1~v10 are the flow velocities of the first to tenth layers in the measurement box, respectively.
It can be seen that the PSO-BP model’s predicted flow is in good agreement with the measured flow. The relative error of the PSO-BP model is less than 10%, and there are no abnormal points with large relative errors. The theoretically calculated flow is generally consistent with the measured flow, but there are a few outliers with large deviation values, the maximum relative error reaches 50%. This may be due to the measurement error caused by the inability of individual probes in the measurement box to accurately obtain the path flow velocity during the transition of the water flow pattern. The outliers should be eliminated or corrected in the background when performing flow calculations for the entire measurement box.

6. Discussion

The measurement and control gate, as a new type of measurement and control equipment, calculates the flow rate through ultrasonic probes arranged in layers inside the measurement box. However, when the flow pattern is turbulent or the flow pattern is rapidly changing, the individual probe will not be able to accurately obtain the path flow velocity, and the flow velocity area method will produce large errors when used for flow calculation. Due to the lack of a professional platform for the detection and testing of measurement and control gates, few studies have been carried out to investigate the calibration method for flow in the measurement box of the measurement and control gate [22,23]. It is very important to calibrate the accuracy of the path flow velocity measured by the probe inside the measurement box during the development and debugging process of the measurement and control gate. The research in this paper indicates that using neural network models to predict flow and thus calibrate the path flow velocity inside the measurement box is a feasible solution.
Neural network models have been widely used in radial gates and slice gates in channels [24,25], but no studies have reported the application of neural network models in measurement and control gates. Since the BP, GA-BP, and PSO-BP models are more widely used neural network models, these three models were chosen in this study to carry out an exploratory preliminary study, and other neural network models will be chosen in the subsequent study for the application of measurement and control gates. The robustness and reliability of the optimized neural network prediction models are assured by comparing them with a large amount of measured data. Both PSO and GA algorithms have good applicability and acceptable computational efficiency. However, the parameter settings of the two algorithms have a significant impact on the optimization effect. The parameters used in this article are all conventional settings, which have shown good performance in other fields, but there is still significant room for improvement in gate flow prediction.
The neural network prediction model established in this paper also has some shortcomings. The flow measurement tests were conducted under undisturbed conditions, without considering working conditions such as obstruction, disturbance in front of the gate, and the addition of diversion channels. In the later stage, flow measurement experiments will be conducted under the influence of different external factors. The increases in the input variables of the neural network can improve the generalization ability, prediction accuracy, and applicability of the prediction model. Further efforts are also needed on the system reliability evaluations of measurement and control gates produced by different manufacturers, which can more realistically evaluate the real situation in the management of agricultural irrigation.

7. Conclusions

(1)
The traditional gate outlet flow formula cannot be applied to the flow calculation in the measurement box of the integrated measurement and control gate. By optimizing the weights and thresholds of BP neural networks using the genetic algorithm (GA) and particle swarm optimization (PSO), GA-BP and PSO-BP neural network models suitable for the integrated measurement and control gate were established. The established model has good self-adaptability for three flow patterns: free flow with gate control, submerged flow with gate control, and weir flow.
(2)
Both GA and PSO algorithms can be used to optimize the initial weights and thresholds of BP neural networks, resulting in better initial network parameters. Compared to the BP model, the GA-BP and PSO-BP models have enhanced robustness and generalization capabilities and reduced the risk of the model falling into the local minimum. The prediction accuracy of the two models was also improved. In the case of a combination of the three flow patterns, the MAPE of the GA-BP model increased by 30.53% and that of the PSO-BP model increased by 34.52%. Compared to the GA-BP model, the PSO-BP model better improves the error distribution of the model and has shorter run times and higher prediction accuracy under single and combined flow patterns.
(3)
Under the premise of known upstream and downstream water levels and gate openings, the PSO-BP model can be used to preliminarily predict the flow of the integrated measurement and control gate and determine the change range of gate flow. By comparing the predicted flow value with the calculated value of the flow velocity in the measurement box of the integrated measurement and control gate, the outlier caused by the shielding of the probe in the measurement box or the complex flow pattern can be effectively eliminated. This prediction method can be used as an efficient and fast method for the flow calibration of the integrated measurement and control gate.

Author Contributions

Conceptualization, Z.H. and J.N.; methodology, Z.H. and J.Z.; data curation, J.N. and L.L.; writing—original draft preparation, J.N.; writing—review and editing, J.Z.; visualization, L.L.; supervision, J.N. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Ningxia Natural Science Foundation (grant no. 2022AAC03726).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

Author Zheng Hou was employed by Hydrology and Water Resources Monitoring and Early Warning Center of Ningxia Hui Autonomous Region. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Nomenclature

FOGfree outflow with gate control
SOGsubmerged outflow with gate control
WFweir flow
Egate opening (m)
Hupstream water level (m)
hdownstream water level (m)
Bgate width (m)
Zdifference between the upstream water level and the downstream water level (m)
Mflow coefficient
XE/Z
kiundetermined coefficient
aundetermined coefficient
nundetermined coefficient
R2coefficient of determination
MAPEmean absolute percentage error
nnumber of test samples
Qimeasured flow
Qpredicted flow
Q ¯ i average value of the measured flow
Qctheoretically calculated flow from the flow velocity of each layer in the measurement box
viflow velocity of the i-th layer in the measurement box

References

  1. Dou, M.; Qin, C.G.; Li, G.Q.; Wang, C. Research on calculation method of free flow discharge based on artificial neural network and regression analysis. Flow. Meas. Instrum. 2020, 72, 101707. [Google Scholar] [CrossRef]
  2. Bijankhan, M.; Kouchakzadeh, S.; Belaud, G. Application of the submerged experimental velocity profiles for the sluice gate’s stage-discharge relationship. Flow. Meas. Instrum. 2017, 54, 97–108. [Google Scholar] [CrossRef]
  3. Nouri, M.; Sihag, P.; Salmasi, F.; Kisi, O. Energy loss in skimming flow over cascade spillways: Comparison of artificial intelligence-based and regression methods. Appl. Sci. 2020, 10, 6903. [Google Scholar] [CrossRef]
  4. Sihag, P.; Nouri, M.; Ahmadpari, H.; Seyedzadeh, A.; Kisi, O. Approximation of the discharge coefficient of radial gates using metaheuristic regression approaches. Sustainability 2022, 14, 15145. [Google Scholar] [CrossRef]
  5. Liu, D.L.; Wu, W.Y.; Xiao, J.; Niu, X.Y. Calibration and application of channel water level-flow relationship curve. Yellow River 2020, 42, 157–158, 184. [Google Scholar]
  6. Liu, H.T.; Zhao, Y.B.; Li, X.J.; Long, Y.F.; Zhao, H.; Zhang, F.J. Study on flow velocity distribution law and flow calculation method of wide shallow trapezoidal channel. Water Sav. Irrig. 2023, 5, 56–61. [Google Scholar]
  7. Deng, X.X.; Ye, A.Z.; Tong, H.F.; Xu, J.; Mao, Y.N.; Ma, F. The study of measurement and calculation method on river discharge. China Rural. Water Hydropower 2015, 6, 70–74. [Google Scholar]
  8. Qin, C.G.; Mao, H.L.; Wang, J.H.; Dou, M. The application and improvement of the free—Flow discharge coefficient formulas at the Huaidian Sluice. China Rural. Water Hydropower 2019, 7, 129–133. [Google Scholar]
  9. Guang, G.H.; Huang, Y.F.; Xiong, J.; Jin, W.R. Uniform flow rate calibration model for flat gate under free-submerged orifice flow. Trans. Chin. Soc. Agric. Eng. 2020, 36, 197–204. [Google Scholar]
  10. Lin, C.H.; Yen, J.F.; Tsai, C.T. Influence of sluice gate contraction coefficient on distinguishing condition. J. Irrig. Drain. Eng. 2002, 128, 249–252. [Google Scholar] [CrossRef]
  11. Ferro, V. Simultaneous flow over and under a gate. J. Irrig. Drain. Eng. 2000, 126, 190–193. [Google Scholar] [CrossRef]
  12. Arslan, C.A.; Abdul, A.H.; Ismael, A.A. Prediction of discharge coefficient for cylindrical weirs using adaptive neuro fuzzy inference system ANFIS and multilayer neural networks MLP. Int. J. Appl. Eng. Res. 2018, 13, 7042–7051. [Google Scholar]
  13. Zhang, N. Study on Stage-Discharge Relationship Based on Neural Network. Master’s Thesis, Nanchang University, Nanchang, China, 2014. [Google Scholar]
  14. Li, S.T.; Wang, J.T.; Yu, M.; Yao, J.W.; Zhao, G.P.; Fan, Y.M. Using GA-RBF neural network model to calculate the diversion capability of the Weishan sluice. J. Irrig. Drain. 2021, 40, 100–104, 139. [Google Scholar]
  15. Salehi, S.; Azimi, A.H. Discharge characteristics of weir-orifice and weir-gate structures. J. Irrig. Drain. Eng. 2019, 145, 04019025. [Google Scholar] [CrossRef]
  16. Karami, S.; Heidari, M.M.; Rad, M.H.A. Investigation of free flow under the sluice gate with the sill using Flow-3D model. Iran. J. Sci. Technol. Trans. Civ. Eng. 2020, 44, 317–324. [Google Scholar] [CrossRef]
  17. Liu, D.; Liu, C.; Tang, Y.; Gong, C. A GA-BP Neural Network Regression Model for Predicting Soil Moisture in Slope Ecological Protection. Sustainability 2022, 14, 1386. [Google Scholar] [CrossRef]
  18. Jin, G.; Feng, W.; Meng, Q. Prediction of waterway cargo transportation volume to support maritime transportation systems based on GA-BP neural network optimization. Sustainability 2022, 14, 13872. [Google Scholar] [CrossRef]
  19. Katherasan, D.; Elias, J.V.; Sathiya, P.; Haq, A.N. Simulation and parameter optimization of flux cored arc welding using artificial neural network and particle swarm optimization algorithm. J. Intell. Manuf. 2014, 25, 67–76. [Google Scholar] [CrossRef]
  20. Zhu, C.H. Study on Hazard Assessment of Landslide in Sichuan Province Based on BP Neural Network and Optimized Algorithm. Master’s Thesis, Southwest Jiaotong University, Chengdu, China, 2020. [Google Scholar]
  21. Willmott, C.J.; Matsuura, K. Advantages of the mean absolute error (MAE) over the root mean square error (RMSE) in assessing average model performance. Clim. Res. 2005, 30, 79–82. [Google Scholar] [CrossRef]
  22. Salmasi, F.; Abraham, J. Expert system for determining discharge coefficients for inclined slide gates using genetic programming. J. Irrig. Drain. Eng. 2020, 146, 06020013. [Google Scholar] [CrossRef]
  23. Majedi-Asl, M.; Fuladipanah, M.; Arun, V.; Tripathi, R.P. Using data mining methods to improve discharge coefficient prediction in Piano Key and Labyrinth weirs. Water Supply 2021, 22, 1964–1982. [Google Scholar] [CrossRef]
  24. Roushangar, K.; Shahnazi, S.; Sadaghiani, A.A. An efficient hybrid greywolf optimization based KELM approach for prediction of the discharge coefficient of submerged radial gates. Soft Comput. 2021, 27, 3623–3640. [Google Scholar] [CrossRef]
  25. Salmasi, F.; Nouri, M.; Sihag, P.; Abraham, J. Application of SVM, ANN, GRNN, RF, GP and RT models for predicting discharge coefficients of oblique sluice gates using experimental data. Water Supply 2020, 21, 232–248. [Google Scholar] [CrossRef]
Figure 1. Test platform for integrated measurement and control gate detection: (a) flow measurement test site and (b) layout plan of the testing device.
Figure 1. Test platform for integrated measurement and control gate detection: (a) flow measurement test site and (b) layout plan of the testing device.
Applsci 13 12313 g001
Figure 2. Box culvert integrated measurement and control gate.
Figure 2. Box culvert integrated measurement and control gate.
Applsci 13 12313 g002
Figure 3. Fitting curves of the flow coefficient under different flow patterns: (a) free outflow with gate control; (b) submerged outflow with gate control; and (c) weir flow.
Figure 3. Fitting curves of the flow coefficient under different flow patterns: (a) free outflow with gate control; (b) submerged outflow with gate control; and (c) weir flow.
Applsci 13 12313 g003
Figure 4. Flow charts of the GA- and PSO-optimized BP neural networks [20]: (a) GA-BP neural network model and (b) PSO-BP neural network model.
Figure 4. Flow charts of the GA- and PSO-optimized BP neural networks [20]: (a) GA-BP neural network model and (b) PSO-BP neural network model.
Applsci 13 12313 g004
Figure 5. Flow prediction results of traditional water measurement methods, the BP model, the GA-BP model, and the PSO-BP model under different flow patterns: (a) free outflow with gate control; (b) submerged outflow with gate control; (c) weir flow; and (d) combined flow patterns.
Figure 5. Flow prediction results of traditional water measurement methods, the BP model, the GA-BP model, and the PSO-BP model under different flow patterns: (a) free outflow with gate control; (b) submerged outflow with gate control; (c) weir flow; and (d) combined flow patterns.
Applsci 13 12313 g005
Figure 6. Relative errors of traditional water measurement methods, the BP model, the GA-BP model, and the PSO-BP model under different flow patterns: (a) free outflow with gate control; (b) submerged outflow with gate control; (c) weir flow; and (d) combined flow patterns.
Figure 6. Relative errors of traditional water measurement methods, the BP model, the GA-BP model, and the PSO-BP model under different flow patterns: (a) free outflow with gate control; (b) submerged outflow with gate control; (c) weir flow; and (d) combined flow patterns.
Applsci 13 12313 g006
Figure 7. Error distributions of traditional water measurement methods, the BP model, the GA-BP model, and the PSO-BP model under different flow patterns: (a) free outflow with gate control; (b) submerged outflow with gate control; (c) weir flow; and (d) combined flow patterns.
Figure 7. Error distributions of traditional water measurement methods, the BP model, the GA-BP model, and the PSO-BP model under different flow patterns: (a) free outflow with gate control; (b) submerged outflow with gate control; (c) weir flow; and (d) combined flow patterns.
Applsci 13 12313 g007
Figure 8. Calculation results and relative errors of the PSO-BP model and the layer flow velocity in the measurement box: (a) flow variation and (b) relative error.
Figure 8. Calculation results and relative errors of the PSO-BP model and the layer flow velocity in the measurement box: (a) flow variation and (b) relative error.
Applsci 13 12313 g008
Table 1. Training sample data for partial flow measurement.
Table 1. Training sample data for partial flow measurement.
Measured Discharge (m3·h−1)Water Level (mm)Gate Width (mm)Gate Opening (mm)E/Hh/HFlow Pattern
UpstreamDownstream
475.691051.9478.26001000.10 0.46 FOG
524.07714.6519.56002000.28 0.73 FOG
942.221318641.46001500.11 0.49 FOG
1149.08945.1703.36005000.53 0.74 FOG
1905.311181.6860.16003000.26 0.73 FOG
115.23409.1356.66001000.24 0.87 SOG
145.55433.2397.96001500.35 0.92 SOG
325.32501.6467.26003000.60 0.93 SOG
530.79637.2517.46002500.39 0.81 SOG
2416.811209.91027.16005800.48 0.85 SOG
114.79385.9360.96004501.17 /WF
525.92555.9508.76005901.06 /WF
859679.6614.16005000.74 /WF
1169.72849.6785.46005800.68 /WF
1424.57814.6706.66005900.72 /WF
Table 2. Evaluation of prediction results of the BP model, GA-BP model, and PSO-BP model.
Table 2. Evaluation of prediction results of the BP model, GA-BP model, and PSO-BP model.
Computational ModelsR2MAPE (%)Maximum Relative Error (%)Run Time (s)
FOGBP0.974 8.24118.22225
GA-BP0.997 2.8587.68236
PSO-BP0.996 2.8276.44418
Traditional method0.20337.83111.36/
SOGBP0.987 8.162−25.0328
GA-BP0.982 4.66716.57534
PSO-BP0.996 4.723−12.42322
Traditional method0.021677.101492.74/
WFBP0.663 7.0412.11917
GA-BP0.835 4.98411.09826
PSO-BP0.883 4.57311.20413
Traditional method0.31728.7039.43/
Combined flow patternsBP0.981 7.72121.39752
GA-BP0.989 5.36415.69464
PSO-BP0.989 5.05612.17141
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Hou, Z.; Niu, J.; Zhu, J.; Lu, L. Flow Prediction of a Measurement and Control Gate Based on an Optimized Back Propagation Neural Network. Appl. Sci. 2023, 13, 12313. https://doi.org/10.3390/app132212313

AMA Style

Hou Z, Niu J, Zhu J, Lu L. Flow Prediction of a Measurement and Control Gate Based on an Optimized Back Propagation Neural Network. Applied Sciences. 2023; 13(22):12313. https://doi.org/10.3390/app132212313

Chicago/Turabian Style

Hou, Zheng, Jiayong Niu, Jie Zhu, and Liguo Lu. 2023. "Flow Prediction of a Measurement and Control Gate Based on an Optimized Back Propagation Neural Network" Applied Sciences 13, no. 22: 12313. https://doi.org/10.3390/app132212313

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop