# On Modeling and Constrained Model Predictive Control of Open Irrigation Canals

Authors: Lihui Cen; Ziqiang Wu; Xiaofang Chen; Yanggui Zou; Shaohui Zhang
Journal: Journal of Control Science and Engineering
 (2017)

---

## Abstract

This paper proposes a model predictive control of open irrigation canals with constraints. The Saint-Venant equations are widely used in hydraulics to model an open canal. As a set of hyperbolic partial differential equations, they are not solved explicitly and difficult to design optimal control algorithms. In this work, a prediction model of an open canal is developed by discretizing the Saint-Venant equations in both space and time. Based on the prediction model, a constrained model predictive control was firstly investigated for the case of one single-pool canal and then generalized to the case of a cascaded canal with multipools. The hydraulic software SICC was used to simulate the canal and test the algorithms with application to a real-world irrigation canal of Yehe irrigation area located in Hebei province.


---

## Body

## 1. Introduction

Open irrigation canals deliver water from the water sources to the farmlands to satisfy the irrigation demands. With the scarcity of water resources, better water control and management attracts increasing attention in both the mathematical and engineering communities. Open irrigation canals are well modeled by the Saint-Venant equations, a set of hyperbolic partial differential equations. The control problem of irrigation canals could be stated as that the water level and water flow rate in a canal are regulated by using the gate opening heights as control actions.The control problem has been investigated in the last few decades. Boundary control of open canals indicates the stable boundary feedback control laws proposed directly based on the Saint-Venant equations. The boundary feedback control was proposed to guarantee the stability of the solutions of the Saint-Venant equations by using either a Riemann invariants approach [1, 2] or a Lyapunov approach [3, 4]. On the other hand, based on the simplified model derived either from the Saint-Venant equations or from the mass conservation laws, a large number of control methods have been proposed ranging from the simplest to the most sophisticated. They were classified in the survey paper [5].Advanced control policies like model predictive control are becoming a research focus in recent years. According to the strength of the rainfall-runoff, multiple model predictive control of a drainage canal is presented [6]. Distributed model predictive control and coordinated policy for an irrigation canal were presented by dividing the multipool canal into several subsystems according to the local structures with communications among the subsystems [7, 8]. A two-level hierarchical distributed model predictive control with a risk management strategy was proposed based on a simplified model coming from the flow conservation law [9]. A constrained predictive control was presented based on an ARIMA model of an irrigation canal [10]. A nonlinear predictive control based on Saint-Venant equations was presented to regulate both water depth and water flow rate by solving the two-point boundary value problem numerically [11]. A multivariable model predictive controller was discussed and tested on a laboratory canal [12].In this work, an approximated predictive model derived from the Saint-Venant equations by discretization in both space and time was presented. Since the gate opening height is constrained by the boundary water depth, a constrained model predictive control was developed to solve the optimization problem. To test the performance of this predictive control algorithm, a numerical model of one single-pool irrigation canal located in Hebei province of China was built in the hydraulic software SICC by using the 1-dimensional hydrodynamic model. The control algorithm was tested through the link between MATLAB and SICC. The predictive control algorithm was further extended to a multipool irrigation canal.


## 2. Modeling of Open Irrigation Canals

The dynamics of open irrigation canals are described by the Saint-Venant equations [13](1)∂Ac∂t+∂Qc∂x=0,∂Qc∂t+∂∂xQc2Ac+gAc∂Hc∂x+gAcSf-S0=0,where the first equation of (1) is the continuity equation, the second one is the dynamical equation, t is time, x∈0,L is the space coordinate with L being the length of the canal, Ac=Acx,t is the wetted cross section at point x and time t, Qc=Qcx,t is the water flow rate, Hc=Hcx,t is the water level, g is the gravity acceleration constant, Sf is the friction slope, and S0 is the bed slope. Sf and S0 are defined as follows:(2)Sf=Qc2Kc2,Kc=AcRc2/3nc,where Rc is the hydraulic radius and nc is the roughness coefficient. Let Bc be the bottom width and Zc be the side slope; it follows that Ac=(Bc+HcZc)Hc.The discharge relationship of a gate between the gate opening height and the water head is described by(3)Qc=CdLcUc2gΔHc,where Cd is the discharge coefficient, Lc is the gate width, Uc is the gate opening height, and ΔHc=Hleft-Hright is the difference between the left and right water levels of the gate.Let us consider a single-pool canal delimited by two gates [14], as shown in Figure 1. Hu and Hd, the upstream water level of Gate 1 and the downstream water level of Gate 2, are assumed to be two constants. ΔHu and ΔHd are the differences between the left and right water levels of Gate 1 and Gate 2, respectively. The water dynamics are modeled by the Saint-Venant equations shown in (1).Figure 1
Structure of one single-pool canal.Since the Saint-Venant equations are a set of hyperbolic PDEs, it is difficult to build a control scheme for a canal system directly based on them. In order to build a control model of an irrigation canal, the Saint-Venant equations are simplified by using the spatial discretization. In this paper, the pool is divided intom-1 sections with m points in space. Define hk  (k=1,2,…,m) and qk  (k=1,2,…,m) as the water level and flow rate at point k and their equilibrium values as H-k  (k=1,2,…,m) and Q-k  (k=1,2,…,m); then the differences between the actual water level and flow rate and the equilibrium ones at point k could be denoted as Δhk=hk-H-k  (k=1,2,…,m) and Δqk=qk-Q-k  (k=1,2,…,m). Similarly, define the gate opening heights of the upstream and downstream gates and their corresponding equilibrium values as u1,  u2 and U-1,  U-2; then the differences between the gate opening heights and their equilibrium points are denoted by Δui=ui-U-i  (i=1,2). By using the finite difference method, the Saint-Venant equations could be discretized in space and then linearized around the equilibrium as follows [14, 15]:(4)Δx˙s=AsΔxs+BsΔus,Δys=CsΔxs,where the state vector Δxs=[Δh1,Δh2,Δq2,…,Δhk,Δqk,…,Δhm-1,Δqm-1,Δhm]T∈R2m-2, the control vector Δus=Δu1,Δu2T∈R2, and the output vector Δys=Δh1,…,Δhk,…,ΔhmT∈Rm.In the following, the modeling of a single-pool canal is extended to the cascaded multipool canal. A cascaded multipool canal is composed byn pools joined by n+1 gates. Without loss of generalization, a two-pool cascaded irrigation canal is taken as the example, as shown in Figure 2. The irrigation canal consists of two pools delimited by three underflow gates. The water dynamics of each pool are also described by the Saint-Venant equations.Figure 2
Structure of a two-pool cascaded canal.Following the modeling of a single-pool irrigation canal, the Saint-Venant equations are simplified for pooli  (i=1,2) as follows:(5)Δx˙si=AsiΔxsi+BsiΔusi,Δysi=CsiΔxsi,i=1,2,where the state vector Δxsi=[Δhi,1, Δhi,2, Δqi,2, …, Δhi,k, Δqi,k,…,Δhi,m-1, Δqi,m-1, Δhi,m]′∈R2m-2,  (i=1,2), the control vector Δusi=Δui,Δui+1′∈R2 (i=1,2), and the output vector Δysi=Δhi,1,…,Δhi,k,…,Δhi,m′∈Rm,  (i=1,2).From (3), the discharge at the intermediate gate is related to the difference between the water level h1,m at the last point m in pool 1 and the water level h2,1 at the first point 1 in pool 2 as follows:(6)q2=CdLc2Uc22gh1,m-h2,1.Combining (5) and (6), it follows the mathematical model of the two-pool cascaded irrigation canal derived from the Saint-Venant equations(7)Δx˙d=AdΔxd+BdΔud,Δyd=CdΔxd,where the state vector Δxd=[Δh1,1, Δh1,2, Δq1,2,…,Δh1,k, Δq1,k,…,Δh1,m-1, Δq1,m-1, Δh1,m, Δh2,1, Δh2,2, Δq2,2, …, Δh2,k, Δq2,k, …, Δh2,m-1, Δq2,m-1, Δh2,m]T∈R4m-4, the control vector Δud=Δu1,Δu2,Δu3T∈R3, and the output vector Δyd=Δh1,1,…,Δh1,k,…,Δh1,m,Δh2,1,…,Δh2,k,…,Δh2,mT∈R2m.


## 3. Mathematical Formulation of Constrained Model Predictive Control of Irrigation Canals

Since the objective is to apply a model predictive control to both the one single-pool canal and the cascaded canal, the model described by (4) should be converted into a discrete-time version as follows:(8)Δxsk+1=GsΔxsk+HsΔusk,Δysk=CsΔxsk,where Gs, Hs, and Cs are the discrete version of matrices As, Bs, and Cs.Since the difference between the actual water level at each spatial point and the target one could be defined asΔys=ys-H-, in which ys=h1,…,hk,…,hmT∈Rm and H-=H-1,…,H-k,…,H-mT∈Rm, the state equations (4) could be rewritten as (9)Δxsk+1=GsΔxsk+HsΔusk,ysk=CsΔxsk+H-.Letξx, ξy, and ξu be the increments in terms of the state vector, output vector, and the control vector at the adjacent sampling time; it is given that (10)ξxk+1=Δxsk+1-Δxsk=Asξxk+Bsξuk,ξyk+1=Δysk+1-Δysk=CsΔxsk+1-Δxsk=Csξxk+1=CsAsξxk+CsBsξuk.Thus the state-space equations of the one single-pool canal for designing the model predictive control could be written as follows:(11)ξxk+1ysk+1=Gs0CsGsIξxkysk+HsCsHsξuk,ysk=0Iξxkysk.The performance functional of the model predictive control problem for the one single-pool canal has the following form:(12)minξU⁡JξU,t=∑j=1Mysk+j∣k-rk+j∣kQ2+∑j=0N-1ξuk+j∣kR2,where ξU=ξuk∣k,ξuk+1∣k,…,ξuk+N-1∣kT, rk+j∣k is the reference trajectory, M is the prediction horizon, N is the control horizon, and Q and R are, respectively, nonnegative and positive definite weighting symmetric matrices with appropriate dimensions.Considering that the gate opening height must be restricted by the upstream and downstream water levels of the gate, the control actions representing the gate opening heights should be constrained by(13)0≤u1k+j-1∣k<Hu,j=1,…,M,(14)0≤u2k+j-1∣k<hnk+j-1∣k,j=1,…,M.Similar to the formulation of model predictive control problem of one single-pool canal, the discrete-time version of (7) for a cascaded multipool irrigation canal has the following form:(15)Δxdk+1=GdΔxdk+HdΔudk,Δydk=CdΔxdk.SubstitutingΔyd=yd-H- into (15) gives (16)Δxdk+1=GdΔxdk+HdΔudk,ydk=CdΔxdk+H-.Letξx, ξy, and ξu be the increments in terms of the state vector, output vector, and the control vector at the adjacent sampling time; it is given that(17)ξxk+1=Δxdk+1-Δxdk=Adξxk+Bdξuk,ξyk+1=Δydk+1-Δydk=CdΔxdk+1-Δxdk=Cdξxk+1=CdAdξxk+CdBdξuk.Thus the state-space equations of the two-pool cascaded canal for designing the model predictive control could be written as follows:(18)ξxk+1ydk+1=Gd0CdGdIξxkydk+HdCdHdξuk,ydk=0Iξxkydk.The performance functional of the model predictive control problem for the two-pool cascaded canal has the following form:(19)minξU⁡JξU=∑j=1Mydk+j∣k-rk+j∣kQ2+∑j=0N-1ξuk+j∣kR2.The control constraints are(20)0≤u1k+j-1∣k<Hu,j=1,…,M,0≤u2k+j-1∣k<h1,mk+j-1∣k,j=1,…,M,0≤u3k+j-1∣k<h2,mk+j-1∣k,j=1,…,M.The control framework of the constrained model predictive control for a two-pool canal is depicted in Figure3.Figure 3
Structure of predictive control scheme.


## 4. Simulation Results and Applications

### 4.1. Case of One Single-Pool Canal

In this section, the proposed constrained model predictive control was applied to a single-pool canal. The test canal is part of Yehe irrigation area in Hebei province of China [16], as shown in Figure 4. The canal has a constant rectangular cross section. The geometric parameters are summarized in Table 1, including the length, bottom width, canal height, bed slope, and side slope. The hydraulic conditions are summarized in Table 2, including the initial discharge at both gates at t=0 and the initial water level of the canal at t=0.Table 1
Geometric parameters of one single-pool canal.
Length (m) Bottom width (m) Height (m) Bed slope Side slope 1000 3.97 2.5 0.0005 0Table 2
Hydraulic conditions of one single-pool canal.
H u (m) H d (m) Initial discharge (m3/s) Initial water level (m) 2 0.5 1 0.8Figure 4
A single-pool canal in Yehe irrigation area.The simulations are performed on a PC with CORE i5, RAM 4 GB. The working environment is WIN 7 32-bit operation system and MATLAB R2008b.This one single-pool canal is divided into 3 sections with 4 spatial points. A numerical model of the canal is established in a hydraulic software, SICC (Simulation of Irrigation Canals and Control) developed by Irstea [17]. The constrained predictive controller is applied to the SICC model through the link between SICC and MATLAB. The weighting matrices Q and R are selected as an identity matrix with according dimensions, respectively. The control horizon N and the prediction horizon M are selected to be of the same length; that is, N=M=6.The simulation time is set as 59 minutes. According to the irrigation demands, it is desired that the target water level of the pool is always kept atr=1.3m in whole simulation. The evolutions of the water levels at four spatial points are illustrated in Figure 5. From these figures, the water levels at the last three points have time delays except the first point. The water levels at the 1st and 4th point are stabilized at the target value faster than those at the 2nd and 3rd point. At each optimization step, it is observed that the upper bound of the control constraint (14) is varied with respect to the water level at the 4th spatial point. The evolutions of the two gate opening heights are illustrated in Figure 6.Figure 5
Evolutions of water levels at four points.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 6
Evolutions of two gate opening heights.
(a)
Opening height of Gate 1 (b)
Opening height of Gate 2


### 4.2. Case of a Two-Pool Cascaded Canal

In the case of two-pool cascaded canal, two pools are assumed having the same length and with a constant trapezoidal cross section, as shown in Figure7. The geometric parameters and hydraulic conditions of each pool are listed in Tables 3 and 4, respectively. Each pool is also divided into 3 sections with 4 points. The control horizon and prediction horizon take the same as those taken in the one single-pool case. By using SICC and MATLAB, the constrained model predictive controller is tested.Table 3
Geometric parameters of each pool of the cascaded canal.
Length (m) Bottom width (m) Height (m) Bed slope Side slope 40 2 5 0 0.1Table 4
Hydraulic conditions of each pool of the cascaded canal.
H u (m) H d (m) Initial discharge (m3/s) Initial water level in pool 1 (m) Initial water level in pool 2 (m) 3.5 1.2 1 2 1.5Figure 7
Schematic of a constant trapezoidal cross section.The simulation time is set as 300 s. Before 100 s, the target water levels of two pools are set asr1(t)=2.5m and r2(t)=2m. After 100 s, the target water levels of two pools switch to r1(t)=2m and r2(t)=1.5m. Similar to the case of one single-pool canal, the first scenario about control horizon and prediction horizon is selected as N=M=10.The simulation results run by SICC about the water level at each spatial point in each pool and the gate opening heights are shown in Figures8, 9, and 10. The evolutions of water levels at four points in pool 1 and pool 2 are illustrated in Figures 8 and 9. From these figures, it is observed the water levels at four points are stabilized at the target values. The evolutions of three gate opening heights are illustrated in Figure 10.Figure 8
Evolutions of water levels at four points in pool 1 withN=M=10.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 9
Evolutions of water levels at four points in pool 2 withN=M=10.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 10
Evolutions of three gate opening heights withN=M=10.
(a)
Opening height of Gate 1 (b)
Opening height of Gate 2 (c)
Opening height of Gate 3In order to show the effects of MPC parameters on the control performance, two more scenarios with longer control horizon and prediction horizon are selected; that is,N=M=30 and N=M=60. The simulation results run by SICC about the evolutions of the water level at each spatial point in two pools and the three gate opening heights are very similar to those of the first scenario with N=M=10. But longer control horizon and prediction horizon lead to faster stabilization to the target values. For the sake of simplicity, only the scenario with N=M=60 is shown in Figures 11, 12, and 13.Figure 11
Evolutions of water levels at four points in pool 1 withN=M=60.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 12
Evolutions of water levels at four points in pool 2 withN=M=60.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 13
Evolutions of three gate opening heights withN=M=60.
(a)
Opening height of Gate 1 (b)
Opening height of Gate 2 (c)
Opening height of Gate 3The control results, including the values of the performance indexJ and the computational time, are summarized in Table 5. From the comparison, it is shown that longer control and prediction horizon result in better optimization performance and higher run time.Table 5
Comparisons of optimization performances and computational times.
N = M = 10 N = M = 30 N = M = 60 J 39.811 38.887 38.864 Run time (s) 11.878 22.610 55.700


## 4.1. Case of One Single-Pool Canal

In this section, the proposed constrained model predictive control was applied to a single-pool canal. The test canal is part of Yehe irrigation area in Hebei province of China [16], as shown in Figure 4. The canal has a constant rectangular cross section. The geometric parameters are summarized in Table 1, including the length, bottom width, canal height, bed slope, and side slope. The hydraulic conditions are summarized in Table 2, including the initial discharge at both gates at t=0 and the initial water level of the canal at t=0.Table 1
Geometric parameters of one single-pool canal.
Length (m) Bottom width (m) Height (m) Bed slope Side slope 1000 3.97 2.5 0.0005 0Table 2
Hydraulic conditions of one single-pool canal.
H u (m) H d (m) Initial discharge (m3/s) Initial water level (m) 2 0.5 1 0.8Figure 4
A single-pool canal in Yehe irrigation area.The simulations are performed on a PC with CORE i5, RAM 4 GB. The working environment is WIN 7 32-bit operation system and MATLAB R2008b.This one single-pool canal is divided into 3 sections with 4 spatial points. A numerical model of the canal is established in a hydraulic software, SICC (Simulation of Irrigation Canals and Control) developed by Irstea [17]. The constrained predictive controller is applied to the SICC model through the link between SICC and MATLAB. The weighting matrices Q and R are selected as an identity matrix with according dimensions, respectively. The control horizon N and the prediction horizon M are selected to be of the same length; that is, N=M=6.The simulation time is set as 59 minutes. According to the irrigation demands, it is desired that the target water level of the pool is always kept atr=1.3m in whole simulation. The evolutions of the water levels at four spatial points are illustrated in Figure 5. From these figures, the water levels at the last three points have time delays except the first point. The water levels at the 1st and 4th point are stabilized at the target value faster than those at the 2nd and 3rd point. At each optimization step, it is observed that the upper bound of the control constraint (14) is varied with respect to the water level at the 4th spatial point. The evolutions of the two gate opening heights are illustrated in Figure 6.Figure 5
Evolutions of water levels at four points.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 6
Evolutions of two gate opening heights.
(a)
Opening height of Gate 1 (b)
Opening height of Gate 2


## 4.2. Case of a Two-Pool Cascaded Canal

In the case of two-pool cascaded canal, two pools are assumed having the same length and with a constant trapezoidal cross section, as shown in Figure7. The geometric parameters and hydraulic conditions of each pool are listed in Tables 3 and 4, respectively. Each pool is also divided into 3 sections with 4 points. The control horizon and prediction horizon take the same as those taken in the one single-pool case. By using SICC and MATLAB, the constrained model predictive controller is tested.Table 3
Geometric parameters of each pool of the cascaded canal.
Length (m) Bottom width (m) Height (m) Bed slope Side slope 40 2 5 0 0.1Table 4
Hydraulic conditions of each pool of the cascaded canal.
H u (m) H d (m) Initial discharge (m3/s) Initial water level in pool 1 (m) Initial water level in pool 2 (m) 3.5 1.2 1 2 1.5Figure 7
Schematic of a constant trapezoidal cross section.The simulation time is set as 300 s. Before 100 s, the target water levels of two pools are set asr1(t)=2.5m and r2(t)=2m. After 100 s, the target water levels of two pools switch to r1(t)=2m and r2(t)=1.5m. Similar to the case of one single-pool canal, the first scenario about control horizon and prediction horizon is selected as N=M=10.The simulation results run by SICC about the water level at each spatial point in each pool and the gate opening heights are shown in Figures8, 9, and 10. The evolutions of water levels at four points in pool 1 and pool 2 are illustrated in Figures 8 and 9. From these figures, it is observed the water levels at four points are stabilized at the target values. The evolutions of three gate opening heights are illustrated in Figure 10.Figure 8
Evolutions of water levels at four points in pool 1 withN=M=10.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 9
Evolutions of water levels at four points in pool 2 withN=M=10.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 10
Evolutions of three gate opening heights withN=M=10.
(a)
Opening height of Gate 1 (b)
Opening height of Gate 2 (c)
Opening height of Gate 3In order to show the effects of MPC parameters on the control performance, two more scenarios with longer control horizon and prediction horizon are selected; that is,N=M=30 and N=M=60. The simulation results run by SICC about the evolutions of the water level at each spatial point in two pools and the three gate opening heights are very similar to those of the first scenario with N=M=10. But longer control horizon and prediction horizon lead to faster stabilization to the target values. For the sake of simplicity, only the scenario with N=M=60 is shown in Figures 11, 12, and 13.Figure 11
Evolutions of water levels at four points in pool 1 withN=M=60.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 12
Evolutions of water levels at four points in pool 2 withN=M=60.
(a)
Water level at 1st point (b)
Water level at 2nd point (c)
Water level at 3rd point (d)
Water level at 4th pointFigure 13
Evolutions of three gate opening heights withN=M=60.
(a)
Opening height of Gate 1 (b)
Opening height of Gate 2 (c)
Opening height of Gate 3The control results, including the values of the performance indexJ and the computational time, are summarized in Table 5. From the comparison, it is shown that longer control and prediction horizon result in better optimization performance and higher run time.Table 5
Comparisons of optimization performances and computational times.
N = M = 10 N = M = 30 N = M = 60 J 39.811 38.887 38.864 Run time (s) 11.878 22.610 55.700


## 5. Conclusions

A predictive model of irrigation canals is mathematically derived from the Saint-Venant equations by discretization in both space and time. Since the gate control actions are restricted by the boundary water levels, a constrained model predictive control is developed for both a single-pool canal and multipool cascaded canal. The control performance of the proposed predictive control scheme is tested on one single-pool canal that is part of Yehe irrigation area in Hebei province of China and generalized to a two-pool cascaded canal. All the simulations carried out in SICC and MATLAB show that the constrained model predictive control could stabilize the water levels to the target values by regulating the gate opening heights. A performance comparison showed the control effects of different control horizon and prediction horizon. It should be emphasized that the predictive control is a centralized one. The time delays at the downstream points of each pool are caused due to the long conveying pool. A decentralized predictive control scheme could be a future work.



---

*Source: 6257074-2017-02-14.xml*