prof mohan kumar _ water networks [compatibility mode]
TRANSCRIPT
Role of Delivery Systems in Control of Role of Delivery Systems in Control of Water Quantity and Quality
M S Mohan KumarM S Mohan KumarG. R. Munavalli
M Prasanna KumarCelia D D’SouzaCelia D D Souza
Pawan Kumar
Objectives of the Study j y
Water Quantity SimulationWater Quantity SimulationWater Quality Simulation Parameter EstimationSource Strength Identification Bacteriological Growth
In a Water Distribution System
Water Quality SimulationWater Quality Deterioration Water Quality Deterioration
• Blending• Age,type and maintenance of the distribution system• Chemical and biological transformationsChemical and biological transformations
Water Quality Expressed in terms of• Constituent concentration (generally chlorine) • Water age• Water age• Source trace
Water Quality ModelingH d li l i i i i• Hydraulic analysis is prerequisite
• Steady state (ultimate values of water quality)• Dynamic state (spatial and temporal distribution of
water quality)water quality)
3
Chlorine Reaction Kinetics
Bulk Flow Reactions Bulk Flow Reactions
• Due to organic content in water
Fi d fi d ki i• First order or non first order kinetics
Wall Reaction Kinetics
• Due to materials at pipe wall and corrosion products
• First or zero order kinetics
Total Chlorine Decay
• Combination of bulk and wall reactions
• Mass transfer from bulk flow to pipe wall
Steady State Water Quality Model
Objective• Simulate the ultimate spatial distribution of constituent
concentration age and source traceconcentration, age and source traceModel Formulation
• Based on 1D flow, complete mixing at nodes, advection dominated and single constit ent (conser ati e or reacti e)dominated and single constituent (conservative or reactive)
• Hydraulic Analysis Model (Niranjan Reddy 1994)• Water Quality Model
1 Constituent1. Constituent
5
Expressions for Reaction CoefficientC ti Ch i l R 1Conservative Chemical: Reci=1Reactive Chemical
• First order bulk and first order wall reactions
• Second order b lk and first order all reactions• Second order bulk and first order wall reactions
6
Steady State Water Quality Model
2. Water age
3. Source trace
All the above formulations for constituent water All the above formulations for constituent, water age and source trace are solved by Gauss-Siedel Iterative solution technique
7
Dynamic Water Quality Model
Comparative Study of Existing Models TDM and EDM with new Hybrid Method (EDMNET)
• For analytical solutionsFor analytical solutions• For application on network examples
Model Formulation• Static hydraulic model (Niranjan Reddy 1994)• Static hydraulic model (Niranjan Reddy 1994)
modified to handle extended period simulation • Water quality model
1. Transport in pipes1. Transport in pipes
8
Expressions for Reaction Rate and ConcentrationConcentration
Conservative Chemical: R[ci(x,t)]=0Reactive ChemicalReactive Chemical
• First order bulk and first order wall reactions
• First order bulk and zero order wall reactions
9
2. Modeling water age• Modeled as reactive constituent of zero order
growth and R[ci(x,t)]=13. Modeling source trace• Modeled as simulating conservative constituent ode ed as s u at g co se vat ve co st tue t
of 100 units concentration at desired source4. Dilution Equation
5. Mass balance equation at storage tank
10
Model ApplicationModel ApplicationTest Problem 3 Used for Conservative and Reactive
ConstituentTank detailsDiameter 15.24 mInitial height 17 29 mInitial height 17.29 mMinimum height 15.24 mMaximum height 21.34 mFirst order chlorine reactionFirst order chlorine reaction constants usedBulk reaction constant 0.55 /dWall reaction constant 0 15 m/dWall reaction constant 0.15 m/d
11
Water Quality Parameter Estimation
Water Quality (Chlorine) Reaction ParametersWater Quality (Chlorine) Reaction Parameters• Bulk reaction parameters (determined by bottle tests) • Wall reaction parameters (product of calibration)
I M d li g T h i U f l t Inverse Modeling Techniques are Useful to Estimate the Unknown Wall Reaction Parameters and Hence to Calibrate the Water Quality ModelUnknown Reaction Parameters are Expressed as
• Overall first order reaction parameterOverall first order reaction parameter• First order wall reaction parameter• Zero order wall reaction parameter• First order wall reaction-pipe roughness parameterp p g p• Zero order wall reaction-pipe roughness parameter
14
Scope of Present WorkDevelopment of Inverse Models for Autocalibration Development of Inverse Models for Autocalibration of Steady State Water Quality Model
D l t f I M d l f A t lib tiDevelopment of Inverse Models for Autocalibrationof a Typical Dynamic Water Quality Model (TDM)
• To incorporate all types of unknown reaction parameters involved infirst or non first order reaction kinetics
• Free from numerical diffusion• Simulation-Optimization Inverse Modeling
Technique is Used with • Gauss-Newton Sensitivity Analysis Technique (GNSAT)• Genetic Algorithm Technique (GAT) g q ( )
in the optimization module
15
Water Quality Parameter Estimation(Dynamic State)
Model Formulation
Solution by GNSAT• Corrections to parameters are obtained by solving Nup
(number of unknown parameters) linear equations given by
• Sensitivity coefficients are determined by parameter perturbation techniqueperturbation technique
16
• Calibration error statisticso Stastical parameters are computedo Parameter uncertainty is obtained using posterior parameter
covariance matrix given by
where, Jf = final Jacobian of sensitivity coefficients; s2=estimated i Merror variance
Parameter confidence limits are given by
∑ −=j
NupjNE )(
• Choice of weightso Weight based on measured values
Solution by GATSolution by GAT• Exactly similar to steady state case except dynamic water quality model
TDM is used in the forward simulation
17
Model Application
Real Life Network 2
Tank detailsDiameter 15.24 mInitial height 17.29 mMinimum height 15.24 mMaximum height 21.34 mFirst order chlorine reaction constants usedBulk reaction constant 0.55 d-1
Wall reaction constant ?Measurements Known at Nodes3, 6, 10, 11, 19, 25, 28 and 34
18
Source Strength IdentificationImportance of Chlorination
• Required to maintain microbial quality of water• Appropriate chlorine residuals should be maintained to achieve a balance
between benefits (such as cheap, easy to handle, effective in killing b i d l id l ) d ill ff ( i i b d dbacteria and longer residuals) and illeffects (carcinogenic byproducts andtaste-odor problems)
Source Strength• Chlorine concentration or mass rate injected at the supply (treatment
plant) and secondary (booster) water quality sources• Estimation of appropriate value of source strengtho to maintain a specified value or a value between specified range of
chlorine residuals at given monitoring node(s) is importantTypes of Water Quality SourcesC i• Concentration source
• Mass booster source• Flow paced booster sourcep• Set point booster source
22
Scope of Present WorkExtending the Simulation-Optimization Inverse Modeling Procedures to Solve Source Strength Identification Problem which
• Incorporates both first or non first order reaction kineticsIncorporates both first or non first order reaction kinetics• Is free from numerical diffusion• Accounts for the temporally varying source strength(s) at various
types of water quality sourcesyp q yDevelopment of Steady State Strength Identification Model Development of Dynamic State Strength Development of Dynamic State Strength Identification Model for a single monitoring node by GNSAT D l t f D i St t St th Development of Dynamic State Strength Identification Model for a residual value within a range at given monitoring node(s) by GATg g g ( ) y
23
Steady State Strength Identification
Problem is posed as unconstrained evendetermined and hence the model formulation of steady state and hence the model formulation of steady state parameter estimation problem is applicable
The only difference being observed values are the specified chlorine concentration and unknown parameters are source strengths
Number of sources is made equal to number of Number of sources is made equal to number of monitoring nodes
24
Strength Identification Model by GNSAT
Model Formulation
On Conversion to Unconstrained Optimization Problemp
25
Model ApplicationFirst order chlorine
ti t tLake
Source
RiverSource
reaction constants usedBulk reaction constant 0 31 /d (Lake)
Sou ce
0.31 /d (Lake)0.03 /d (River)Wall reaction constant Case (i) I- orderCase (i) I orderZone 1 0.3048 m/dZone 2 1.5244 m/dZone 3 3.0488 m/dZone 4 6.0976 m/dCase (ii) Zero Order215 mg/m2/dMonitoring Node
Chlorine Conc. AtLake: ?River: ?
26
Strength Identification Model by GAT
Model Formulation
On Conversion to Unconstrained Optimization Problem
Fitness Value=1/E
28
Model Application (Example Network 1)For Linear Kinetics
Tank detailsDiameter 15.24 mInitial height 17 29 mInitial height 17.29 mMinimum height 15.24 mMaximum height 21.34 mFirst order chlorine reactionFirst order chlorine reaction constants usedBulk reaction constant 0.55 /dWall reaction constant 0 36 m/dWall reaction constant 0.36 m/dWater Quality Sources atA, B, C, D, E and FMonitoring Nodes: 2 to 36 and Source g
Nodes
29
Bacteriological Modeling in Distribution SystemBacterial Growth
• Increase in the cell number by utilizing organic carbon is as a energy source
• Organic matter in drinking water is natural in origin resulting from d i i ( h i d f l i id )decaying vegetation (e.g. humic and fulvic acids)
• Given the presence of nutrients regrowth is theoretically possible• May result in biofilm formation
F t Aff ti B t i l G thFactors Affecting Bacterial Growth• Attachment to and shearing from the surfaces• Age of biofilm• Disinfectant levels
Multicomponent Reaction Transport Model• Used as tool to study the bacterial growthsy g• Components incorporatedo Organic carbon (Substrate)o Bacterial content (Biomass)o Bacterial content (Biomass)o Disinfectant (Chlorine)
34
Scope of Present WorkDevelopment of Multicomponent Reaction Transport Model as Applicable to a Network
• Through simplified expressions for the processes such as bacterial growth, substrate consumption, attachment, detachment and g pdisinfectant action
• Which can predict the spatial and temporal spread of contaminant intruded into the system
• Development of numerical Eulerian and Lagrangian solution methods
to solve multicomponent modelD l t f M lti t R ti Development of Multicomponent Reaction Transport Model as Applicable to Pilot Loop Experiments p
35
Numerical Solution Methods Eulerian Finite Difference Method
• Multistep computing schemeo Decoupling of governing equations into transport and kinetico Solving transport equations by MacCormack schemeo Solving kinetic equations by Runge-Kutta procedure
For each time step
Solve kinetic equationsfor first half time step
Solve transport equationsfor full time step
Solve kinetic equationsfor second half time step
39
Numerical Solution Methods Lagrangian Time Driven Method
• TDM used earlier for single constituent is modifiedo Redistribution of masso Creation of new segments
40
Model Application to a Network Problem
First order chlorine ireaction constants
usedTOC3 55 mg/L (Lake)3.55 mg/L (Lake)0.56 mg/L (River)Wall reaction constant Zone 1 0 3048 m/dZone 1 0.3048 m/dZone 2 1.5244 m/dZone 3 3.0488 m/dZone 4 6.0976 m/d203
Chlorine Conc. AtLake: 0.49 mg/LRiver: Varies between
1.00 and 1.50 mg/L41
Why controls in water supply systems?Why controls in water supply systems?
To reach the targets/set points (reservoir flows / levels)To reach the targets as fast as possibleTo reach the targets as fast as possibleTo ensure the smoothest possible operation of valves/pumps
To control the slow transients
For real time operation monitored by SCADA
Particularly useful for complex pipe networks
47
Practical issues
Normal Questions asked
How much supply is made to different reservoirs ?How much supply is made to different reservoirs ?
How to maintain equitable distribution among q gdifferent reservoirs ?
How to minimize leakage ?How to minimize leakage ?
How much throttling needed to achieve targeted g gflows ?
How to maintain sufficient pressure / reduce How to maintain sufficient pressure / reduce pressure ?
49
Mathematical model of a water supply system
D i l b h i f fl id i h i li• Dynamical behavior of fluid in the pipeline( ) ( )( )thh
lgA
dttdQ
lossp
p −Δ= ( ) ( ) ( )ththth llossfplossloss −− +=
• Friction Loss Valve Loss
ldt p
where
( ) ( )tQgAK
thp
vlossvalve
22
2 ⎟⎟
⎠
⎞
⎜⎜
⎝
⎛=
( ) ( )tQDHWC
lth
p
pfploss
852.187.4852.1
7.10⎟⎟⎠
⎞⎜⎜⎝
⎛=−
• Head versus Flow characteristics of Pump
( ) CB
• Continuity equation at Reservoir
( ) 22002
0, pppp QnC
NQnB
NAQNh −+=
• Continuity equation at Reservoir( )( ) ( ) ( )tQtQ
dttVd
oi −= 50
PID/PD/PI controllers
Introduction to different controllers
- Proportional Integral (PI) controller, Proportional Derivative (PD) controller and Proportional Integral Derivative controller (PID)-most commonly used controllers.
-Have been in use in different forms since long time.
W k ll f li t-Works well for linear systems
Dynamic inversion based controllers:
- Nonlinear control design
- Technique of feedback linearisation
- Output tracking problems- Output tracking problems
- May be implemented as PD, PI or PID 51
Controller Equations
PD Controller
PID Cont olle
dtdeKeKu dp +=
PID Controller
dtdeKdteKeKu dip ++= ∫
DI based nonlinear controller
dtdip ∫for
⎥⎦⎤
⎢⎣⎡ −= − )()(
.1 XfXXgu des
uXgXfX )()(.
+=52
Solution Procedure
Known initial conditions
Solve the controller equations for control variables
Integrate the state equations to get state i blvariables
Repeat the process till the end of the Repeat the process till the end of the operation period
53
Data for Gaziantep water supply system
lp1 = 669.27m hs1 = 113.4m D=1.4 m
lp2 = 13805.04m hs2 = 210.4m A0 = 0.0001433l 20094 69 h 283 4 B 0 005015lp3 = 20094.69m hs3 = 283.4m B0 = 0.005015
lp4 = 4689.04m hs4 = 279.7m C0 = 3.98
A i= 1 5394 m2 A = 475 m2 n = 1Api 1.5394 m At 475 m n 1
Pump Rated Discharge 2830 lit/sec
Pump Rated Speed 985 rpm
Initial Reservoir levels 3.20 m,2.15 m,4.20 m
Targeted Reservoir levels 4.0 m,2.50 m,3.91 m55
System dynamics
( ) [ ][ ]Tatbtcto
T
QhQhQhQ
xxxxxxxtX
123
7654321
=
=State Vector
( ) [ ][ ]
321T
cba
T
NNN
uuutU
=
=
where
Control Vector
State Equations( )( )( ) ( ) ( )
octt
oootoo
NQkkNkkfQ
QQkh
QRGhkQ
2
3
23
−=
−+=
&
&
&( ) ( )( ) ( )bbbbttbb
aaaataa
QkQRGhhkxf
QkQRGhkxf
−−+−=
−−+−=
where
23
221
23
21
State Equations
( ) ( ) ( )( )( ) ( ) ( ) bbbbbbb
cbtt
ccccccc
NQkkNkkxfQ
QQkh
NQkkNkkxfQ
22
1
2
22
1
++=
−=
++=
&
&
( ) ( )( ) ( )
pptt
ccccttcc
bbbbttbb
CkBkklgA
kAk
QkQRGhhkxf
QkQGhhkxf
=====
−−+−=
,,A,,/1
030201
23
232
321
( )( ) ( ) ( ) aaaaaaa
batt
NQkkNkkxfQ
QQkh
22
1
1
++=
−=&
&
sjsippp
ppp
pptt
hhGgAD
lfR
l
−=⎟⎟⎠
⎞⎜⎜⎝
⎛= ,
2
2
030201
56
[ ]eeeE T321 =
Error vector
PD controllers:
[ ]Ttttttt hhhhhh *11
*22
*33 −−−
Error vector
dtdeKeKN dpc
11 +=
d
PD controllers:
dtde
KeKN dpb2
2 +=
deKKN 3
dtKeKN dpa
33 +=
dtKde
KKN ∫1
PID controller equations:
dteKdt
KeKN idpc ∫++= 11
1
dteKde
KeKN idpb ∫++= 22
2 dtN idpb ∫ 22
dteKdtde
KeKN idpa ∫++= 33
3
57
DI Controller equations
N N N P d( ) ( )( ) ( )( ) ( ) 0
0
0
122
1
222
1
322
1
=++
=++
=++
γ
γ
γ
ccctcct
bbbtbbt
aaataat
NQkkkNkkk
NQkkkNkkk
NQkkkNkkkNa,Nb,Nc are Pump speeds
( ) ( ){ } ( )Δ
where
( ) ( ){ } ( )( ) ( ) ( ) ( ){ }
( ){ } ( )*22
322
12
*331
bd
cbcccbt
ttpoctdct
hhKQQkK
NxkkNkkxfxfk
hhKQQkKxfk
−+−+
−−−=
−+−+=Δ
γ
γ
( ){ } ( )( ) ( ) ( ) ( ){ }
( ){ } ( )*11
522
13
22
ttpbatd
bbbbbat
ttpcbtd
hhKQQkK
NxkkNkkxfxfk
hhKQQkK
−+−+
−−−=
++Δ
γ
58
Target outflow rate (Qo*): 2 4 m3s-1
Case 1: Constant set point over the time period
Target outflow rate (Qo ): 2.4 m s
Target reservoir levels (ht1*, ht2
*, ht3
*): 4.0 m, 2.5 m and 3.91 m
1st Initial condition:X(0) =
= (2.83, 3.20, 2.83, 2.15, 2.83, 4.20, 2.83)T
[ ] 123T
atbtcto QhQhQhQ
2nd Initial condition:X(0) =
(2 20 3 50 2 20 2 70 2 20 3 80 2 20) T[ ] 123
Tatbtcto QhQhQhQ
= (2.20, 3.50, 2.20, 2.70, 2.20, 3.80, 2.20) T
59
Case 2: Three changes of set point
Targets:Targets:
Outflow: 2.3 to 2.7 m3s-1
2 7 t 2 8 3 12.7 to 2.8 m3s-1
2.8 to 2.6 m3s-1
For every 2 hrs
1st reservoir level: 4.0m
2nd reservoir level: 2.5m
61
Outflow, reservoir levels and pump speeds for the , p p pcase of step changes in target outflow (Qo
*) using DI
62
Case 3: Reservoir levels and pump speeds for the case of constant target outflow (Q *) with different case of constant target outflow (Qo ) with different
initial conditions using DI
63
Reservoir levels and speed change of the variable speed pump, Na for ±5% outflow disturbance (Q o) - Test problem 1. 64
Bangalore city water supply system – Test problem 4
Salient featuresInflow 673 Mld
Cauvery Stages I (132), II(131), III(294) and ARK(116)
48 reservoirs spread over 2190 sq.km
Several reservoirs on one complex
26 pumps26 pumps
Diameter 1750 mm to 150 mm
Type of pipe and age – MS, CI, DI etc, new to 50 year old
65
Targeted Inflows to the Ground Level Reservoirs
S.No Reservoir Targeted Inflow Mld
1 KGR 401 KGR 40
2 KUM 10
3 BSK 353 BSK 35
4 BTM 10
5 BTR 755 BTR 75
6 MNK 7
7 BYR 50
8 MR 6
9 AER 60
10 HGR 5067
11 LLR 30
S.No Reservoir Targeted Inflow Mld
30
12 WCR 28
13 BCR 28
14 KMH 40
15 CJF 77
16 KGT I 3716 KGT I 37
17 MBR 50
18 CLR 20
Total 673 68
Different Tuning approaches for the controllers
- Offline tuning method
* Ziegler Nichols rules
* Genetic algorithm based approach
- Online tuning method
Fuzzy gain scheduler
Design of different controllers using above tuning methodses g o d e e t co t o e s us g abo e tu g et ods
* PID controllers – ZNPID,GAPID,FZPID
* DI controllers - ZNDI,GADI,FZDI, ,
73
1) Ziegler-Nichols rules – for tuning a PID controller
PI controller gains
Kp = 0.45* KuKp 0.45 Ku
Ki = 0.54* Ku/ PuKu: Ultimate Gain
Pu: Period of oscillation
PID controller gains:
Kp = 3* Ku /5
Ki = 6* Ku/(5* Pu)
Kd 3* K * P /40Kd = 3* Ku * Pu /40
74
3) Fuzzy based online tuning approach
ii )( KKKkK +−= minminmax )( ppppp KKKkK +
minminmax )( ddddd KKKkK +−=
( )PKK 2/2= ( )upi PKK 2/=
Membership functions for e, Δe, kp and kd.
77
Comparison of three gain tuning approaches – PID controllers
Errors and variation in pump speeds - Test problem 1 79
Test problem 3 – Case 1
Selected error plots and corresponding variation in valve loss coefficients for 70% of initial flows as targets
81
Test problem 3 – Case 2
Selected error plots and corresponding variation in valve loss coefficients for 30% of initial flows as targets
83
Gains found using GA – PID controller
ProblemProblem 1 3
Case 1 Case 2
Kp1 0.992*10-3 407.1 308.2
Kp2 0.972*10-3 982.4 848.2p 0.97 0 98 . 8 8.
KP Kp3 0.912*10-3 664.7 407.1
Kp4 --- 152.9 156.5
Kp5 --- 301.2 908.2
Proportional gains
Ki1 0.369*10-6 996.5 174.1
Ki2 0.124*10-6 987.7 101.2
KI Ki3 0.115*10-6 1120.6 251.8
Ki4 --- 869.4 107.3
Integral gains
Ki5 --- 992.9 403.5
Kd1 0.0973 114.1 251.8
Kd2 0.0484 177.6 474.1
KD Kd3 0 0344 795 3 565 9D i ti i KD Kd3 0.0344 795.3 565.9
Kd4 --- 611.8 576.5
Kd5 --- 202.4 491.8
Derivative gains
85
Maintain physical barrier between distribution system
i t i d t l
Strategies in the Efficient Management of WDSs
Develop methods to
interior and external environment
Management of WDSs
pdetermine and analyze the quantitative and qualitative status of WDSsstatus of WDSs
To take quick decisions to
Physical
To take quick decisions to maintain the three -physical, hydraulic and
QualityHydraulic
water quality integrity of WDSs Maintain disinfectant residual,
bio-stability, prevent external Maintain desirable
water flows, t contaminationpressures, water age
86
Efficient Management of WDSsEfficient Management of WDSs
Modeling Techniques – to simulate the quantitative and qualitative behaviour ofquantitative and qualitative behaviour of water distribution systems
Decision / Control Systems – to control important parameters of water distribution systems
87
Limitations of Deterministic Water Quality Modeling of WDSs
• Water quality modeling of WDSs has advanced and has become complexadvanced and has become complex
• Number of calibrating parameters with the introduction of other components (like Substrates & Biomass) has increased
• Calibration is tedious 88
Objectives of the StudyObjectives of the Study
• Use of soft computing modeling techniques in• Use of soft computing modeling techniques in the temporal prediction of important water quality indicators of water distribution systemsquality indicators of water distribution systems
• Develop control algorithms in an integrated approach for the quantitative and qualitative control of water distribution systems
89
Objectives in the Data-driven Modeling of WDSs
• Develop models in the temporal prediction of p p p– Chlorine & Biomass
U f diff t l ith f l t k• Use of different algorithms of neural networks– Resilient Back Propagation– Levenberg-MarquardtLevenberg Marquardt – General Regression
f iff i f• Use of different architectures of neural networks– One-output – Two-outputTwo output– Three-output
90
Water Quality Indicators of WDSsWater Quality Indicators of WDSs
• Chlorine and Biomass are the two key parameters of water quality
• Chlorine – a minimum of 0.2 mg/l and a safeguard against further microbial contamination
• Biomass – indicator of the presence of microbial re-growth in water distribution systems
91
Back Propagation AlgorithmBack Propagation Algorithm
Error Equation21 ( )
ON
E d y= −∑Error Equation1
( )pj pjjp
E d yN =
= ∑
( 1) ( ) ( )kj kj p kjw t w t w t+ = + ΔWeight Change
)1()()( −Δ⋅+∂
∂⋅−=Δ twt
wE
tw ijpp
ijp αε∂wij
92
Resilient Back Propagation Algorithm (RP)
⎪⎪⎧ >−
∂∂⋅
∂∂
−Δ⋅+ twEt
wEift
ijijij 0)1()(),1(η
⎪⎪
⎪⎪
⎨ <−∂∂⋅
∂∂
−Δ⋅=Δ − twEt
wEiftt
ijijij
ijij
ij 0)1()(),1()( η+− <<< ηη 10
⎪⎪
⎩−Δ elsetij ),1(
⎪⎧ >
∂Δ− tEiftij 0)()(
⎪⎪
⎪⎪⎪
⎨ <∂∂
Δ
>∂
Δ
=Δ twEift
tw
ift
twij
ij
ijij
ij 0)(),(
0)(),(
)(
⎪⎪⎪
⎩else,0
)()()1( twtwtw ijijij Δ+=+ )()()1( twtwtw ijijij Δ++
93
Levenberg Marquardt AlgorithmLevenberg-Marquardt Algorithm (LM)Error Equation 21 ( )
ON
pj pjE d yN
= −∑
w w wδ= +Weight Change
1pj pj
jpN =∑
1k k kw w wδ+ = +
1
Weight Change
( )( ) 1T Tk k k k kw J e J J Iδ λ
−= − +
94
General Regression Ne ral Net orkGeneral Regression Neural Network2
1( )
exp
m
i ijni
x xY =
⎛ ⎞−⎜ ⎟
⎜ ⎟∑
∑ 12
1^
2
exp2
( )
ij
j
m
Y
Y
σ=
⎜ ⎟−⎜ ⎟⎜ ⎟⎝ ⎠=⎛ ⎞
∑
∑ 2
12
1
( )exp
2
i ijni
j
x x
σ=
=
⎛ ⎞−⎜ ⎟
⎜ ⎟−⎜ ⎟⎜ ⎟⎝ ⎠
∑∑
⎝ ⎠m – number of inputs
n – number of training cases
xi – ith variable of testing case
xij – ith variable of the jth training case
95
Development of the Artificial Neural Network (ANN) Models
• Selection of Input data
• Principal Component Analysis
• Performance of the modelPerformance of the model
I E A l i• Input Error Analysis96
Selection of Input Data for theSelection of Input Data for the Models
• Source chlorine, substrate and biomass• Water age• Inflows • Consumption, if any• Time lagged source chlorine based on• Time-lagged source chlorine based on
average residence time
97
Case Study I – Bangalore WDS y g(1994)
an inflow system
three sources supplying to the main ground level
d h d t kand overhead tanks
98
Hydraulic and Water Quality P i f C S d IProperties of Case Study I
• Cauvery Stage I (node 1), Cauvery Stage II (node y g ( ), y g (2) and Arkavathi scheme (node 3) which supplies 1.577 m3/s, 1.682 m3/s and 1.577 m3/s
• Chlorine concentration at the three source nodes is C o e co ce t at o at t e t ee sou ce odes s0.5 mg/l
• Representative data was generated using Multi-component Reaction transport model (Munavallicomponent Reaction transport model (Munavalli and Mohan Kumar, 2004) 99
Input Data to the Model – Case Study I• The total number of Inputs – 23 (3 inputs each for source
chlorine residual, biomass, substrate and inflow concentrations; 1 input each for consumption and water age; 3concentrations; 1 input each for consumption and water age; 3 time lags of source chlorine for each of the source nodes )
• 24 and 6 nodes were chosen for training and testing of the model respectively
• the total training and testing dataset used in the development of the models are 1728 (24×3×24) and 432 (6×3×24) ( ) ( )respectively
fi t i i i l t ti f 99 0% f th• first six principal components accounting for 99.0% of the variance of the dataset 100
Bangalore WDS – Temporal Prediction of Chlorine (T ti D t t)(Testing Dataset)
Algorithm ArchitectureChlorine Residual
R2 MAE
Resilient Back Propagation (RP)
6 -10 - 5 -1 0.87 0.054(RP)Levenberg-Marquardt 6 - 8 - 5 -1 0.92 0.048(LM) General Regression NA 0.86 0.046Regression (GR)
NA 0.86 0.046NA – Not Applicable
101
Bangalore WDS – Temporal Prediction of Chlorine at Node 25
Variation of Chlorine concentration (a) without noisy data and (b) with noisy data (LM – 5%, GR and RP – 2%)noisy data (LM 5%, GR and RP 2%)
102
Bangalore WDS – Temporal Prediction ofBangalore WDS Temporal Prediction of Biomass (Testing Dataset)
Algorithm ArchitectureBiomass
R2 MAE
Resilient BackPropagation(RP)
6 -10 - 6 -1 0.74 0.008(RP)Levenberg-Marquardt 6 - 8 - 9 -1 0.80 0.0062(LM)GeneralRegression NA 0.67 0.009Regression(GR)
NA 0.67 0.009
103
Bangalore WDS TemporalBangalore WDS – Temporal Prediction of Biomass at Node 25
Variation of Biomass concentration (a) without noisy data and (b) with noisy data (LM – 5%, GR and RP – 2%)noisy data (LM 5%, GR and RP 2%)
104
Use of Different Architecture Models of ANNs
• Number of Outputs for each of the models is different
• Use of three type of models– One-outputOne output– Two-output
Three output– Three-output105
Water Quality Indicators and Model Outputs
• Chlorine and Biomass are standard water quality indicators
• Substrates (Nutrients) influence the presenceSubstrates (Nutrients) influence the presence and absence of the above two indicators
• Different combinations of water quality indicators (Chlorine – C; Biomass – X; andindicators (Chlorine – C; Biomass – X; and Substrates – S) to produce three types of ANN models
106
Different Models in the Temporal Prediction ofDifferent Models in the Temporal Prediction of Water Quality Indicators
• Three outputs for each case study Chlorine (C)• Three outputs for each case study – Chlorine (C), Biomass (X) and Substrate (S)
• The different combinations of ANN models– One output – chlorine biomass or substrateOne output chlorine, biomass or substrate
– Two output – chlorine + biomass, chlorine + substrate, pbiomass + substrate
– Three output – chlorine + biomass + substrate107
Development of Different Architecture ANN Models
• Selection of Input data
• Principal Component Analysis
• Performance of the models based on LM algorithm
• Input Error Analysis
108
Case Study II – North Marins WDSCase Study II North Marins WDSTwo sources of water:
Stafford Lake and the North Marin Aqueduct
Stafford Lake source t l d i thoperates only during the
peak demand period -16 hours per day p y
Stafford Lake water has high humic content
North Marin Aqueduct water is derived from a Raney Well Fi ldField
109
Hydraulic and Water QualityHydraulic and Water Quality Properties of Case Study II
• At each source the chlorine concentration is 0.5 mg/lg/
• The lake water has a slightly high humic contentThe lake water has a slightly high humic content thus increasing the TOC content (5-12 mg/l) entering into the system
• There are flow reversals in many of the pipes of y p pthe system due to the draining and filling cycles of tanks 110
Input Data to the Models – Case Study II
• The total number of Inputs – 30 (2 each for source chlorine, biomass and substrate concentration, 2 for inflows 1 each for consumption water age and 10 timeinflows, 1 each for consumption, water age and 10 time lags of source chlorine residual for both sources)
• 26 and 6 nodes were randomly chosen for training and testing of the model respectively
• The total training and testing dataset used in the development of the model is 1872 (26×3×24) and 432development of the model is 1872 (26 3 24) and 432 (6×3×24) respectively
• 18 principal components accounting for 98% of the total variance of the input dataset 111
Different ANN Models in the Temporal Prediction of Water Quality Indicators (TestingPrediction of Water Quality Indicators – (Testing
Dataset)
Architecture
Type C X Syp
(C, S, X) 18-8-9-1 18-8-9-1 18-8-9-1
(C+X) 18-15-12-2 18-15-12-2 -(C+X) 18-15-12-2 18-15-12-2 -
(C+S) 18-10-8-2 - 18-10-8-2
(X+S) - 18-15-12-2 18-15-12-2
(C+S+X) 18-15-12-3
112
Performance Index (R2) for each of the ANN M d l (T i D )ANN Models – (Testing Dataset)
Type C X S
(C, S, X) 0.85 0.91 0.93
(C+X) 0.82 0.95 -
(C+S) 0.84 - 0.92
(X+S) - 0.96 0.92(X S) 0.96 0.92
(C+S+X) 0.80 0.96 0.92
113
Performance Index (MAE) for each ofPerformance Index (MAE) for each of the ANN Models – (Testing Dataset)
MAE
Type C X SType C X S
(C, S, X) 0.137 0.006 0.096
(C+X) 0 128 0 006(C+X) 0.128 0.006 -
(C+S) 0.122 - 0.097
(X+S) - 0.006 0.101
(C+S+X) 0.129 0.006 0.101
114
North Marin WDS – Temporal Prediction of Chlorine at Node 153
Variation of Chlorine concentration (a) without noisy data and (b) with noisy data
115
North Marin WDS TemporalNorth Marin WDS – Temporal Prediction of Biomass at Node 153
Variation of Biomass concentration (a) without noisy data and (b) with noisy data
116
North Marin WDS TemporalNorth Marin WDS – Temporal Prediction of Substrate at Node
153
Variation of Substrate concentration (a) without noisy data and (b) with noisy data
117
Need for Quantity ControlNeed for Quantity Control • Increased and uneven consumer demands
• Operation of WDSs is complex• Operation of WDSs is complex
S dd t / f d d• Sudden event / emergency of demands
• Human intervention in control – erroneous results for large networks
118
Need for Quality ControlNeed for Quality Control• Water quality deteriorates throughout the system
• High dose of chlorine injection at source not g jsuitable
• Maintain minimum residual as well as avoid Disinfection-By-Products (DBP) productss ect o y oducts ( ) p oducts
• To address a sudden event of contamination• To address a sudden event of contamination119
Objectives in the Control of WDSsObjectives in the Control of WDSs
• Quantity and Quality (Chemical) Control1. SEQ-PID controller2. SIM-PID controller3. NOM-PID controller
• Quantity and Quality (Chemical & Biological) ControlBiological) Control1. SIM-PID controller2 NOM-PID controller2. NOM-PID controller
120
Different Propositions of PIDDifferent Propositions of PID controller
Integrated Approach – Solutions for both hydraulic and water quality control y q y
Three propositions of PID controllerThree propositions of PID controller1. SEQ-PID2 SIM PID2. SIM-PID3. NOM-PID
121
SEQ PID controllerSEQ-PID controller (Sequential)( q )
Different set of tuning gains for each of the targetsg
The water quality controller action beginsThe water quality controller action begins only when the flow control has been achievedachieved
122
SIM PID ControllerSIM-PID Controller (Simultaneous)
Different set of tuning gains for each of the targetsg
The water quality and hydraulic controllerThe water quality and hydraulic controller work simultaneously and independently
123
NOM PID controllerNOM-PID controller (Normalized)( )
Single set of tuning gains for any set of targets
Error for each of the targets is normalized
The control action for each of the targets work at the same timeat the same time
124
Procedure for Control of QuantityProcedure for Control of Quantity and Quality in WDSs
Known initial conditions
Determine the initial error for each of the targets
Solve the controller equations for control variables
Integrate the state equations to get new state variables
Repeat the process till the end of the operation period125
Case Study I Faridabad WDSCase Study I – Faridabad WDSFlow Control – To
maintain flow - 70% of initial flows
Quality Control –/ f0.4 mg/l of chlorine
residual
126
Details of the NetworkDetails of the Network• Water is pumped from the source node (Node p p (
1) and is distributed to seven major tanks • The pipe sizes of the distribution system varyThe pipe sizes of the distribution system vary
from 150 to 900 mm • Total design discharge of the pump is 0 6 m3/s• Total design discharge of the pump is 0.6 m3/s• Lift for the seven tanks varies from a minimum
f 2 0 t i f 10 5of 2.0 m to a maximum of 10.5 m
127
State / Control / Error EquationsState / Control / Error Equations
( ) [ ]TX& 1 2 3
1 2 3 7 1 2 30 1 2 3 30
( ) [ , , ,..... ]
[ , , ,... , , ,... , , , ,.... ]
Tn
T
X t x x x x
h h h h Q Q Q c c c c
=
=
&
13 17 27 28 29 12 15 19 26 30( ) [ , , , , , , , , , ]v v v v vU t K K K K K c c c c c=
* * * * *13 13 17 17 27 27 28 28 29 29( ) [ , , , , ,E t Q Q Q Q Q Q Q Q Q Q= − − − − −
* * * * *2 2 3 3 5 5 7 7 8 8, , , , ] c c c c c c c c c c− − − − −
128
Formulation of the ProblemMM
( )2 2
. .41 4
1 1 4
0 ( )( ) ( )tt N
t t
Qdh Q tX t h A Q tdt A A
−= = = = =
( )2 2
. .12 1
2 2 1
0 ( )( ) ( ) ( )tt N
t t
Qdh Q tX t h t A Q tdt A A
−= = = = =
.1.852 213 13 13 13 13
21 13 2 131.852 4.8713 13 13
.1.852 2
13 13 13 2 13 2 13 13
10.71( ) ( ) ( ) ( )2
[( ) ( ) ]
v
t t s s p vj
dQ gA l K QX t h h Qdt l c D g A
Q P h h h h H Q K Q
⎡ ⎤×= = − − −⎢ ⎥
⎣ ⎦
= − + − − −2 2
MM.
1.8521 1 19 12 13 11.852 4.87
1 1
10.71( ) ( ) ( )dQ gA lX t h h Qdt l c D
⎡ ⎤×= = − −⎢ ⎥
⎣ ⎦
MM
13 13 13 2 13 2 13 13[( ) ( ) ]t t s s p vjQ Q Q
d k1 1
.1.852
1 12 13 12 13 1
.1.852
1 12 13 1
( ) ( )
[( ) ]
p t t s s p
p t t ij p
Q P h h h h H Q
Q P h h S H Q
⎣ ⎦
⎡ ⎤= − + − −⎣ ⎦
= − + −
.1 1 1
38 ( )2
dc k cX tdt
= = −
MM.
2 212 420 9 10 12 122
4
.2 24
12 9 10 9 10 12 12
( ) ( ) ( ) ( )
( ) ( )
o oo
t t
B CdQ gAX t h h A N NQ Qdt l n n
gAQ h h h h A N B NQ C Q
⎡ ⎤= = − + + +⎢ ⎥⎣ ⎦
⎡ ⎤= − + − + + +⎣ ⎦
1
n
Nt
AA
= pp
p
gAP
l= 1.852 4.87
10.71 pp
p
lH
c D×
=
S h h=12 9 10 9 10 12 124
.2 2
12 4 9 10 12 12
( ) ( )
[( ) ]
t t s s o o o
t t ij o o o
Q h h h h A N B NQ C Ql
Q P h h S A N B NQ C Q
⎡ ⎤+ + + +⎣ ⎦
= − + + + +
ij si sjS h h= −
129
Errors in Chlorine Residual Targets in TanksErrors in Chlorine Residual Targets in Tanks and Chlorine Injection Rates
131
Gains of the Different ControllersGains of the Different Controllers
Type Controller K K KType Controller Kp Ki Kd
SEQ-PIDQuantityQuality
1.80 1.80 0.45SEQ PID Quality 0.6 0.6 0.15
SIM PIDQuantity 1.80 1.80 0.45SIM-PID Quality
1.800.6
1.800.6
0.450.15
QuantityNOM-PID
QuantityQuality 0.3 0.6 0.03
132
Details of the NetworkDetails of the NetworkIt has four sources of river supply. CauveryIt has four sources of river supply. Cauvery stage 1 (source 1), Cauvery stage II (source 2), Cauvery stage III (source 4) and Arkavatti Cauve y stage (sou ce ) a d avattriver (source 3) supplying 1.577 m3/s, 1.682 m3/s, 3.15 m3/s and 1.577 m3/s 3/s, 3. 5 3/s d .577 3/s
Th f l t 18 i t kThese four sources supply to 18 main tanks spread over the entire area of Bangalore City
134
State / Control / Error EquationsState / Control / Error Equations
1 3 4 16 17 18 1 105 1 2 3 135( ) [ , , ,... , , , ,.... , , ,.... ]Tt t t t t tX t h h h h h h Q Q c c c c=&1 3 4 16 17 18 1 105 1 2 3 135( ) t t t t t t Q Q
18 23 7 10 12 18 25 64 60 112( ) [ , ,........ , , , , , , , ,v v v v vU t K K K K K c c c c c=
32 51 70 38 134, 86 97 93 107, 5 9 12, , , , , , , , , ] c c c c c c c c c c c c
* * * * * * *14 14 22 22 33 33 61 61 5 5 9 9 11 11( ) [ , , , ,..... , , ,E t Q Q Q Q Q Q Q Q Q Q Q Q Q Q= − − − − − − −
* * * * * * *22 22 27 27 66 66 27 27 7 7 11 11 14 14, , , ,............. , , ] c c c c c c c c c c c c c c− − − − − − −
flow_st =[420.0 378.0 248.0 125.8 541.8 223.4 400.9 120.9 278.10 530.40 626.3 421.5 354.6 340.56 339.85 346.24 302.60 588.61]
cl_st =[0.2 0.2 0.2 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.4 0.4 ]
135
Gains of the Different ControllersGains of the Different Controllers
Type Controller Kp Ki Kdyp p i d
SEQ-PIDQuantityQuality
5001 32
8.01 32
0.80 33Q Q y 1.32 1.32 0.33
SIM PIDQuantityQ li
500 8.0 0.8SIM-PID Quality 1.5 1.5 0.38
QuantityNOM-PID
QuantityQuality 1.26 1.00 0.39
138
Quantity and Quality (Chemical &Quantity and Quality (Chemical & Biological) Control
• Providing safe drinking water remains a top prioritypriority
• A minimum of 0 2 mg/l chlorine residual to• A minimum of 0.2 mg/l chlorine residual to be maintained
• To safe-guard systems from microbial contaminants we need to measure indicatorscontaminants we need to measure indicators of contamination in WDSs 139
Monitoring of Water Quality IndicatorsMonitoring of Water Quality Indicators
• US EPA (2005) conducted a study to determine water quality indicators which influence an event of waterquality indicators which influence an event of water quality change and accidental contamination
• Baseline water quality parameters - pH, conductivity, dissolved oxygen, free and total chlorine and TOC d sso ved o yge , ee d o c o e d OC
• Experimental studies have shown that chlorine andExperimental studies have shown that chlorine and total organic carbon are able to respond and trigger alarms thus giving a warning in the event of
140
contamination140
Water Quality Scenarios inWater Quality Scenarios in WDSs
• Presence of organic carbon after treatment
• Bacterial contamination cannot be totally removedremoved
• Rejuvenation of injured bacterial components in conducive environments
141
Objectives of Quantity andObjectives of Quantity and Quality (Chemical & Biological)
Control• To maintain sufficient chlorine residual to
prevent formation of bacterial re-growth
• To address events of contamination at any point within the systempoint within the system
U f SIM PID d NOM PID t ll142
• Use of SIM-PID and NOM-PID controllers 142
Mutli component ReactionMutli-component Reaction Transport Model
• Model – gives the distribution of chlorine organic carbon (BDOC) and biomass
• Takes into consideration important processes of the three componentsthe three components
• Considers the bulk and wall zone of pipes• Considers the bulk and wall zone of pipes
Can predict the spread of contaminants intrudingCan predict the spread of contaminants intruding into the system
143
Main Work Done• Development of Inhouse Deterministic Models for
Prediction Hydraulics and Water Quality ( both Chemical Biological Reactions)Chemical Biological Reactions)
• Parameter Estimation Based on Traditional as well as Heuristic Approaches
l f l d d l d• Development of Control Based Models Based on PI, PID and DI Controllers to Control Water Quantity Q y
• Development of SIMULINK / MATLAB approaches for Control of Water Networks
144
Main Work Done (Contd)
• ANN based models for prediction of Water Quality – Different inputs, different Q y p ,architectures – Multiple outputs- Simple calibration
• Application of Control algorithms for control of Water Quality – Both Chemicalcontrol of Water Quality Both Chemical and Biological quality
145
Future Work
• Prediction of Reaction Kinetics using Pilot loop experiments
l f i i• Development of CWS – Contaminant Warning System – Accidental, Intentional Contamination
• Sensor application in Water Networks Real time• Sensor application in Water Networks – Real time monitoring as well as control
• Reliability, Resilience and Vulnerability of Water y, yNetworks
• Efficient Operation of Asset Management
146