Iranian Journal of Soil and Water Research

Iranian Journal of Soil and Water Research

Comparison of Linear and Nonlinear Hydraulic Canal Model Performance within a Discrete Reinforcement Learning Framework

Document Type : Research Paper

Author
Water Science and Engineering Department, Faculty of Agriculture, Bu-Ali Sina University, Hamedan, Iran.
Abstract
Water management and control in irrigation canals are challenging due to the nonlinear behavior of open-channel flow, time delays, and variable water withdrawals. In recent years, reinforcement learning has emerged as a promising approach for controlling such systems; however, the influence of the underlying hydraulic model on the quality of the learning process has not yet been quantitatively investigated. This study compares the performance of a discrete reinforcement learning algorithm integrated with two simulation environments: a nonlinear hydraulic model based on the full Saint-Venant equations and a linearized hydraulic model of an irrigation canal. The learning agent was trained independently using each model, and the resulting control policies were evaluated based on water delivery errors as well as the efficiency and adequacy performance indicators. The results show that the nonlinear model achieved substantially smaller delivery errors than the linear model in the downstream reaches, with minimum efficiency and adequacy values of 0.962 and 0.972, respectively. In contrast, the minimum efficiency of the linear model decreased to 0.497 in the terminal reaches, while the maximum absolute delivery error reached 59%. Although the linear model exhibited faster convergence during training and provided acceptable performance within the linearization range (±20% discharge variation), it learned weaker control policies outside this range, resulting in degraded water distribution performance, particularly in the downstream reaches.
Keywords
Subjects

Introduction

Water management in conveyance and distribution canals is inherently challenging due to nonlinear hydraulic behavior, significant time delays between control actions and system responses, disturbances caused by variable and often sudden farmer off-takes, and uncertainties in hydraulic parameters. Accurate simulation of these systems is a prerequisite for designing intelligent controllers capable of maintaining stable water levels and ensuring fair water allocation. Two main categories of hydraulic simulators exist: fully nonlinear models based on the Saint-Venant equations, which provide high accuracy but require substantial computational resources, and simplified linear models, such as state-space representations, which offer faster computations at the cost of physical fidelity. Discrete reinforcement learning (RL) algorithms, particularly SARSA (State-Action-Reward-State-Action), have emerged as powerful tools for learning optimal control policies through interaction with an environment. However, a critical research gap persists: no prior study has quantitatively evaluated how the choice of hydraulic simulator (nonlinear vs. linear) affects the learning process, convergence speed, and final control policy quality of discrete RL algorithms. This study addresses this gap by providing the first systematic comparison of RL performance integrated with both simulator types.

Purpose

The primary purpose of this research is to quantitatively compare the performance of discrete reinforcement learning (SARSA) when integrated with two distinct hydraulic simulators: (1) a fully nonlinear model based on the Saint-Venant equations (implemented in the AICSS software), and (2) a linear state-space model identified from input-output data of the nonlinear simulator. The comparison focuses on three key aspects: (a) prediction accuracy (error indices such as IAE and MAE), (b) control performance (efficiency and adequacy indices), and (c) learning speed (convergence rate). The study aims to answer the fundamental question: does the computational simplicity and higher speed of linear models justify their accuracy loss in discrete RL-based control of irrigation canals?

Research Method

The study was conducted on the ASCE (American Society of Civil Engineers) standardized Test Canal No. 2, which consists of eight consecutive pools, eight vertical sliding gates (with a pump at the final pool), and eight lateral off-takes. This configuration represents a typical irrigation canal with cascaded hydraulic interactions.

The nonlinear hydraulic behavior was simulated using the AICSS (Agricultural Irrigation Conveyance System Simulator) software, which solves the full one-dimensional Saint-Venant equations (continuity and momentum) to model both steady and unsteady flow conditions.

A linear state-space model was derived using a data-driven system identification approach. First, the nonlinear model was excited by applying step changes of +5%, +10%, and +20% to each gate position relative to its reference value. The resulting input (gate positions) and output (water depths) data were recorded. Second, this incremental data was imported into MATLAB's System Identification Toolbox to estimate the state-space matrices with a sampling time of 36 seconds. Validation was performed using Pseudo-Random Binary Sequence (PRBS) signals to ensure generalizability and avoid overfitting.

The SARSA algorithm was integrated with both simulators. The state vector was defined as Si = [Pli, QTi], where Pli is the reach number and QTi is the off-take discharge. Actions corresponded to gate position adjustments. The reward function was designed to penalize deviations from target water depths. Hyperparameters were systematically tuned: initial temperature of 0.0007 for the Softmax action selection, initial learning rate of 0.3 with a decay factor of 1.067, discount factor of 0.9, and 500 learning episodes with 8 independent runs.

Quantitative evaluation used Maximum Absolute Error (MAE), Integral Absolute Error (IAE), Efficiency and Adequacy indices, classified into "Good," "Moderate," and "Poor" categories based on established thresholds.

Results:

The results clearly demonstrate the superior performance of the nonlinear simulator across all evaluation metrics.

The nonlinear model achieved remarkably low errors, with MAE and IAE limited to 12.3% and 8.9%, respectively, across all eight reaches. In contrast, the linear model exhibited an exponential error increase from upstream to downstream. In Reach 8, the linear model's MAE reached 59% and IAE reached 51%, both classified as "Poor." The nonlinear model produced errors smaller than the linear model in downstream reaches.

The nonlinear model achieved minimum efficiency of 0.962 and minimum adequacy of 0.972, both in the "Good" category, indicating precise water delivery without significant surplus or deficit. The linear model, while maintaining adequacy (adequacy up to 1.00), suffered a dramatic efficiency drop to 0.497 in Reach 8 ("Poor"), indicating substantial water wastage to compensate for modeling errors. A deep "gap" between efficiency and adequacy was observed for the linear model but not for the nonlinear model.

The linear model converged faster due to its simpler computational structure. However, this speed advantage did not translate into better control policies; instead, the linear model learned skewed policies that favored upstream off-takes while over-delivering to downstream ones.

Averaging Q-tables from 8 independent runs reduced operational phase errors significantly, lowering MAE from 21% (learning phase) to 10.7% (operational phase) for the nonlinear model.

Conclusion

This study provides definitive quantitative evidence that the choice of hydraulic simulator fundamentally determines the success of discrete reinforcement learning for irrigation canal control. The nonlinear Saint-Venant model consistently delivers high accuracy, stable performance, fair water distribution, and balanced efficiency-adequacy trade-offs across all canal reaches. The linear state-space model, despite its faster learning speed and acceptable performance within a ±20% linearization range, suffers from inherent limitations: it cannot simulate key nonlinear phenomena such as flow-dependent energy losses, wave propagation delays, and flow interactions between adjacent pools. These limitations become critically pronounced in downstream reaches, where cumulative errors lead to inefficient control policies, excessive water wastage, and unfair distribution. The findings refute the notion that linear models' computational simplicity can compensate for their accuracy loss in RL-based control. For sustainable, efficient, and equitable water resource management in conveyance and distribution canals, nonlinear simulators are better choice. Future work should focus on developing adaptive, hybrid models that combine physical constraints with data-driven learning to maintain accuracy across wider operating ranges while preserving computational efficiency.

Funding

This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.

Authorship contribution

Conceptualization, methodology, software, validation, formal analysis, investigation, resources, data curation, writing—original draft preparation, writing—review and editing, visualization, supervision, project administration, funding acquisition; K.Sh.  All authors have read and agreed to the published version of the manuscript.

Declaration of Generative AI and AI-assisted technologies in the writing process

Statement: During the preparation of this work the author(s) used [Deepseek] in order to [wring]. After using this tool/service, the author(s) reviewed and edited the content as needed and take(s) full responsibility for the content of the publication.

Data availability statement

In this section, please provide details regarding where data supporting reported results can be Data available on request from the authors.

Ethical considerations

The authors avoided data fabrication, falsification, and plagiarism, and any form of misconduct.

Acknowledgements

      The authors would like to thank anonymous referees for their constructive comments.

Conflict of interest

The authors declare no conflict of interest.

Arango JP, Duviella E, Etienne L, Langueh K, Segovia P, Puig V (2025) A Nonlinear State Feedback Tracking Controller for Open Channel Irrigation Systems IFAC-PapersOnLine 59:44-49 doi:https://doi.org/10.1016/j.ifacol.2025.12.420
Clemmens AJ, Kacerek TF, Grawitz B, Schuurmans W (1998) Test cases for canal control algorithms J Irrig Drain Eng 124:23-30 doi:https://doi.org/10.1061/(ASCE)0733-9437(1998)124:1(23)
Conde G, Quijano N, Ocampo-Martinez C (2021) Modeling and control in open-channel irrigation systems: A review Annu Rev Control 51:153-171 doi:https://doi.org/10.1016/j.arcontrol.2021.01.003
Deshays R, Segovia P, Duviella E (2021) Design of a MATLAB HEC-RAS Interface to Test Advanced Control Strategies on Water Systems Water 13:763 doi:https://doi.org/10.3390/w13060763
Fatemeh O, Hesam G, Shahverdi K (2020) Comparing Fuzzy SARSA Learning (FSL) and Ant Colony Optimization (ACO) Algorithms in Water Delivery Scheduling under Water Shortage Conditions Irrigation and Drainage Engineering doi:https://doi.org/10.1061/(ASCE)IR.1943-4774.0001496
Henderson F (1966) Open channel flow, . Macmillan, New York,
Ijaz N, Haider S, Muaaz M (2025) Development of a hydrodynamic model of the irrigation canal network by using HEC-RAS: a case study of Layyah Canal Division, Pakistan Modeling Earth Systems and Environment 11:195
Kong L, Liu Y, Li J, Tian Y, Yang Q, Chen Z (2024) Nonlinear model predictive controller for gate control in open canal irrigation systems with flexible water demands Comput Electron Agric 222:109023 doi:https://doi.org/10.1016/j.compag.2024.109023
Li X, Mao Z, Jia M, Liu W, Guan G, Luo Y (2025) Model predictive control based on an integrator delay coupled model applied to open canal irrigation systems Journal of Hydroinformatics 27:1390-1411 doi:https://doi.org/10.2166/hydro.2025.037
Molden DJ, Gates TK (1990) Performance measures for evaluation of irrigation-water-delivery systems J Irrig Drain Eng 116:804-823 doi:https://doi.org/10.1061/(ASCE)0733-9437(1990)116:6(804)
Rahparast D, Hashemy Shahdany SM (2024) Spatiotemporal Assessment Model for Manual Operation Systems' Technical Performance in Surface Water Distribution Under Water Scarcity Scenarios Water Resour Manag 38:3639-3656 doi:https://doi.org/10.1007/s11269-024-03832-w
Shahverdi K (2023) AICSS: Automatic simulator–controller/optimizer model of open channels Irrigation and Drainage 72:1124-1136 doi:https://doi.org/10.1002/ird.2852
Shahverdi K, Loni R, Yoosefdoost I, Berndtsson R, Kaviani M, Yoosefdoost A (2026) Enhancing Operational Efficiency in Water Canals Using Sequential Fuzzy Reinforcement Learning Water Resour Manag 40:189 doi:https://doi.org/10.1007/s11269-026-04554-x
Shahverdi K, Maestre J (2022) Gray Wolf Optimization for Scheduling Irrigation Water J Irrig Drain Eng 148:04022020 doi:https://doi.org/10.1061/(ASCE)IR.1943-4774.0001688
Shahverdi K, Maestre J, Alamiyan-Harandi F, Tian X (2020) Generalizing Fuzzy SARSA Learning for Real-Time Operation of Irrigation Canals Water 12:2407 doi:https://doi.org/10.3390/w12092407
Sharifi H, Roozbahani A, Shahdany SMH (2021) Evaluating the Performance of Agricultural Water Distribution Systems Using FIS, ANN and ANFIS Intelligent Models Water Resour Manag:1-20 doi:https://doi.org/10.1007/s11269-021-02810-w
Strelkoff T (1969) One-dimensional equations of open-channel flow Journal of the Hydraulics Division 95(3):861-876 doi:https://doi.org/10.1061/JYCEAJ.00021