Sunteți pe pagina 1din 164

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
Dit proefschrift is goedgekeurd door de promotor:
Prof.dr.ir. N.C. van de Giesen

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. Martinez, Universitat Politecnica 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 LATEX.

Key words: hydrodynamic model, model reduction, model predictive con-


trol, open channel flow, operational water management, real-time control,
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 peoples 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

i
ii Summary

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
August 2012 in Delft
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

iii
iv Contents

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
5.2 Model predictive control of open channel flow . . . . . . . . . 88
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

Publications 147
vi Contents
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 SQP-based 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

vii
viii List of Tables
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
x List of Figures

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 differences (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-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 differences (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
xii List of Figures
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

1
2 Chapter 1. Introduction

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

Figure 1.2: Open channel water quantity and quality using a 1D model
4 Chapter 1. Introduction

Some researchers adjusted the basic reservoir model and generated an Integrator-
Delay (ID) model [11] and an 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 man-
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.
6 Chapter 1. Introduction

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 system. Based on the way
of generating control actions, controllers can be categorized into local con-
trol and centralized control. In local control, each control 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.
8 Chapter 1. Introduction

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
10 Chapter 1. Introduction

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
describes the behavior of a controller
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 optimization 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
12 Chapter 1. Introduction

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 1950s. 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 thesis
POD incorporated with a snapshot method is applied to generate the reduced
state-space model for both water quantity and quality in this thesis.
The snapshot approach takes snapshots of an off-line simulation model, which
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.
14 Chapter 1. Introduction

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 nonlinear 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.
16 Chapter 1. Introduction
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 water systems, keeping both water 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 control (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

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

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
20 Chapter 2. Real-time control of combined water quantity & quality

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 approximations 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 Q
+ = ql (2.1)
t x

Q (Qv) Q|Q|
+ + gAf +g 2 =0 (2.2)
t x x Cz RAf

(Af c) (Qc) c
+ = (KAf ) + ql cl (2.3)
t x x x

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 Af /Pf
22 Chapter 2. Real-time control of combined water quantity & quality

(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/m3 ], cl
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:

W 2v2
K = 0.011
dm us (2.4)
p
us = gRSb

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 Qi1/2 Qi+1/2


= + ql,i (2.5)
dt x

dvi+1/2 1 Qi+1 vi+1 Qi vi Qi+1 Qi


+ ( vi+1/2 )
dt Af,i+1/2 x x
(2.6)
i+1 i vi+1/2 |vi+1/2 |
+g +g =0
x Cz2 R

dAf,i ci Qi1/2 ci1/2 Qi+1/2 ci+1/2 1


= + (Ki+1/2 Af,i+1/2 ci+1
dt x x2 (2.7)
(Ki+1/2 Af,i+1/2 + Ki1/2 Af,i1/2 )ci + Ki1/2 Af,i1/2 ci1 ) + ql,i cl,i

Qi1/2 + Qi+1/2 Af,i + Af,i+1


where: Qi = Af,i+1/2 =
2 2

 
vi1/2 (Qi 0) ci (Qi+1/2 0)
vi = ci+1/2 =
vi+1/2 (Qi < 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].
24 Chapter 2. Real-time control of combined water quantity & quality

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 = Ak xk + Buk uk + Bdk dk


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

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 d 1
= = [Qin (t ) Qout (t)] (2.9)
dt dt As

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. Qin and 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)
= Qin (t)cin (t) Qout (t)cout (t) (2.10)
dt
Substituted with the flow mass balance, Equation 2.10 becomes:

dec dc 1
= = [Qin (t)(cin (t) c(t)) Qout (t)(cout (t) c(t))] (2.11)
dt dt V

where V is the water volume in the reach [m3 ], ec is the average concentra-
tion deviation from the target concentration [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:

nr X
X n
min J = min { Wx, (ek )2 + Wx,c (ekc ek 2 k 2 k 2
c ) + Wu (Qc ) + Wu,c (ec ) }
j=1 k=1
(2.12)
26 Chapter 2. Real-time control of combined water quantity & quality

k
ec 0
subject to: 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], Wx, , Wx,c and Wu are the penalties for e , ec and Qc
separately. ec 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.

Wu,c is the penalty on virtual inputs. Its value is extremely small, which
k
makes the term of Wx,c ec almost equal to zero, no matter what the value
k
of ec 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/m3 (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.
Chapter 2. Real-time control of combined water quantity & quality

Table 2.3: Lateral flow in each reach


Lateral 1 Lateral 2 Lateral 3
Reach Discharge Concentration Discharge Concentration Discharge Concentration
(m3 /s) (kg/m3 ) (m3 /s) (kg/m3 ) (m3 /s) (kg/m3 )
1 0.02 1.0 0.03 1.2 No third lateral
2 0.02 1.2 0.03 1.4 No third lateral
3 0.04 0.9 0.02 1.5 0.03 1.8
4 0.02 1.5 0.04 1.0 No third lateral
28
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 ek
c ( 0) of each canal reach, which is used to switch on/off
the water quality control; d includes all the lateral flows. The
pdiscrete delay
steps in the model are estimated by the travelling time (Lc /( gAf /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
1 1 1 1
Wx, (0.28)2 (0.28)2 (0.28)2 (0.28)2
1 1 1 1
Wx,c (0.58)2 (0.58)2 (0.58)2 (0.58)2
1 1 1 1
Wu,c (1.01010 )2 (1.01010 )2 (1.01010 )2 (1.01010 )2
Gate 1 Gate 2 Gate 3 Gate 4 Gate 5
1 1 1 1 1
Wu (0.61)2 (0.61)2 (0.61)2 (0.61)2 (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
30 Chapter 2. Real-time control of combined water quantity & quality

Qkc = Kp [ek ek1 ] + Ki ek (2.13)

where k is a discrete time index, Qc is the required flow change for a certain
structure [m3 /s], Kp 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 neighbouring 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 prediction 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.
32 Chapter 2. Real-time control of combined water quantity & quality

(a) PI (b) MPC

Figure 2.8: Water level deviations from the targets

(a) PI (b) MPC

Figure 2.9: Average concentration deviations from the targets


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.
34 Chapter 2. Real-time control of combined water quantity & quality
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

35
36 Chapter 3. Control effectiveness Vs computational efficiency in MPC

3.1 Introduction

More and more attention is being paid to increase the efficiency of water
delivery and usage and decrease spilling of water. From an operational wa-
ter management point of view, proper real-time control techniques can help
achieve this goal. Most of the research and applications of diverse control
techniques on open channel flow were originally designed for irrigation sys-
tems, for example [61], [26] and [14]. Model predictive control (MPC) is one
of the most advanced control techniques, as it can deal with setting an op-
timal trade-off between water level deviations from the target level and flow
changes while taking their physical limitations (constraints) into account.
The drawback of this methodology is the heavy computational demand. With
the improvements of both hardware and software, the application of MPC
became practically possible. Advances in hardware, in terms of computer
capacities, are outside the scope of this research. Software improvements can
be achieved through faster optimization algorithms or through the reduction
of model complexity. Model reduction is the focus of this research.
MPC requires a prediction model to estimate the dynamic system behavior
over a prediction horizon. Different prediction models have different model
accuracy and complexity. In general, it can be stated that the larger the
model complexity, the higher the model accuracy. However, the model ac-
curacy and complexity influence the control effectiveness in terms of control
goal achievement in the closed-loop implementation, and computational effi-
ciency regarding the computational time in delivering an accurate solution of
the constraint optimization problem in MPC. The trade-off between model
accuracy and complexity is the central consideration of this research.
The Integrator Delay (ID) model [11] is a commonly used prediction model
for MPC in water management. The model is usually linearized around the
average flow condition and only has a small number of states depending
on the number of controlled water levels and delay steps. However, due to
the linearization, it is limited to small flow changes. In contrast with the
ID model, the Saint-Venant (SV) equations accurately calculate the system
dynamics over the full range of flow conditions, but this mathematical model
includes many states. It is extremely computationally costly when used in
MPC. Therefore, we propose a reduced Saint-Venant (RSV) model developed
in [62]. The model captures the main dynamics of the SV model, but the
number of states and disturbances is significantly reduced. Additionally, the
Model Predictive Control of Open Channel Flow. Advances in Water Resources. Volume
34(2):282-290, 2010
3.2. Model predictive control of open channel flow 37

RSV model does not have the limitation of small flow change as long as the
coherent flow structure is detected through snapshots of the full set of states
in an off-line simulation.
This chapter compares the RSV model and control performance with the SV
model and ID model. It extends previous work by Xu and van Overloop [62]
with more realistic flow conditions. In addition, the number of terms in the
disturbance vector is reduced, which further reduces the computational time.
The chapter is structured as follows: After briefly introducing MPC for open
channel flow, three different MPC prediction models are discussed with focus
on the RSV model. Then the different model and control performances are
evaluated through a test case. Finally, based on the results, the conclusion
that the RSV model is a promising means to balance the trade-off between
control effectiveness and computational efficiency is drawn.

3.2 Model predictive control of open channel


flow
When controlling open channel flow, a common goal is to keep a specific
water level at a target level by smoothly adjusting the controllable structures,
for example weirs, gates and pumps. Additionally, the control actions for
the structures need to remain within the physically possible capacities, such
as maximum gate opening or maximum pump capacity. MPC solves this
goal as an optimization problem, formulated as an objective function subject
to certain constraints. The objective function should capture the future
dynamic behavior which can be described by a prediction model (internal
model). Physical disturbances, such as rain inflows or off-take flows to water
users, can also be included in the model. Finally, an optimization technique
is required to calculate the optimal control actions. The whole process runs
with a finite prediction horizon, and only the first optimal control action is
applied in each closed loop step (receding horizon). Figure 2.5 on page 24
shows the diagram of the MPC structure.

3.2.1 State-space model formulation with Kalman fil-


ter

From a control point of view, it is convenient to structure the prediction


model into a state-space formulation. The model could be either linear time
38 Chapter 3. Control effectiveness Vs computational efficiency in MPC

invariant or linear time variant depending on whether the state matrix, con-
trol matrix, and disturbance matrix are fixed or change over time. A linear
model can make the controller design easier. A linear time variant state-space
formulation is shown in Equation 2.8 on page 24:

In open channel flow control, the state vector x contains the states of wa-
ter level deviation from the target level, the control input vector u is the
change of control flow, and the disturbance vector d can include physical
disturbances, e.g. rain inflow or lateral flow, and terms generated from dis-
cretization when constructing the state-space model. Since the states only
contain water level deviations, when substituting flows at time step index
k + 1 from the momentum equation into the continuity equation, all the flow
related terms at time step index k of the discretization of the Saint-Venant
equations, are constructed into the disturbance vector. Output y is the same
as the state vector x in this case and the output matrix C is an identity
matrix.

Note that a non-linear system can be approximated by a linear time variant


model. As a prediction model of MPC, the Saint-Venant model or reduced
SV model in this case are linearized at specific flow conditions of each time
step over the prediction horizon. The values of matrices A, Bu and Bd over
the prediction horizon can be estimated by running the prediction model
with the optimal control actions of the previous time step. This is referred
to as Forward Estimation in [8]. The Forward Estimation is a pure
Saint-Venant model simulation and there is no control involved.

The state-space model in equation 2.8 on page 24 assumes that the complete
system states xk are known. In practice, it is not possible to measure all
states. For example, water levels in an irrigation system are measured typ-
ically only at the most upstream and downstream end of each canal reach,
which represent the first and last values in the state vector xk , while the
intermediate water levels are unmeasured. The test case in this chapter has
the same set of measurements. Therefore, a proper estimation of unmeasured
states is needed based on a limited number of measured values. The Kalman
filter [63] is a commonly used estimator. It assumes a certain initial model
error and independent white noise with a normal distribution on both mea-
surements p(wmeas ) N (0, 12 ) and the model p(wmodel ) N (0, 22 ). Because
the model states are correlated, when updating the measured model states
with the measurements, the unmeasured states can be updated as well [63].
The estimator equation is given as follows, driven by the error between mea-
k
sured output ym and corresponding model state xk . The model state xk is
replaced by the updated estimation xk :
3.2. Model predictive control of open channel flow 39

xk = xk + LK [ym (k) Hm xk ] (3.1)

where Hm is the measurement matrix, LK is the optimal Kalman gain, which


represents the relative importance of measurements against model calcula-
tion. Its calculation is based on the measurement noise covariance RN which
T
equals E(wmeas wmeas ), measurement matrix Hm , and a priori model error

covariance Pk . Here E means expectation.
Before measurements are available, the model runs to calculate the a priori
Pk , which equals APk1 AT , where A is the state (system) matrix, Pk1 is a
posteriori model error covariance which is calculated from the previous step,
T
and QN is the model noise covariance which equals E(wmodel wmodel ). Before
starting, P0 is calculated by assuming a constant model error in this case,
which equals E(T ). After the measurements are available, LK is calculated
as Pk HmT
(Hm Pk Hm
T
+ RN )1 , then the states are updated with equation 3.1
and Pk is also updated for the next calculation of the a priori model error
covariance, which equals to (I LK Hm )Pk with I the identity matrix.

3.2.2 Optimization Problem

According to the control goal, MPC formulates the objective function J to


minimize the water level deviation from the target level and the change of
structure flow along the prediction horizon n. A typical minimization of a
quadratic function is the result shown in Equation 3.2, which can be solved
with the quadprog function in MATLAB [64]:

n
X n
X
min J = min{ [(xk )T Wx xk ] + [(Qkc )T Wu Qkc ]} (3.2)
U U
k=0 k=1


xk+1 = Ak xk + Buk uk + Bdk dk
subject to:
Qc,min Qkc Qc,max

where n is the number of prediction steps, Wx and Wu are the weighting


factors on x and Qc , respectively. Note that Qc is the change of control
flow in open channel flow notation, which represents the control notation uk
in equation 2.8 on page 24. Assuming the downstream water level of a canal
reach is controlled, Wx only penalizes on this controlled water level deviation
from the target level. Qc is the control flow, which is constricted between
the minimum and maximum flow of Qc,min and Qc,max .
40 Chapter 3. Control effectiveness Vs computational efficiency in MPC

When replacing the model 2.8 on page 24 with the estimated state x into the
objective function 3.2 and minimizing J with respect to the control action U
(or Qc ) over the prediction horizon, the problem becomes:

1 J
min J = min( U T HU + f U + gc ) = = HU + f (3.3)
U U 2 U

where H is the Hessian matrix and f is the Jacobian matrix. These matri-
ces are calculated as the input of the optimization algorithm: (Assume the
number of controls, e.g. the number of control gates, is nu )

T
H = 2(Bu,n Qx,n Bu,n + Ru,n ) dimension : (n nu ) (n nu )
(3.4)
f = 2((xk )T ATn + DnT Bd,n
T
)Qx,n Bu,n dimension : 1 (n nu )

Note that all the matrices except xk are over the prediction horizon labelled
by the subscript 0 n0 . The calculation of these large matrices is presented in
Appendix A, after deleting the subscript 0 r0 in the variable notation. Al-
though the appendix is formulated for the reduced model, the procedure fits
the general MPC internal model generation.
In MPC, the total control process time contains the optimization time itself,
the time to build up the input matrices of optimization (H and f ) and their
related matrices (An , Bu,n , Bd,n ), the time to call prediction models which
is determined by the model complexity and the rest of some process time
related to the matrix size. The first two time consumption are discussed
below.
First of all, from the matrices dimension in equation 3.4, it is easily veri-
fied that matrices H and f in different models have the same dimensions,
separately, as long as the number of control inputs nu and the number of
time steps over the prediction horizon are the same. Thus, H and f related
matrix operations in MPC will not influence the optimization time. The
optimization time with different models will only be affected by the search
space and the initial search point.
The time to build up the large matrices over the prediction horizon (An ,
Bu,n , Bd,n , H and f ) may differ significantly with different models. Because
building up these matrices contains a lot of matrix multiplication (see Ap-
pendix A, without subscript 0 r0 ) and the matrix size, mainly determined by
3.3. Process model formulation 41

the number of states and disturbances in this case, largely influences the ma-
trix multiplication time, it is necessary to decrease the matrix size by means
of model reduction, in order to reduce the computational time.

3.3 Process model formulation


Open channel flow is commonly described by the Saint-Venant equations.
They consist of the mass and momentum conservation equations, which are
expressed in Equations 2.1 on page 21 and 2.2 on page 21. An example of
an open canal is schematized in Figure 3.1 with major variables.

Figure 3.1: Canal reach schematization

3.3.1 State-space model formulation with SV model

The SV model is usually not used as the prediction model in MPC because of
the costly computation to achieve an accurate prediction, but it is the basis of
the RSV model. The SV model presented here is used to test the model and
control performance with the RSV model. Following Stelling and Duinmeijer
[17] and Xu et al. [8] the spatial discretization of the Saint-Venant equations
uses the staggered grid scheme listed in equation 2.5 on page 22 and 2.6 on
page 22, and the integration scheme in time is based on the method, e.g.
n+ = n+1 + (1 ) n in equation 2.6 on page 22. The scheme is regarded
as fully implicit when equals 1 and fully explicit when is 0. The fully
implicit scheme normally has large wave damping especially when large time
steps are used. Accurate results can be achieved when taking as 0.55 [65].
The advection term in equation 2.6 on page 22 is calculated explicitly by
first-order upwinding.
Substituting equation 2.6 on page 22 into 2.5 on page 22 and writing them
into the state-space format considering that the control input is the change
of gate flow (Qc ), we obtain:
42 Chapter 3. Control effectiveness Vs computational efficiency in MPC

ak1,1 ak1,2

0 0 0 0 ek+1
1 ek1
ak2,2 ak2,2 k
a2,3 0 0 0 ek+1 ek2
2
... ... ...

.. ..
0 0 0

.
= I
.
l+1,l+1 k
0 0 akl1,l2 akl1,l1 akl1,l 0
k+1
el1 el1
t
0 0 0 akl,l1 akl,l
k+1 k
k x
Wt,l
el el
0 0 0 0 0 1 Qk+1
c Qkc
bk1


1 0 0 0 1 bk1 bk2
0
..
0 1 0 0 0 ..
.

. k+1
+ Qc +
.... . . . . ..
. . . . . k
bl2 bkl1

0
0 0 0 0 1
bkl1

1
0 0 0 0 0 t
Qk+1
W k x in
t,l
(3.5)
where e equals the water level from the Kalman estimator minus the tar-
get water level, Qin is the inflow of the reach, Qc is the outflow (structure
flow) of the reach, Qc is the change of outflow, t is the control time,
x is the spatial increment, l is the number of spatial discretization point,
Tw,i (k) is the top width at calculation points i at time step k, ai,j and bi
are functions of variables that change over time and are estimated by the
Forward Estimation [63]. By multiplying the inverse of the first matrix on
both sides of Equation 3.5, it gives the linear time-varying state-space model
format as Equation 2.8 on page 24. Note that the Kalman filter in Equation
3.1 is usually required to estimate the unmeasured values along the canal
reach.

3.3.2 State-space model formulation with RSV model

In order to cope with the computational burden in MPC with the SV model, a
much simpler prediction model needs to be developed, containing less states
and disturbances. Model reduction is an important tool to reduce model
order, which can be formed as z = zr . z and zr are column vectors in
original and reduced domain separately. The key process of generating the
reduced vector is to calculate the basis function . In linear algebra, this
is formulated as an over-determination problem, which can be solved based
on the least square error between the original and projected vectors. Proper
orthogonal decomposition (POD) is a known model reduction technique, e.g.
3.3. Process model formulation 43

[37] [41] and [36]. A snapshot method is usually incorporated into POD to
capture the coherent flow structure. In addition, POD calculates an orthog-
onal matrix of the basis function: T = I. Then the reduced vector
becomes: zr = T z.
Sirovich [66] pointed out that the eigenvectors of the spatial correlation ma-
trix (kernel matrix) are a linear combination of the snapshots and formulated
the basis functions as:

M
X
i = ji zj (3.6)
j=1

where i is the ith eigenvector of the kernel matrix, zj is the j th snapshot, M


is the number of snapshots, and ji is a coefficient. According to Sirovich [66],
the coefficient ji is selected from the eigenvector of the correlation matrix
CR, assuming that M independent snapshots z1 , z2 , . . . , zM are taken from
an off-line simulation of a high-order model, the SV model in this case. Each
snapshot is a column vector containing N states that are the water level
deviations from a target level in the open channel flow model:

1 T
CRi,j = (z zj ) (3.7)
M i
Finally, the number of the basis functions in use is selected based on the m
largest eigenvalues of the correlation matrix CR, and the combinations of i
formulates the basis function matrix with a dimension of N m.
The snapshots can be taken on both states and disturbances considering
the state-space model formulation. Therefore, the full states x(k) from the
Kalman estimator and the disturbances d(k) become a function of the re-
duced states xr (k) and reduced disturbances dr (k), respectively, with respect
to the basis function matrix 1 (N m1 ) and 2 (N m2 ):

x(k) = 1 xr (k)
(3.8)
d(k) = 2 dr (k)

Substituting Equation 3.8 into state-space model 2.8 on page 24, it be-
comes:

xr (k + 1) = Ar (k)xr (k) + Bu,r (k)u(k) + Bd,r (k)dr (k)


(3.9)
y(k) = Cr xr (k)
44 Chapter 3. Control effectiveness Vs computational efficiency in MPC

where Ar (k) = T1 A(k)1 , Bu,r (k) = T1 Bu (k), Bd,r (k) = T1 Bd (k)2 ,


Cr = C1 , 1 is orthogonal with 1 (T1 1 = I), 2 is orthogonal with
2 (T2 2 = I), and I is the identity matrix. Ar (k) has a dimension of
m1 m1 , Bu,r (k) is m1 nu , and Bd,r (k) is m1 m2 . If m1  N and
m2  N , the model order is significantly reduced.
Because of the connection between states and disturbances through the state-
space model formulation, reducing the order of disturbance decreases not only
the disturbance accuracy itself, but also the state accuracy. Therefore, we
suggest reducing the number of disturbances to an acceptable tolerance while
the number of disturbances is always higher than the number of states.
The overall state-space model over the prediction horizon is described in
Appendix A. The same Forward Estimation procedure described by Xu et
al. [8] can be used to calculate the time varying matrices: Ar (k). . . Ar (k +
n 1), Bu,r (k). . . Bu,r (k + n 1) and Bd,r (k). . . Bd,r (k + n 1), based on the
optimal solution of the previous step.
For the application of the reduced model to MPC (see Figure 2.5 on page 24
for MPC procedure), the internal model calls the SV model first, then
the basis functions are used to generate the RSV model over the prediction
horizon by calculating time-varying matrices of Ar , Bu,r and Bd,r . Although
this introduces an extra procedure of generating the reduced model, the
MPC is expected to take much less process time due to the time reduction in
matrix multiplication with the reduced model. Note that the Kalman filter
in Equation 3.1 is usually required to estimate the unmeasured values along
the canal reach.
Because of model reduction, the objective function used by the RSV model
predictive control is changed when substituting the reduced states function
in Equation 3.8 into the objective function 3.2

n
X n
X
k T k
min J = min{ [(xr ) Wx,r xr ] + [(Qkc )T Wu Qkc ]} (3.10)
Qc Qc
k=0 k=1

xk+1 = Akr xkr + Bu,r


k
uk + Bd,r
k
dk

r
subject to: k
Qc,min Qc Qc,max

where Wx,r = T Wx . The Hessian and Jacobian matrices are calculated by


substituting the reduced model in equation 3.9 into the objective function
3.10.
3.4. Test case 45

3.3.3 State-space model formulation with ID model

In order to compare the control effectiveness and computational efficiency


with the RSV model, the commonly used ID model is presented here as the
ultimate simplification of open channel flow. The mathematical expression of
the ID model is a mass balance combined with a water travelling delay:

t kkd
ek+1 = ek + [Qin Qkc ] (3.11)
As

where e is the water level deviation from the target water level at the down-
stream end of the canal reach [m], t is the control time [s], As is the storage
area in the backwater part [m2 ], Qin is the upstream inflow [m3 /s], Qc is the
downstream control flow of a structure [m3 /s], k is the time step [], kd is
the number of delay steps [], which equals the delay time [s] divided by
the control time t and kd is always rounded up to be conservative.
The ID model requires the determination of the two pool properties: delay
time and storage area. They are pre-determined with a hydraulic model
simulation through a standard procedure, which uses a small step flow change
on the upstream side and a constant downstream flow, following [11] and [29].
A Kalman filter is not necessary for the ID model, since the downstream water
level in the model is directly measured in practice.
Due to the linearization, the ID model is inaccurate over the entire simulation
period. Figure 3.2 shows water level profiles with different flow conditions.
The two pool properties, especially the storage area in the backwater part, are
significantly different under the three flow conditions. This is a disadvantage
of the ID model.

3.4 Test case

The test canal reach has a total length of 4, 000m with a downstream gate
flow controlling the upstream water level of the gate to 3.2m (negative
value means below mean sea level). The upstream flow trajectory shown in
Figure 3.3 is considered as a known physical disturbance and used to test
the MPC controller with three models. The maximum downstream gate flow
is assumed to be 4m3 /s. Note that a virtual gate is used here, which only
forces a certain discharge instead of gate opening. It works as a pump. No
46 Chapter 3. Control effectiveness Vs computational efficiency in MPC

Figure 3.2: Longitudinal profile with different flow conditions

lateral flow was considered. The canal geometric parameters are listed in
Table 3.1.

Table 3.1: Canal geometric parameters


Length Upstream Bed Bed Slope Bed Width Side Slope Chezy
(m) level (m) tan() (m) tan() (s1/2 /m)
4000 -1.42 1:1000 1 1:1.5 45

Each of the simulations continue for 20 hours with a time step of 2 seconds.
The coefficient in time integration of the simulation model is set to 0.55, in
order to avoid strong wave damping and keep the model accurate. But the
is set to 1 for the SV and RSV model in MPC prediction model, in order
to avoid model instability with large control time step of 240 seconds.
Water level measurements are assumed only to be available at the upstream
and downstream end of the reach. For the Kalman filter design, when using
SV and RSV models, we assume that both the measurements and the model
have normal distributed white noise and the model also has a certain initial
error. In addition, the two measurements have the same white noise. The
parameters are listed in Table 3.2.
1
-1.4 means the elevation is 1.4 meter below mean sea level.
3.4. Test case 47

Figure 3.3: Upstream Flow Condition for MPC Test

Table 3.2: Parameters for Kalman filter design


Measurement noise model noise Initial model error
p(wmeas )(m)1 p(wmodel )(m)1 (m)
2 2
N (0, 0.001 ) N (0, 0.0005 ) 0.01

The three implementations of MPC have the same control setup, for example
the same weighting factors, the same control time step t of 240 seconds with
a prediction horizon of 2 hours. This gives a prediction length n of 30 steps.
The weighting factors on water level deviation from the target level (Wx )
and change of gate flow (Wu ) are selected according to the MAVE factor
that represents the Maximum Allowed Value Estimate [29]. The maximum
allowed water level deviation from the target level (assumed 10cm) and the
maximum gate flow (4m3 /s) are used as the reasonable initial guess of MAVE
factors. Because the states and control input are in units of m and m3 /s, by
taking the reciprocal of the squared MAEV factors, the objective function
can be normalized. It is allowed to make some additional tuning on the
penalties through trial-and-error. The tuned weighting factors are listed in
Table 3.3.
12
The unit of m on noise is for mean and standard deviation, and the noise variances
have a unit of m2
48 Chapter 3. Control effectiveness Vs computational efficiency in MPC

Table 3.3: Weighting factors


Wx Wu
Weighting factor 400 4

3.4.1 SV model setup

The SV model is spatially discretized into 500 calculation points with a space
step x equal to 8 meters. With the 30 prediction steps, the controller gives
15,531 (501 31) present and future states in total. In order to use the
change of flow for the control input, an extra state Qc is added to the state,
(see Equation 3.5). The optimization problem was unsolvable on a 32-bit
computer due to the memory limit. It was tractable on a 64-bit computer
with an 8 Gb internal memory. From another perspective, this shows the
heavy calculation burden of large matrix multiplication and the importance
of model reduction.

3.4.2 RSV model setup

In order to generate the RSV model, the SV model was simulated with the
upstream flow trajectory Qin according to Figure 3.4, and the downstream
water level was kept to the target water level through feedback control of the
downstream gate. During the simulation, 100 independent snapshots were
taken on both states and disturbances. The state basis function was formu-
lated by the 10 eigenvectors corresponding to the 10 dominant eigenvalues of
the state correlation matrix, and the disturbance basis function used 30 cor-
responding eigenvectors of the disturbance correlation matrix. The number
of eigenvectors in use was found by trial-and-error in this research.

3.4.3 ID model

The model is linearized around the average flow condition of 3.04m3 /s. With
a 0.1m3 /s step change in upstream flow, the test system is estimated with 8
delay steps (kd ) with 240 seconds control time and 7,600m2 storage area (As ),
through the downstream water level response, according to the description
in section 3.3.3.
3.4. Test case 49

Figure 3.4: Upstream Flow Condition for Reduced Model

3.4.4 MPC performance indicators

After the test of three implementations of MPC, the control performance


needs to be analyzed. According to Clemmens et al. [67], several perfor-
mance indicators can be used to examine the water level error and gate
discharge, which represent the overall MPC behavior. Maximum Absolute
Error (MAE) is one of the water level indicators, which concerns the percent-
age of maximum absolute water level deviation from the target level against
the target level. The calculation is as follows:

max(yt ytarget )
M AE = (3.12)
ytarget

where: yt is controlled water level at time t, ytarget is the target water


level.

Integrated Absolute Discharge Change (IAQ) is an indicator of the change of


gate discharge which reflects the tear and wear of the gate along the whole
simulation. IAQ is calculated as follows:
50 Chapter 3. Control effectiveness Vs computational efficiency in MPC

t2
X
IAQ = (|Qc,t Qc,t1 |) |Qc,t1 Qc,t2 | (3.13)
t=t1

where: Qc,t is gate discharge at time step t, t1 and t2 are the initial and final
time step respectively.

3.5 Results

This part is intended to demonstrate the results of model accuracy and com-
plexity, control effectiveness, and computational efficiency. It shows the ad-
vantages of using the RSV model in MPC compared to the other two models.
It is assumed that the SV model is the most accurate one in describing the
open channel flow and the MPC is the most effective with the SV model
under the same control parameter setup. It is noticed that there is always
a trade-off between the MPC control effectiveness and computational effi-
ciency.

3.5.1 Results of RSV model accuracy and model com-


plexity

As model complexity increases, the model accuracy is expected to increase.


This principle is reflected in Figure 3.5 which shows the influence of both
state and disturbance reduction on model accuracy. The figure is produced
by the flow condition in Figure 3.4. Figure 3.5 is a semi-logarithmic plot
with the model accuracy on the y-axis, calculated by the sum of least square
water level errors along the canal reach between the projected high-order
model and the SV model over the 20-hour simulation period. Here the pro-
jected high-order model means an SV model converted back from the RSV
model. The model complexity is represented by the number of states and
disturbances.
Figure 3.5 can be used as a selection reference of the number of eigenvectors
(number of states or disturbances) in use. In each disturbance scenario of
Figure 3.5, the model accuracy has an exponential change first with respect
to the number of states and stays flat under a certain number-of-disturbance
threshold. This implies that the number of states in selection should be on
3.5. Results 51

Figure 3.5: Model accuracy Vs model complexity

the skewed line. When the number of states remains unchanged, reducing
the order of disturbance decreases the model accuracy.
The result of the RSV model (after projecting onto the high-order model) is
presented in Figure 3.6. It shows the water level difference along the canal
reach between the RSV model and the SV model. The accuracy of the RSV
model is outstanding, with an insignificant water level difference of less than
3mm from the SV model.

3.5.2 Results of control effectiveness and computational


efficiency in MPC

Control effectiveness

Because of the change of objective function in the RSV model predictive


control, it is unfair to compare the control effectiveness with different models
through the objective function values. Instead, it is more interesting to com-
pare the closed-loop optimization results, since it reflects how effective the
controller acts exactly on the water system. The MPC results with different
models are shown in Figures 3.7 and 3.8 for the controlled downstream gate
flow (Qc ) and the controlled water level.
52 Chapter 3. Control effectiveness Vs computational efficiency in MPC

Figure 3.6: Model level difference between SV and RSV model

In Figure 3.7, the upstream flow (Qin ) is also presented, which works as a
known physical disturbance on the canal reach. Figure 3.7 clearly shows the
downstream gate flow constraint of 4m3 /s and demonstrates the advantage
of MPC in prediction. Because of the flow limit, the gate flow increases in
advance to decrease the water level to create extra storage. For example, the
fast water level drop at about 800 minutes simulation time (the 2.4104 point
on the x-axis) in Figure 3.8 is due to the prediction of the peak flow (dashed
green line) in Figure 3.7. This is a common feature of MPC regardless of the
prediction model type.

According to Figure 3.8, the overall MPC performance with the three models
is good. The water level is controlled around the target level with a maximum
deviation of 4cm. But the controlled water level with the RSV model follows
the SV model track better and is more accurate than the ID model. Figure
3.8 obviously shows that the controlled water level in the ID model (dotted
black line) shifts towards the right, which means the overall delay steps in the
ID model are overestimated. In addition to the fixed storage area, the water
level fluctuates more in the ID model than in the other two models.

The performance indicators of Maximum Absolute Error (MAE) and Inte-


grated Absolute Discharge Change (IAQ) with three different models are
3.5. Results 53

Figure 3.7: Gate flow with different prediction models

Figure 3.8: Water level with different prediction models


54 Chapter 3. Control effectiveness Vs computational efficiency in MPC

presented in Table 3.4. This table demonstrates the overall performance of


MPC with three different models. The results are equivalent to the expecta-
tion that the SV model is the most accurate, the RSV model follows the SV
model track well and they both outperform the ID model significantly.

Table 3.4: Overall performance of MPC


Maximum Absolute Value Integrated Absolute Discharge Change
(MAE3 ) (%) (IAQ) (m3 /s)
SV -0.60 13.55
RSV -0.63 13.53
ID -1.23 16.33

Computational efficiency

The computational efficiency in MPC is reflected by the computational time.


Figure 3.9 shows the time spent in the control process with different pre-
diction models. The control process time of using the SV model and RSV
model includes the Forward Estimation and Kalman filter as well. The
figure shows that the computational speed of the RSV model is more than 8
times faster than that of the SV model. The control process time of using the
ID model is extremely low in Figure 3.9. The most important reason is that
the ID model is much simpler than the other two and has much less states
and disturbances. Besides, the controller only calls the ID model once per
control step, while the other two models are called n times per control step
(n is the number prediction steps) within the controller and the Forward
Estimation, and 120 times per control step (simulation steps between two
control steps) in the Kalman filter.
Most of the control process time of using the SV model is spent on the state
matrix, control matrix, and disturbance matrix related matrix multiplication
over the prediction horizon. Figure 3.10 shows an example of the influence
of the matrix size on the control process time. It points out that building up
the state matrix, control matrix and disturbance matrix over the prediction
horizon in MPC takes 77.3% of the total control process time with the SV
model in this case, while it only takes 0.3% with the RSV model due to the
reduced matrix size. Most of the time taken (97.7%) with the RSV model
is shifted to call the prediction model within the controller, the Forward
Estimation, and the Kalman filter. The rest of the process time is also
1
MAE is negative because the target level is negative
3.6. Conclusions 55

Figure 3.9: Computational efficiency with different models

reduced significantly, since many calculations are related to these large matrix
multiplications.
As discussed in Section 3.2.2, the optimization time is only affected by the
search space and the initial search point. Figure 3.10 shows that the dif-
ference in optimization time consumption with three models is insignificant.
In addition, the optimization time is relatively short because the control
problem is very simple in this case.

3.6 Conclusions
This chapter explored the application of a model reduction technique on
model predictive control. The idea and procedure of proper orthogonal de-
composition, implemented with the snapshots method, were illustrated as an
effective way of generating a reduced model.
The reduced model RSV is very accurate in describing the flow dynamics. It
keeps the model structure of the SV model, overcomes the limitations of the
ID model, and functions properly over the entire flow range. The generated
RSV model is also efficient for large scale problems, in terms of the number
of states and disturbances.
Both implementations of MPC with the SV model and RSV model need a
Kalman filter to estimate the unmeasured states. Thus extra computational
56 Chapter 3. Control effectiveness Vs computational efficiency in MPC

Figure 3.10: Computational time in each part of total control process with
different models

time is added to the system, but it is rather limited. Compared with the MPC
using the SV model, the RSV model significantly reduces the computational
time by reducing the matrix size. Although this computational time is higher
than the ID model, it is very acceptable. Therefore, it can be concluded
that the reduced model is capable of balancing the control effectiveness and
computational efficiency in MPC, and the POD model reduction technique
is applicable to the MPC prediction model.
In addition, the flow condition used for MPC in Figure 3.3 has different ranges
and change frequencies from Figure 3.4 for generating the RSV model. This
shows that the RSV model can deal with extrapolated flow conditions, once
the coherent flow structures are determined.
While the approach is very effective, MPC with the RSV model could still
be improved by speeding up the SV model calculation. This will dramati-
cally decrease the MPC calculation time, since 97.7% of the control process
time is spent on calling the prediction model, although the absolute time
consumption is small. This may be done by optimizing the computer code
or changing to a lower level (faster) programming language.
Chapter 4

Reduced models in model


predictive control controlling
water quantity & quality

Abstract
This chapter1 studies the application of complex models in MPC to control
both water quantity and quality. However, because of the online optimiza-
tion of MPC, the computational time becomes an issue. In order to reduce
the computational time, a model reduction technique, Proper Orthogonal
Decomposition (POD), is applied to reduce the model order. The method
is tested on a Polder flushing case. The results show that POD can signifi-
cantly reduce the model order for both water quantity and quality with high
accuracy. The MPC using the reduced model performs well in controlling
combined water quantity and quality in open water channels.

4.1 Introduction
Over the last decades, many control techniques and operation rules have
been developed to manage water systems for both water quantity and qual-
ity. Most of the research concerns river and reservoir operation. For ex-
1
based on: Xu. M., van Overloop. P.J. and van de Giesen. N.C. Model reduction on
model predictive control of combined water quantity and quality. Environmental Modelling
& Software. 2012. (Accepted)

57
58 Chapter 4. Reduced models in MPC controlling water quantity & quality

ample, Kerachian and Karamouz [68], Dhar and Datta [69], Shirangi et al.
[70] and Chaves and Kojiri [71] used a Genetic Algorithm (GA) together
with water quality simulation models either physically-based or data-driven
Neural Network (NN) model, to manage the water quality in river-reservoirs;
Mujumdar and Saxena [72] and Chaves et al. [73] applied Stochastic Dy-
namic Programming (SDP) to regulate both water quantity and quality in
rivers and reservoirs under uncertainty. These control techniques are nor-
mally based on mid-term or long-term operation (daily to monthly). One of
the intrinsic reasons is that water quality processes are generally character-
ized by longer time scales compared to water quantity, therefore, it is often
difficult to account for water quality when designing a short-term (real-time)
controller.

Over the last decades, also many real-time control methods have been de-
veloped for short-term water system operation (minutes to hourly) over the
last decades. However, most of the research in this field concern operation of
irrigation and drainage canals and rivers, for example [13], [74], [26], [14] and
[75]. In these applications, only water quantity is maintained by controlling
water levels. In general, water quality is managed through manual operation,
for example Dutch polder canals are usually manually operated every couple
of days, depending on the system under investigation, in order to flush out
the pollution. One of the reasons that combined water quantity and qual-
ity management in real-time has not taken off in the past is related to the
unavailability of real-time water quality measurements. Real-time control
requires continuous measurement within each control step. The traditional
laboratory measurement of water quality is not feasible and affordable in
real-time application. However, real-time water quality control will receive
more attention with the development of real-time water quality measurement
[49].

Recently, different real-time control methods have been applied to water


quality management in canal systems. For example, Litrico et al. [76] used
an adaptive control method to control canal discharge by adjusting hydraulic
structures to restrict algae development. Augustijn et al. [77] applied dy-
namic control to prevent salt intrusion in a lake that was modeled as open
channel flow. Xu et al. [8] applied a model predictive control technique to
generate an optimal flushing strategy and maintain both water quantity and
quality in a polder system.

Real-time control is starting to play an important role in operational wa-


ter management of open water channels. Among different real-time control
methods such as Proportional Integral (PI) control, Linear Quadratic Reg-
4.1. Introduction 59

ulator (LQR), Model Predictive Control (MPC) has important advantages


in controlling water systems. It uses an internal model to predict the future
system behavior over a finite prediction horizon, and generates optimal con-
trol actions through optimizing an objective function at every control step.
Constraints can also be taken into account in the optimization [51]. MPC is
completed by a predictive model that provides a prediction of the systems
disturbances. Because of the prediction, MPC can take anticipatory actions
before undesired changes happen. Our research focuses on the application of
MPC controlling both water quantity and quality in open channels.

According to the authors knowledge, Xu et al. [8] were first to use MPC to
control combined water quantity and quality. They applied simple reservoir
models in MPC to maintain water levels and average solute concentrations
in a drainage canal. That research showed the possibility of controlling com-
bined water quantity and quality with MPC. However, that research had two
drawbacks. First, the internal model for water quality was a reservoir model
that assumed complete mixing. Therefore, only the average concentration in
the canal reaches could be considered. Second, the research scenario was very
simple with water quality change at only one lateral while all the lateral dis-
charges remained unchanged. These two issues of [8] were the main trigger
for this research. For water quality control in a canal system, more com-
plex and physics-based models are required to capture the main dynamics.
Subsequently, the control targets can be located at the places where water
quality needs to be controlled. In addition, it is of importance to analyze
the control behavior under more realistic scenarios, for example, with both
water quantity and quality changes in all laterals.

MPC solves control problems online, which means that it generates opti-
mal solutions over a finite prediction horizon of which only the first one is
implemented in closed loop. Optimization in MPC requires major compu-
tational resources. This requirement restricts the real-time implementation
of MPC using models that are accurate but complex. Xu et al. [78] applied
a model reduction technique, Proper Orthogonal Decomposition (POD), for
the Saint-Venant equations to reduce model order. POD was used to balance
control effectiveness with computation time. The research by Xu et al. [78]
was conducted for water quantity control on a single canal reach without
lateral flows. The method looks promising for controlling combined water
quantity and quality using complex models with more realistic scenarios in
MPC. The control process includes two steps that are illustrated in Figure
4.1.

Model reduction, often referred to as model emulation, is a well-established


60 Chapter 4. Reduced models in MPC controlling water quantity & quality

Figure 4.1: Work flow of MPC controlling a water system using model re-
duction technique

research field. Model emulation is an efficient way of describing the essential


natural processes in a system as compact as possible by an emulator with
the least possible computational burden. Because of this characteristic it is
especially useful for application in optimization routines [79] [80]. Emulation
modeling can be categorized for both static and dynamic models. Ratto et
al. [79] gave intensive literature review on both types. Castelletti et al. [81]
provided a general framework on both data-based and model-based dynamic
emulation modeling, and summarized 6 steps for the emulation procedure.
Model emulation is also widely used for sensitivity analysis which evaluates
robustness of complex models, such as [82] [83].

In this Chapter, POD model reduction is implemented to generate a reduced


model of the combined Saint-Venant equations and general transport equa-
tion, based on snapshots of water quantity and quality states taken from an
offline simulation. As such, it is categorized as a model-based dynamic emu-
lation modeling technique. The reduced model can be verified through other
scenarios. The reduced model is then used as the internal model in MPC.
The main innovation of this research is to implement complex water quantity
4.2. Model reduction on combined open water quantity and quality model 61

and quality models in MPC using a model reduction technique.


MPC algorithms can not be directly implemented without a robustness study.
However, there has been intensive research on the robustness of linear and
nonlinear MPC algorithms. For example, Pannocchia et al. [84] developed a
Partial Enumeration MPC, a suboptimal controller, controlling a nonlinear
system, and proved the stability of the MPC algorithm. Marruedo et al.
[85] Pannocchia et al. [86] Pannocchia et al. [87] Pannocchia et al. [88]
proved the stability and robustness of nonlinear MPC algorithms applying
suboptimal solutions to the system under certain assumptions. Given this
previous research, it is assumed that applying the MPC algorithm controlling
combined water quantity and quality is permitted, although the robustness
and stability analysis is not the focus of this research.
The chapter is organized as follows. Section 4.2 introduces a combined water
quantity and quality model and its discretization, and describes the method
of using POD to generate a reduced model. In Section 4.3, MPC is intro-
duced to control a water system. It focuses on the formulation of control ob-
jectives on combined water quantity and quality, and the state-space model
formulation with the reduced model. In Section 4.4, a polder flushing case
is demonstrated. Section 4.5 presents the reduced model results and the
MPC performance using the reduced model. Section 4.6 discusses the main
issues in controlling combined water quantity and quality. The conclusions
are drawn in Section 4.7.

4.2 Model reduction on combined open water


quantity and quality model

In this section, we describe the combined open water quantity and qual-
ity model and the use of Proper Orthogonal Decomposition to reduce the
model. The reduced model will be implemented in Model Predictive Control
to reduce computation time.

4.2.1 Combined open water quantity and quality model

The open water quantity and quality model can be described by the Saint-
Venant equations and the general transport equation [89] [58] as in equa-
tions 2.1 on page 21, 2.2 on page 21 and 2.3 on page 21:
62 Chapter 4. Reduced models in MPC controlling water quantity & quality

The discretization of equations 2.1 on page 21, 2.2 on page 21 and 2.3 on
page 21 are extensively described in [8] and the discretized version can be
structured as a linear time-varying state-space model which is commonly
used in model-based control techniques, such as [90] [91]. Appendix A pro-
vides a detailed description of the discretization and the state-space model
formulation. From a control perspective, the general format of the linear
time-varying state-space model can be seen in 2.8 on page 24:
Using the state-space model formulation, the combined water quantity and
quality equations for a canal reach with upstream and downstream hydraulic
structures can be written as:

ek+1

a1,1 a1,2 0 0 | 0 0 0 0

,i,1
k+1
a2,2 a2,2 a2,3 0 | 0 0 0 0 e ,i,2

..

... ...

.

0 0 | 0 0 0 0

k+1

0 0 al,l1 al,l | 0 0 0 0 e,i,l


+


k+1

0 0 0 0 | b1,1 b1,2 0 0 ec,i,1


0 0 0 0 | b2,1 b2,2 b2,3 0 ek+1

c,i,2
... ... ..
|
0
0 0 0 0 0 .
0 0 0 0 | 0 0 bl,l1 bl,l k+1
ec,i,l
c1,1 0


ek,i,1 0 0 dk,i,1
ek .. .. dk,i,2
,i,2 . .

.
.. ..



0 0

.

ek,i,l 0 cl,1 
k
d,i,l
Qk+1

c,1

= I2l,2l + + I2l,2l

Qk+1
d1,1 0

ekc,i,1 c,2 dkc,i,1

ek 0 0
dkc,i,2
c,i,2
.. .. .. ..


. . .
.
k
ec,i,l
0 0 dkc,i,l
0 dl,1
(4.1)
where i represents the ith canal reach, l is the total number of discrete points
of each reach. For example, ek,i,l and ekc,i,l are the water level and concen-
tration deviations from their targets at lth discrete point of ith reach at time
step k. Qkc,1 and Qkc,1 are the upstream and downstream flows, controlled by
the structures, at the reach at time step k. a, b, c and d are the time-varying
4.2. Model reduction on combined open water quantity and quality model 63

coefficients, d and dc are the water quantity and quality disturbances, respec-
tively. Comparing the notations in equation 4.1 with the general state-space
model notation, it is noticed that: xki = [ek,i,1 , , ek,i,l , ekc,i,1 , , ekc,i,l ]T and
dki = [dk,i,1 , , dk,i,l , dkc,i,1 , , dkc,i,l ]T , however, the control input is the con-
trol flow, and we use uQ for differentiation. Thus, ukQ,i = [Qk+1 k+1 T
c,1 , Qc,2 ] .
Equation 4.1 is used to generate the reduced model and the complete model
constraints will be formulated in Section 4.3.2 where the control input vector
uses the change of control flow.
are known a-priori. They are
The time-varying coefficients (a, b, c and d)
velocity, water level or concentration related, which change at every time
step. The calculation of the time-varying coefficients is referred to Forward
Estimation, which executes the Saint-Venant and transport model over the
prediction. The Forward Estimation uses the optimal control information
over the prediction horizon from the previous control step. This can also be
considered as model approximation.
The disturbances (d and dc ) include physical and virtual disturbances, the
latter being necessary to numerically formulate the control problem. Physical
disturbances can be uncontrolled lateral discharges and pollution concentra-
tions in this test case. Virtual disturbances are the terms emerging from
the discretization of the Saint-Venant equations and the transport equation.
All calculations of the coefficients and variables are formulated in Appendix
A. Multiplying the inverse of the first matrix on both sides of Equation 4.1
results in a linear time-varying state-space model. Note that considering a
linear time-varying (non-linear) model as a linear model has significant ad-
vantages in optimization problems, due to convexity when combined with a
quadratic objective function.

4.2.2 Model reduction on combined water quantity and


quality model

Model reduction reduces model order or dimension to decrease computa-


tional requirements while maintaining sufficient model accuracy and relevant
system dynamics. The idea of model reduction can be tracked back to [92].
Since then, model reduction has been largely adopted in various fields, such
as signal analysis, image processing, control engineering, etc [33]. Recently,
some contributions have appeared in the field of water management, e.g. [34]
and [35] for groundwater modeling, [36] for tsunami forecasting and [37] for
fluid control.
64 Chapter 4. Reduced models in MPC controlling water quantity & quality

Model reduction can be either data driven, building a model by fitting the
data through a machine learning process, or model driven, using a mathe-
matical model, to calculate the reduced model [34]. Recently, Castelletti et
al. [93] [94] applied data-driven dynamic emulation modeling for the optimal
management of environmental systems. Proper Orthogonal Decomposition
(POD) is one of the most popular and widely applied model driven reduction
techniques to reduce the model order 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 extensive explanation of three POD meth-
ods: Karhunen-Loeve Decomposition (KLD), Singular Value Decomposition
(SVD), and Principal Component Analysis (PCA), and proves the equiva-
lence of these three methods. This chapter applies POD with a snapshot
method to generate the reduced state-space model for both water quantity
and quality.
The snapshot approach has already been applied by several researchers, such
as [37], [41] and [36]. The approach takes snapshots of an off-line simula-
tion model and forms a two-point spatial correlation (kernel) matrix. Each
snapshot is a column vector containing states, which are the water level and
concentrations deviations from their targets, in a combined water quantity
and quality model. Siade et al. [34] provides a method to select the optimal
snapshot set for a groundwater model. In our research, we try to take as
many snapshots as possible from the off-line simulation, in order to cover a
wide flow range. For example the range between 1 per 1000 year drought flow
and 1 per 1000 year flooding flow. Then the normal scenarios falling in this
range can rely on the reduced model generated by such a scenario. The time
step of the off-line simulation uses the control time step which is relatively
large, in the range of 2 minutes to 1 hour for real-time operation. The full
model is executed only once for generating the reduced model. Taking more
snapshots will not significantly increase the computation time.
Sirovich [66] pointed out that the basis functions are formed by taking the
most dominant eigenvectors of the kernel matrix, which are a linear combi-
nation of the snapshots:

M
X
i = ji zj (4.2)
j=1

where i is the ith eigenvector of the kernel matrix, zj is the j th snapshot,


M is the number of snapshots, and ji is a coefficient, which is selected from
4.3. Model predictive control of combined water quantity and quality 65

the eigenvector of the correlation matrix CR (M M dimension) [66]:

1 T
CRi,j = (z zj ) (4.3)
M i
Finally, the number of the basis functions in use is selected based on the m
dominant eigenvalues of the correlation matrix CR, and the combinations of
i forms the basis function matrix with a dimension of N m. Xu et al.
[78] analyzes the relationship between the reduced model accuracy and the
number of reduced states which were selected through trial-and-error.
Furthermore, snapshots can be taken of disturbances as well, when consid-
ering the disturbances as a vector. The same procedure as for the state
reduction can be used. Therefore, the original states xk and disturbances
dk become a function of the reduced states xkr and reduced disturbances
dkr , respectively, with respect to the basis function matrix 1 (N m1 ) and
2 (N m2 ):

xk = 1 xkr
(4.4)
dk = 2 dkr

The basis functions are formulated in such a way that the original vector and
the projected vector have the least square error [36]. When equation 4.4 is
substituted into the state-space model 2.8 on page 24, we obtain:

xk+1
r = Akr xkr + Bu,r
k
uk + Bd,r
k
dkr (4.5)

where Akr = T1 Ak 1 , Bu,r


k
= T1 Buk , Bd,r
k
= T1 Bdk 2 , 1 is orthogonal with
1 (T1 1 = I), 2 is orthogonal with 2 (T2 2 = I), and I is the identity
matrix. Akr has a dimension of m1 m1 , Bu,r k
is m1 nu , and Bd,rk
is m1 m2 .
If m1  N and m2  N , the model order is significantly reduced.

4.3 Model predictive control of combined wa-


ter quantity and quality

4.3.1 Optimization problem formulation

In the combined water quantity and quality control of open channel problems,
the most general goal is to keep both the water level and the concentration
66 Chapter 4. Reduced models in MPC controlling water quantity & quality

at the end of a canal to reach at their target values, with as few control flow
changes as possible. A quadratic objective function is normally formulated
in MPC in order to deal with both positive and negative deviations of the
variables [29]. An advantage of using a quadratic optimization formulation
with a linear model is the guarantee of a convex optimization problem and,
thus, a definite global optimum [31].
Besides these common goals, extra limitations are added to the objective.
First, when the water is clean, water quality control should be turned off;
Second, when the water level lies outside the maximum and minimum allowed
water level limits, water quantity control dominates and the only objective
then becomes bringing the water level back to the water level limit. These
two additional goals are achieved by adding soft constraints to the objective
function [29]. We first provide the minimization of the objective function in
equation 4.6 and then describe the soft constraints in detail later on.

nr X
X n1
J =P min { [(ek+j+1 T k+j+1
,i,l ) We,i e,i,l
ns n1
Qk+1
P
s=1 j=0 c,s i=1 j=0
(k+j+1) T (k+j+1)
+ (ek+j+1
,i,l e,i ) We,i,l e,i (ek+j+1
,i,l e,i )
(k+j+1) T (k+j+1)
+ (ek+j+1
c,i,l ec,i ) Wec,i (ek+j+1
c,i,l ec,i )
(k+j+1) T (k+j+1)
+ (e,i ) We,i e,i
(k+j+1) T (k+j+1)
+ (ec,i ) Wec,i ec,i ]
nr X
X n1
+ [(Qk+j T k+j
c,s ) WQc,s Qc,s ]}
i=1 j=0
(4.6)

k+j
+ Bdk+j dk+j
k+j+1

x = Ak+j xk+j + Buk+j uQ
e,i,min e(k+j+1) e,i,max

j = 0, , n 1

subject to:

e(k+j+1) 0 i = 1, , nr
k+j
Qc,s,min Qc,s Qc,s,min s = 1, , ns

where nr is the number of canal reaches, ns is the number of controlled


structures, n is the prediction horizon, e,i,l is the water level deviation from
the target value at the last discretization point of the ith reach, with We,i
as its weighting factor, e,i and ec,i are the virtual inputs for water level and
concentration at the reach necessary for the soft constraints, with We,i and
4.3. Model predictive control of combined water quantity and quality 67

Wec,i as their weighting factors, respectively, e,i,l e,i and ec,i,l ec,i are
the virtual states introduced as soft constraints, with We,i,l e,i and Wec,i as
their weighting factors, Qc,s is the change of control flow at sth structure
having a weighting factor of WQc,s . e,i,min and e,i,max are the minimum and
maximum allowed water level deviations of the ith reach, respectively, Qc,s,min
and Qc,s,min are the sth minimum and maximum allowed control flows. In the
model equality constraints over the prediction horizon, xk = [xk1 , , xknr ],
ukQ = [Qk+1 k+1 k k k
c,1 , , Qc,ns ] and d = [d1 , , dnr ]. Here the disturbance vector d
is supposed to be known or can be calculated from a prediction model.

The first limitation on water quality control is solved by introducing the vir-
tual variable ec,i over the prediction horizon. When the value of the water
quality parameter in a canal reach is higher than the target value, namely
ec,i,l > 0, the virtual variable should be set to zero to keep the water quality
control goal in the objective function. When ec,i,l 0, the water quality
control goal should be switched off, which is realized by setting ec,i = ec,i,l .
Therefore, the virtual variable changes within the prediction horizon accord-
ing to the water quality condition and the inequality constraint ec,i 0. The
change of the virtual variable ec,i is implemented by adding an extra term
(k+j+1) T (k+j+1)
(ec,i ) Wec,i ec,i to the objective function and setting its weighting
factor Wec,i to a value that is near zero, 1.0 1020 in this case. In such a
way, ec,i can be given any value in the optimization. This does not affect the
value of the added term itself but does influence the water quality control of
ec,i,l ec,i .

The second limitation of the upper and lower water level bounds is solved in
the same way as the water quality control by adding an extra term (ek+j+1
,i,l
(k+j+1) k+j+1 (k+j+1)
e,i )T We,i,l e,i (e,i,l e,i ) to the objective function. The only
difference is that the term (e,i,l ) We,i ek+j+1
k+j+1 T
,i,l for water quantity control
always remains active over the control horizon. The virtual variable e,i
is constrained between the bounds. The weighting factor on the virtual
variable e,i is also set to 1.0 1020 in order to allow the change of the
virtual variable. However, the weighting factor We,i,l e,i on the virtual state
(k+j+1)
ek+j+1
,i,l e,i is set to a large value, 1.0 1010 in this case, to avoid the
water level exceeding the maximum and minimum allowed limits. When the
water level stays within the bounds, the virtual state is always zero and does
not influence the control goal. When the water level exceeds the bounds, the
virtual state dominates the other control goals because of the large weighting
factor, bringing the water levels back within the bounds.
68 Chapter 4. Reduced models in MPC controlling water quantity & quality

4.3.2 Optimization problem formulation using reduced


model

Because the model used in MPC is the reduced model, the variables in the
original objective should be adapted to the reduced states. Therefore, the ob-
jective function is changed by substituting the reduced function of Equation
4.4 into the objective function:

nr X
X n1
J = Pn min { [(ek+j+1 T T k+j+1
,r,i,l ) (1 We,i 1 )e,r,i,l
s
P n1 k+1
s=1 j=0 Qc,s i=1 j=0
(k+j+1) T (k+j+1)
+ (ek+j+1
,i,l e,i ) We,i,l e,i (ek+j+1
,i,l e,i )
(k+j+1) T (k+j+1)
+ (ek+j+1
c,i,l ec,i ) Wec,i (ek+j+1
c,i,l ec,i )
(k+j+1) T (k+j+1) (k+j+1) T (k+j+1)
+ (e,i ) We,i e,i + (ec,i ) Wec,i ec,i ]
nr X
X n1
+ [(Qk+j T k+j
c,s ) WQc,s Qc,s ]}
i=1 j=0
(4.7)

k+j k+j k+j k+j


k+j+1
x = Ak+j
r x
k+j
+ Bu,r uQ + Bd,r d
r


(k+j+1)

e,i,min e e,i,max j = 0, , n 1
subject to:

e(k+j+1) 0 i = 1, , nr
k+j
Qc,s,min Qc,s Qc,s,min s = 1, , ns

k+j+1
where e,r,i,l is the reduced water level deviation from the target at the end
of the i reach at j th prediction step of control time step k.
th

In addition, one of the control objectives is to minimize the number of changes


in the flow as little as possible in order to save energy and reduce wear and
tear. Therefore, the control flow Qk+j+1 c,s in the model is split into Qk+j
c,s
k+j+1
and Qc,s , namely, Qk+j+1
c,s = Q k+j
c,s + Q k+j+1
c,s . The control variable is
k+j+1 k+j
the change of control flow Qc,s and Qc,s goes into the states. Moreover,
according to the control objectives, two soft constraints are introduced. Thus,
two virtual inputs and states are added to the prediction model. Finally, the
time-varying state-space model constraints in MPC become:
4.4. Test case 69


xrk+j+1 Ak+j B k+j
0 0 x k+j

r u,r r
k+j+1 k+j
uQ 0 1 0 0 u Q

= k+j

(k+j+1) k+j
ek+j+1 k+j k+j

e,i A,i,l 1 Bu,,i,l 0 0 e,i,l e,i

,i,l
k+j k+j
ek+j+1
c,i,l
(k+j+1)
ec,i Ac,i,l 1 Bu,c,i,l 0 0 ek+j k+j
c,i,l ec,i

k+j k+j
Bu,r 0 0
B
uk+j+1
Q
d,r
1 0 0 e(k+j) + k+j0
 
+ dk+j

k+j r
Bu,,i,l 1 0 ,i
(k+j) Bd,,i,l 2
k+j
Bu,c,i,l 0 1 ec,i k+j
Bd,c,i,l 2
(4.8)
k+j+1
where uQ is the vector of change of control flows: uk+j+1
Q = [Qk+j+1
c,1 , ,
k+j+1 T k
Qc,ns ] . Therefore, the control input vector u in equation 2.8 on page 24
becomes [(uk+1 T k k T
Q ) e,i e,i ] .

4.4 Test case


The test canal in this chapter is a virtual example of a polder system. It has 4
reaches with 5 structures controlling both water levels and concentrations at
the downstream side of each reach. The canal has a trapezoidal cross section.
The structures are four gates in series and one pump at the end of the canal.
All control structures have a maximum flow capacity of 1.2m3 /s. The first
gate can introduce clean water from a storage canal with a concentration
of 0.4kg/m3 . The schematic view is shown in Figure 2.6 on page 27 with
geometric parameters. The target values for both water quantity and quality
control are listed in Table 2.1 on page 26. Each of the reaches is discretized
into 100 spatial increments, so there are 800 states in total for both water
level and concentration states. The same number applies for the disturbances.
Optimizing such a complex model over 30 prediction steps in this case can
presently not be accomplished in an online setting.
Several laterals at each reach flow into the canal with different discharges and
concentrations. Their locations are presented in Table 2.2 on page 27.
The processes of the experiments include two steps as shown in Figure 4.1
Model Reduction block and Model Predictive Control block. Both steps
react on certain scenarios of lateral flow changes, as shown in Tables 4.1 and
4.2 for reduced model generation and verification, and Table 4.3 for MPC
test using the reduced model. For simplicity, a step change in all lateral
70 Chapter 4. Reduced models in MPC controlling water quantity & quality

discharges and concentrations is assumed for the three scenarios. However,


the three step changes are different in magnitude and happen at different time
instances and over different durations. In practice, lateral flow scenarios can
be produced by certain rainfall-runoff models and normally do not contain
step changes.
In the Model Reduction block of Figure 4.1, a feedback control (Propor-
tional Integral (PI) control) is used in an offline simulation to maintain the
downstream water level and concentration in each reach close to their tar-
get values. The most upstream gate is related to the highest concentration
among the reaches, and the other structures use upstream control on water
levels. The PI control is shown in Equation 4.9:

Qkc = Kp (ek ek1 ) + Ki ek (4.9)

where ek is the water level or concentration deviation from the target in


a reach at time step k, Kp and Ki are the proportional and integral gain
factors, which are selected by trial-and-error and shown in Table 4.4.
A decoupler introduced by [59], [13] is used between the gates, which adds the
downstream gate flow to the upstream gate for each canal reach in order to
avoid counteracting disturbances from local controllers between neighboring
reaches. The offline simulation takes 20 hours with a simulation time step of
4 minutes. At each step, a snapshot is taken in this case, thus 300 snapshots
in total. With the POD model reduction technique, the model is reduced
to 20 states in total (for both water levels and concentrations, no controlled
release and virtual states) and 30 disturbances. These values were found
with trial and error.
The Water System in Figure 4.1 is represented by the mathematical model
in Section 4.2.1. The test case was simulated for 20 hours with a simulation
time step of 1 minute. In the Model Predictive Control block of Figure 4.1,
the MPC has a control time step of 4 minutes with a prediction horizon of 2
hours. Note that this means that, during the simulation, MPC executes the
optimization over 2 hours at each 4 minute interval and implements only the
first control actions, which are kept constant in the simulation for 4 minutes.
In order to distinguish and analyze the interactive and non-interactive effects
between water quantity and quality control, the first experiment (Experiment
A) turns off the water quality control by setting up the weighting factor on
the water quality state to extremely small values. The second experiment
(Experiment B) switches on the water quality control and compares the con-
trol performance with the first experiment. The weighting factors in MPC
4.4. Test case

Table 4.1: Lateral flow scenario for reduced model generation (step changes happen between 8 and 10 hours of
simulation)
Lateral 1 Lateral 2 Lateral 3
Reach Discharge Concentration Discharge Concentration Discharge Concentration
(m3 /s) (kg/m3 ) (m3 /s) (kg/m3 ) (m3 /s) (kg/m3 )
1 0.02 to 0.08 1.0 to 1.6 0.03 to 0.09 1.2 to 1.8 No third lateral
2 0.02 to 0.08 1.2 to 1.8 0.03 to 0.09 1.4 to 2.0 No third lateral
3 0.04 to 0.10 0.9 to 1.5 0.02 to 0.08 1.5 to 2.1 0.03 to 0.09 1.8 to 2.4
4 0.02 to 0.08 1.5 to 2.1 0.04 to 0.10 1.0 to 1.6 No third lateral
71
Chapter 4. Reduced models in MPC controlling water quantity & quality

Table 4.2: Lateral flow scenario for reduced model verification (step changes happen between 5 and 8 hours of the
simulation)
Lateral 1 Lateral 2 Lateral 3
Reach Discharge Concentration Discharge Concentration Discharge Concentration
(m3 /s) (kg/m3 ) (m3 /s) (kg/m3 ) (m3 /s) (kg/m3 )
1 0.02 to 0.07 1.0 to 1.5 0.03 to 0.08 1.2 to 1.7 No third lateral
2 0.02 to 0.07 1.2 to 1.7 0.03 to 0.08 1.4 to 1.9 No third lateral
3 0.04 to 0.09 0.9 to 1.4 0.02 to 0.07 1.5 to 2.0 0.03 to 0.08 1.8 to 2.8
4 0.02 to 0.07 1.5 to 2.0 0.04 to 0.09 1.0 to 1.5 No third lateral
72
4.4. Test case

Table 4.3: Lateral flow scenario for testing the reduced model performance (step changes happen between 3 and 6
hours of the simulation)
Lateral 1 Lateral 2 Lateral 3
Reach Discharge Concentration Discharge Concentration Discharge Concentration
(m3 /s) (kg/m3 ) (m3 /s) (kg/m3 ) (m3 /s) (kg/m3 )
1 0.02 to 0.06 1.0 to 1.4 0.03 to 0.07 1.2 to 1.6 No third lateral
2 0.02 to 0.06 1.2 to 1.6 0.03 to 0.07 1.4 to 1.8 No third lateral
3 0.04 to 0.08 0.9 to 1.3 0.02 to 0.06 1.5 to 1.9 0.03 to 0.07 1.8 to 2.2
4 0.02 to 0.06 1.5 to 1.9 0.04 to 0.09 1.0 to 1.4 No third lateral
73
74 Chapter 4. Reduced models in MPC controlling water quantity & quality

Table 4.4: Gain factors of the PI control


Gate 1 Gate 2 Gate 3 Gate 4 Gate 5
Kp 4.5 4.5 4.5 4.5 4.5
Ki 0.05 0.45 0.45 0.45 0.45

are listed in Table 4.5.

Table 4.5: Weighting factors in MPC for all reaches and structures
1 2 3 4 5
1 1 1 1
We,i (0.2)2 (0.2)2 (0.2)2 (0.2)2
1 1 1 1
We,i,l e,i (1.0105 )2 (1.0105 )2 (1.0105 )2 (1.010 5 )2
1 1 1 1 1
Wec,i (A) (1.01010 )2 (1.01010 )2 (1.01010 )2 (1.01010 )2
2 1 1 1 1
Wec,i (B) (0.2)2 (0.2)2 (0.2)2 (0.2)2
1 1 1 1
We,i (1.01010 )2 (1.01010 )2 (1.01010 )2 (1.01010 )2
1 1 1 1
Wec,i (1.01010 )2 (1.01010 )2 (1.01010 )2 (1.01010 )2
1 1 1 1 1
WQc,s (0.02)2 (0.02)2 (0.02)2 (0.02)2 (0.02)2

The different control methods are tested in closed loop on the model of the
polder system that acts as real-world. In this off-line setting, it is possible
to simulate the Model Predictive Controller that uses the full model, but the
simulation time is much larger than real-time.

4.5 Results

This section presents the reduced model accuracy for both water quantity
and quality models, and the results of MPC control performance using the
reduced model. In order to demonstrate these two criteria, the reduced model
is compared with the full model. MPC using the reduced model is compared
with the MPC using the full model. All the model and control parameters
are set the same in the comparisons.

1
the values are used in water quantity control (A)
2
the values are used in combined water quantity and quality control (B)
4.5. Results 75

4.5.1 Reduced model performance

The reduced model is validated with a different lateral scenario and the per-
formance can be analyzed by projecting the reduced model states and distur-
bances back to the original order as illustrated in Figures 4.2 and 4.3.
Figure 4.2 (I and III) shows that the downstream water levels in all reaches
are well controlled at their targets with feedback control. The concentration
in the last reach is around the target while the concentrations in upstream
reaches are always below the targets because of the flushing. Figure 4.2
(II and IV) also demonstrates that water levels and concentrations between
the reduced model and the original model have a maximum difference in
the order of only 103 m and 102 kg/m3 , respectively. This means that the
reduced model is representative for the original model and can capture the
relevant system dynamics well. The same results occur in the disturbance
vector for both water quantity and quality, which has a maximum difference
in the order of 102 , as shown in Figure 4.3 (II and IV). However, each reach
has a different model error.
Another way to demonstrate model accuracy is to use the Root Mean Square
Error (RMSE), which describes the spread of the reduced model to the orig-
inal model. Figure 4.4 illustrates the RMSE of both water levels and con-
centrations. The results show a high accuracy of the reduced model on both
water quantity and quality, and they are consistent with the model compar-
isons in Figures 4.2 and 4.3.

4.5.2 MPC performance under the reduced model

The reduced model can approximate the full dynamic model with a validation
scenario according to the results in 5.1. It is expected that MPC will have a
good control performance using this reduced model. Figures 4.5 to 4.8 show
the closed-loop MPC performance for both Experiment A and Experiment
B in comparison with MPC using the full model. All the figures indicate the
advantage of anticipation in MPC using the prediction.

Water quantity control only

In Experiment A, there is only water quantity control. The concentrations


are uncontrolled and they are only a consequence of the water quantity con-
trol. Figure 4.5 shows the controlled water levels and the subsequent concen-
76 Chapter 4. Reduced models in MPC controlling water quantity & quality

Figure 4.2: Reduced water level states (I) and concentration states (III)
projected back to the original order, and the water level differences (II) and
concentration differences (IV) between the reduced model and the original
model
4.5. Results 77

Figure 4.3: Reduced water quantity disturbances (I) and quality disturbances
(III) projected back to the original order, and the water quantity disturbance
differences (II) and water quality disturbance differences (IV) between the
reduced model and the original model.
78 Chapter 4. Reduced models in MPC controlling water quantity & quality

Figure 4.4: Root mean square error of the reduced model on water quantity
and quality (interpolated scenario)

trations using both reduced and full models. The controlled water levels in
Figure 4.5 (I and III) show a decrease in all reaches before 180 minutes. This
is because of the prediction of the increase of lateral discharges, thus pre-
releasing occurs. The phenomenon is a result of the control flows in Figure
4.6, where the flows of downstream structures increase to release more water,
while the flows of upstream structures decrease to introduce less water. In
this way, extra space is created in the canal for the coming high flow.
Because each canal reach has a different model error, the influence on the
control performance is expected to be different. This difference is clearly
illustrated in Figure 4.5, where the water level deviations in (I) are widely
spread among the four reaches comparing to (III). However, the water levels
are well maintained and the steady-state condition is reached.

Combined water quantity and quality control

In Experiment B, water quality control is added to control both water level


and concentration at the downstream end of each reach. Figures 4.7 and 4.8
illustrate the control performance on water level, concentration and control
flow. All variables have similar trajectories compared to the water quantity
control in Experiment A but show different magnitudes.
The water levels in Figure 4.7 (I) also indicate the pre-releasing at the be-
ginning. After pre-releasing, the peak flows come from the laterals with
high discharges and concentrations. The upstream gate tries to reduce the
discharge in order to let lateral flows raise the water level to the target.
4.5. Results 79

Figure 4.5: Controlled water levels (I) and uncontrolled concentrations (II)
using the reduced model; controlled water levels (III) and uncontrolled con-
centrations (IV) using the full model (Experiment A)

However, this action will deteriorate the water quality and the water quality
control requires pumping out more polluted water and introducing clean wa-
ter. Therefore, the water level drops after rising to a certain level when the
water quality control dominates. When water quantity dominates again, the
controller tries to raise the water levels. This rotation of control dominance
causes the water level fluctuations. After 360 minutes, when lateral flows are
turned back to the original values, the control flows are still relatively high
as shown in Figure 4.8 and the water levels have a large drop due to the
gradual change of the control flows. This is the same phenomenon as found
in the results of water quality control. In the end, the system returns back
to the targets.
In Figure 4.8 (I), the control flows show a similar pattern as the water quan-
tity control in Figure 4.6 (I), but with larger magnitudes during the period
of lateral flow change. That is because of the added water quality control,
80 Chapter 4. Reduced models in MPC controlling water quantity & quality

Figure 4.6: Control flows (I) using the reduced model and (II) using the full
model (Experiment A)

which requires releasing more polluted water downstream and introducing


more relatively clean water upstream. Because of the large increase of the
downstream flows, the upstream flows can not decrease too much due to the
water quantity control. These controlled flows introduce more clean water
and lead to a relatively low concentration increase, especially in reaches 1
and 2 (comparing Figure 4.7 (II) with Figure 4.5 (II)). However, because
of the large amount of polluted lateral flow and because the concentration
difference among reaches are small, especially in reaches 3 and 4, the magni-
tude on reducing the concentration peak is limited. On the other hand, the
flushing process is faster in combined water quantity and quality control due
to the relatively larger flows, and water becomes clean a bit earlier compared
to the water quantity Experiment A.

When comparing the MPC results using two different models, we notice that
the control flows using the reduced model are smaller compared to those
using the full model in Figure 4.8, which indicates an underestimation of the
states in the reduced model. The high discharges of the full model result in a
faster flushing as shown in Figure 4.7 (II and IV). Moreover, the water level
deviations spread even more widely in Figure 4.7 (I) because of the added
water quality control, but they are still well controlled.

In Figure 4.8, it can be noticed that flow conditions at the end of the con-
trol experiments are different. The controlled discharges when using the full
model are larger than the initial steady state conditions and the concentra-
tion in the last reach is below the target value, which leads to over-flushing.
However, from a control perspective, the problem is solved properly by MPC
using both models. Figure 4.9 shows the objective function values of both
4.6. Discussions 81

Figure 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)

controllers. After 600 minutes, both objectives return to zero and the opti-
mization problem is solved. The reason of this over-flushing is due to the
switch-off of the water quality control when water is clean, while discharge
is still too high.

4.6 Discussions
Water quantity and quality are the two major objectives in this research.
They are formulated in a single objective function by assigning different
weighting factors to each objective. However, conflicts may easily exist
among the objectives. For example in Experiment B, water quantity con-
trol tries to decrease the control flow of the first gate because the lateral
inflows will raise the water level. However, from a water quality control
82 Chapter 4. Reduced models in MPC controlling water quantity & quality

Figure 4.8: Control flows (I) using the reduced model and (II) using the full
model (Experiment B)

point of view, more clean water needs to be introduced into the system,
because more polluted lateral inflows will deteriorate the water quality sit-
uation. Thus, the first gate flow should increase. The relative importance
of water quantity and quality control in the objective function decides the
increase or decrease of the control flows.

It can be noticed that the magnitudes of scenarios used for model verifica-
tion in Table 4.2 and MPC test in Table 4.3 are lower than the ones used
for reduced model generation in Table 3. This is intended to let the model
reduction scenario cover the entire flow range in the MPC test. In this case,
the snapshots taken in the off-line simulation of model reduction capture
the main flow dynamics. Appendix B illustrates a situation where the step
change of lateral flows is higher than the one used for the reduced model
generation. The results show that the difference between the reduced and
original model is around 10 times larger for both state and disturbance vec-
tors, when the same number of reduced states and disturbances are used.
This is due to the flow dynamics that are not captured in the snapshots.
Therefore, it is strongly recommended that the model reduction scenario
covers the flow and concentration ranges as widely as possible.

This chapter demonstrates the possibilities of controlling combined water


quantity and quality using a reduced model. In the test case the control
locations are selected at the downstream end of each reach. Attention is
needed when the system starts at zero flow and the water is clean and at
target. Because water transport takes time, the polluted lateral flow may
have already deteriorated the water quality too much before the pollution
reaches the downstream side and is detected by the controller. In this case,
4.7. Conclusions and future research 83

Figure 4.9: Objective function value of MPC using reduced and full models

the average water quality should be considered or the control point/sensor


should be located close to the most polluted lateral point.
Because of the differences in scenarios and locations of the control targets,
the comparison between this research and Xu et al. (2010a) is only addressed
in a qualitative manner. In both cases, the water system can be properly
controlled. However, in the present research, more complex water quantity
and quality models are applied in MPC using complex scenarios. Thanks to
the model reduction, the system can be controlled in real-time. In addition,
the location of the control target can be set more flexibly here due to the
spatial discretization.

4.7 Conclusions and future research

This chapter studies combined water quantity and quality control and pro-
vides a model reduction technique to implement complex high order models
in Model Predictive Control. The research demonstrates that the extension
of MPC to control both water quantity and quality control using complex
models is possible.
According to the comparison between the two experiments, water quantity
84 Chapter 4. Reduced models in MPC controlling water quantity & quality

and quality control may conflict. However, the optimization in MPC can deal
with the conflicts and finds the optimal solutions for all objectives. Thanks
to the prediction of the flow dynamics in MPC, the water system can respond
to the known water quantity and quality disturbances in advance and create
extra space for the upcoming problems.
Proper Orthogonal Decomposition is an efficient model reduction method
to reduce the model order for both water quantity and quality. From a
state-space model perspective, the number of states and disturbances can be
significantly reduced while maintaining high accuracy. Because the reduced
model can capture the main flow structure, it can be used as the prediction
model in MPC to reduce the computational time. With model reduction,
MPC could be run in real-time, whereas this was not possible with the full
model.
According to the discussion above, some future research can be performed.
1) The computation of Pareto fronts can be useful, in order to assess the
trade-off between water quantity and quality objectives. 2) In reality, there
are significant uncertainties in both data (lateral scenarios) and prediction
models used. It is worth to incorporate uncertainty analysis of real-world
applications and the adoption of robust MPC. 3) From an organization point
of view, it could be also interesting to split the optimization in two agents,
responsible for either water quantity or water quality management at different
locations. Instead solving the central problem at once, the two agents need
to collaborate in a distributed model predictive control configuration to come
to a global optimum.
Chapter 5

Model assessment in model


predictive control

Abstract

This chapter1 presents a comparison between linear and nonlinear model


predictive control. Model predictive control (MPC) is a model-based control
technique that uses an optimization algorithm to generate optimal control
actions. Based on the model used in optimization, MPC approaches can
be categorized as linear or nonlinear. Both classes have advantages and
disadvantages in terms of control accuracy and computational time. A typ-
ical linear model in open channel water management is the Integrator De-
lay (ID) model, while a nonlinear model usually refers to the Saint-Venant
equations. In earlier work, we proposed the use of linearized Saint-Venant
equations for MPC, where the model is formulated in a linear time-varying
format and time-varying parameters are estimated outside of the optimiza-
tion. Quadratic Programming (QP) is used to solve the optimization prob-
lem. However, the control accuracy of such an MPC scheme is not clear. In
this chapter, we compare this approach with an MPC scheme that uses Se-
quential Quadratic Programming (SQP) to solve the optimization problem.
Because the estimation of the time-varying parameters is integrated in the
optimization in SQP, the solutions from SQP-based MPC are expected to
be superior to the solutions of QP-based approach. However, SQP can be
computationally expensive. A simulation experiment illustrates that the QP-
based MPC approach using a linearized Saint-Venant model has an accurate

85
86 Chapter 5. Model assessment in model predictive control

approximation of the control performance of SQP.

5.1 Introduction

Over the last decade, model predictive control (MPC) of open channel flow
has been a subject of extensive study [95],[96],[29],[97],[98],[99]. MPC is a
model-based control technique that uses an optimization algorithm to gen-
erate optimal control actions. Advantages of MPC are that it predicts the
future system dynamics, therefore being able to take into account future
known disturbances. It can also deal with constraints within the optimiza-
tion. Based on the type of model used in the optimization, MPC approaches
can be categorized as linear or nonlinear. The focus of MPC in open channel
water management is mainly on efficient water delivery in irrigation systems,
and river operations for flood or drought prevention. A common feature of
the existing research is that, typically, linear models are used for predicting
the system dynamics, such as the reservoir model and the classical Integrator
Delay (ID) model in [95],[96],[29],[97],[98]. Under certain assumptions, these
linear models can approximate the nonlinear system dynamics well. The
MPC optimization problems when using such linear models are easy and fast
to solve. Moreover, guaranteed global optimal solutions can be found.
A nonlinear model can normally include more system dynamics than a linear
one. This extra information in the nonlinear model may increase the control
accuracy in MPC. However, due to the use of such a nonlinear model, the
optimization problem can become non-convex and hard to solve. Indeed,
this is the case when using the Saint-Venant equations. Theoretically, a
guarantee for finding the global optimum for nonlinear optimization can not
often be given [32]. Since the optimal action needs to be taken within a
prescribed time period in real-time control, computational time is important
in achieving the optimum. Unfortunately, such a nonlinear MPC scheme can
be very time consuming, e.g., due to the CPU-intensive model executions for
the numerical calculation of gradients of a Lagrangian function with respect
to the control variables, especially in the areas where these gradients are flat.
This computational complexity in MPC using such a nonlinear model was
also stated by Barjas Blanco in [99]. Therefore, they used a series of reservoir
models instead.
1
based on: Xu. M., Negenborn. R.R., van Overloop. P.J. and van de Giesen. N.C. De
Saint-Venant equations-based model predictive control of open channel flow. Advances in
Water Resources. Volume 49:37-45, 2012.
5.1. Introduction 87

Some researchers use adjoint sensitivity analysis to speed up the nonlinear


optimization by analytically calculating the gradients of the Lagrangian func-
tion with respect to the control variables [100],[101]. This is attractive for
making such an MPC implementation feasible in real-time control, but it
needs extensive analytical analysis of the nonlinear model and its derivatives
beforehand. Moreover, any change to the control problem requires a new
analytical derivation. For these reasons, the adjoint sensitivity analysis is
not conducted in this thesis. Instead, in [78], we proposed an MPC scheme
using linearized Saint-Venant equations in a time-varying format to approx-
imate the nonlinear dynamics. The scheme requires a much more complex
discretization and mathematical formulation of the equations than the reser-
voir model in [99]. This MPC scheme solves the optimization problem with
a standard Quadratic Programming (QP) solver, which considers the model
constraints as linear.
The MPC approach in [78] is found to be the most accurate for comparison
with MPC using an Integrator Delay model and a Reduced Saint-Venant
model. The proposed method formulates the Saint-Venant equations as a
linear time-varying state-space model. It uses a Forward Estimation to
estimate the time-varying parameters outside of the optimization, based on
the optimal solutions over a prediction horizon from the previous control
step. However, due to the lack of information at the last prediction step,
the optimal solutions in the previous control step are not optimal anymore
in the present step. Therefore, it is unclear what the performance of this
QP-based MPC controller is. The purpose of this work is to explore the
accuracy of the control procedure of [78] by comparing the results with an
MPC controller that formulates Sequential Quadratic Programming (SQP)
problems and solves the entire time-varying Saint-Venant equations within
the optimization. According to Schittkowski [102], SQP is a state-of-the-art
method for solving nonlinear programming problems. Here the MPC scheme
using this method is called SQP-based MPC.
In this Chapter, we focus on the performance assessment of the two MPC
schemes in terms of water level deviations from the target and the control
actions. Because of the integrated calculation of the time-varying parameters
within the optimization, the solutions from SQP-based MPC are expected
to be superior to the solutions of QP-based approach, given sufficient com-
putation time. It is the question how the two methods compare in terms of
computational time and control accuracy. Regarding the control accuracy,
the SQP-based MPC can be used as a benchmark. In addition, for the QP-
based MPC, iterations are added between the Forward Estimation and the
Quadratic Programming blocks, in order to compensate the influence of
88 Chapter 5. Model assessment in model predictive control

the lack of information at the last prediction step. Therefore, another goal
of this work is to investigate the significance of this influence.
This Chapter is organized as follows. Section 5.2 describes the main compo-
nents of MPC, including the open channel flow modeling and the optimization
problem formulation. It summarizes the QP-based MPC scheme using the
linearized Saint-Venant model and introduces the SQP-based MPC scheme.
Section 5.3 introduces the test case used to compare the control performance
between the two MPC schemes. A detailed demonstration of the results is
given in Section 5.4 and conclusions and future research are given in Section
5.5.

5.2 Model predictive control of open channel


flow
Model predictive control has a general structure which uses an internal model
to predict future system dynamics over a finite prediction horizon and solves
a constrained optimization problem with a certain optimization algorithm.
MPC uses online optimization, which means the optimization is conducted
at every control time step and only the first control action over the prediction
horizon is applied to the system. A typical MPC control problem in open
channel water management is to maintain a water level far downstream of a
control structure at the end of the canal reach. In the following sections, we
discuss the main components of MPC for such a system: internal model and
optimization.

5.2.1 Open channel flow model

In order to control the open channel flow with MPC, the dynamics of the
system need to be properly defined in the internal model of the controller.
Open channel flow dynamics is usually described by the Saint-Venant equa-
tions, which contain the mass and momentum conservations [89] shown in
Equations 2.1 on page 21 and 2.2 on page 21
According to Stelling and Duinmeijer [17], the Saint-Venant equations can be
spatially discretized with staggered grids. A semi-implicit scheme is applied
to the time integration, where the advection term in the momentum equation
is explicitly discretized by a first-order upwind method. The friction term is
linearized by using |Q| explicitly. All other terms are implicit. In this way,
5.2. Model predictive control of open channel flow 89

the Saint-Venant equations are linearized at every time step. Substituting


the velocities of step n + 1 from the discretized version of Equation 2.2 on
page 21 into Equation 2.1 on page 21, the water levels can be calculated
with a tri-diagonal system, and the velocities are updated with the calculated
water levels through the momentum Equation 2.2 on page 21. The detailed
discretization of the Saint-Venant equations can refer to Equation 3.5 on
page 42.
In general, there is no specific format for the model constraints in MPC.
However, in QP-based MPC, the internal model is usually formulated as a
linear state-space system. Due to the inter-connection between water levels
and velocities, the Saint-Venant equations are approximated by a linear state-
space model that is time-varying as shown in Equation 2.8 on page 24

5.2.2 Generic MPC formulation

Typically, an MPC problem in open channel water management solves the


minimization of a quadratic objective function, subject to linear or nonlinear
model equality constraints and linear inequality constraints on the control
inputs. The reason to use a quadratic objective function is to balance both
positive and negative variations of states and control inputs, such as water
level deviations from the target level and the change of controlled structure
flow. The formulation can then be written for a certain control time step
k:

n1
X n1
X
k k k+j+1 T k+j+1
min J(X , U ) = min { (x ) Wx x + (uk+j )T Wu uk+j }
X k ,U k X k ,U k
j=0 j=0
(5.1)

hi (X k , U k ) = 0 i = 1, , me
subject to:
ri (X k , U k ) 0 i = 1, , mi

where J represents a quadratic objective function, X k+1 = [xk+1 , , xk+n ]T


and U k = [uk , , uk+n1 ]T are the states and control inputs over the pre-
diction horizon with a length of n, hi and ri are the ith equality and inequal-
ity constraints, respectively, me is the number of equality constraints, mi
is the number of inequality constraints, Wx and Wu are diagonal matrices
representing the weighting factors on the state x and the control input u,
respectively.
90 Chapter 5. Model assessment in model predictive control

In open channel flow system, typically the state xk+j+1 = k+j+1 t is the
water level deviation from the target level (t ) and the control input uk+j =
Qk+j
c Qck+j1 is the change of structure flow, where Qc is the controlled
structure flow. The downstream water level of a canal reach is assumed
controlled, and Wx only penalizes the controlled water level deviation. The
equality constraints reflect the dynamics of the system, e.g. the Saint-Venant
equations in this case. The structure flow Qc is restricted typically between
the minimum and maximum flows of Qc,min and Qc,max as the inequality
constraints, namely Qc,min Qk+j c Qc,max . Note that both equality and
inequality constraints are over the prediction horizon n.
According to the type of model constraints, the obtained optimization prob-
lem can be solved with different solvers. For example, if the model constraints
are linear, Quadratic Programming (QP) can be use. If the model constraints
are nonlinear, Sequential Quadratic Programming (SQP) can be used. In this
chapter, Equation 2.8 on page 24 is a linear time-varying system with proper
discretization. It is a linear approximation of partial differential equations
at each time step with time-varying parameters. However, the equation is
actually nonlinear over a finite horizon, which exactly needs to be considered
in MPC as the internal model. In the following sections, we discuss two
methods to estimate the time-varying parameters in MPC.

5.2.3 QP-based model predictive control

QP-based MPC is intended to solve a quadratic optimization problem sub-


ject to linear constraints. Xu et al. [78] approximates the linear time-varying
Saint-Venant model over the prediction horizon as a linear model. Figure 5.1
shows the work flow of the QP-based MPC controlling a water system. In
this MPC scheme, the time-varying parameters of Ak , Buk and Bdk are calcu-
lated outside of the optimization solver and estimated through a Forward
Estimation procedure. Forward Estimation simulates the Saint-Venant
equations over a finite prediction horizon based on the previous optimal so-
lutions which, in this Chapter, are the optimal gate flows over the prediction
horizon.
However, due to the control step change from k 1 to k, the optimal flow of
the last prediction step is missing. Therefore, the optimal solutions at step
k 1 are not optimal any more at step k with the new system information
of the last prediction step. This lack of system information is severe for
the very first control step when no previous optimal solutions are available
at all. In order to handle this drawback and increase the control accuracy,
5.2. Model predictive control of open channel flow 91

iterations between the blocks of Forward Estimation and Quadratic Pro-


gramming can be included in the procedure. In practice, not all the water
levels are measured along a canal. Therefore, a standard Kalman filter [63]
is used to estimate the unmeasured water levels with a limited number of
measurements.

Figure 5.1: QP-based MPC controlling a water system

When the model Equation 2.8 on page 24 over a prediction horizon is sub-
stituted into the objective function 5.1 with calculated Ak , Buk and Bdk , the
optimization problem can be written as:

1
min J(U k ) = min[ (U k )T H k U k + (f k )T U k + gc ] (5.2)
Uk Uk 2

subject to: Qc,min Qk+j


c Qc,max j = 0, , n 1

where H is the Hessian matrix, f is the Jacobian matrix and gc is a constant


matrix.
92 Chapter 5. Model assessment in model predictive control

Because the constrained model is linear with pre-determined and fixed time
varying parameters of Ak , Buk and Bdk , the Hessian and the Jacobian can be
analytically calculated with one model run over the prediction horizon [29].
Therefore, there is no need for extra model executions for the gradient com-
paring to numerical calculation, which saves a large amount of computational
time, especially when iterations are used within the optimization. But the
MPC procedure does need (niter + 1) 2n model executions for the Forward
Estimation to estimate the time varying parameters and for the calculation
of the Hessian and Jacobian, where niter is the number of iterations between
the Forward Estimation and Quadratic Programming. The optimiza-
tion problem of Equation 5.2 is a typical quadratic programming problem,
which is in our case solved by the standard MATLAB function quadprog
[103].

5.2.4 SQP-based model predictive control

In the SQP-based MPC approach, a specific model format is not required.


However, because of the linear time-varying state-space model setup for the
QP-based MPC, this model setup is also applied in a SQP-based MPC
scheme. Figure 5.2 illustrates the work flow of an SQP-based MPC con-
trolling the same water system as in Section 5.2.3. Compared to QP-based
MPC, the QP-based MPC block in Figure 5.1 is replaced by SQP-based
MPC. In this scheme, the entire model over a finite prediction horizon is
integrated in a sequence of QP sub-problems, which are solved by a QP op-
timization solver until the objective function value converges. Because the
time-varying parameters are calculated internally in the optimization, the
solutions are guaranteed to be optimal.
In Sequential Quadratic Programming (SQP), the objective function is re-
quired to have a second order derivative and the constraints are required
to be continuously differentiable. SQP formulates a sequence of QP sub-
problems based on the Hessian approximation of the Lagrangian function by
taking the second order Taylor expansion of the Lagrangian function, and
uses an iterative way to solve the QP sub-problems. The MATLAB function
fmincon [103],[104],[105],[106] is used to solver the SQP problem. However,
for the sake of facilitation of explaining the number of model executions re-
quired, which is related to the computational time, we provide some relevant
equations of SQP.
SQP is based on the Lagrangian function shown in Equation 5.3 with the
Lagrange multipliers on the model constraints.
5.2. Model predictive control of open channel flow 93

Figure 5.2: SQP-based MPC controlling a water system

me
X mi
X
L(X k , U k , k , Mk ) = J(X k , U k ) + ki hi (X k , U k ) + Mki ri (X k , U k )
i=1 i=1
(5.3)
where L is the Lagrangian function, ki = [k+1
i , , k+n
i ] and Mki = [k+1
i ,
k+n
, i ] are the Lagrange multipliers.
The QP sub-problems at control step k are formulated according to Equation
5.4 by taking the second order Taylor expansion of the Lagrangian function.
The solutions of the QP sub-problems S are used to formulate the next
iteration until the objective function values converge.

1
min L(X k , U k , k , Mk ) = min[ (S k )T HL,p
k
S k +(fL,p
k T k k
) S +gL,p ] (5.4)
k k k
X ,U , ,M k S k 2


hi (Xp , Up ) + 5X hi (Xp , Up )s1 + 5U hi (Xp , Up )s2 = 0, i = 1, , me
subject to:
ri (Xp , Up ) + 5X ri (Xp , Up )s1 + 5U ri (Xp , Up )s2 0, i = 1, , mi

k
where HL,p is the Hessian matrix of the Lagrangian function at (Xpk , Upk ),
k
fL,p is the Jacobian matrix of the Lagrangian function at (Xpk , Upk ), gL,p is
94 Chapter 5. Model assessment in model predictive control

the constant matrix, S k is the search direction containing S1k = Xp+1k


Xpk
and S2k = Up+1
k
Upk . Note that the subscript p represents the iteration index
in SQP.
Because of the difficulty in analytically calculating the gradient of the La-
grangian function, a numerical method is often used to estimate the gradient
by executing the prediction model. Forward difference is one of the numerical
methods for the estimation by assuming a small perturbation on the state
or the control input, as described in Equation 5.5

Lxk+1 + Lxk+1 Lxk+2 + Lxk+2 Lxk+n + Lxpk+n


5X L(X k , U k , k , Mk ) = [ p p
, p p
, , p ]T

Luk + Lukp Luk+1 + Luk+1 Luk+n1 + Luk+n1
5U L(X k , U k , k , Mk ) = [ p , p p
, , p p
]T

(5.5)
The Lagrange multipliers in calculating the gradient of the Lagrangian func-
tion can be obtained through the Karush-Kuhn-Tucker (KKT) conditions
shown in Equation 5.6. KKT conditions are the first order necessary optimal-
ity conditions that need to be fulfilled for nonlinear optimization [107],[108].
It is obtained by taking the partial derivative of the Lagrangian function
with respect to X k ,U k ,k , and Mk .

5L(Xpk , Upk , kp , Mkp ) = 5X J(Xpk , Upk ) + 5U J(Xpk , Upk )


me
X Xmi
+ k k
i,p 5X hi (Xp , Up ) +k
Mki,p 5U ri (Xpk , Upk ) = 0
i=1 i=1 (5.6)
ki,p hi (Xpk , Upk ) = 0
Mki,p 0

In order to numerically calculate the Jacobian matrix of the Lagrangian


function, n model runs are required. These model runs include n(2n + 1)
runs to calculate the Lagrangian function values of Lxk+1 , , Lxk+n and
Luk , , Luk+n1 , and 2 n n additional runs to calculate the Lagrangian
function values with small perturbation on each of the variables of state X
and control input U , namely Lxk+1 + , , Lxk+n + and Luk + , , Luk+n1 + .
Because all the model variables over the prediction horizon in X and U are
dependent, a small perturbation on one variable will change the model con-
straints and influence all Lagrangian function values. Thus, the model needs
to be executed over the prediction horizon n for each small perturbation of
the 2n variables in order to calculate the Jacobian matrix.
5.3. Test case 95

For the Hessian matrix, Quasi-Newton method is used to calculate the Hes-
sian approximation. The BroydenFletcherGoldfarbShanno (BFGS) method
is one of the most popular algorithms to update the Hessian approximation
based on the Jacobian matrix [107]. Therefore, there is no need for extra
model executions to calculate the Hessian matrix of the Lagrangian func-
tion.
In total, n(2n + 1) model runs are required for each of the iterations in the
nonlinear optimization with the forward difference method.

5.3 Test case

In order to assess the performance of the QP-based MPC scheme using


the linearized Saint-Venant model in comparison with the SQP-based MPC
scheme, we will perform simulation experiments. Figure 3.1 describes a test
canal reach and includes all the geometric parameter values. In the test case,
we assume no lateral flows and try to control the downstream water level of
the canal reach at 3.2mM SL (mean sea level) by operating the downstream
gate with a maximum flow of 4m3 /s, given an upstream inflow disturbance.
Figure 3.3 on page 47 shows the inflow disturbance scenario, involving large
and frequent variations. The discharges are above the maximum downstream
gate flow in certain periods.
Two simulation experiments are setup to compare the QP-based and SQP-
based MPC schemes. Figures 5.3(a) and 5.3(b) show the procedures. In
experiment (a) (Figure 5.3(a)), both MPC schemes use the same informa-
tion from the water system, and only the optimal control actions from SQP-
based MPC are sent back to the water system. This experiment illustrates
the controllers behavior with different prediction models in terms of the cal-
culation of time-varying parameters. In experiment (b) (Figure 5.3(b)), both
QP-based MPC and SQP-based MPC form their own loops with the water
systems. The two water systems start from the same initial condition. This
experiment is intended to show the influence of the controllers on the total
water system loop. In addition, according to the QP-based MPC scheme
shown in Figure 5.1, different numbers of iterations are tested in each MPC
implementation, especially for the first control step when no previous control
information is available for calculating the time-varying parameters of the
state-space model.
Each experiment covers a simulation period of 20 hours with a simulation
96 Chapter 5. Model assessment in model predictive control

(a) Experiment of controller behavior

(b) Experiment of control influence on the water system

Figure 5.3: Two experiments

time step of 2 seconds. The gate is operated every 4 minutes using the optimal
control action. The reach is discretized in 500 segments, resulting in 500 wa-
ter level states. A Kalman filter is implemented to estimate the unmeasured
water levels and velocities as the initial condition of the model constraints
based on the measured water levels at the upstream and downstream side of
the reach (details of the Kalman filter are in [78]). The optimization problem
in this case is only subject to the Saint-Venant equations and there is only
one structure in control. Therefore, the number of equality constraints (me )
and the number of inequality constraints (mi ) both equal to 1.

5.4 Results

In this section, we perform the experiments described in the previous section


to assess the performance of the QP-based and SQP-based MPC schemes.
In addition, we will provide an analysis of the computational time require-
ments.
5.4. Results 97

5.4.1 Results of control performance

Experiment of controller behavior

Before starting experiment (a), it is necessary to analyze the convergence


of the objective function values of the QP-based MPC scheme using the
linearized Saint-Venant model, since iterations between the Forward Esti-
mation and QP solver are used to increase the model accuracy. Over
the iterations, the performance is expected to increase, as the unknown in-
formation from the previous optimization is updated. Figure 5.4 shows this
convergence of the objective function values at control steps 1, 13, 67, 115
and 193, where upstream inflows are above the maximum downstream con-
trol flow and the control limits may be reached. At these control steps, the
upstream inflows in the prediction also change significantly, as is illustrated
in Figure 3.3 on page 47. Note that the first objective function values in
Figure 5.4 are without iterations. It is clear that the objective function val-
ues converge after a certain number of iterations. But iterations only have
significant influence for the very first control step, while the influence on the
rest of the control steps is negligible. Figure 5.6 also shows the evolution of
predicted water levels and gate flows of QP-based MPC over 30 iterations
at the first control step. The evolution results are similar to Figure 5.4 and
show a fast convergence.

To compare the behavior of the controllers, the control goal of minimizing


the objective function values is analyzed. Figure 5.6 shows the results of
experiment (a). Because of the lack of previous optimal information in the
QP-based MPC scheme, especially at the very first control step, the figure
also plots the result of this MPC scheme with 10 iterations between the For-
ward Estimation and QP solver at the first control step. A maximum of
10 initial iterations is taken as tests showed that taking a larger number of
iterations does not alter the solutions any further (Figure 5.4). Figure 5.6
shows that SQP-based MPC has relatively low costs per control step over the
prediction horizon and outperforms the QP-based MPC in that sense. The
difference between the objective function values of the two MPC schemes
shows that the lack of information from the previous control step does in-
fluence control performance, especially for the first control step. Oscillations
occur due to the complete ignorance of the previous information at the be-
ginning. The influence vanishes quickly as the simulation proceeds. On the
other hand, the QP-based MPC can follow the SQP-based MPC performance
trajectory very well.
98 Chapter 5. Model assessment in model predictive control

Figure 5.4: Convergence of objective function values of the QP-based MPC


scheme at control steps 1, 13, 67, 115, and 193

Figure 5.5: Evolution of the predicted water levels and discharges of QP-
based MPC over 30 iterations at the first control step
5.4. Results 99

Figure 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)

Moreover, there is a maximum of only 14.39% difference in the objective


function values between SQP-based MPC and QP-based MPC with 10 initial
iterations, shown in Figure 5.7. The percentage is calculated by taking the
difference of their objective function values divided by the objective function
value of the SQP-based MPC scheme. The larger differences mainly happen
at the beginning of the simulation, where many flow constraints are acti-
vated, but no previous information is available as will be shown in Figure 5.9
later on. Although the control flow also reaches the constraints in the simu-
lation afterwards, for example at about 800 minutes shown in Figure 5.9, the
percentage difference between the two MPC schemes is small (< 5%) due to
the previously available information (at about control step 200).

Experiment of control influence on the water system

After assessing the behavior of the controllers in experiment (a), it is nec-


essary to analyze their control influence on the water systems over a full
simulation. Regarding the control performance, the first indicators are the
controlled water level and discharge evolution over the simulation horizon,
shown in Figures 5.8 and 5.9 for both MPC schemes, respectively. Both
100 Chapter 5. Model assessment in model predictive control

Figure 5.7: Percentage difference in objective function values between SQP-


based MPC and QP-based MPC with 10 initial iterations in experiment (a)

controllers can control the water levels very close to the target, and the sys-
tem behavior using these two controllers is very similar. The water level
oscillations that are visible in Figure 5.8 are realistic and caused by the dis-
crete steps that the controller takes every 4 minutes, while the flow dynamics
is simulated using a 2 second time interval. The maximum control flow of
4m3 /s is reached several times during the whole simulation as shown in Fig-
ure 5.9.

The performance of the controlled water levels and discharges can also be in-
dicated through quantitative performance indicators, such as the Maximum
Absolute Error (MAE) indicating the percentage of maximum water level
deviation from the target and the Integrated Absolute Discharge Change
(IAQ) calculated by the integral of the absolute flow changes over the simu-
lation minus the absolute flow difference of the first and last simulation steps
[67]. IAQ reflects the tear and wear of the gate over the whole simulation.
The comparison of the two MPC schemes using these indicators is shown in
Table 5.1. As can be seen, the differences in control performance between
the schemes are small. Due to the higher model accuracy, SQP-based MPC
has slightly lower values for the MAE and IAQ indicators, which indicates
slightly better performance.
5.4. Results 101

Figure 5.8: Controlled water levels in SQP-based MPC and QP-based MPC
without iterations

Figure 5.9: Controlled discharge in SQP-based MPC and QP-based MPC


without iterations (Upstream inflow is plotted to indicate the downstream
flow trends)
102 Chapter 5. Model assessment in model predictive control

Table 5.1: Performance indicators of both SQP-based MPC and QP-based


MPC
Maximum Absolute Value Integrated Absolute Discharge
(MAE) (%) Change (IAQ) (m3 /s)
SQP-based MPC -0.55 13.52
QP-based MPC -0.60 13.55

5.4.2 Results of computational time

Computational time is important for real-time control implementation. Be-


fore the next control time step is reached, the optimization results should be
available. Table 5.2 shows the computational time of different components in
both MPC executions. According to the MPC procedures in Figures 5.1 and
5.2, the total time per control step represents the average computational
time from water system to water system through Kalman filter and
MPC block. The control time is the specific time for the control gener-
ation in MPC block. The model calls in control represents the time of
model simulations within the MPC block. For QP-based MPC, the model
calls in control includes the time of calling the model in the Forward Esti-
mation and the controller, while for SQP-based MPC it is the time of calling
the model in the SQP optimization. The calculation of both MPC schemes
was on a 64-bit computer with an 8 Gb internal memory.

Table 5.2: Computational time components in both QP-based MPC and


SQP-based MPC executions
SQP-based MPC QP-based MPC
Total time per control step (s) 1761.25 54.39
Control time (s) 1750.14 44.40
Model calls in control (s) 1748.44 2.48

From Table 5.2, it follows that 99.37% of the total computational time in
SQP-based MPC is used to generate the control actions, while 99.9% of the
control actions calculation time is spent on the model executions within the
optimization. This illustrates the importance for reducing the total number
of model executions and speeding up the model computations. It is noted
that the control time and the model calls in control do not include the
time of Kalman filtering.
Moreover, there exist large computational time differences between the two
MPC executions. Since the actual control time step is 4 minutes, the table
5.4. Results 103

indicates that the optimization time of SQP-based MPC is unacceptable in


this case, while the implementation of QP-based MPC is possible and 2 or 3
iterations can even be allowed. The time of model calls in control is not the
major time consumption in QP-based MPC and most of the computational
time is spent on the large matrix multiplications in order to build up the
Hessian and Jacobian over the prediction, according to Xu et al. [78].

Because model calling takes most of the computational time in SQP-based


MPC, it is interesting to analyze the number of model executions. Table
5.3 compares the number of model executions per control step of the two
MPC schemes, which is a function of the number of iterations niter and the
prediction horizon n. For the QP-based MPC, niter is the number of iterations
between the Forward Estimation and Quadratic Programming blocks.
For SQP-based MPC, the number of iterations per control step is taken as
an average number of iterations over the full control steps (niter ).

Table 5.3: Number of model executions per control step in linear and non-
linear MPC
QP-based MPC SQP-based MPC
No iteration niter iterations -
Number of
model executions 2n (niter + 1) 2n n(2n + 1) niter
per control step

It should be noticed that the model execution in QP-based MPC only occurs
in the Forward Estimation and preparation of Hessian and Jacobian matri-
ces buildup over the prediction horizon. Therefore, the number of executions
increases linearly with the number of iterations between the Forward Esti-
mation and Quadratic Programming. Because the Hessian and Jacobian
matrices are pre-calculated, there is no need to execute the model within the
QP optimization, although QP iteratively solves the optimization problem.
Figure 5.10 shows the number of iterations used in the SQP in SQP-based
MPC. There are niter = 45.86 iterations per control step on average, and
every iteration requires n(2n + 1) model calls to calculate the Hessian ap-
proximation and the Jacobian matrices. For that reason, the computational
difference between the two MPC schemes is significant.
104 Chapter 5. Model assessment in model predictive control

Figure 5.10: Number of iterations used in SQP optimization

5.5 Conclusions and future research

In this Chapter, a comparison has been made between QP-based and SQP-
based MPC schemes for control of open channel flow that can be described by
1-dimensional Saint-Venant equations. Two experiments were conducted for
testing the behaviors of controllers and their influence on the water systems.
Both MPC schemes presented in this chapter can control the water system
very well. Due to the integrated calculation of the time-varying parameters
of the Saint-Venant equations, a more accurate prediction model is achieved
in SQP-based MPC. Furthermore, SQP-based MPC achieves slightly better
control performance regarding the minimization of the objective function.
SQP-based MPC is more computationally expensive. The QP-based MPC
using the linearized Saint-Venant equations was tested in a single canal reach
in this research. However, in general, as the complexity of the problem
increases, the computational time will increase accordingly when the same
model accuracy (spatial discretization) is reached.

In QP-based MPC using linearized Saint-Venant model, iterations between


the Forward Estimation and Quadratic Programming can improve the
control results. The improvement is only significant at the very first con-
trol step, when there is no previous optimal information at all and many
constraints are active. The influence of this lack of previous optimal infor-
5.5. Conclusions and future research 105

mation dies out quickly as the simulation proceeds and the control results
converge fast over the iterations. As a benchmark for control performance,
the results of SQP-based MPC show that the procedure of QP-based MPC
with the Forward Estimation is an effective and efficient way to deal with
nonlinearity of the model constraints.
This chapter also provides an interesting finding that model executions take
99.9% of the control time in the optimization of SQP-based MPC. This sug-
gests a working direction for SQP-based MPC in the future regarding reduc-
ing the total number of model executions and speeding up the model calcula-
tions, for example, the adjoint method. In addition, switching all the calcu-
lations to low level programming will also decrease the computational time
significantly, since the matrix inverse in the model calculation takes much
time. Because of the non-convexity of the optimization, there is no guaran-
tee of global optimum in nonlinear optimization. Once the computational
burden of SQP-based MPC optimization is conquered, a multi-start method,
a number of SQP-based MPC executions with multiple initial values, can be
implemented to increase the chance of reaching the global optimum.
More practically, another future research direction regarding MPC is to an-
alyze the influence of future uncertainty on the proposed QP-based MPC
procedure. For example, what is predicted in the previous step does not hap-
pen or what is not predicted in the previous step does happen, etc. Unlike
the theoretical work in this Chapter, which assumes perfect predictions, real
world implementations have to deal with these changing predictions.
106 Chapter 5. Model assessment in model predictive control
Chapter 6

Conclusions and future


research

In this thesis, real-time control of combined surface water quantity and qual-
ity was studied. As a test case, a polder system was considered where, due
to deteriorating water quality, the canals need to be flushed. Both feed-
back control and model predictive control (MPC) were designed to control
the flushing procedure. The thesis focuses on the implementation of MPC,
because of its advantage of prediction and constraint handling which leads
to better operation. Model Predictive Control proved to be a much larger
challenge due to the heavy computation, which can be a barrier for real-time
implementation. The control performance of MPC using different simplified
internal models was analyzed and a model reduction method to balance the
control effectiveness and the computation time in MPC was proposed. The
main research questions as stated in the introduction were answered and the
main findings and future research are summarized in this chapter.

6.1 Conclusions
1. In this thesis, both simple and complex models applied in MPC were
studied controlling both in water quantity and quality. For flow mod-
elling, commonly the Integrator Delay model suffices. For polders and
irrigation canals, the flow changes are small over the prediction hori-
zon which allows for such a linear model. An accurate model is needed
for river operation, because river discharges vary significantly. There-
fore, the Saint-Venant model is required to achieve sufficient accuracy.

107
108 Chapter 6. Conclusions and future research

This thesis mainly focuses on the Saint-Venant model and proposes a


reduced Saint-Venant model for MPC.
2. Combined surface water quantity and quality control is possible. Both
feedback control and MPC can control the water system very well,
yet the control performance is different. Because of the prediction
used in MPC, this MPC controller can take actions in advance while
feedback control waits until the deviation from the target happens.
This is important in flood control or polder flushing where limits of
operations are narrow.
3. Different models can be used as prediction models in MPC. Different
model accuracy and complexity lead to different control performance.
Essentially, control effectiveness and computation time of the model
needs to be properly balanced.
4. Proper Orthogonal Decomposition (POD) is an efficient method to pro-
duce a reduced model that contains less number of states, yet still be
accurate enough for control purposes. It runs an offline simulation to
generate model snapshots, which are used to formulate basis functions.
As long as enough snapshots are used in a simulation with wide flow
ranges, the coherent flow structures can be captured. POD can be used
on either linear or nonlinear models, which makes it perfect to reduce
the order of the discretized Saint-Venant equations.
5. The reduced Saint-Venant model has a low order of states, reducing the
large matrix operation time within MPC. Accordingly, the computation
time of MPC is significantly reduced. Because the main flow charac-
teristics are captured by the reduced model, the control effectiveness
remains very high.
6. The proposed MPC scheme with the Forward Estimation procedure
linearizes the Saint-Venant equations at every time step. This lin-
earized time-varying model transforms the nonlinear MPC to linear
MPC and changes the nonlinear programming to standard quadratic
programming which can be solved in a straightforward and fast way.
7. Iterations can be included in the proposed MPC procedure between
the Forward Estimation and the MPC optimization. They increase
the control accuracy when the prediction is uncertain. Otherwise, the
influence of iterations is insignificant.
8. SQP is often used to solve a nonlinear optimization by formulating a
sequence of quadratic programming sub-problems. Although it is in-
6.2. Future research 109

teresting to study this method applied to nonlinear MPC under the


constraint of a nonlinear model, the numerical calculation of the gra-
dient of the Lagrangian function can be extremely time consuming.

6.2 Future research

Data and sensors

1. In this thesis, all the measurements for water quantity and quality
variables are assumed to be measurable at a prescribed control inter-
val. Water quantity variables, such as water levels or flows, can be
easily measured and many implementations of these measurements are
available. However, water quality measurements in real-time are much
more difficult in practical implementation, especially for certain sub-
stances, e.g. nitrate, PH. This difficulty needs to be taken into account
for real-time control of water quantity. A focus towards real-time mea-
surements of water quality variables is recommended.
2. The research in this thesis is based on deterministic MPC and all the
study cases assume perfect predictions for MPC. However, this is usu-
ally not valid in reality and uncertainty needs to be considered, for
example in the input data and the prediction model itself. Ensemble
predictions such as [109] [110] are required to cope with the uncertainty,
and the combination of MPC with uncertain predictions needs further
research.

Controller structure

1. For the polder flushing case, applying a water network instead of a canal
will make the test more challenging. It will be difficult for feedback
control to control both water quantity and quality. MPC, using the
network model, will still be able to find sensible control solutions.

Optimization issues

1. In combined water quantity and quality control, a single objective func-


tion is formulated for both water quantity and quality variables, to-
110 Chapter 6. Conclusions and future research

gether with the change of structure flow. The relative importance of


each target is tuned by setting different weighting factors of the con-
trol variables. However, in order to assess the trade-off between water
quantity and quality objectives, the computation of Pareto fronts can
be useful.
2. Optimization is one of the key elements in MPC. Thus, it can be in-
teresting to study better optimization for non-linear problems and to
better understand the topography of the objective function. It is also
worthwhile to understand if a global minimum is really needed or if, as
is the case with the traveling salesman problem, a good local minimum
would be sufficient as well.

Computation methods

1. The execution of the Saint-Venant model in MPC programmed in Mat-


lab takes most of the computational time. Therefore, it is interesting
to switch the code to a low level programming language, such as FOR-
TRAN or C. This will reduce the computational time significantly. In
addition, the tests in Chapters 3 and 5 are conducted on a single canal
reach. When dealing with large-scale systems, it is important to ana-
lyze the increase of computation time as the model calculations increase
significantly.
2. Since model reduction techniques are very powerful to reduce the model
order, it is useful to apply the technique to 3-dimensional models, where
computation time is usually a problem in real-time operation, especially
applying such models in MPC. A potential application is to model
and control salt water intrusion, which is a hot issue in Delta areas,
e.g. the Marina Bay in Singapore and the Haringvliet sluices in the
Netherlands. Figure 6.1 shows a schematic view of MPC controlling
both water quantity and quality using reduced models in 1-dimension
or 3-dimension.
6.2. Future research 111

Figure 6.1: Schematic view of MPC controlling both surface water quantity
and quality using reduced models
112 Chapter 6. Conclusions and future research
Bibliography

[1] Ward. D.R. Water Wars: Drought, Flood, Folly and the Politics of
Thirst. Riverhead Hardcover, first edition, 2002.
[2] Zhang. Q. and Gao. G. The spatial and temporal features of drought
and flood disasters in the past 50 years and monitoring and warning
services in China. Science & Technology Review, 7, 2004.
[3] Coward. E.W. Irrigation and agricultural development in Asia: Per-
spectives from the social sciencest. Cornell Univ Pr, 1980.
[4] Rao. NH, Sarma. PBS, and Chander. S. Irrigation scheduling under a
limited water supply. Agricultural Water Management, 15(2):165175,
1988.
[5] Sperna Weiland. F. Hydrological Impacts on Climite Change. Utrecht
Studies in Earth Sciences, 2011.
[6] Warmer. H. and van Dokkum. R. Water pollution control in the Nether-
lands. Policy and Practice. RIZA report, 2002.
[7] Xu. M., van Overloop. P.J., and van de Giesen. N.C. Model selection
for salt water intrusion in delta areas. In 25th ICID European Regional
Conference, pages Paper II17, May. 2011.
[8] 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):869878, 2010.
[9] Fontane. D. G., Labadie. J. W., and Loftis. B. Optimal control of reser-
voir discharge quality through selective withdrawal. Water Resources
Research, 17(6):15941602, 1981.
[10] Cembrano. G., Quevedo. J., Salamero. M., Puig. V., Figueras. J., and
Marti. J. Optimal control of urban drainage systems. A cases tudy.
Control Engineering Practice, 12(1):19, 2004.

113
114 Bibliography

[11] Schuurmans. J., Bosgra. O.H., and Brouwer. R. Open-channel flow


model approximation for controller design. Applied Mathematical Mod-
elling, 19(9):525530, 1995.

[12] Litrico. X. and Fromion. V. Simplified modeling of irrigation canals


for controller design. Journal of Irrigation and Drainage Engineering,
130(5), 2004.

[13] Schuurmans. J., Hof. A., Dijkstra. S., Bosgra. O.H., and Brouwer. R.
Simple water level controller for irrigation and drainage canals. Journal
of Irrigation and Drainage Engineering, 125(4):189195, 1999.

[14] Wahlin. B.T. and Clemmens. A.J. Automatic downstream water-level


feedback control of branching canal networks: theory. Journal of Irri-
gation and Drainage Engineering, 132(3):198207, 2006.

[15] Courant.R., Friedrichs. K., and Lew. H. On the partial difference equa-
tions of mathematical physics. IBM Journal of Research and Develop-
ment, 11(2):215234, 1967.

[16] Lyn. D.A. and Goodwin. P. Stability of general Preissmann scheme.


Journal of Hydraulic Engineering, 113(1):1628, 1987.

[17] Stelling. G.S. and Duinmeijer. S.P.A. A staggered conservative scheme


for every Froude number in rapidly varied shallow water flows. Inter-
national Journal for Numerical Methods in Fluids, 43(12):13291354,
2003.

[18] van der Vegt. JJW and De Boom. WC. Numerical simulation of flow
around circular cylinders at high reynolds numbers. In Behaviour of
offshore structures: proceedings of the 4th International Conference on
Behaviour of Offshore Structures (BOSS85), pages 227238, Jul. 1985.

[19] Dewey. H.G. and Madsen. W.R. Flow control and transients in the
California aqueduct. Journal of Irrigation and Drainage Engineering
Division, 120(HY3), 1976.

[20] Bodely. W.E. and Wylie. E.B. Control of transients in series channels
with gates. Journal of Hydraulics Division, 104(HY10), 1978.

[21] Buyalski. C.P. Automatic downstream control of the corning canal


check gates by the el-flo plus reset control system. In U.S./U.S.S.R
Symposium on Automation and Remote Control of Water Resources
Systems, Frunze, U.S.S.R, May. 1979.
Bibliography 115

[22] Buyalski. C.P. Automatic upstream control system for canals. In 8th
Technical Conference, U.S. Commission on Irrigation, Drainage, and
Flood Control, Phoenix, Arizona, Sept. 1979.
[23] Stedinger. J.R., Sule. B.F., and Loucks. D.P. Stochastic dynamic
programming models for reservoir operation optimization. Water Re-
sources Research, 20(11):14991505, 1984.
[24] Chang. L.C. and Chang. F.J. Intelligent control for modelling of
real-time reservoir operation. Hydrological Processes, 15(9):16211634,
2001.
[25] Burt. C.M., Mills. R.S., Khalsa. R.D., and Ruiz. VC. Improved
Proportional-Integral (PI) logic for canal automation. Journal of Irri-
gation and Drainage Engineering, 124(1):5357, 1998.
[26] Litrico. X. and Fromion. V. Design of structured multivariable con-
trollers for irrigation canals. In 44th IEEE Conference on Decision
and Control, the European Control Conference, pages 18811886, Dec.
2005.
[27] van Overloop. P.J., Schuurmans. J., Brouwer. R., and Burt. C.M.
Multiple-model optimization of proportional integral controllers on
canals. Journal of Irrigation and Drainage Engineering, 131(2):190
196, 2005.
[28] Malaterre. P.O., Rogers. D.C., and Schuurmans. J. Classification of
canal control algorithms. Journal of Irrigation and Drainage Engi-
neering, 124(1):310, 1998.
[29] van Overloop. P.J. Model Predictive Control on Open Water Systems.
IOS Press, 2006.
[30] Garcia. C.E., Prett. D.M., and Morari. M. Model predictive control:
theory and practice a survey. Automatica, 25(3):335348, 1989.
[31] Leigh. J.R. Control Theory. The Institution of Electrical Engineers,
second edition, 2004.
[32] Camacho. E. and Bordons. C. Nonlinear model predictive control: an
introductory review. Assessment and Future Directions of Nonlinear
Model Predictive Control, 358(1):116, 2007.
[33] Holmes. P., Lumley. J.L., and Berkooz. G. Turbulence, Coherent Struc-
tures, Dynamical Systems and Symmetry. Cambridge University Press,
1998.
116 Bibliography

[34] Siade. A.J., Putti. M., and Yeh. W.W.G. Snapshot selection for ground-
water model reduction using proper orthogonal decomposition. Water
Resources Research, 46(8):W08539, 2010.
[35] Winton. C., Pettway. J., Kelley. C., Howington. S., and Eslinger. O.J.
Application of Proper Orthogonal Decomposition (POD) to inverse
problems in saturated groundwater flow. Advances in Water Resources,
34(12):15191526, 2011.
[36] Ha. D.M., Tkalich. P., and Chan. E.S. Tsunami forecasting using
proper orthogonal decomposition method. Journal of Geophysical
Research-Oceans, 113(C6):C06019, 2008.
[37] Ravindran. S.S. A reduced-order approach for optimal control of flu-
ids using proper orthogonal decomposition. International Journal for
Numerical Methods in Fluids, 34(5):425448, 2000.
[38] Hinze. M. and Volkwein. S. Proper orthogonal decomposition surrogate
models for nonlinear dynamical systems: error estimates and subopti-
mal control. Dimension Reduction of Large-Scale Systems, 45(1):261
306, 2005.
[39] Chen. G., Li. Y., and Yan. G. A nonlinear pod reduced order model
for limit cycle oscillation prediction. SCIENCE CHINA Physics, Me-
chanics & Astronomy, 53(7):13251332, 2010.
[40] Liang. Y.C., Lee. H.P., Lim. S.P., Lin. W.Z., Lee. K.H., and Wu. C.G.
Proper orthogonal decomposition and its applications - part i: theory.
Journal of Sound and Vibration, 252(3):527544, 2002.
[41] Ha. D.M., Lim. K.M., Khoo. B.C., and Willcox. K. Real-time opti-
mization using proper orthogonal decomposition: Free surface shape
prediction due to underwater bubble dynamics. Computers & Fluids,
36(3).
[42] Litrico. X. and Fromion. V. H control of an irrigation canal pool with
a mixed control politics. In Control Systems Technology, IEEE Trans-
actions on, pages 99111, Jan. 2006.
[43] Breur. K.J., van Leeuwen. P., and Dellaert. N.P. Deriving discharge
strategies to reduce cso in urban drainage systems. Water Science and
Technology, 36(8):259263, 1997.
[44] Petruck. A., Cassar. A., and Dettmar. J. Advanced real time control of
a combined sewer system. Water Science and Technology, 37(1):319
326, 1997.
Bibliography 117

[45] Vanrolleghem. P.A., Benedetti. L., and Meirlaen. J. Modelling and real-
time control of the integrated urban wastewater system. Environmental
Modelling & Software, 20(4):427442, 2005.
[46] Cox. B.A. A review of currently available in-stream water quality mod-
els and their applicability for simulating dissolved oxygen in lowland
rivers. Science of the Total Environment, 314:335377, 2003.
[47] Elshorbagy. A. and Ormsbee. L. Object-oriented modeling approach
to surface water quality management. Journal of Environmental Engi-
neering, 21(5):689698, 2006.
[48] Lobbrecht. A.H., Sinke. M.D., and Bouma. S.B. Dynamic control of
the Delfland polders and storage basin, the Netherlands. Water Science
and Technology, 39(4):269279, 1999.
[49] Glasgow. H.B., Burkholder. J.A.M., Reed. R.E., Lewitus. A.J., and
Kleinman. J.E. Real-time remote monitoring of water quality: a review
of current applications, and advancements in sensor, telemetry, and
computing technologies. Journal of Experimental Marine Biology and
Ecology, 300(1-2):409448, 2004.
[50] Johnson. K.S. and Coletti. L.J. In situ ultraviolet spectrophotometry
for high resolution and long-term monitoring of nitrate, bromide and
bisulfide in the ocean. Deep-Sea Research Part I, 49(7):12911305,
2002.
[51] Camacho. E.F. and Bordons. C. Model Predictive Control. Springer,
second edition, 2004.
[52] Fischer. H.B. Mixing in Inland and Coastal Waters. Academic Press,
second edition, 1979.
[53] Versteeg. H.K. and Malalasekera. W. An Introduction to Computa-
tional Fluid Dynamics: The Finite Volume Method. Longman Scientific
& Technical, 1995.
[54] Bolea. Y., Puig. V., and Blesa. J. Gain-scheduled Smith proportional-
integral derivative controllers for linear parameter varying first-order
plus time-varying delay systems. Control Theory & Applications, IET,
5(18):21422155, 2011.
[55] Tornil-Sin. S., Ocampo-Martinez. C., Puig. V., and Escobet. T. Ro-
bust fault detection of non-linear systems using set-membership state
estimation based on constraint satisfaction. Engineering Applications
of Artificial Intelligence, 25(1):110, 2012.
118 Bibliography

[56] Reddy. J.M., Dia. A., and Oussou. A. Design of control algorithm
for operation of irrigation canals. Journal of Irrigation and Drainage
Engineering, 118(6):852867, 1992.

[57] Durdu. O.F. Control of transient flow in irrigation canals using Lya-
punov fuzzy filter-based Gaussian regulator. International Journal for
Numerical Methods in Fluids, 50(4):491509, 2005.

[58] Thomann. R.V. and Mueller. J.A. Principles of Surface Water Quality
Modeling and Control. Harper & Row, Publishers, 1987.

[59] Schuurmans. J. Control of Water Levels in Open-channels. Delft Uni-


versity of Technology, the Netherlands, 1997.

[60] Ziegler. J.G. and Nichols. N.B. Optimum settings for automatic con-
trollers. Journal of Dynamic Systems, Measurement, and Control,
132(3):115220, 1993.

[61] Clemmens. A.J. and Schuurmans. J. Simple optimal downstream feed-


back canal controllers: theory. Journal of Irrigation and Drainage
Engineering, 130(1):2634, 2004.

[62] Xu. M. and van Overloop. P.J. On the application of model reduction
in model predictive control of open channel flow. In 9th International
Conference on Hydroinformatics, pages 21692177, Sept. 2010.

[63] Simon. D. Optimal State Estimation: Kalman, H Infinity, and Non-


linear Approaches. John Wiley & Sons, 2006.

[64] The MathWorks. MATLAB Users Guide. Natick, 1998.

[65] WL|Delft Hydraulic. Sobek User Guide and Technical Reference Man-
ual. 2004.

[66] L. Sirovic. Turbulence and the dynamics of coherent structures i: Co-


herent structures. ii: Symmetries and transformations. iii: Dynamics
and scaling. Quarterly of Applied Mathematics, 45(3):516590, 1987.

[67] A.J Clemmens, Kacerek. T.F., Grawitz. B., and Schuurmans. W. Test
cases for canal control algorithms. Journal of Irrigation and Drainage
Engineering, 124(1):2330, 1998.

[68] Kerachian. R. and Karamouz. M. A stochastic conflict resolution model


for water quality management in reservoir-river systems. Advances in
Water Resources, 30(4):866882, 2007.
Bibliography 119

[69] Dhar. A. and Datta. B. Optimal operation of reservoirs for downstream


water quality control using linked simulation optimization. Hydrological
Processes, 22(6):842853, 2008.
[70] Shirangi. E., Kerachian. R., and Bajestan. M.S. A simplified model for
reservoir operation considering the water quality issues: Application of
the Young conflict resolution theory. Environmental Monitoring and
Assessment, 146(1):7789, 2008.
[71] Chaves. P. and Kojiri. T. Deriving reservoir operational strategies
considering water quantity and quality objectives by stochastic fuzzy
neural networks. Advances in Water Resources, 30(5):13291341, 2007.
[72] Mujumdar. P. and Saxena. P. A stochastic dynamic programming
model for stream water quality management. Sadhana, 29(5):477497,
2004.
[73] Chaves. P., Tsukatani. T., and Kojiri. T. Operation of storage reser-
voir for water quality by using optimization and artificial intelligence
techniques. Mathematics and Computers in Simulation, 67(4):419432,
2004.
[74] van Overloop. P.J., Schuurmans. W., and Brouwer. R. Model predictive
control of canal systems in the netherlands. 2003.
[75] Negenborn. R.R., Lukszo. Z., and Hellendoorn. H. Intelligent Infras-
tructures. Springer, 2010.
[76] Litrico. X., Belaud. G., and Fovet. O. Adaptive control of algae de-
tachment in regulated canal networks. In Networking, Sensing and
Control (ICNSC), 2011 IEEE International Conference on, pages 197
202, Delft, the Netherlands, Apr. 2011.
[77] Augustijn. D.C.M., van den Berg. M., de Bruine. E., and Korving. H.
Dynamic control of salt intrusion in the mark-vliet river system, the
netherlands. Water Resource Management, 25(3):10051020, 2011.
[78] Xu. M., van Overloop. P.J., and van de Giesen. N.C. On the study
of control effectiveness and computational efficiency of reduced Saint-
Venant model in model predictive control. Advances in Water Re-
sources, 34(2):282290, 2010.
[79] Ratto. M., Castelletti. A., and Pagano. A. Emulation techniques for the
reduction and sensitivity analysis of complex environmental models.
Environmental Modelling & Software, 34:14, 2012.
120 Bibliography

[80] Razavi. S., Tolson. B.A., and Burn. D.H. Numerical assessment of
metamodelling strategies in computationally intensive optimization.
Environmental Modelling & Software, 34:6786, 2012.
[81] Castelletti. A., Galellib. S., Restellia. M., and Soncini-Sessaa. R. A
general framework for dynamic emulation modelling in environmental
problems. Environmental Modelling & Software, 34:518, 2012.
[82] Ratto. M. and Pagano. A. Using recursive algorithms for the efficient
identification of smoothing spline ANOVA models. Advances in Statis-
tical Analysis, 94:367388, 2010.
[83] Borgonovo. E., Castaings. W., and Tarantola. S. Model emulation and
moment-independent sensitivity analysis: An application to environ-
mental modelling. Environmental Modelling & Software, 34:105115,
2012.
[84] Pannocchia. G., Rawlings. J.B., and Wright. S.J. Partial enumeration
MPC: Robust stability results and application to an unstable CSTR.
Journal of Process Control, 21:14591466, 2011.
[85] Marruedo. D.L., Alamo. T., and Camacho. E.F. Input-to-state stable
MPC for constrained discrete-time nonlinear systems with bounded ad-
ditive uncertainties. In 41st IEEE Conference on Decision and Control,
pages 46194624, Las Vega, Nevada, USA, Dec. 2002.
[86] Pannocchia. G., Rawlings. J.B., and Wright. S.J. Conditions under
which suboptimal nonlinear MPC is inherently robust. System & Con-
trol Letters, 60:747755, 2011.
[87] Pannocchia. G., Rawlings. J.B., and Wright. S.J. Inherently robust
suboptimal nonlinear MPC: theory and application. In 50th IEEE
Conference on Decision and Control and European Control Conference
(CDC-ECC), pages 33983403, Orlando, FL, USA, Dec. 2011.
[88] Pannocchia. G., Rawlings. J.B., and Wright. S.J. Is suboptimal non-
linear MPC inherently robust? In 18th IFAC World Congress, pages
79817986, Milano, Italy, Aug.-Sept. 2011.
[89] Chow. V.T. Open-Channel Hydraulics. McGraw-Hill, Inc., New York,
1959.
[90] Lee. J.H., Lee. K.S., and Kim. W.C. Model-based iterative learning
control with a quadratic criterion for time-varying linear systems. Au-
tomatica, 35(5):641657, 2000.
Bibliography 121

[91] Falcone. P., Borrelli. F., Tseng. H.E., Asgari. J., and Hrovat. D. Lin-
ear time-varying model predictive control and its application to active
steering systems: Stability analysis and experimental validation. In-
ternational Journal of Robust and Nonlinear Control, 18(8):862875,
2008.

[92] Blanning. R.W. The construction and implementation of metamodels.


simulation, 24(6):177184, 1975.

[93] Castelletti. A., Galellib. S., Restellia. M., and Soncini-Sessaa. R. A


data-driven dynamic emulation modelling approach for the manage-
ment of large, distributed water resources systems. In 19th Interna-
tional Congress on Modelling and Simulation, pages 40084014, Perth,
Australia, Dec. 2011.

[94] Castelletti. A., Galellib. S., Restellia. M., and Soncini-Sessaa. R. Data-
driven dynamic emulation modelling for the optimal management of
environmental systems. Environmental Modelling & Software, 34:30
43, 2012.

[95] Wahlin. B.T. Performance of model predictive control on ASCE test


canal 1. Journal of Irrigation and Drainage Engineering, 130(3):227
238, 2004.

[96] Willems. P., Blanco. T.B., Chiang. P.K., Cauwenberghs. K., Berla-
mont. J., and De Moor. B. Evaluation of river flood regulation by
means of model predictive control. In 4th International Symposium
on Flood Defence: Managing Flood Risk, Reliability and Vulnerability,
pages 80.180.8, May. 2008.

[97] Rodellar. J., Gomez. M., and Bonet. L. Control method for on-demand
operation of open channel flow. Journal of Irrigation and Drainage
Engineering, 119(2):225241, 1993.

[98] Negenborn. R.R., van Overloop. P.J., Keviczky. T., and De Schutter.
B. Distributed model predictive control of irrigation canals. Networks
and Heterogeneous Media, 4(2):359380, 2009.

[99] Barjas Blanco. T., Willems. P., Chiang. P.K., Haverbeke. N., Berla-
mont. J., and De Moor. B. Flood regulation using nonlinear model
predictive control. Control Engineering Practice, 18(10):11471157,
2010.
122 Bibliography

[100] Ding. Y. and Wang. S.S.Y. Optimal control of open-channel flow us-
ing adjoint sensitivity analysis. Journal of Hydraulic Engineeringl,
132(11):12151228, 2006.
[101] Schwanenberg. D., Verhoeven. G., and Raso. L. Nonlinear model pre-
dictive of water resources systems in operational flood forecasting. In
9th International Conference on Hydroinformatics, pages 20142021,
Tianjin, China, Sept. 2010.
[102] Schittkowski. K. NLPQL: A FORTRAN subroutine solving constrained
nonlinear programming problems. Annals of Operations Research,
5(1):485500, 1986.
[103] Gill. P.E., Murray. W., and Wright. M.H. Practical Optimization. Aca-
demic Press, 1981.
[104] Han. S.P. A globally convergent method for nonlinear programming.
Journal of Optimization Theory and Applications, 22(3):297309, 1977.
[105] Powell. M.J.D. The convergence of variable metric methods for nonlin-
early constrained optimization calculations. Nonlinear Programming,
pages 2763, 1978.
[106] Powell. M.J.D. A fast algorithm for nonlinearly constrained optimiza-
tion calculations. Numerical Analysis, pages 144157, 1978.
[107] Bonnans. J.F., Gilbert. J.C., Lemarechal. C., and Sagastizbal. C.A.
Numerical Optimization: Theoretical and Practical Aspects. Springer-
Verlag New York, 2006.
[108] Sun. W. and Yuan. Y. Optimization Theory and Methods: Nonlinear
Programming. Springer, 2006.
[109] Raso. L., van de Giesen. N., Stive. P., Schwanenberg. D., and van
Overloop. P.J. Tree structure generation from ensemble forecasts for
real time control. Hydrological Processes, 2012. doi:10.1002/hyp.9473.
[110] Pianosi. F. and Raso. L. Dynamic modelling of predictive uncer-
tainty by regression on absolute errors. Water Resources Research,
48(W03516), 2012.
Appendix A

Time-varying state-space model


over prediction horizon

Note: the subscript r represents that the variables are in reduced-order do-
main. When deleting the subscript r, they become the original variables in
the unreduced model.
The reduced-order time variant state-space model is described as follows:

xr (k + 1) = Ar (k)xr (k) + Bu,r (k)u(k) + Bd,r (k)d(k)


(A.1)
yr (k) = Cr xr (k)

When the model is written over the prediction horizon, the overall state-space
model formulation becomes, following van Overloop [14]:


xr (k) u(k) dr (k)
xr (k + 1) u(k + 1) dr (k + 1)
= Ar,n xr (k) + Bur,n + Bdr,n

.. .. ..
. . .
xr (k + n) u(k + n 1) dr (k + n 1)

yr (k) yr (k)
yr (k + 1) yr (k + 1)
= Cr,n

.. ..
. .
yr (k + n) yr (k + n)
(A.2)

123
124 Appendix A. Time-varying state-space model over prediction horizon

The prediction matrices of Ar,n , Bu,r,n , Bd,r,n and Cr,n are also time-varying
and given as:

I

Ar (k)

Ar,n =
Ar (k + 1)Ar (k)

..
.
Ar (k + n 1)Ar (k + n 2) Ar (k)
0 0 0

Bu,r (k) 0 0
Ar (k+1)Bu,r (k) Bu,r (k+1) 0
Bu,r,n =

.. .. ..
. . . 0
Ar (k+n1)Ar (k+1)Bu,r (k) Ar (k+n2)Ar (k+1)Bu,r (k+1) Bu,r (k+n1)
0 0 0
Bd,r (k) 0 0
Ar (k+1)Bd,r (k) Bd,r (k+1) 0
Bd,r,n =

.. .. ...
. . 0
Ar (k+n1)Ar (k+1)Bd,r (k) Ar (k+n2)Ar (k+1)Bd,r (k+1) Bd,r (k+n1)

Cr 0 0
0 Cr 0
Cr,n =

0 0 ...
0
0 0 Cr
Appendix B

Combined water quantity and


quality state-space model
formulation

The one dimensional water quantity and quality model is generally described
by the Saint-Venant equations and the transport equation:

A Q
+ = ql (B.1)
t x

Q Qv Q|Q|
+ + gA +g 2 =0 (B.2)
t x x Cz RA

Ac Qc c
+ = (KA ) + ql cl (B.3)
t x x x

According to Stelling and Duinmeijer [17] and Xu et al. [8], the equations for
both water quantity and quality can be spatially discretized with staggered
grids. A semi-implicit scheme is applied to the time integration for the Saint-
Venant equations, where the advection term in the momentum equation is
explicitly discretized by first-order upwinding. The friction term is linearized
by setting |Q| to explicit. The remaining terms use the implicit scheme. The
time integration for the transport model is fully implicit. The water quantity
and quality equations are solved through a tri-diagonal format:

125
126 Appendix B. Combined water quantity and quality state-space model formulation

ek+1

a1,1 a1,2 0 0 | 0 0 0 0

,i,1
k+1
a2,2 a2,2 a2,3 0 | 0 0 0 0 e ,i,2

..

... ...

.

0 0 | 0 0 0 0

k+1

0 0 al,l1 al,l | 0 0 0 0 e,i,l


+


0 0 0 0 | b1,1 b1,2 0 0 ek+1

c,i,1
k+1

0 0 0 0 | b2,1 b2,2 b2,3 0 e

c,i,2
... ... ..
|
0
0 0 0 0 0 .
0 0 0 0 | 0 0 bl,l1 bl,l k+1
ec,i,l
c1,1 0


ek,i,1 0 0 dk,i,1
ek .. .. dk,i,2
,i,2 . .

.. ..

.
0 0

.

ek,i,l 0 cl,1 
k
d,i,l
Qk+1

c,1

= I2l,2l + + I2l,2l

Qk+1
d1,1 0

ekc,i,1 c,2 dkc,i,1

ek 0 0
dkc,i,2
c,i,2
.. .. .. ..


. . .
.
ek c,i,l
0 0 k
dc,i,l
0 dl,1
(B.4)
t k
ai,i1 = xW k Ai1 f ui1/2
t,i

t k
ai,i = 1 + k (Ai1 f ui1/2
xWt,i
+ Aki f ui+1/2 )

t k
ai,i+1 = xW k Ai f ui+1/2
t,i

k+1 k+1
t Ki1 Ai1/2
bi,i1 = xA k x
i

k+1 k+1 k+1


t K A +K Ak+1
bi,i = 1 + xAki
( i1 i1/2x i i+1/2
)

t Kik+1 Ak+1
i+1/2
bi,i+1 = xA k( x
)
i

t
ci,1 = k ,i
xWt,i
=1

t
ci,2 = k ,i
xWt,i
=l
127

di,1 = t
xAki
(ck+1
in cki ), i = 1

di,2 = t
xAki
(ck+1
l ckl ), i = l

t k k
d,i = k (Ai rui+1/2
xWt,i
+ ql,i ), i = 1

t k
d,i = k (Ai1 rui1/2
xWt,i
Aki rui+1/2 + ql,i
k
), i = 2, 3, . . . , l 1

t k k
d,i = k (Ai1 rui1/2
xWt,i
+ ql,i ), i = l
k+1 k+1
t Kin Ai
dc,i = k
xAi
[ x
(ck+1 k k k k+1 k k+1 k+1
in c ) + ql,i (cl,i ci ) + Qi+1/2 ci Qi+1/2 ci+1/2 ], i =1

t k k k k+1 k+1 k k+1 k+1 k+1 k+1


dc,i = xA k [ql,i (cl,i ci )+(Qi+1/2 Qi1/2 )ci (Qi+1/2 ci+1/2 Qi1/2 ci1/2 )], i =
i
2, 3, . . . , l 1

dc,i = t
[q k (ck
xAki l,i l,i
cki ) Qk+1 k k+1 k+1
i1/2 ci + Qi1/2 ci1/2 ], i = l

(

ci (Qk+1
i+1/2 0)
where ci+1/2 =
ci+1 (Qk+1
i+1/2 < 0)

where c is the concentration target value, Kin and cin are the dispersion
coefficient and concentration of the incoming water. Note that cin uses the
outflow concentration of the upstream reach if the reach in concern is not
the first one. All the variables at time step k + 1 in the above matrices are
calculated through a Forward Estimation procedure.

gt
f ui+1/2 = k
|vi+1/2 |
x(1 + g Cz2 R
)

Qki+1 vi+1
k Qk v k Qki+1 Qki
Ak 1 ( x
i i k
+ vi+1/2 x
) k
+ vi+1/2
i+1/2
rui+1/2 = k
|vi+1/2 |
1+g Cz2 R


Qki+1/2 +Qki1/2 Aki+1 +Aki vi1/2 (Qki 0)
where: Qki = , Aki+1/2 = , vi =
2 2 vi+1/2 (Qki < 0)
128 Appendix B. Combined water quantity and quality state-space model formulation
Appendix C

Reduced model verification


using extrapolated scenario of
lateral flows

In section 4.4, the reduced model is verified using the interpolated scenario
of lateral flows and it achieves good model accuracy. However, it is also
important to verify the model according scenario extrapolation. Table C.1
provides the verification scenario and Figures C.1, C.2 and C.3 show the
reduced model accuracy using the extrapolated scenario.

Figure C.1: Root mean square error of the reduced model on water quantity
and quality (extrapolated scenario)

129
130 Appendix C. Reduced model verification using extrapolated scenario of lateral flows

Table C.1: Lateral flow scenario for reduced model verification (step changes happen between 5 and 8 hours of the
simulation
Lateral 1 Lateral 2 Lateral 3
Reach Discharge Concentration Discharge Concentration Discharge Concentration
(m3 /s) (kg/m3 ) (m3 /s) (kg/m3 ) (m3 /s) (kg/m3 )
1 0.02 to 0.10 1.0 to 1.8 0.03 to 0.11 1.2 to 2.0 No third lateral
2 0.02 to 0.10 1.2 to 2.0 0.03 to 0.11 1.4 to 2.2 No third lateral
3 0.04 to 0.12 0.9 to 1.7 0.02 to 0.10 1.5 to 2.3 0.03 to 0.11 1.8 to 2.6
4 0.02 to 0.10 1.5 to 2.3 0.04 to 0.12 1.0 to 1.8 No third lateral
131

Figure C.2: Reduced water level states (I) and concentration states (III)
projected back to the original order, and the water level differences (II) and
concentration differences (IV) between the reduced model and the original
model
132 Appendix C. Reduced model verification using extrapolated scenario of lateral flows

Figure 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 disturbance differences (IV)
between the reduced model and the original model
Appendix D

Linearization of hydraulic
structures

It is noticed that in all the cases, we used pump flows to represent hydraulic
structures for simplicity. However, in many canals with gravity flows, weirs
and gates are often used, while pumps are only used to lift water out of the
system. Although weirs and gates are not used in this study, it is important
to mention the possibility of applying these hydraulic structures to our case
study.

In general, weirs and gates can both create free flow and submerged flow,
depending on the upstream and downstream water levels of the structure
and the structure settings. These flow conditions can be described by the
following equations [65] (assuming positive flow, namely upstream water level
is higher than downstream water level. For negative flow, the same approach
follows):

r
2 2 3
Free weir flow: Qk = Cg Wg g(hku hcr ) 2
3 3 (D.1)
3 3
when hku hg < dg k & hku hg > (hkd hkg )
2 2

q
Submerged weir flow: Qk = Ce Cg Wg (hkd hkg ) 2g(hku hkd )
3 3 (D.2)
when hku hg < dg k & hku hg (hkd hkg )
2 2
133
134 Appendix D. Linearization of hydraulic structures

q
Free gate flow: Qk = Cg Wg g (hkg hcr ) 2g(hku hcr + g (hkg hcr ))
3
when hku hg dg k & hkd hcr + dg k )
2
(D.3)

q
k
Submerged gate flow: Q = Cg Wg g (hkg hcr ) 2g(hku hkd )
3 (D.4)
when hku hg dg k & hkd > hcr + dg k )
2

where Ce is discharge coefficient [], Cg is lateral contraction coefficient [],


Wg is the structure width [m], hu is the upstream water level of the structure,
hd is the downstream water level of the structure [m], hcr is the crest level
[m], hg is the gate lower edge level [m], dg is the height of gate opening [m],
which equals hg hcr , g is the contraction coefficient, g is the gravitational
acceleration and equals 9.81[m/s2 ], k is the time step.
For discrete systems, the structure equations need to be discretized. In order
to reach a stable condition with large time step which is normally the case
in real-time control, implicit scheme is necessary as used in discretization of
the Saint-Venant equations in this thesis. However, the structure formulas
are nonlinear, the implementation of implicit scheme will destroy the linear
formulation of the internal model in MPC. In order to keep the linearity of
the model formulation, first order Taylor expansion is applied to the structure
equations. This is expected to be working well, but further investigation is
required. The Taylor expansion if the structure formulas are as follows:
Free weir flow:
r
k+1 k 2
Q = Q + Cg Wg g(hku hcr )(hk+1
u hku ) (D.5)
3

Submerged weir flow:


Ce Cg Wg (hkd hkg ) k+1
Qk+1 = Qk + p
k
(hu hku )
k
2g(hu hd )
q hkd hkg (D.6)
+ Ce Cg Wg ( 2g(hku hkd ) p k
)(hk+1
d hkd )
k
2g(hu hd )
q
Ce Cg Wg 2g(hku hkd )(hk+1g hkg )
135

Free gate flow:

k+1 k
gCg Wg g (hkg hcr )
Q =Q +q (hk+1
u hku )
k k
2g(hu (hcr + g (hg hcr )))
q
+ Cg Wg g ( 2g(hku (hcr + g (hkg hcr ))) (D.7)
Ce Cg Wg (hkd hkg )
q )(hk+1
g hkg )
k 2 k
2g(hu (hcr + g (hg hcr )))

Submerged gate flow:

gCg Wg g (hkg hcr ) k+1


Qk+1 = Qk + p
k
(hu hku )
k
2g(hu hd )
gCg Wg g (hkg hcr ) k+1 (D.8)
p k
(hd hkd )
k
2g(hu hd )
q
+ Cg Wg g 2g(hku hkd )(hk+1
g hkg )
136 Appendix D. Linearization of hydraulic structures
List of Symbols

Symbol Description Unit

Af cross-sectional area [m2 ]


A system matrix []
An system matrix over the prediction horizon []
Ar reduced system matrix []
Ar,n reduced system matrix over the prediction horizon []
As surface area [m2 ]
Bd disturbance matrix []
Bd,n disturbance matrix over the prediction horizon []
Bd,r reduced disturbance matrix []
Bd,r,n reduced disturbance matrix over the prediction
horizon []
Bu control input matrix []
Bu,n control input matrix over the prediction horizon []
Bu,r reduced control input matrix []
Bu,r,n reduced control input matrix over the prediction
horizon []
C output matrix []
Cr reduced output matrix []
Cr,n reduced output matrix over the prediction horizon []
1
Cz Chezy coefficient [m 2 /s]
CR correlation matrix []
D disturbance vector []
H Hessian matrix []
HL Hessian matrix of the Lagrangian function L []
Hf Hessian matrix of the objective function fo []
Hm measurement matrix []
I identity matrix []
J Objective function []

137
138 List of symbols

K dispersion coefficient [m2 /s]


Ki integral gain factor []
Kp proportional gain factor []
Kp, proportional gain factor on water level deviation
from target []
Kp,c proportional gain factor on concentration deviation
from target []
L Lagrangian function []
Lc canal length [m]
LK Kalman gain []
M number of snapshots []
N number of states []
P a priori []
P posteriori []
Pf wetted perimeter [m]
Q mean flow [m3 /s]
Qc control flow [m3 /s]
Qc,max maximum control flow [m3 /s]
Qc,min minimum control flow [m3 /s]
Qin inflow discharge [m3 /s]
Qout outflow discharge [m3 /s]
Qp pump discharge [m3 /s]
Qp,max maximum pump flow [m3 /s]
Qp,min minimum pump flow [m3 /s]
Qc,max maximum control flow change [m3 /s]
Qc,min minimum control flow change [m3 /s]
QN model noise covariance []
R hydraulic radius [m]
RN measurement noise covariance []
S search direction matrix []
Sb bottom slope []
Tc control time step [s]
U input vector [m3 /s]
V water volume [m3 ]
W mean width [m]
Wb bed width [m]
Wt top width [m]
Wx penalty on states []
Wx, penalty on water level deviation from target [1/m2 ]
Wx,c penalty on concentration deviation from target [(m3 /kg)2 ]
Wr penalty on reduced states []
List of symbols 139

Wx,n penalty on states over the prediction horizon []


Wu penalty on control input [(s/m3 )2 ]
Wu,n penalty on control input over the
prediction horizon [(s/m3 )2 ]

Wu,c penalty on virtual input []
X state matrix []
Y output matrix []
YL gradient of the first order derivative of the
Lagrangian function []
a function of variables []
b function of variables []
c concentration [kg/m3 ]
cl lateral concentration [kg/m3 ]
cin inflow concentration [kg/m3 ]
cout outflow concentration [kg/m3 ]
d disturbance []
dm mean water depth [m]
dr reduced disturbance []
e water level deviation from target [m]
e water level deviation from target after Kalman filter [m]
ec average concentration deviation from target [kg/m3 ]
ec virtual input []
f Jacobian matrix []
fm model function []
fo objective function []
fu linearization factor in discretized Saint-Venant
equations []
g gravitational acceleration [m/s2 ]
gc constant matrix []
gf constant matrix []
gL constant matrix []
h constraint function []
k time step index []
kd number of delay steps []
l number of spatial increment []
m total number of constraints []
m1 number of reduced states []
m2 number of reduced disturbances []
me number of equality constraints []
n prediction horizon []
140 List of symbols

niter number of iterations []


niter average number of iterations []
nr number of canal reaches []
nu number of control inputs []
ql lateral flow [m2 /s]
ru linearization factor in discretized Saint-Venant
equations []
s search direction []
t time [s]
t1 initial time [s]
t2 final time [s]
t time step [s]
u control input [m3 /s]
us shear velocity [m/s]
v mean velocity [m/s]
wmeas measurement noise []
wmodel model noise []
x state []
x Kalman state []
xr reduced Kalman state []
x spatial increment [m]
y output []
yr reduced output []
ym measured output []
yt controlled water level [m]
ytarget target water level [m]
z snapshot vector []
zr reduced snapshot vector []
1 basis function matrix of states []
2 basis function matrix of disturbances []
1 orthogonal matrix with 1 []
2 orthogonal matrix with 2 []
lagrange multiplier matrix on equality constraints []
M lagrange multiplier matrix on inequality constraints []
coefficient []
side slope []
delay time [s]
w shear stress [N/m2 ]
water level above reference level [m]
initial model error [m]
1 standard deviation of measurements [m]
List of symbols 141

2 standard deviation of the model [m]


perturbation []
lagrange multiplier on an equality constraint []
lagrange multiplier on an inequality constraint []
eigenvector of the kernel matrix []
142 List of symbols
Acknowledgements

Finalizing PhD work is not an easy task. It needs complete support from
both academic side and the family side. I am sincerely appreciated for all
the help I had during my PhD progress.
I thank Dr. Peter-Jules van Overloop. It sounds weird to call such a good
friend like this. Although it needs to be formal, Id rather use PJ here. I
am very appreciated for all the careful supervisions you gave. I enjoyed the
moments discussing scientific research with you. You inspired me by some
of your crazy ideas and the way working towards them, although I am not
completely agree with you sometimes. Meanwhile, you are also an excellent
friend for sharing life experience. Thank you for bringing me to different
Dutch occasions, getting to know your families and friends, and introducing
the real Dutch life. I still remember the night with your band playing at a
bar in your hometown Bergen op Zoom till 3am. It was great fun.
I thank Prof. Nick van de Giesen for giving me the opportunity to continue
the PhD study. Thank you for giving me your concrete support and the
complete freedom to develop myself not only in the research but also for
social activities. Your trust pushes me to work towards the target. I am
even more appreciated for allowing me to work at Deltares without finalizing
my PhD dissertation.
I thank the committee for spending their valuable time on reading my dis-
sertation and giving comments for the improvements.
I thank Dr. Rudy Negenborn. It was a great pleasure to work with you on
an article. Your attitude and the way of thinking and performing in scientific
research gave me a deep impression. Looking forward to cooperating with
you again in the future.
Of course, I wont forget Betty Rothfusz, the kind and beautiful secretary
who helped to arrange everything during my PhD study. I thank all the
colleagues at TUDelft. It was great fun to work and play together with

143
144 Acknowledgements

you.
I thank Deltares, the company where I am working. Thank you for admitting
my expertise before I get my PhD degree and give me space to finalize my
PhD work.
Family is always important. Only with the full family support, I can finalize
the PhD research. Thank you my dear wife Bai Yuqian. As you said that
marrying with you is my most wise decision ever in my life, I agree with
you! Your love and encouragement give me the best support. Thank you
for your understanding and allowing me to work even in the weekend. More
important, thank you for giving me the best gift in my life: our son, Xu
Jiayue. Hey, little man. You are my hero. Your smile, naive, naughty and
cry drag all my tiredness away and keep me fresh. Love you forever!
I thank my father. Only when I became the father of Jiayue, I fully realized
the responsibility of being a father. Thank you for your understanding and
support.
To my mom in the heaven. Its a pity that you cant be with us to enjoy such
a moment that you were looking forward to. But I can feel your existence
and you are always with us. Somehow, I can feel you are smiling in the sky
looking at me. Please bless us!
About Author

Min Xu was born on October 29, 1981 in Suzhou China. He came to the
Netherlands in 2005 after his Bachelor at Hohai University. He studied water
management in Delft University of Technology majoring in operational water
management. During his master, he was a student assistant for half year. He
conducted an internship at Friesland water board for rainfall-runoff modeling
and damage calculation. His graduation project was together with USDA.
He spent 3 months in Arizona to model an irrigation canal and build up the
control system to balance the water mismatches in the canal. The master
project was completed in 2007.
In November 2007, Min Xu started his PhD research at Delft University of
Technology. The PhD research was an extension of his study interest in oper-
ational water management, specifically with model predictive control (MPC).
His PhD mainly focused on the application of real-time control to the com-
bined surface water quantity and quality control. Moreover, computational
accuracy and efficiency was another interest of his study. He developed a
control procedure for MPC with the reduced model to balance the control
effectiveness and computational time. Besides his PhD research topic, Min
Xu is also interested in other water management fields, such as numerical
modeling, flood protection, river or canal network control, sewer system con-
trol.
Before finishing his PhD, Min Xu received a job position at Deltares in
the unit of Inland Water System. He became an adviser and researcher
in the department of operational water management. His main focus is on
flood forecasting and real-time control. Moreover, this position also provides
a great platform to expand the knowledge of water management in other
fields.

145
146 About Author
Publications

Journal papers

1. Xu. M., van Overloop. P.J. and van de Giesen. N.C. Model reduction
on model predictive control of combined water quantity and quality.
Environmental Modelling & Software. 2012. (Accepted)
2. Xu. M., Negenborn. R.R., van Overloop. P.J. and van de Giesen.
N.C. De Saint-Venant equations-based model predictive control of open
channel flow. Advances in Water Resources. Volume 49:37-45, 2012.
3. 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 model predictive control of open channel flow. Ad-
vances in Water Resources. Volume 34(2):282-290, 2010.
4. 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.

Conference papers

1. Xu. M. and Schwanenberg. D. Comparison of sequential and simulta-


neous model predictive control of reservoir systems. In the Proceedings
of the 10 th International Conference on Hydroinformatics, HIC 2012.
Hamberg, Germany, HIC2012-0272, 2012.
2. Schwanenberg. D., Ochterbeck. T., Gooijer. J., Xu. M. and van
Heeringen. K. Model predictive control of pumps and gates for draining
dutch polder systems. In the Proceedings of the 10 th International Con-

147
148 Publications

ference on Hydroinformatics, HIC 2012. Hamberg, Germany, HIC2012-


0058, 2012.
3. Xu. M., van Overloop. P.J. and van de Giesen. N.C. Model selection
for salt water intrusion in delta areas. In the Proceedings of the 25 th
ICID European Regional Conference. Groningen, the Netherlands, Pa-
per II-17, 2011.
4. Xu. M. and van Overloop. P.J. On the Application of model reduction
in model predictive control of open channel flow. In the Proceedings
of the 9 th International Conference on Hydroinformatics, HIC 2010.
Tianjin, CHINA, Volume 3:2169-2177, 2010.
5. Xu. M., van Overloop. P.J., Schielen. R.M.J. and Havinga. H. Model
predictive control of discharge distribution of the Rhine river in the
Netherlands. In the Proceedings of the NCR Publication. Dalfsen, the
Netherlands, 52-53, 2008.

Abstract
1. Xu. M. and van Overloop. P.J. Model predictive control on irriga-
tion canals, application on the Central Main Canal in Arizona. EGU
Geophysical Research Abstracts. Vol. 10:EGU2008-A-00000, 2008.

S-ar putea să vă placă și