### Real-time Control of Combined Water

### Quantity & Quality in Open Channels

### Real-time Control of Combined Water

### Quantity & Quality in Open Channels

### Proefschrift

### ter verkrijging van de graad van doctor

### aan de Technische Universiteit Delft

### op gezag van de Rector Magnificus prof. ir. K.C.A.M. Luyben,

### voorzitter van het College voor Promoties,

### in het openbaar te verdedigen

### op Woensdag 09 Januari 2013 om 10:00 uur

### door

### Min XU

### civiel ingenieur

### geboren te China

Copromotor Dr.ir. P.J.A.T.M. van Overloop Samenstelling promotiecommissie:

Rector Magnificus, voorzitter

Prof.dr.ir. N.C. van de Giesen, Technische Universiteit Delft, promotor Dr.ir. P.J.A.T.M. van Overloop, Technische Universiteit Delft, copromotor

Prof.dr.ir. B. Schultz, UNESCO-IHE

Prof.dr.ir. H.H.G. Savenije, Technische Universiteit Delft Prof.dr.ir. G.S. Stelling, Technische Universiteit Delft

Dr.ir. G. Belaud, SupAgro, Montpellier, France

Dr.ir. C.O. Martin´ez, Universitat Polit`ecnica de Catalunya, Barcelona Prof.dr.ir. J. Hellendoorn, Technische Universiteit Delft, reservelid

This research was performed at the Section of Water Resources Management, Faculty of Civil Engineering & Geosciences, Delft University of Technology, and has been financially supported by IBM Ph.D. Fellowship Award.

Copyright c 2013 by Min Xu

Published by: VSSD, Delft, The Netherlands ISBN: 978-90-6562-310-2

All rights reserved. No part of the material protected by this copyright no-tice may be reproduced or utilized in any form or by any means, electronic, or mechanical, including photocopy, recording or by any information storage and retrieval system, without written permission of the publisher.

This thesis was written using LA_{TEX.}

Key words: hydrodynamic model, model reduction, model predictive con-trol, open channel flow, operational water management, real-time concon-trol, water quantity, water quality

## Summary

Fresh water supply and flood protection are two central issues in water man-agement. Society needs more and more fresh water and a safe water system to guarantee a better life. A more severe climate will result in more droughts and extreme storms. As a consequence, salt water intrusion will increase. Therefore, clean and fresh water is becoming scarce. Potentially, there lies a severe conflict between people’s demands and what nature can provide. In practice, water systems are complex. Both water quantity and quality cri-teria must be served. Moreover, water is normally used as a multi-functional resource. For example, water in a reservoir is used for irrigation, power gen-eration, flood protection and reclamation. These objectives are usually in conflict most of the time and it is not easy for people to cope with these contradictions.

Smart regulation of water systems is essential not only from the world-wide water issue perspective, but also from the specific water problem aspect. Real-time control is a powerful tool to help people with accurate regulation of water systems. In practice, water quantity control is extensively stud-ied, but fully integrated water quantity and quality control has hardly been touched. Moreover, in order to deal with multi-objectives in a water system, advanced control techniques, such as model predictive control (MPC), are often required which require extensive computational resources. This brings forward two research questions:

1. What is the possibility of controlling both water quantity and quality in a water system?

2. In MPC, what is the possibility to reduce the computational burden in order to make the control implementation possible?

In this PhD thesis, a case of polder flushing in real-time is selected for the first research question, which includes both water quantity and quality prob-lems.The task is to flush polluted water out of the polder with clean water

while keeping water levels close to the setpoints. Instead of manual opera-tion which is often applied in practice, control systems were designed with feedback control and MPC. In MPC, different types of internal models were applied ranging from a linear reservoir model to hydrodynamic models. The different control performance of the two controllers were compared. We con-clude that real-time control is possible to maintain both water quantity and quality at the same time in a one dimensional water system model. Fur-thermore, MPC performs much better than the classic feedback control in controlling the water quality when operational limits are very strict. In MPC, using different internal models will also result in different control per-formance, affecting both control effectiveness and computation time.

Being an advanced control technique, MPC is playing a more and more im-portant role in controlling water systems. The computational burden is the main barrier for MPC implementation. In this PhD thesis, we propose a con-trol procedure of MPC with a model reduction technique, Proper Orthogonal Decomposition (POD), in order to speed up the computation. POD is able to reduce the order of states and disturbances, and speed up the matrix op-eration in MPC. In a test case, we concluded that MPC using the reduced model is a good trade-off between control effectiveness and computation time. Therefore, the proposed MPC procedure is considered as a successful method for MPC implementation.

Min Xu

## Contents

Summary i

List of Tables vi

List of Figures viii

1 Introduction 1

1.1 Water quantity & quality management in open channels . . . 1

1.1.1 Current situation . . . 1

1.1.2 Modelling of open channel flow . . . 2

1.2 Real-time control of open channels . . . 5

1.2.1 General introduction . . . 5

1.2.2 Real-time control methods . . . 6

1.3 Model predictive control . . . 10

1.4 Model reduction . . . 12

1.5 Objective of the study . . . 13

1.6 Outline of the thesis . . . 14

2 Real-time control of combined water quantity & quality 17 2.1 Introduction . . . 18

2.2 Method . . . 21

2.2.1 Forward estimation . . . 21

2.2.2 Model predictive control . . . 23

2.3 Test Case . . . 26

2.3.1 Case setup . . . 26

2.3.2 MPC setup . . . 29

2.3.3 Classical control setup . . . 29

2.4 Results . . . 30

2.5 Conclusions and discussions . . . 31 3 Control effectiveness Vs computational efficiency in model

predictive control 35

3.1 Introduction . . . 36

3.2 Model predictive control of open channel flow . . . 37

3.2.1 State-space model formulation with Kalman filter . . . 37

3.2.2 Optimization Problem . . . 39

3.3 Process model formulation . . . 41

3.3.1 State-space model formulation with SV model . . . 41

3.3.2 State-space model formulation with RSV model . . . . 42

3.3.3 State-space model formulation with ID model . . . 45

3.4 Test case . . . 45 3.4.1 SV model setup . . . 48 3.4.2 RSV model setup . . . 48 3.4.3 ID model . . . 48 3.4.4 MPC performance indicators . . . 49 3.5 Results . . . 50

3.5.1 Results of RSV model accuracy and model complexity 50 3.5.2 Results of control effectiveness and computational effi-ciency in MPC . . . 51

3.6 Conclusions . . . 55

4 Reduced models in model predictive control controlling wa-ter quantity & quality 57 4.1 Introduction . . . 57

4.2 Model reduction on combined open water quantity and quality model . . . 61

4.2.1 Combined open water quantity and quality model . . . 61

4.2.2 Model reduction on combined water quantity and qual-ity model . . . 63

4.3 Model predictive control of combined water quantity and quality 65 4.3.1 Optimization problem formulation . . . 65

4.3.2 Optimization problem formulation using reduced model 68 4.4 Test case . . . 69

4.5 Results . . . 74

4.5.1 Reduced model performance . . . 75

4.5.2 MPC performance under the reduced model . . . 75

4.6 Discussions . . . 81

4.7 Conclusions and future research . . . 83

5 Model assessment in model predictive control 85 5.1 Introduction . . . 86

Contents v

5.2.1 Open channel flow model . . . 88

5.2.2 Generic MPC formulation . . . 89

5.2.3 QP-based model predictive control . . . 90

5.2.4 SQP-based model predictive control . . . 92

5.3 Test case . . . 95

5.4 Results . . . 96

5.4.1 Results of control performance . . . 97

5.4.2 Results of computational time . . . 102

5.5 Conclusions and future research . . . 104

6 Conclusions and future research 107 6.1 Conclusions . . . 107

6.2 Future research . . . 109

A Time-varying state-space model over prediction horizon 123

B Combined water quantity and quality state-space model

for-mulation 125

C Reduced model verification using extrapolated scenario of

lateral flows 129

D Linearization of hydraulic structures 133

List of Symbols 137

Acknowledgements 143

About Author 145

## List of Tables

2.1 Target values of water level and concentration . . . 26

2.2 Locations of laterals in each reach . . . 27

2.3 Lateral flow in each reach . . . 28

2.4 Penalties in the objective function of MPC . . . 29

2.5 Gain factors of PI control . . . 30

3.1 Canal geometric parameters . . . 46

3.2 Parameters for Kalman filter design . . . 47

3.3 Weighting factors . . . 48

3.4 Overall performance of MPC . . . 54

4.1 Lateral flow scenario for reduced model generation (step changes happen between 8 and 10 hours of simulation) . . . 71

4.2 Lateral flow scenario for reduced model verification (step changes happen between 5 and 8 hours of the simulation) . . . 72

4.3 Lateral flow scenario for testing the reduced model perfor-mance (step changes happen between 3 and 6 hours of the simulation) . . . 73

4.4 Gain factors of the PI control . . . 74

4.5 Weighting factors in MPC for all reaches and structures . . . . 74

5.1 Performance indicators of both Sbased MPC and QP-based MPC . . . 102

5.2 Computational time components in both QP-based MPC and SQP-based MPC executions . . . 102

5.3 Number of model executions per control step in linear and nonlinear MPC . . . 103

C.1 Lateral flow scenario for reduced model verification (step changes happen between 5 and 8 hours of the simulation . . . 130

## List of Figures

1.1 Lock exchange with a 2DV model . . . 3

1.2 Open channel water quantity and quality using a 1D model . . 3

1.3 Structure disgram of feedback control of an actual system . . . 6

1.4 Structure diagram of model predictive control of an actual system (van Overloop 2006) . . . 7

1.5 Local control of a drainage canal . . . 8

1.6 Local control of a drainage canal with decouplers . . . 8

1.7 Centralized control (LQR) of a drainage canal . . . 9

1.8 Centralized control (MPC) of a drainage canal . . . 9

1.9 Structure diagram of model predictive control of an actual system using a LTV model . . . 11

2.1 Schematic view of a Dutch polder . . . 19

2.2 Schematic diagram of “Forward Estimation” and MPC on both water quantity and quality . . . 20

2.3 Canal reach schematization . . . 21

2.4 Schematic view of staggered 1D grid . . . 23

2.5 Block diagram of MPC . . . 24

2.6 Longitudinal profile of canal reaches with geometric charac-teristics . . . 27

2.7 Flow through structure . . . 31

2.8 Water level deviations from the targets . . . 32

2.9 Average concentration deviations from the targets . . . 32

3.1 Canal reach schematization . . . 41

3.2 Longitudinal profile with different flow conditions . . . 46

3.3 Upstream Flow Condition for MPC Test . . . 47

3.4 Upstream Flow Condition for Reduced Model . . . 49

3.5 Model accuracy Vs model complexity . . . 51

3.6 Model level difference between SV and RSV model . . . 52

3.7 Gate flow with different prediction models . . . 53 ix

3.8 Water level with different prediction models . . . 53 3.9 Computational efficiency with different models . . . 55 3.10 Computational time in each part of total control process with

different models . . . 56 4.1 Work flow of MPC controlling a water system using model

reduction technique . . . 60 4.2 Reduced water level states (I) and concentration states (III)

projected back to the original order, and the water level dif-ferences (II) and concentration difdif-ferences (IV) between the reduced model and the original model . . . 76 4.3 Reduced water quantity disturbances (I) and quality

distur-bances (III) projected back to the original order, and the water quantity disturbance differences (II) and water quality distur-bance differences (IV) between the reduced model and the original model. . . 77 4.4 Root mean square error of the reduced model on water

quan-tity and quality (interpolated scenario) . . . 78 4.5 Controlled water levels (I) and uncontrolled concentrations

(II) using the reduced model; controlled water levels (III) and uncontrolled concentrations (IV) using the full model (Exper-iment A) . . . 79 4.6 Control flows (I) using the reduced model and (II) using the

full model (Experiment A) . . . 80 4.7 Controlled water levels (I) and concentrations (II) using the

reduced model; controlled water levels (III) and concentrations (IV) using the full model (Experiment B) . . . 81 4.8 Control flows (I) using the reduced model and (II) using the

full model (Experiment B) . . . 82 4.9 Objective function value of MPC using reduced and full models 83 5.1 QP-based MPC controlling a water system . . . 91 5.2 SQP-based MPC controlling a water system . . . 93 5.3 Two experiments . . . 96 5.4 Convergence of objective function values of the QP-based MPC

scheme at control steps 1, 13, 67, 115, and 193 . . . 98 5.5 Evolution of the predicted water levels and discharges of

QP-based MPC over 30 iterations at the first control step . . . 98 5.6 Comparison of objective function values between SQP-based

MPC and QP-based MPC (10 iterations are only applied at the first control step) . . . 99

List of Figures xi

5.7 Percentage difference in objective function values between SQP-based MPC and QP-SQP-based MPC with 10 initial iterations in experiment (a) . . . 100 5.8 Controlled water levels in SQP-based MPC and QP-based

MPC without iterations . . . 101 5.9 Controlled discharge in SQP-based MPC and QP-based MPC

without iterations (Upstream inflow is plotted to indicate the downstream flow trends) . . . 101 5.10 Number of iterations used in SQP optimization . . . 104 6.1 Schematic view of MPC controlling both surface water

quan-tity and quality using reduced models . . . 111 C.1 Root mean square error of the reduced model on water

quan-tity and quality (extrapolated scenario) . . . 129 C.2 Reduced water level states (I) and concentration states (III)

projected back to the original order, and the water level dif-ferences (II) and concentration difdif-ferences (IV) between the reduced model and the original model . . . 131 C.3 Reduced water quantity disturbances (I) and quality

distur-bances (III) projected back to the original order, and the water quantity disturbance differences (II) and water quality distur-bance differences (IV) between the reduced model and the original model . . . 132

## Chapter 1

## Introduction

### 1.1

### Water quantity & quality management in

### open channels

### 1.1.1

### Current situation

Water is a natural resource that is closely related to the life of human beings. Important water functions are drinking water supply, water recreation, irri-gation, etc. In terms of water use, two criteria need to be met: quantity and quality. However, the amount of fresh water that is suitable for use is limited. Maintaining a healthy water condition, not only in water quantity but also in water quality, is extremely important for the existence and development of a society.

In the past, people were paying attention to water quantity issues, typi-cally for flood and drought protection [1] [2]. Water delivery for irrigation is another quantity issue [3] [4]. However, due to the economic and social development of societies, water is polluted more and more, especially in de-veloping countries. For example, in 2009 water was polluted in the Taihu lake, eastern China, and caused algae blooming over a long period. This largely influenced the water supply of the region and caused a huge eco-nomic loss. Water quality management is becoming a hot issue. Moreover, as climate changes, severe situations, such as drought, flooding and salt water intrusion, will occur more often [5], and clean water is getting scarce.

Ideally, water quantity and quality needs to be considered at the same time in the operation of a water system. However, in some cases they can be

in conflict with each other. Salt water intrusion in estuaries is an example. During dry periods, more water is required for human consumption as well as for agriculture. However, due to low river discharges, salt water can intrude further upstream and affect the fresh water intake. Such conflicts require more efficient and effective measures.

People recognize water quality problems and try to find solutions. Most water quality management is on a strategic level, for example limiting the pollution emission from a legislation perspective [6]. This strategic measure can control the behavior of human beings, and have some effects to a certain degree. However, it can not eliminate the non-human pollution, for example the polluted runoff from farm lands after fertilization. In this case, the pollution problem still needs to be solved as much as possible while considering the water quantity requirements. This research focuses on the situation when pollution is already in the system, and on how to transport, dilute and remove the pollution using operational water management.

### 1.1.2

### Modelling of open channel flow

In order to properly manage both water quantity and quality, it is impor-tant to understand how water and pollution behave. Nowadays numerical models are popular tools to mimic the real world. In practice, water systems are always in three dimensions that requires 3D models to fully describe the dynamics. Based on the accuracy, complexity and research focuses, some less important components or elements can be neglected and models can be reduced to lower dimension. For example, Figure 1.1 [7] shows a simulation results of a lock exchange with a two dimensional model (horizontal and ver-tical). In open channels, one dimensional models are often accurate enough under certain assumptions, e.g. Figure 1.2 [8] illustrates a one dimensional water quantity and quality model result during the control of flushing. According to modelling objectives and characteristics of a water system, dif-ferent models can be used to describe the flow dynamics. Typical models include reservoir models, hydrodynamic models and transport models for water quality. Reservoir models are simple mass balances which contain lit-tle dynamics. Therefore, they are normally used for overall management of reservoirs. Reservoir models usually have much less state variables than hydrodynamics models, which results in fast computation. Some of the reser-voir models are linear. Because of these advantages, they are also used in model-based control of water systems, such as [9] [10].

1.1. Water quantity & quality management in open channels 3

Figure 1.1: Lock exchange with a 2DV model

Some researchers adjusted the basic reservoir model and generated an Integrator-Delay (ID) model [11] and an Integrator-Integrator-Delay-Zero(IDZ) model [12] to ful-fill the requirements of irrigation canal automation, where water transport is characterized by delays in the canal reaches. The ID model splits the canal into a uniform flow part and a back water part, which are character-ized by the delay and storage, respectively. This model development made great contribution to canal automation and various applications have been conducted using this model over the last 15 years such as [13] [14]. One of the limitations of the ID or IDZ model in model-based control is that it is restricted to small flow fluctuations, in order to avoid nonlinear changes in delay and storage.

Although reservoir models are widely applied, detailed depiction of flow dy-namics requires hydrodynamic models. Therefore, these hydrodynamic mod-els are used to simulate the real world. They need a certain scheme to dis-cretize the mathematical equations in space and time. A commonly used hydrodynamic model is the one dimensional Saint-Venant equations. For water quality modelling, the one dimensional transport equation is widely used.

Most of the 1-dimensional hydrodynamic models need to fulfill the Courant condition which is required to achieve a stable simulation [15]. In general, an explicit scheme needs a small time step which increases computation time. Many models use implicit or semi-implicit schemes which fulfill the stability condition with a larger time step. Some schemes result in unconditionally stable, such as the Preissmann scheme with an adapted time integration parameter [16], a staggered conservative scheme [17]. This is very important in the models used for real-time control purposes, where the control time step is normally much larger than the simulation time step. The disadvantage of using these implicit or semi-implicit models is the wave damping, although, usually waves need to be filtered anyway in real-time control to avoid aliasing [18].

In this research, the substances considered in water quality control are as-sumed to be conservative or at least conservative during the research period. Typical conservative substances are salinity, nitrate and phosphate, etc.

1.2. Real-time control of open channels 5

### 1.2

### Real-time control of open channels

### 1.2.1

### General introduction

Water systems are usually managed to fulfill certain requirements in op-eration, such as maintaining water levels in a river for shipping or flood protection, keeping water clean in reservoirs for recreation or drinking water supply. Such operations used to be implemented manually. However, the conventional manual operations are characterized by lack of accuracy and it is difficult to meet the increasing criteria of water management, especially in complex water networks with multiple control objectives. As clean water is becoming scarce and severer situations occur more often, increased efficiency is required in operational water management. Real-time control becomes important to mitigate the effect of critical situations and in this way reduce damages.

Real-time control emerged from industry and has been applied to water agement since 1970s. The first real-time control applications in water man-agement were in controlling irrigation canals, due to the requirements of efficient water delivery [19],[20],[21],[22]. Although there has been much re-search on reservoir operations earlier, such as [23] [24], they mainly focused on long-term or mid-term operation which is typically at the management level. Real-time control as considered in this research applies as short-term operational water management, namely in the order of minutes or hours de-pending on the system under investigation. Recently, short-term real-time control has become popular in river operation such as flood protection.

There is already extensive research on water quantity control, especially in irrigation canal automation, such as [25] [26] [27]. However, the combined water quantity and quality control is seldom studied. One of the important reasons is the limited availability of real-time water quality measurements. This is a necessity for real-time control implementation. Since water quality is becoming more and more important and real-time water quality measure-ments are available nowadays, researchers recently pay more attention to water quality control. In this research, real-time measurements are assumed to be available for both water quantity and quality.

### 1.2.2

### Real-time control methods

Reactive versus Predictive

Real-time control contains many control methods, which can be classified differently based on the criteria under concern. Malaterre et al. [28] made a classification of control algorithms from the perspectives of both civil and hy-draulic engineers (controlled variable) and control engineers (control logic). The classification of control logic is extended and a distinction is made be-tween reactive (feedback) control and predictive control based on the in-formation used by the controller. Control actions in a reactive control are based on the current system information, while predictive control uses future system predictions to generate control actions, often employing some form of optimization. A structure diagram of feedback control is shown in Fig-ure 1.3. The key element is to properly select gain factors in the feedback controller.

Figure 1.3: Structure disgram of feedback control of an actual system A typical reactive control in operational water management is Proportional Integral (PI) control, where the control action is a function of the state deviation and its integral. The advantages of PI control is that the control formulation is very simple and the controller is usually very stable with proper gain factors. Linear Quadratic Regulator (LQR) is another reactive control, which is categorized into optimal control because optimization is applied to find the feedback gain factors.

A typical predictive control is Model Predictive Control (MPC). The control method was only introduced in water management about 10 years ago [29]. MPC is considered as an advanced control technique, because it uses a

pre-1.2. Real-time control of open channels 7

diction model (internal model) to anticipate the future system behavior and applies an optimization algorithm to generate optimal control actions over a finite prediction horizon. Advantages of MPC are that it can pre-react on future system changes based on the system prediction. This is very impor-tant for example in flood protection to reduce the flood peak by pre-releasing water, in order to create extra storage. Physical and operational constraints can also be taken into account within the optimization. [30] On the other hand, the large disadvantage of MPC is the relatively large computation time. MPC is an online control method that performs the optimization at every control step. MPC implements only the first control action over the predic-tion horizon. Figure 1.4 shows the structure diagram of model predictive control on an actual system.

Figure 1.4: Structure diagram of model predictive control of an actual system (van Overloop 2006)

Local versus Centralized

Open channels are usually divided into several reaches by hydraulic struc-tures, such as sluices, weirs and pumps. Each reach can form its own sub-system where the structure tries to maintain that sub-system. Based on the way of generating control actions, controllers can be categorized into local con-trol and centralized concon-trol. In local concon-trol, each concon-trol structure is used to control the local state, and controllers do not communicate with each other. Figure 1.5 illustrates the control of a drainage canal using local controllers.

Because of the inter-connection between neighboring reaches, the operation of one structure will influence the neighboring reaches and cause water level oscillations. Therefore, when using local control for the entire canal, it is difficult to achieve a good performance.

Figure 1.5: Local control of a drainage canal

In order to reduce the influence of local operations, decouplers are often required to connect the separate reaches and let the local controllers com-municate with each other. The decoupler is a type of feedforward control. Local control of a drainage canal with decouplers is shown in Figure 1.6. By sending the control information of the structure downwards, the downstream structure reacts not only on the water level in control but also on the up-stream flow change. In this way the oscillations can be minimized. Notice that the local control with decouplers is still considered as local control.

Figure 1.6: Local control of a drainage canal with decouplers

In centralized control, information is sent to each individual structure from a centralized calculation on a central computer. The information can be either direct control inputs, such as pump flows or weir crest levels, or indirect control signals, such as optimal gain factors used to calculate the control inputs in LQR. Figure 1.7 shows a centralized control of a drainage canal using LQR.

1.2. Real-time control of open channels 9

Figure 1.7: Centralized control (LQR) of a drainage canal

Model predictive control is an example of providing direct control inputs in centralized control. In principle, MPC can be either local or centralized control, depending on the control configurations. However, because of the advantage of optimization, MPC is often used to control the entire system. Alternatively, part of a system with several control structure is used but normally a higher level optimization is used that negotiates among different MPCs. This is called Distributed Model Predictive Control (DMPC), which is out of the scope of this thesis. In this case, the decoupling is already taken into account within the optimization. The influence of operating one hydraulic structure generates compensating actions for other structures. Fig-ure 1.8 illustrates a centralized control of a drainage canal using MPC.

Figure 1.8: Centralized control (MPC) of a drainage canal

This thesis focuses on MPC controlling combined water quantity and quality in open channels. PI control is used for comparison and to give insight into

the advantages of MPC.

### 1.3

### Model predictive control

As can be seen in Figure 1.4, MPC includes several components such as
objective function, internal model, optimization. In operational water
man-agement of open channels, a typical objective of water quantity control is to
minimize the water level deviations from the setpoints, while for water quality
management, it is important to keep water as “clean” as possible and control
the solute concentration below a certain criterion for use. In practice it is
also important to consider the wear and tear of hydraulic structures, which
means that the structure settings need to be adjusted as smoothly as
possi-ble, i.e. minimizing the changes of structure settings. In feedback control,
these goals are realized through proper tuning of gain factors, while MPC
formulates them into an objective function. A quadratic objective function is
often used in MPC to cope with both positive and negative deviations.
The internal model in MPC is used to predict the future dynamics of a
system, based on which optimization generates the optimal control actions
over a finite prediction horizon. Therefore, the accuracy1 _{of the internal}

model directly influences the control effectiveness2_{. Based on the type of}

internal models in use, MPC can be categorized into linear MPC (LMPC) and nonlinear MPC (NMPC). In this thesis, the implementation of different internal models is discussed, both linear and nonlinear. These models can be either very simple and run fast with low accuracy, or very complex which are accurate but computationally expensive. This thesis also provides a reduced model where accuracy and computational burden lie between simple and complex models.

A traditional MPC formulation is to use a linear time-invariant state-space model (LTI). This problem can be efficiently solved through Quadratic Pro-gramming (QP) and guaranteed global optimal solutions can be found [31]. In operational water management, this LTI model can be reservoir models for both water quantity and quality. The ID model developed by Schuurmans et al. [11] is widely used in open channel flow control. However, when the system under investigation is highly nonlinear, linear models are not

repre-1_{means the quality of being correct or true. Here the accuracy only describes the model}

performance

2_{means producing the results that are wanted or intended.} _{The effectiveness only}

1.3. Model predictive control 11

sentative anymore. The Saint-Venant equations and transport equation are typical nonlinear models for water quantity and quality. It is necessary to use nonlinear models and consider NMPC which iteratively solves an optimiza-tion problem through a nonlinear optimizaoptimiza-tion algorithm, e.g. Sequential Quadratic Programming (SQP). In NMPC, optimal solutions from the op-timization are not guaranteed global optimal and the computation time is usually very high due to the numerical calculations of the gradients of the objective function [32].

A nonlinear model can still be linearized with a dedicated discretization scheme. It can then be transformed into a linear state-space model format but with time-variant coefficients that are state-related. From a control per-spective, the model is called a linear time-variant state-space model (LTV). The LTV model in MPC is linear at each control time step, but it is actu-ally nonlinear over a finite prediction horizon. However, due to the efficient calculation of Quadratic Programming, the application of a LTV model in QP-based MPC can integrate the advantages of using accurate hydraulic models and efficient optimization with guaranteed global optimum. In this thesis, the scheme is developed by introducing a procedure called “Forward Estimation” before the execution of MPC.

Figure 1.9: Structure diagram of model predictive control of an actual system using a LTV model

The “Forward Estimation” is basically a simulation model, which is used to estimate the time-variant coefficients of the internal model used in MPC. The simulation is executed over the prediction horizon. The “Forward Es-timation” works with the currently observed states and the control inputs from the previous control step. In conventional MPC application, the opti-mal control actions over the prediction horizon are not implemented except the first one, however, they are used in the “Forward Estimation” in LTV model of MPC. The adjusted MPC diagram with the implementation of a LTV model is illustrated in Figure 1.9.

### 1.4

### Model reduction

Although a QP problem can be solved efficiently, the formulation of the opti-mization problem will still be computationally intensive when the hydraulic models are spatially discretized with fine grids. To solve this issue, model reduction techniques are necessary to reduce the model order. However, it is very important that the reduced model can still maintain the required model accuracy.

Model reduction has emerged since the 1950’s. The main applications are in the field of signal analysis, image processing, control engineering, etc [33]. Recently, some contributions have appeared in the field of water manage-ment, e.g. [34] and [35] for groundwater modeling, [36] for tsunami forecast-ing and [37] for fluid control. Model reduction can be either data driven, building a model by fitting the data through a machine learning process, or model driven, using a mathematical model, to calculate the reduced model [34].

Proper Orthogonal Decomposition (POD) is one of the most popular and widely applied model driven reduction techniques to reduce the model or-der by calculating basis functions. POD can be applied not only to linear models, but also to nonlinear models, e.g. [38], [39]. The calculation of the basis functions is the key process of POD. Liang et al. [40] provides an ex-tensive explanation of three POD methods: Karhunen-Loeve Decomposition (KLD), Singular Value Decomposition (SVD), Principal Component Analy-sis (PCA), and proves the equivalence of these three methods. In this theAnaly-sis POD incorporated with a snapshot method is applied to generate the reduced state-space model for both water quantity and quality in this thesis.

1.5. Objective of the study 13

includes combined Saint-Venant equations and transport equation for water quantity and quality, and forms a correlation matrix. Based on the most “energetic” eigenvalues of the correlation matrix, the method generates basis functions and formulates a reduced model. Each snapshot is a column vector containing states, which are water levels and solute concentrations. The snapshot approach has already been applied by several researchers in the field of water management, such as [37], [41] and [36]. These studies focused on water quantity, while in this thesis combined water quantity and quality is studied. Moreover, the reduced model is implemented in MPC and the influence on the control performance3 is analyzed.

### 1.5

### Objective of the study

The thesis covers three main objectives:

1. The research addresses the importance and the possibility of real-time control techniques in controlling both surface water quantity and qual-ity. Feedback control and model predictive control are the control meth-ods studied for this purpose.

2. Model predictive control is selected as the main focus of the study, be-cause of its predictive and optimization capabilities, by which a high control performance can be achieved. Since the prediction model in MPC has a large influence on the control performance regarding con-trol effectiveness and computation time, the second objective is to de-velop a model reduction technique for MPC for a tractable real-time implementation. The MPC performance using the reduced models is analyzed.

3. Nonlinear model predictive control is studied in order to cope with the nonlinearity of the prediction model. This study is intended to com-plete the study of model predictive control with different prediction models in order to illustrate the control effectiveness and control ac-curacy. Moreover, this study provides insight into the accuracy of the proposed model reduction technique in MPC.

This thesis focuses on man-made open channels. Note that all the case studies in this thesis are virtual. However, the theory and methods on control and

3_{means how well or badly one performs a particular job or activity. It is a general}

expression. In this thesis, it includes model accuracy, control effectiveness and computation time.

modelling can be extended to real water systems.

### 1.6

### Outline of the thesis

According to the above objectives, the thesis is organized as follows:

In Chapter 2, the possibility of controlling combined water quantity and qual-ity is studied. Both PI control and MPC are applied to control the flushing of a polder system, which can be considered as a one-dimensional system. The PI control is coupled with a decoupler. The MPC uses linear reservoir models for both water quantity and quality. The control performances of the two controllers are compared.

In Chapter 3, MPC uses more complex hydrodynamic models to improve the control performance. Because of the model complexity and the heavy computation burden, a model reduction technique is necessary to reduce the model order in the model predictive controller. The hydrodynamic model is linearized through a discretization scheme. The model is formulated into a linear time-varying state-space model for the implementation of linear MPC. A “Forward Estimation” procedure is introduced to estimate the linear time-varying parameters. Hence, this chapter studies the possibility of applying model reduction in MPC and provides a method to solve a linear time-varying system in linear MPC. This chapter also analyzes the degree of computational time reduction. A detailed comparison with the ID model and the linearized Saint-Venant model is studied. For simplicity, only water quantity is consid-ered with one canal reach.

In Chapter 4, the model reduction technique is applied to both a hydrody-namic model and a transport model in MPC for water quantity and quality control, respectively. In order to illustrate the control performance, the lin-earized models without reduction is executed in MPC as well.

Chapters 3 and 4 show that open channel flow can be controlled by MPC using complex dynamic models through model reduction. The control perfor-mances are compared with the full linearized dynamic models, which serve as the reference case. In this comparison, the “Forward Estimation” and the optimization algorithm are kept the same. The influence of the internal model to both control accuracy and computation time is analyzed. The “For-ward Estimation” will introduce errors or uncertainty in the internal model and reduce the control accuracy. For the complete analysis of MPC con-trolling open channel flow, a nonlinear MPC is applied to solve the control

1.6. Outline of the thesis 15

problem.

In Chapter 5, a nonlinear MPC had been studied using the full linearized Saint-Venant model. Since the linear time-varying system is actually nonlin-ear over the prediction horizon, a nonlinnonlin-ear optimization algorithm is nec-essary to tackle the problem without applying the “Forward Estimation”. In other words, the linear time-varying parameters are solved internally in the optimization instead of externally in linear MPC. The nonlinear MPC is considered as a benchmark for the control performance. However, the computation time of nonlinear MPC using numerical gradients of the objec-tive function is unacceptable. This computation time issue is not considered in this chapter. It is suggested for future research to solve this issue by analytically providing the gradient, which requires intensive mathematical analysis.

In Chapter 6 the main findings and conclusions of the thesis are summarized and the possible future research is elaborated.

## Chapter 2

## Real-time control of combined

## water quantity & quality

### Abstract

This chapter1 _{presents the initial study on real-time control of combined }

wa-ter quantity and quality. In open wawa-ter systems, keeping both wawa-ter depths and water quality at specified values is critical for maintaining a “healthy” water system. Many systems still require manual operation, at least for water quality management. When applying real-time control, both quantity and quality standards need to be met. In this chapter, an artificial polder flush-ing case is studied. Model Predictive Control (MPC) is developed to control the system. In addition to MPC, a “Forward Estimation” procedure is used to acquire water quality predictions for the simplified model used in MPC optimization. In order to illustrate the advantages of MPC, classical con-trol [Proportional-Integral concon-trol (PI)] has been developed for comparison in the test case. The results show that both algorithms are able to control the polder flushing process, but MPC is more efficient in functionality and control flexibility.

1_{based on: Xu. M., van Overloop. P.J., van de Giesen. N.C. and Stelling. G.S.}

Real-time control of combined surface water quantity and quality: polder flushing. Water Science and Technology. 61(4):869-878, 2010

### 2.1

### Introduction

Quantity and quality are the main characteristics to describe a water system. Much research has been devoted to how to optimize the water usage. For example, in irrigation systems, various real-time control methods have been applied to operate water systems efficiently [28], [13], [42]. For water quality, research on real-time control has only been conducted for sewer systems or urban waste water systems [43], [44], [45]. For water quality issues in rivers and open canals, more attention has been paid to modeling [46], [47], to simulate pollution transport and provide measures or strategies for reducing pollution. As will be shown here, real-time control for water quality can also be used to manage such systems.

Many rivers and canals have water quality problems caused by pollution. Here, a polder system is considered. Figure 2.1 shows a schematic view of a typical Dutch polder. It is a terrain of low-lying areas that is surrounded by dikes. Within the low-lying areas, there lie many polder ditches that are inter-connected through hydraulic structures, such as weirs and sluices. Outside the polder, surrounding the low-lying areas, storage canals are situ-ated. Those storage canals have higher elevations and provide space for the extra water from the polder storage during wet periods. The storage canals also supply fresh water to polders during dry periods. The polder system is only connected to the outside through man-operated devices. Water levels in both polder ditches and surrounding storage canals are maintained close to given target levels by operating hydraulic structures in order to maintain certain ground water levels in the polder, and avoid dike breaks in the stor-age canal [48]. Water quality is an issue in a polder system, because many nutrients from fertilizers, such as nitrate or phosphate, drain into the ditches. In summer, surface water quality can also deteriorate due to saline seepage and drainage water from greenhouses [48].

In polder water management, water quantity and quality control is sepa-rated. For water quality control, a certain fixed flushing strategy is used at a specific time interval, for example once every three days depending on the system. This fixed strategy is based on the worst case scenario with respect to pollution that could occur throughout the entire year. This strategy is not only overly conservative, but also inefficient. Any disturbances between two moments of flushing will make the flushing strategy less efficient, some-times even insufficient. For example, many nutrients from fertilizers quickly drain into the ditches after heavy rainfall and deteriorate the water quality. In this situation, the flushing strategy should be modified to cope with the

2.1. Introduction 19

Figure 2.1: Schematic view of a Dutch polder

disturbances. Therefore, real-time control could be used, based on real-time water quality measurements. [49] provides an overview of some techniques of monitoring water quality in realtime, such as measuring salinity, temper-ature, nutrients, dissolved oxygen, turbidity, pH, etc. Water quality sensors are able to continuously collect the measurements in the order of seconds and they can even work in turbid water conditions, for example the MBARI ISUS nitrate sensor [50]. Furthermore, real-time control can take water quantity and quality into account at the same time.

Many control methods are available for water quantity control, especially for irrigation systems [28]. The present study provides a guideline for extending control theory to water quality as well. In this polder flushing situation, several canal reaches are controlled (multiple variable control) and multiple objectives (water level and quality control) are formulated. Optimization could be subject to certain constraints, such as pump capacities, limitations on changing gate position and limitations on water level and water quality fluctuations. Therefore, an advanced control technique, Model Predictive Control (MPC), is considered [51]. In order to implement MPC on water quality, a so-called “Forward Estimation” is required to predict the control

variables for each reach over the prediction horizon. These predictions are part of the inputs of a simplified model used in MPC. The “Forward Esti-mation” is performed outside the MPC optimization. A schematic diagram of the implementation procedure is shown in Figure 2.2. The innovation of this research is the joint application of this control method on water quantity and quality in an integrated framework.

This chapter is organized as follows: Section 2.2 introduces the water quan-tity and quality control method, including the “Forward Estimation” proce-dure and the MPC scheme. A test case is setup in section 2.3 to test the proposed control method. In order to demonstrate the MPC control perfor-mance, it is compared with a classical feedback control. Section 2.4 shows the comparison results between MPC and feedback control. The advantages and disadvantages of each control methods on combined water quantity and quality are in section 2.5.

Figure 2.2: Schematic diagram of “Forward Estimation” and MPC on both water quantity and quality

2.2. Method 21

### 2.2

### Method

### 2.2.1

### Forward estimation

The “Forward Estimation” is regarded as a pre-simulation of flow and pollu-tion transport. It uses two linear approximapollu-tions of the Saint-Venant equa-tions and the one dimensional advection-dispersion transport equation to predict the inflow and outflow concentrations along with the average con-centration in the canal reaches. The prediction covers the entire prediction horizon based on the optimized control flows from the previous optimiza-tion. These partial differential equations used in the “Forward Estimation” are demonstrated in Equations 2.1, 2.2 and 2.3. For the transport equation, instantaneous complete cross-sectional mixing is assumed [52]. During the canal flushing processes, the pollution is assumed to be conservative. The schematization of a canal reach is shown in Figure 2.3 to illustrate the vari-ables.

Figure 2.3: Canal reach schematization

∂Af ∂t + ∂Q ∂x = ql (2.1) ∂Q ∂t + ∂(Qv) ∂x + gAf ∂η ∂x + g Q|Q| C2 zRAf = 0 (2.2) ∂(Afc) ∂t + ∂(Qc) ∂x = ∂ ∂x(KAf ∂c ∂x) + qlcl (2.3)

where Af is the cross sectional area [m2], Q is the flow [m3/s], ql is the

lateral inflow per unit length [m2_{/s], v is the mean velocity [m/s], which}

equals Q/Af, η is the water depth above the reference plane [m], Cz is the

Chezy coefficient [m1/2_{/s], R is the hydraulic radius [m], which equals A}
f/Pf

(Pf is the wetted perimeter [m]) and g is the gravity acceleration [m/s2], K

is the dispersion coefficient [m2_{/s], c is the average concentration [kg/m}3_{], c}
l

is the lateral flow concentration [kg/m3], t is time and x is horizontal length.
[52] provides equations to calculate the longitudinal dispersion coefficient
K:
K = 0.011W
2_{v}2
dmus
us=
p
gRSb
(2.4)

where W is the mean width [m], dm is the mean water depth [m], us is the

shear velocity [m/s], and Sb is the bottom slope of the canal [−]. A spatial

discretization of the Equations 2.1, 2.2 and 2.3, has been developed in the form of a staggered conservative scheme in combination with a first order upwind approximation [53], [17]. In the staggered grid, the values of ∗vi

at point i and ∗ci+1/2 at point (i + 1/2) are missing (see Figure 2.4). An

upwind approximation is applied to achieve those values according to the
flow direction.
dAf,i
dt =
Qi−1/2− Qi+1/2
∆x + ql,i (2.5)
dvi+1/2
dt +
1
¯
Af,i+1/2
(Q¯i+1
∗_{v}
i+1− ¯Qi∗vi
∆x − vi+1/2
¯
Qi+1− ¯Qi
∆x )
+ gηi+1− ηi
∆x + g
vi+1/2|vi+1/2|
C2
zR
= 0
(2.6)
dAf,ici
dt =

Qi−1/2∗ci−1/2− Qi+1/2∗ci+1/2

∆x +

1

∆x2(Ki+1/2A¯f,i+1/2ci+1

−(Ki+1/2A¯f,i+1/2+ Ki−1/2A¯f,i−1/2)ci+ Ki−1/2A¯f,i−1/2ci−1) + ql,icl,i

(2.7)
where: Q¯i =
Qi−1/2+ Qi+1/2
2
¯
Af,i+1/2=
Af,i+ Af,i+1
2
∗
vi =
v_{i−1/2} ( ¯Qi ≥ 0)
vi+1/2 ( ¯Qi < 0)
∗
ci+1/2 =
c_{i} (Qi+1/2 ≥ 0)
ci+1 (Qi+1/2 < 0)

2.2. Method 23

Figure 2.4: Schematic view of staggered 1D grid

The integration scheme in time is based on the theta method [17]. The equations are connected with each other, giving rise to tri-diagonal matrices. A schematic view of the staggered 1-dimensional grid is shown in Figure 2.4. Note that the water system is simulated with the same model as the “Forward Estimation”

### 2.2.2

### Model predictive control

Model Predictive Control (MPC) has been developed in industrial engineer-ing since the 1970s. MPC has recently been introduced in water manage-ment, mainly for controlling water levels in the system. For example van Overloop[29] applied MPC on various open channel systems, and Wahlin and Clemmens [14] used MPC to control water levels in branching canal networks. A block diagram of MPC describes the process (see Figure 2.5). Extending this method to combined water quantity and quality control ap-pears promising.

MPC needs a model to predict the future behavior of a system. The com-monly used models for describing the dynamics of water quantity and quality in a shallow water system are Saint-Venant equations and the advection-dispersion transport equation. However, these are non-linear partial differ-ential equations, and make controller design and implementation a difficult task. From a control point of view, it is potentially attractive to design a controller with a linear approximation of the non-linear system model [31].

Figure 2.5: Block diagram of MPC

In this research, a discrete time-varying state-space model is used in order to cope with the varying parameters over the prediction horizon. Current research on linear time-varying model in real-time control can be found in [54] [55]. The model can be described as:

xk+1 = Akxk+ B_{u}kuk+ B_{d}kdk

y(k) = Cx(k) (2.8)

where: x is the state vector, u is the input vector, d is the disturbance vector, A is the state matrix, Bu is the control input matrix, Bd is the disturbance

matrix, C is the output matrix and y is the output, k is the time step index. The equations are structured into matrices and can be solved with for example MATLAB.

Many linear approximations have been developed for the Saint-Venant equa-tions, especially for irrigation canals. A canal reach is divided into several segments and a state estimator or observer is used to estimate the hydraulic information for each segment [56], [57]. However, such approximations are not appropriate for MPC due to the fact that MPC uses online (real-time) optimization, and the use of many segments increases the computational power requirements considerably. This problem is compounded if the same linearization procedure for the water quality model is added. Therefore, a simplified model is needed, provided it can preserve the main system charac-teristics. [11] developed an Integrator Delay (ID) model, which is a lumped parameter model. The ID model captures the main dynamics of water trans-port and assumes two elements in a canal reach: uniform flow part, mainly characterized by its delay time, and a backwater part, characterized by its surface area. The equation description is as follows:

2.2. Method 25 deη dt = dη dt = 1 As [Qin(t − τ ) − Qout(t)] (2.9)

where eη is water level deviation from target level [m], which has the same

derivative as the water level η when the target level is constant. Qinand Qout

are inflow and outflow [m3/s], As is the backwater surface area [m2] and τ is

the delay time in the uniform flow part [s].

For a simplified water quality model, Tomann and Mueller [58] provide a lake model as a completely mixed system which maintains the mass balance. This model assumes that the outflow concentration is equal to the concentration in the lake. If the model is applied to a long canal and the control step is short, this assumption is invalid. Therefore, the model should be modified to a non-mixed system with the calculation of the average concentration of the lake and the outflow concentration. In this case, the calculation is possible when applying the “Forward Estimation”. Then the water quality mass balance can be written as:

d(V c)

dt = Qin(t)cin(t) − Qout(t)cout(t) (2.10) Substituted with the flow mass balance, Equation 2.10 becomes:

dec dt = dc dt = 1 V [Qin(t)(cin(t) − c(t)) − Qout(t)(cout(t) − c(t))] (2.11) where V is the water volume in the reach [m3], ec is the average

concentra-tion deviaconcentra-tion from the target concentraconcentra-tion [kg/m3], which has the same derivative as the average concentration c when the target concentration is constant, cin and cout are inflow and outflow concentrations [kg/m3].

For MPC, an objective function J is used to describe the goal of controlling
combined water quantity and quality. Both water level and concentration
need to be maintained to their target values. In addition, the control flow
needs to be adjusted as smoothly as possible. The objective function is
formulated as follows:
min J = min
nr
X
j=1
{
n
X
k=1
Wx,η(ekη)
2 _{+ W}
x,c(ekc− e
∗k
c )
2_{+ W}
u(∆Qkc)
2 _{+ W}∗
u,c(e
∗k
c )
2_{}}
(2.12)

subject to:
e∗k_{c} ≤ 0
∆Qc,min ≤ ∆Qkc ≤ ∆Qc,max
Qp,min ≤ Qkp ≤ Qp,max

where: n is the number of steps in the prediction horizon and nr is the total

number of canal reaches, ∆Qc is the change of control flow (both for gate

and pump) [m3_{/s], W}

x,η, Wx,c and Wu are the penalties for eη, ec and ∆Qc

separately. e∗_{c} is a virtual variable as soft constraint [kg/m3] introduced to
restrict ec. The introduction of the soft constraint is due to the restriction

that water quality control should be deactivated when water is clean (below
target concentration). van Overloop [29] points out that soft constraints are
implemented as extra penalty when the state or input violates the limitation.
W_{u,c}∗ is the penalty on virtual inputs. Its value is extremely small, which
makes the term of W_{x,c}∗ e∗k_{c} almost equal to zero, no matter what the value
of e∗k_{c} is. Qp is the pump flow [m3/s]. The constraints on ∆Qc and Qp

are regarded as hard constraints (physical constraints) that can never be violated.

### 2.3

### Test Case

### 2.3.1

### Case setup

To demonstrate the potential of the method, an artificial but realistic polder flushing test case is studied, which consists of four canal reaches, separated by 3 in-line gates. The reaches have different water quality contents at the beginning, but the average concentrations are all below water quality target concentrations. The target values of water quantity and quality are listed in Table 2.1. The canal characteristics are shown in Figure 2.6.

Table 2.1: Target values of water level and concentration

Reach 1 Reach 2 Reach 3 Reach 4

Target level (m) -0.4 -0.8 -1.4 -1.8

Target concentration (kg/m3_{)} _{0.7} _{0.7} _{0.7} _{0.7}

Each canal reach was divided into 100 segments for spatial discretization, thus 10 meters per segment. The pollution is assumed to be conservative or at least conservative during the flushing period, for example, in the case of salinity control. At each time step, the dispersion coefficient K at each

2.3. Test Case 27

Figure 2.6: Longitudinal profile of canal reaches with geometric characteris-tics

discretized velocity point is estimated through Equation 2.4. The canal in-troduces fresh water from a storage canal through Gate 1, and a pump is used to lift water out of the system at the other end. Each reach has several pol-luted lateral inflows. Their initial locations, flows and concentrations listed in Tables 2.2 and 2.3. These laterals are disturbances to the system.

Table 2.2: Locations of laterals in each reach Distance to reach head (m) Reach Lateral 1 Lateral 2 Lateral 3

1 400 700 No third lateral

2 300 700 No third lateral

3 200 500 900

4 500 800 No third lateral

The total simulation time is 20 hours and the controller executes once every
4 minutes. During the simulation, the concentration of the second lateral in
the second reach is increased from 1.4 kg/m3 _{to 5.6 kg/m}3 _{(a step change)}

after 5 hours and keeps constant afterwards. Other lateral concentrations and flows remain the same. This disturbance is assumed to be known in advance or can be predicted. The selection of which lateral concentration increases is chosen randomly. Which exact disturbance scenario is used, is assumed to be irrelevant for the evaluation of real-time control. This case demonstrates how real-time control corrects for water quality disturbances while water quantity criteria are still maintained. The total system is modeled and tested in MATLAB.

T able 2.3: Lateral flo w in ea ch reac h Lateral 1 Lateral 2 Lateral 3 Reac h Disc harge Concen tration Disc harge Co ncen tration Disc harge Concen tration (m 3 /s ) (k g /m 3 ) (m 3 /s ) (k g /m 3 ) (m 3 /s ) (k g /m 3 ) 1 0.02 1.0 0.03 1.2 No third latera l 2 0.02 1.2 0.03 1.4 No third latera l 3 0.04 0.9 0.02 1.5 0.03 1.8 4 0.02 1.5 0.04 1.0 No third latera l

2.3. Test Case 29

### 2.3.2

### MPC setup

The internal model and the objective function are in accordance with those in
Section 2.2.2. In the state space model, x includes the water level deviations
and concentration deviations from their setpoints as well as flows on the
delayed time steps; u includes the flow changes of each structure and the
virtual inputs e∗k_{c} (≤ 0) of each canal reach, which is used to switch on/off
the water quality control; d includes all the lateral flows. The discrete delay
steps in the model are estimated by the travelling time (Lc/(pgAf/Wt+ v))

[59], divided by the control time step and rounded upwards, where Lc is the

canal length [m], Af is the cross sectional area [m2], Wt is the top width

[m], g is the gravity acceleration [m/s2] and v is the mean velocity [m/s]. The calculation results in 2 delay steps with a 4 minutes control time step for each reach. The MPC controller uses a 4-hour prediction horizon. When MPC detects the lateral concentration change within the prediction horizon, it should adjust the flow at the present control step.

There are no specific rules for tuning MPC. van Overloop [29] provides a method for obtaining a set of starting penalties for the objective function using MAVE estimate. Further tuning can be followed through trial-and-error. Table 2.4 displays the penalties used in this case.

Table 2.4: Penalties in the objective function of MPC

Reach 1 Reach 2 Reach 3 Reach 4

Wx,η _{(0.28)}1 2
1
(0.28)2
1
(0.28)2
1
(0.28)2
Wx,c _{(0.58)}1 2
1
(0.58)2
1
(0.58)2
1
(0.58)2
W_{u,c}∗ _{(1.0×10}1 10_{)}2
1
(1.0×1010_{)}2
1
(1.0×1010_{)}2
1
(1.0×1010_{)}2

Gate 1 Gate 2 Gate 3 Gate 4 Gate 5

Wu _{(0.61)}1 2
1
(0.61)2
1
(0.61)2
1
(0.61)2
1
(0.61)2

### 2.3.3

### Classical control setup

Proportional-integral control (PI) is a commonly used control method in water management. It is relatively simple and robust with respect to distur-bances. Researchers have applied PI controllers on irrigation and river water systems for water level control [59], [27]. The reason for applying PI control in this case is to compare its performance with MPC and to illustrate the advantage of the more advanced control method, MPC. The principle behind PI control is a simple equation 2.13

∆Qk_{c} = Kp[ek− ek−1] + Kiek (2.13)

where k is a discrete time index, ∆Qcis the required flow change for a certain

structure [m3_{/s], K}

p and Ki are proportional and integral gain factors, e is

water level deviation from a given target level [m].

This method can be extended to water quality control by defining e as the water quality deviation from target value. In this polder flushing case, Gate 1 (inflow to the system) is linked to the water quality variable in the most polluted reach. The remaining gates and the pump apply local upstream control [28] on water levels in each reach with decouplers. The decoupler is considered to be a feedforward control, which has the function of counteract-ing the influence of flow interactions between neighbourcounteract-ing canal reaches [59], [13]. In this case, the decoupler sends the upstream gate flow information directly to all structures and avoids flow interactions between neighbouring reaches. Thus, it avoids extra water level fluctuations.

Researchers have made important contributions to select proper gain factors for PI control, for example, [60]. In simple situations, such as in this test case, a trial-and-error method can be used. Table 2.5 displays the selected gain factors of PI control.

Table 2.5: Gain factors of PI control

Gain factor Reach 1 Reach 2 Reach 3 Reach 4 Pump

Kp 0.65 6.31 6.84 6.31 8.21

Ki 0.06 0.48 0.46 0.48 0.49

### 2.4

### Results

The simulation results of using both PI control and MPC are shown in Figures 2.7 through 2.9. In these figures, gate and pump flows, water level deviations and average pollutant concentration deviations from their target values are demonstrated. Figures 2.7(a) through 2.9(a) are the results of PI control and Figures 2.7(b) through 2.9(b) are for MPC. It is clear that with a step change in water quality, both controls can stabilize water levels and restore water quality back to their target values. They move the system from one steady state to another.

2.5. Conclusions and discussions 31

With PI control, Gate 1 reacts when the step change happens. This is the moment when the water quality deteriorates. Due to the decoupling, water level controllers take actions at the same time and decrease the water level at the end of each pool. Figures 2.8(a) and 2.9(a) show that water levels can be efficiently maintained with PI control, but water quality deteriorations in reach 3 and 4 are relatively high.

When MPC is applied, it can adjust the system in advance due to the pre-diction (a 4-hour prepre-diction in this case). When MPC detects lateral con-centration increases within the prediction horizon, it increases clean water inflow and thus decreases the concentration first. Figure 2.7(b) shows this earlier response when comparing with PI control result in Figure 2.7(a). In this case, when the actual lateral change occurs, there is more leeway for concentration increase. This is a significant difference from PI control where the concentration peak is much higher. Figure 2.9(a) and 2.9(b) demonstrate this difference. Figure 2.8(b) show that MPC can also control water levels within a relatively safe margin.

(a) PI (b) MPC

Figure 2.7: Flow through structure

### 2.5

### Conclusions and discussions

This chapter explored the innovation of combined surface water quantity and quality control. A polder flushing strategy was studied based on real-time control. Regarding the results of applying PI control and MPC, the following conclusions can be drawn.

1. Both PI control and MPC are able to maintain water levels and restore water quality back to their target values during canal flushing.

(a) PI (b) MPC

Figure 2.8: Water level deviations from the targets

(a) PI (b) MPC

2.5. Conclusions and discussions 33

2. PI control and MPC performances are different. PI control takes late action, while MPC takes advantage of the prediction, which leads to smaller concentration deviations and a better flushing strategy.

3. The incorporation of a “Forward Estimation” process, proposed in Figure 2.2, is proved to be a feasible procedure when applying simplified water quantity and quality models for MPC.

Based on the above comparison between MPC and PI control in the canal flushing case, three aspects can be considered for discussion.

1. Functionality: PI control is much simpler than MPC and it uses less computational power. Although it can stabilize the system relatively well, this setup of PI control (the first gate controls water quality and the rest maintains water levels) has limited functionality. It is specifically designed for canal flushing. If there is water scarcity in the system while water quality is not a problem, this setup is unable to supply water downstream, because the first gate is not programmed to maintain water quantity. In contrast, MPC is a multi-objective control system for both water quantity and quality, and it is designed to optimize flows in any situation. From this viewpoint, it has more functionality than PI control.

2. Control flexibility: MPC is able to consider system constraints that may be present within the optimization, for example, the maximum allowed pollution concentration. Because MPC can react in advance based on the prediction, extra leeway can be created before the real concentration peak arrives. This is extremely important, especially when water quality deviation margins are small and the constraints are easily violated. The constraint violation may be unavoidable or be mitigated through very tight control when applying PI control.

3. Implementation difficulty: It is not sufficient for MPC to only use mea-surements. MPC needs a proper model to predict the future behavior. In reality, it is difficult to obtain all the information required by the model, such as to anticipate the lateral flow and its concentration. Therefore, other models are needed to generate these inputs first, for example a rainfall-runoff model coupled with a water quality model. Since PI control reacts only when deviations occur, measurements are enough to fill the controller. This makes the implementation of PI control much easier.

## Chapter 3

## Control effectiveness Vs

## computational efficiency in

## model predictive control

### Abstract

This chapter1_{presents a study on the control effectiveness and computational}

efficiency using reduced Saint-Venant models in MPC. Model predictive con-trol (MPC) of open channel flow is becoming an important tool in water management. The complexity of the prediction model has a large influence on the MPC application in terms of control effectiveness and computational efficiency. The Saint-Venant equations, called SV model in this chapter, and the Integrator Delay (ID) model are either accurate but computationally costly, or simple but restricted to allowed flow changes. In this chapter, a reduced Saint-Venant (RSV) model is developed through a model reduction technique, Proper Orthogonal Decomposition (POD), on the SV equations. The RSV model keeps the main flow dynamics and functions over a large flow range but is easier to implement in MPC. In the test case of a modeled canal reach, the number of states and disturbances in the RSV model is about 45 and 16 times less than the SV model, respectively. The computational time of MPC with the RSV model is significantly reduced, while the controller remains effective. Thus, the RSV model is a promising means to balance the control effectiveness and computational efficiency.

1_{based on: Xu.} _{M., van Overloop.} _{P.J. and van de Giesen.} _{N.C. On the Study}

of Control Effectiveness and Computation Efficiency of Reduced Saint-Venant Model in