Professional Documents
Culture Documents
References
• Global Water Partnership (2005). Monitoring and Evaluation Indicators for IWRM
Strategies and Plans: Technical Brief 3. http://www.gwpforum.org.
• Heun, J.C. (2011). A Framework of Analysis for Water Resources Planning. UNESCO-
IHE Lecture Notes. Delft, The Netherlands.
• Jain S.K. and Singh V.P., (2003) „Water Resources Systems Planning and Management‟,
Elsevier, The Netherlands.
• Loucks, D. P., van Beek, E., Stedinger, J. R., Dijkman, J. P. M. and Villars, M. T. (2005).
Water Resources Systems Planning and Management: An Introduction to Methods,
Models and Applications. UNESCO Publishing, Paris.
• Mays L.W and Tung Y-K, 1992. „Hydrosystems Engineering and Management‟,
McGraw Hill, USA.
Concept
Classification
1.1 Concept of a System System Analysis
Pros and cons
System Representation
Some Systems in
Parameters, b WRPM:
Watershed
Aquifer
Development Area
Transformation function Detention Basin
Inputs, I Outputs, Q
Q(t) = W(a, b) * I(t)
• Mathematical model
Policies or controls, a • Typically a set of algebraic equations
• Derived from differential equations of
System Characteristics – Conservation of Mass (e.g., continuity)
– Conservation of Momentum (e.g.,
Linear Nonlinear Manning)
Lumped Distributed – Conservation of Energy (e.g., friction
loss)
Steady-state Transient
Deterministic Stochastic
Concept
Linear and Nonlinear systems: A linear system is the one in which the
output is a constant ratio of the input. In a linear system the output
due to a combination of inputs is equal to the sum of the outputs
from each of the inputs individually i. e principle of superposition.
Time-variant and Time-invariant systems: In a time invariant system
the input-output relationship does not depend on the time of
application of input. i.e. output is the same for the same input at all
times. E.g. Unit hydrograph.
Deterministic system and Stochastic system: In a stochastic system
the input-output relationship is probabilistic.
Continuous and Discrete systems: In continuous system the changes in
the system take place continuously.
Concept
i
Qi h j ui j 1
j 1
Concept
• Hydrologic systems
Concept
•Continuity equation
•Convolution equation
1.3 Water resource Concept
Classification
System Analysis
• Systems analysis
• Forces the user to identify the known and not readily known
elements of the system
– Multi-purpose plan
– International plan
– National plan
– Regional plan
– District plan
Figure . Common spatial and temporal scales of models of various river basin
processes (Loucks et al., 2005)
2.3 Planning Approaches
• Top down approach (command and control approach).
– Planning process typically dominated by professionals
– Very less stakeholder participation
– The approach assumes that one or more institutions have the ability
and authority to develop and implement the plan, in other words, that
will oversee and manage the coordinated development and operation
of the basin‟s activities on the surface and ground waters of the basin.
– Widely practiced in past century-still practiced in many developing
countries
– However, becoming less desirable and acceptable over time
• Bottom up approach (grass-root approach).
– Within the past two decades WRPM processes have increasingly
involved the active participation of interested stakeholders.
– Bottom-up planning must strive to achieve a common or „shared‟
vision of goals and priorities among all stakeholders.
2.3 Planning Approaches
• Typical Analytical Framework for water resources studies (Delft
Hydraulics).
2.3 Water Resources Planning
Need of Integration in WRP
Interdependence calls for integration
(GWP, 2000).
• Natural system (Land and water,
surface-and ground waters,
quality and quantity, upstream
and downstream, Freshwater and
coastal water).
• Human system (water and
national economy, sectoral,
public-private, involving every
body)
Four dimensions of IWRM (Savenije
and van der Zaag, 2008)
(1) Water resources, (2) Water users,
(3) Spatial scales, (4) Temporal
scales
2.4 Water Resources Management
Land
Area (106 ha)
(103 km2) 80 8
70 7
Irrigated
Flow
60 Land 6
(km3) Area
50 5
40 4
30 3
Flow
20 2
10 1
0 0
1930 1940 1950 1960 1970 1980 1990 2000
1964
1973
1976
1985
1989
1997
2000
Aral Sea 2001
2002
2003
2004
2005
2006
2007
2008
2009
2.4 Water Resources Management
Environmental
Policy
Enabling
Environment
Economic Social
Policy Policy
2.4 Water Resources Management
• Sustainable water resources management: Water resource
systems that are designed and managed to fully contribute to the
needs of society, now and in the indefinite future, while protecting
their cultural, ecological and hydrological integrity.
Decision
Data
Implementation
Measurement !
(
(!
! ( !(!
(!(
( !
! (
!
(
!
(
!
(
!
(
!
(
!
( (!
! ( !
( !
( !!
((
!
(
!
(! !
(
(
!
( !
( !
( !
(
Decision !
(
!
(
!
(
!
(
!
(
!
(
!
(
!
(
!!
((
!
(
!
(
!
(!
!
(
!
(
!
(
!
(
!
(
!
(
!
( ( !
( !
(
Support
!
( !!
(( !
(
Data !
(
!
(
!
(
!
( !
( !
(
!
(
!
(!
(
!
(
(!
!(
!
(
!
(
!
(
!
(
Processing & !
(
Decision Making
System Archiving
Analysis
Data base
MCDM Data model
Operating rules Data display
Expert system
Rainfall/runoff,
Optimization, Warnings
Flooding, Hydraulics, Water Allocation,
Risk management, Dispute Resolution
Water Pollution, Environmental Flows
Structure
Spectral
Partitioning of time
series
Structure
Spectral
Background
• If the properties of the process is unaffected by a change of time
origin, the process is called “strictly stationary”, which means that
the joint probability distribution of any m observations made at
times t1, t2, …, tm is the same as that associated with m
observations made at times t1 + k, t2 + k, …, tm + k.
• It also follows from the definition of stationarity, that the process
obtained by performing a linear operation on a stationary process is
also stationary.
• In particular, if zt is a stationary process, then the first difference
Z t Z t Z t 1
and higher differences d Zt are stationary.
Structure
Spectral
j0
White noise zt
Linear filter
at
Structure
Spectral
z t ( B )a t
Squaring both sides and finding their expected values yields
2
z
2
a j
j0
2
The linear filter model can be put in another form in which the
current deviation (~
z t z t ) is regressed on past
deviations ~ z t 1 , ~
z t 2 ,...
Structure
Spectral
where B 1 1 B 2 B 2
... p B p
is the
autoregressive operator of order p.
1
( B)z t a t is equivalent to z ( B)a where ( B) 1 ( B)
t t ( B)
The variance of the process is:
2
2z a
1 11 2 2 ... p p
Structure
Spectral
Z t 1 Z t 1 at
where μ is the mean level, ϕ1 is the AR parameter, and at is the
error term with zero mean and variance Sa2. at is assumed to be
identically and independently distributed
S a2 , k 0
at at k
0 , k 0
Structure
Spectral
AR(1) process
Z t 1 Z t 1 at
at 0
Standard normal variate t
a
2
at t a since z2 a
, 1 2
1 12 a z 1
at t z 1 12
Thus Z t 1 Z t 1 t z 1 12
Zt 1 Z t 1
t 1 12
z z
t 1 t 1 t 1 12
Structure
Spectral
12
2 2
2 2
2 1
1 2
1 2
1
Using the stationary conditions, the admissible values for ρ1 and ρ2,
for a stationary AR(2), must lie in the region
1 1 1
1 2 1
1
(1 2 )
2
1
2
Structure
Spectral
2a
2
1 11 2 2
z
1 2 2a
1 2 (1 2 ) 2
1
2
Structure
Spectral
1 11 22
1 2 a2
3.704
1 2 (1 2 ) 1
2 2
Structure
Spectral
ˆk Z t Z Z t k Z
k
ˆ t 1
, k 0,1,2,
ˆ0
Z Z
n
2
t
t 1
nk
Z t Z Z t k Z
ˆ k t 1
,
Z Z
n
2
t
t 1
nk
Z t Z Z t k Z
t k 1
ˆ k
Z Z
n
2
t
t 1
ˆ22 2 11 1 2 1
1 11 1 1 1
2
1 1 2 1 ... p p 1
2 1 1 2 ... p p 2
. ... .
. ... .
p 1 p 1 2 p 2 ... p
Structure
Spectral
Solution
1 r1 1 r2 / 1 r12 0.4581.004 / 1 0.4582 0.582
2 r2 r12 / 1 r12 0.004 0.4582 / 1 0.4582 0.271
R 2 1r1 2 r2 0.582 0.458 0.271 0.004
2 1 R 2 0.8562
t 0.582 0 0.271 0 0.8561.352 1.157,
xt 0.182 t 1 1.211
t 1 0.5821.157 0.271 0 0.856 0.532 0.238,
xt 1 0.181 t 1 1 1.040
t 2 0.582 0.238 0.2711.157 0.856 0.789 0.489,
xt 2 0.182 t 2 1 1.089
Structure
Spectral
Z t B at
• where ϴ(B) = 1- ϴ1B is the MA operator of order one. For the
process to be invertible, parameter θ1 must satisfy |ϴ1| < 1.
However, the process is of course stationary for all values of
1.
1
k 1 (1 12 )
k 1 12 kk k
• where ϕ(B) and ϴ(B) are the AR(p) and the MA(q) operator,
respectively.
(1 11 )(1 1 )
1
1 12 211
2 11
k 1 k-1 k2
Structure
Spectral
2 1
2 1 ( 21 1) 1 0
2 1 (21 - 1) 1 0
Structure
Spectral
ˆ
z2 1 ˆ12
2
1 2ˆ1ˆ1 ˆ12
a
r2
ˆ1
r1
ˆ
1
b b 4 r1 ˆ1
2
2
2 r ˆ 1 1
b 1 2ˆ1r1 ˆ12
Structure
Spectral
Soln:
ρ1=0.3125
ρ2= 0.2344
ρ3 =0.1758
ρ4 =0.1318
Structure
Spectral
Nonstationary Processes
Differencing
• Calculating differences allows a trend to be removed from a
series:
Z t Z t Z t 1
2 Z t Z t Z t 1
X t X t X t 1 1 B X t
2 X t X t 1 B 1 B X t 1 2 B B 2 X t
X t 2 X t 1 X t 2
B
( Z t )
d
at
B
Seasonal integrated autoregressive moving average
(SARIMA) processes
• The general notation of a SARIMA (p,d,q)×(P,D,Q) model is
( s Z t )
d D B B s
B B s
at
Structure
Spectral
• Other tools in the identification are the sample ACF and the
sample PACF for univariate time series models. Plots of the
sample ACF and the sample PACF indicate the type of
stochastic process that can be assumed (AR, MA or ARMA)
and the order of this process.
• In the estimation stage the parameter values are estimated by
using an optimization algorithm, based on a least squared
criterion or a maximum likelihood criterion.
• In the stage of diagnostic checking (verification) it is checked
if the model assumptions are answered. This is mainly based
on analysis of the residuals: the plot of residuals against time,
the residual ACF and the residual PACF.
Structure
Spectral
P
j 1
ij 1 for i 1,2,, m
Time series analysis
3.3 Markov Models Disaggregation
Markov model
The special case f=0 in which the current value is independent from
the past is called the independence model. The transition matrix then
becomes a single probability distribution: C0 PYt j P1 Pk
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Pt+1=QPt
Pn=QnxP0
=Q(n)P0
Example 2:
Example 3:
(a) Determine the elements of the one-step annual transition matrix on
the assumption that the process is homogeneous in time.
(b) If the reservoir is initially full, what are the probabilities of the
various states on (i) 1 January 2080 and on (ii) 1 January 1982?
(c) If the reservoir is initially full, what is the probability that the
reservoir (i) will not be empty during the first 3 years of operation and
(ii) will be empty for the first time around 1 January 1983?
(d) What is the return period for a full reservoir?
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
Xt~N(3,1)
S3
S2
annual demand S1
=3 units
S0
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(a) From the tables of the normal distribution, the probabilities of the
five types of inflows are approximated as follows for t=0,1,2…
P(Xt=1)=0.061
P(Xt=2)=0.245
P(Xt=3)=0.388
P(Xt=4)=0.245
P(Xt=5)=0.061
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(a) The one step transition probabilities q(i, j), i, j=0,1,2,3,4 are as
follows.
q(0,0)=P(Xt≤3)=0.694
q(1,0)=P(Xt=4)=0.245
q(2,0)=P(Xt=5)=0.061
q(3,0)=P(Xt≥6)=0.000
1.000
q(0,1)=P(Xt≤2)=0.306
q(1,1)=P(Xt=3)=0.388
q(2,1)=P(Xt=4)=0.245
q(3,1)=P(Xt≥5)=0.061
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(a) The one step transition probabilities q(i, j), i, j=0,1,2,3,4 are as
follows.
q(0,2)=P(Xt≤1)=0.061
q(1,2)=P(Xt=2)=0.245
q(2,2)=P(Xt=3)=0.388
q(3,2)=P(Xt≥4)=0.306
1.000
q(0,3)=P(Xt<1)=0.000
q(1,3)=P(Xt=1)=0.061
q(2,3)=P(Xt=2)=0.245
q(3,3)=P(Xt≥3)=0.694
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(a) Hence, the one step transition matrix is given by:
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(b i) The following simultaneous equations are obtained by using
Which gives the probabilities of the various states after a long period,
such as 100 years
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(b ii) The initial vector of unconditional probabilities
P0=[0 0 0 1]T, and from equation P2=Q2P0.
Because the elements of the column vector P0 are zero except the last
which is 1. The column vector P2 is equal to the vector formed by the
elements of the last column of the product QQ, that is,
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(b ii) where
Hence
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(c i) Given the initial vector of unconditional probabilities in order to
determine the unconditional probabilities of first time emptiness
after a period of t years of operation of the reservoir (t=1,2,3,…)
the elements of the first column of the one step transition matrix
Q are adjusted so that when the reservoir reaches an empty state
it remains empty there after. In this particular case an absorption
state is setup by changing the first element to 1 and the other
elements in the first column to 0.
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(c i) The adjusted matrix of transition probabilities is given by:
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Solution:
(c i)
Hence
Time series analysis
3.3 Markov Models Disaggregation
Markov model
Solution:
(c i)
Solution:
(c ii) Because of the absorption state P2(0) includes the probabilities of
first time emptiness after 1 year and 2 years. Likewise, P3(0)
includes the probabilities of first time emptiness after 1 year and
2 years and 3 years. Therefore the probability of an empty
reservoir for the first time at the end of the third year is
P3(0)-P2(0)=0.056
(d) The steady state probability of a full reservoir from answers to b(i)
is 0.273. This is the long run probability of having a full reservoir
in any year. Hence, the return period of a full reservoir is
1/0.273=3.66 years (on average the reservoir will be full once in
3.66 years).
4.1 Modelling Techniques
ii. Dynamic (takes into account the change in the parameters of the
system and the operational policy with time) in nature.
4.3 Classification of simulation
• Simulation models can be deterministic or stochastic
Rt
Release available
water & Release demand & Release demand
deficits occur demand met spill excess
St Demand
Rt Dt
Qt X1t
K X2t
Dt
Dt Dt+K St+ Q t
4.3 Hedging Rule
hedging D
K
4.3 Performance Evaluation
XT X t if Xt XT
Dt
0 if Xt XT
4.3 Performance Criteria - Vulnerability
Dt
Vulnerability =
Dt 0 # of times Dt > 0 occured
4.3 Simulate the System
Release available x1
6
Allocation, Xi
water x2
x3
Dt 4
0
Dt K Dt+K St + Q t 0 2 4 6 8 10 12 14 16
Release, R
Policies
Model
4.3 Uncertainty
• Deterministic process • Stochastic process
– Inputs assumed known. – Explicitly account for
– Ignore variability variability and uncertainty
– Assume inputs are well – Inputs are stochastic processes
represented by average values. – Historic record is one
– Over estimates benefits and realization of process.
underestimates losses
4.3 Simulate the System
Reservoir operating policy Allocation policy
Rt
8
Release available x1
6
Allocation, Xi
water x2
x3
Dt 4
0
Dt K Dt+K St + Q t 0 2 4 6 8 10 12 14 16
Release, R
Distribution of inputs
FX(x)
FY(y)
Policies
X
Generate multiple
input sequences Compute
h(y) statistics of
g(x) outputs
y
Simulate each h(y)
x System
g(x) Input sequence
Get multiple
output sequences
y
x Model
4.3 System Simulation
Start
St
X1t
R
Qt X2t t=0
St = S0
K X3t
t=t+1
Operating Policy Allocation Policy
Rt 8
6
x1 Read Qt File
Allocation, Xi
Release available x2
water x3
4
Dt
Release Release demand 2 Compute
demand + excess Rt, Xit, i=1,…n
0
0 2 4 6 8 10 12 14 16
Data
Dt K Dt+K St + Q t Release, R Storage
St+1 = St +Qt -Rt
• Create network representation of system
• Need inflows for each period for each node
• For each period: No
Done?
Perform mass balance calculations for Yes
each node
Stop
Determine releases from reservoirs
Allocate water to users
4.3 Example
DEMAND
St 5
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Total # of Frequency 9
SimulationShortage Failures of Failure
1 -1.031 2 0.100 8
2 -10.050 8 0.400 7
3 -0.516 1 0.050
# of Failures
4 -0.184 1 0.050 6
5 -1.159 2 0.100 5
6 -10.747 8 0.400
7 -4.627 6 0.300
4
8 -1.134 4 0.200 3
9 -1.446 4 0.200
2
10 0.000 0 0.000
11 -1.735 4 0.200 1
12 -3.384 5 0.250 0
13 -3.639 3 0.150
14 0.000 0 0.000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
15 -0.067 1 0.050 Simulation
16 -1.561 3 0.150
17 -3.586 6 0.300
18 -0.223 1 0.050
19
20
-1.347
-0.977
1
2
0.050
0.100
Average failure frequency = 0.165
21 -4.758 0 0.250 Average reliability = 1- 0.165 = 0.835 = 83.5%
22 -4.966 5 0.250
23 -3.641 4 0.200 Actual failure frequency [0, 0.40]
Average -2.643
Std. Dev. 2.93704
0.165
0.118163 Actual Reliability [100%, 60%]
5.1 Optimization techniques
Analytical/Numerical differentiation,
Linear Programming (LP),
Dynamic Programming (DP),
Non-Linear Programming (NLP),
Integer Programming (IP),
Goal Programming,
etc
5.1 Optimization Problems
30
Bi ( xi ) ai xi bi xi2 i 1,2,3
25
Ben efit, B
20
15 B1
B2
10
B3
5
Example
• Decision variables: xi , i 1, 2, 3
3
maximize (ai xi bi xi2 )
• Objective: i 1
Note: if sufficient
water is available
the allocations are
x1 x2 x3 R Q independent and
• Constraint:
equal to
3 x1* 3, x2* 2.33, x3* 8
maximize ( ai xi bi xi2 )
i 1 How?
• Optimization model: x
subject to
3
xi R Q
i 1
5.1 Optimization
Benefit Bi (xit )
f(x)
Global
• First-order conditions Tangent is
minimum
• First-order conditions
f ( x )
for a local optimum 0
x1
at x x*
f ( x )
0
xn
• n - simultaneous equations
5.1 Analytical Optimization
Function of multiple variables
subject to g(X) = 0,
The function f(x) and the equality constraint, g(x), may or may not be linear.
We shall write the Lagrangean of the function f(x) denoted by Lf(x, l) and
apply the Lagrangean multiplier method.
When g(x)=0 optimizing Lf(x) is the same as optimizing f(x). Now the
original problem is transformed to unconstrained optimization by the
introduction of the additional variable l.
5.1 Analytical Optimization
Single Constraint
Multiple Decision Variables
Lagrangian
minimize f ( x )
L( x , l ) f ( x ) l[h( x )]
Vector
x
subject to
Notice what
h( x ) 0 happens to h(x)
One constraint f h
l 0 when we have a
x1 x1 feasible vector x
f h
First-order conditions l 0
x2 x2
N+1 equations
f h
l 0
xn xn
h( x ) 0
5.1 Analytical Optimization
Bi ( xi ) ai xi bi xi2 i 1,2,3 a1 6; a2 7; a3 8
b1 1.0; b2 1.5; b3 0.5
3 3
L x,l (ai xi bi xi ) l xi R Q
2
i 1 i 1
L
a1 2b1x1 l 0
x1
L
a2 2b2 x2 l 0
x2
L
a3 2b3 x3 l 0
x3
L
x1 x2 x3 R Q 0
l
5.1 Analytical Optimization
30
25
Benefit, B
20
15
B1
10
B2
5 B3
0
0 1 2 3 4 5 6 7 8 9 10
x 2* x 1* Allocation, x x 3*
Total
Downstream
Q x1 x2 x3 l R Flow
5.00 0.18 0.45 2.36 5.64 2.00 2.00
8.00 1.00 1.00 4.00 4.00 2.00 2.00
10.00 1.55 1.36 5.09 2.91 2.00 2.00
15.00 2.91 2.27 7.82 0.18 2.00 2.00
16.00 3.00 2.33 8.00 0.00 2.00 2.67
20.00 3.00 2.33 8.00 0.00 2.00 6.67
5.1 Analytical Optimization
Necessary condition
2L
Lij evaluated at x 0 , i 1,2,..., n; j 1,2,..., n
xi x j
g p ( x)
g pi evaluated at x 0 , p 1,2,..., m;
xi
5.1 Analytical Optimization
Sufficiency condition :
If all the roots are positive and independent of X, then X0 is the global
minimum.
5.1 Analytical Optimization
l j g j ( x) 0, j 1,..., m
g j ( x) 0, j 1,..., m
and l j 0, j 1,..., m
In addition if f(x) is concave and the constraints form a convex set, these
conditions are sufficient for a global maximum.
5.2 Analytical Optimization
Example
Maximize Z 6x 5 y
subject to 2x 3y 5
x 3 y 11
4 x y 15
x, y 0
5.2 Graphical method: Step - 1
This is known as
‘feasible region’
5.2 Graphical method: Step - 3
Maximize Z 8 x 11y
subject to 3x y 7
x 3y 8
x, y 0
5.2 Different cases of optimal solution
2. An unbounded solution,
• Proportionality assumptions
• Additivity assumption
• Divisibility assumption
• Deterministic assumption
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Example 1
A construction site requires a minimum of 10,000 yd3 of sand and
gravel mixture. The mixture must contain no less than 5000 yd3 of
sand and no more than 6000 yd3 of gravel. The material may be
obtained from two sites
1 5 30 70
2 7 60 40
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Constraints
x1 + x2 10000.00 >= 10,000
0.3x1 +0.6x2 5000.00 >= 5000
0.7x1+0.4x2 5000.00 <= 6000
x1 3333.33 >= 0
x2 6666.67 >= 0
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
2X1
(waste units
generated) 2X1 – X2 Waste
treatment
plant
X2 0.2(2X1 – X2)
(units of waste
discharged without
treatment)
watercourse
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Solution :
Let X1 be units of finished goods to be produced
X2 be units of waste discharged without treatment
Sales of finished goods (in $ K), 10X1
Cost of producing goods (in $ K), 3X1
Cost of treating the waste ( in $ K) generated from the production
process, 0.6(2X1-X2)
Effluent tax (in $ K), 2[X2 + 0.2(2X1 – X2)].
The objective function to the problem is to maximize the profit which is
10X1 – {3X1 + 0.6(2X1 – X2) + 2[X2 + 0.2(2X1 – X2)]} =5X1 – X2. The
objective is then expressed as:
Max X0 =5X1 – X2
Subject to 2X1 – X2 ≤ 10
0.4X1 + 0.8X2 ≤ 4
2X1 – X2 ≥ 0
X1 ≥ 0 and X2 ≥ 0
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Soln:
Graphical method: Feasible space of the manufacturing waste
treatment plant example
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method
Simplex method
All the basic solutions need not (and, in general, will not) be
feasible.
• A basic solution which is also feasible is called as the Basic
Feasible Solution.
• All the corner points of the feasible space are basic feasible
solutions.
The possible no. of basic feasible solutions can be too large to be
enumerated completely.
• The goal would be, starting with an initial basic feasible solution,
to generate better and better basic feasible solutions until the
optimal basic feasible solution is obtained.
Initial basic feasible solution: The basic feasible solution used as
an initial solution in the simplex method. This is the solution in
which all the n decision variables are set to zero. Obviously slack
variables yield an initial basic feasible solution.
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method
The general procedure is:
1. Express the given LP problem in the standard form, with
equality constraints and non-negative right hand side values.
2. Identify the starting solution and construct the simplex table.
3. Check for optimality of the current solution. The solution will
be optimal if all the coefficients in the z-row are non-negative.
Else, an iteration is needed.
4. Identify the entering variable. This is the non-basic variable
with the most negative coefficients in the z-row.
5. Identify the departing variable. This is the basic variable in the
current solution in row i for which
bi Where i is the row and j is the pivot column
is minimum
aij corresponding to the entering variable.
aij 0
Simplex method
Express the given LP problem of the manufacturing waste treatment
plant example in standard form
Simplex method
The standard form of the LP model can be written as in the table
X0 – 5X1 + X2 – 0S1 – 0S2 – 0S3=0
0 + 2X1 - X2 + S1+ 0S2 + 0S3=10
0 + 0.4X1 + 0.8X2 + 0S1 + S2 + 0S3=4
0 - 2X1 + X2 + 0S1 + 0S2 + S3=0
Basic X0 X1 X2 S1 S2 S3 Soln
X0 1 -5 1 0 0 0 0
S1 0 2 -1 1 0 0 10
S2 0 0.4 0.8 0 1 0 4
S3 0 -2 1 0 0 1 0
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method
The current non-basic variable to be made basic is called the
entering variable while the current basic variable to be made non-
basic is called the leaving variable.
For a maximization problem, an entering variable is selected, based
on the optimality condition, as the non-basic variable having the
most negative coefficient in the X0 equation (Z-row) of the simplex
tableau.
The one with the largest negative value is selected because it has the
greatest potential to improve the objective function value.
On the other hand the rule of selecting the entering variable for a
minimization problem is reversed, that is choose the non-basic
variable with the largest positive coefficient in the objective
function row of the simplex tableau.
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method
Next, one of the current basic variables must be chosen to become
non-basic. The selection of the leaving variable is governed by the
feasibility condition to ensure that only feasible solutions are
enumerated during the course of the iterations.
Identify the coefficients which are positive in the column of the
entering variable, known as the pivot column, except the objective
function row, of the current solution. If all the coefficients are non-
positive thus the problem is ill posed (it has unbounded solution).
Compute the ratio of the RHS (solution column) to the positive
coefficient under the pivot column for each row.
Pick the row with least of these ratios and mark as the pivot row. The
basic variable in the current solution corresponding to this row in the
simplex table will be the leaving variable. The coefficient which is
common to the pivot row and the pivot column is the pivot
coefficient.
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method
The most negative coefficient in the z-row is -5, thus X1 is entering
variable.
Among the ratio of the RHS (soln column) and positive pivot
column, the least ratio is 5, thus S1 is the leaving variable.
At the intersection of pivot row and column, pivot coefficient is 2.
Pivot column
S3 0 -2 1 0 0 1 0 -
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method
Next, row operation (or Gauss Jordan transformation) is applied to
update the variables in the basic and non-basic variable list.
The new pivot row is obtained by dividing the elements of each old
row by the pivot coefficient.
New row = old row – (pivot column coefficient) (New pivot row)
Similarly the new z row is computed. This completes the first iteration.
This solution would have been optimal if all the coefficients of the z-
row were non-negative. Thus another iteration is performed until this
requirement is met.
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method
Row operation (or Gauss Jordan transformation)
The old pivot row = [0 2 -1 1 0 0 10]
The new pivot row = [0 1 -1/2 ½ 0 0 5]
The rows other than the pivot row are transformed as:
The old row 3 = [0 0.4 0.8 0 1 0 4]
New row 3= [0 0.4 0.8 0 1 0 4] – (0.4) [0 1 -1/2 ½ 0 0 5]
= [0 0 1 -0.2 1 0 2]
Results of iteration 1
Basic X0 X1 X2 S1 S2 S3 Soln
X0 1 0 -1.5 2.5 0 0 25
X1 0 1 -0.5 0.5 0 0 5
S2 0 0 1 -0.2 1 0 2
S3 0 0 0 1 0 1 10
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method
From the previous result of iteration the most negative coefficient in
the z-row is -1.5, thus the entering variable is X2.
The smallest positive ratio is 2, thus S2 is the leaving variable. The
pivot coefficient is 1. The new pivot row = [0 0 1 -0.2 1 0 2]
After the row operations, the simplex tableau is given below.
The feasible extreme point associated with this tableau is
(X1, X2)=(6,2) and the objective function value is 28. All coefficients
in the z-row are non-negative. Thus optimality achieved.
Results of iteration 2
Basic X0 X1 X2 S1 S2 S3 Soln
X0 1 0 0 2.2 1.5 0 28
X1 0 1 0 0.4 0.5 0 6
X2 0 0 1 -0.2 1 0 2
S3 0 0 0 1 0 1 10
Hydrologic DSS
Categories of Optimize
Analytical
5.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Dual Problem
Each LP problem (called as Primal in this context) is associated with
its counterpart known as Dual LP problem.
Instead of primal, solving the dual LP problem is sometimes easier.
Dual Problem
Dual Problem
C c1 , c2 , , cn m
a11 a12 a1n b1
a a22 a2 n b
A 21
, b 2
am1 am 2 amn bm
Input Output
Characteristics of DP problem: S1 Stage 1 S2
Xn Xn-1 X2 X1
Stage 1
R1
f1* S1 maxR1 x1
S1
User 1 0 x1 S1
x1 0 S1 Q
0 0 0 0 0
1 0 0 7 1
1 7
2 0 0 12 2
1 7
2 12
3 0 0 15 3
1 7
2 12
3 15
4 0 0 16 4
1 7
2 12
3 15
4 16
Hydrologic DSS
Categories of Optimize
Analytical
5.3 Dynamic Programing Linear programs
Dynamic programs
Stochastic Dynamic
5 0 0 16 4
1 7
2 12
3 15
4 16
5 15
6 0 0 16 4
1 7
2 12
3 15
4 16
5 15
6 12
Hydrologic DSS
Categories of Optimize
Analytical
5.3 Dynamic Programing Linear programs
Dynamic programs
Stochastic Dynamic
Stage 2
R2(x2)
f 2* S 2 max R2 x2 f1* S 2 x2
S2 S2-x2
User 2 User 1 0 x2 S 2
x2
0 S2 Q
S2: Amount of water available for allocation to User 2 and User 1 together
X2: Amount of water allocated to User 2
S2-X2: Amount of water available for allocation at stage 1 (user 1)
X2*: allocation to User 2, that resulted on return of f2*(S2)
f2*(S2): maximum return due to allocation of S2
Hydrologic DSS
Categories of Optimize
Analytical
5.3 Dynamic Programing Linear programs
Dynamic programs
Stochastic Dynamic
0 0 0 0 0 0 0 0
1 0 0 1 7 7 7 0
1 5 0 0 5
2 0 0 2 12 12 12 0,1
1 5 1 7 12
2 6 0 0 6
3 0 0 3 15 15 17 1
1 5 2 12 17
2 6 1 7 13
3 3 0 0 3
4 0 0 4 16 16 20 1
1 5 3 15 20
2 6 2 12 18
3 3 1 7 10
4 -4 0 0 -4
Hydrologic DSS
Categories of Optimize
Analytical
5.3 Dynamic Programing Linear programs
Dynamic programs
Stochastic Dynamic
5 0 0 5 16 16 21 1,2
1 5 4 16 21
2 6 3 15 21
3 3 2 12 15
4 -4 1 7 3
5 -15 0 0 -15
6 0 0 6 16 16 22 2
1 5 5 16 21
2 6 4 16 22
3 3 3 15 18
4 -4 2 12 8
5 -15 1 7 -8
6 -30 0 0 -30
Hydrologic DSS
Categories of Optimize
Analytical
5.3 Dynamic Programing Linear programs
Dynamic programs
Stochastic Dynamic
Stage 3
R3(x3)
S3
f 3* S3 max R3 x3 f 2* S3 x3
User 3 S3-x3 User 2 User 1
0 x3 S3
x3 S3 Q
S3: Amount of water available for allocation to User 1, User 2 and User 3
together=6 units
X3: Amount of water allocated to User 3
S3-X3: Amount of water available for allocation at stage 2 (user 1 & 2
together)
X3*: allocation to User 3, that resulted on return of f3*(S3)
f3*(S3): maximum return due to allocation of S3
Hydrologic DSS
Categories of Optimize
Analytical
5.3 Dynamic Programing Linear programs
Dynamic programs
Stochastic Dynamic
6 0 0 6 22 22 28 2
1 5 5 21 26
2 8 4 20 28
3 9 3 17 26
4 8 2 12 20
5 5 1 7 13
6 0 0 0 0
When the third stage is solved, all the three users are considered for
allocation, thus the total maximum return is
f3(6)=28
The allocations to the individual users are traced back
From the table for stage 3
X3*=2
Hydrologic DSS
Categories of Optimize
Analytical
5.3 Dynamic Programing Linear programs
Dynamic programs
Stochastic Dynamic
Z2
Consider a problem in which Z
two objectives z1 and z2 are to Z1
be maximized.
• Let both be functions of
decision variable x .
X1 X2 X
• Solutions with x < x1 and x > x2 can be eliminated.
• The range x1 < x < x2 is the non-inferior range.
• In this range, it is not possible to increase the value of one OF
without decreasing that of the other.
5.4 Multi-Objective Planning
subject to g i ( x) bi i 1,2,..., m
Plan formulation:
• Generates a set of non-inferior solutions.
• Two common approaches in formulating a MOP problem
• Weighting method
• Constraint method
5.4 Multi-Objective Planning
Weighting method:
Constraint method:
Max Zj (X)
s.t.
gi(X) ≤ bi i = 1, 2, ……, m and
Zk(X) ≥ Lk for all k ≠ j
Example 5.4:
Example 5.4:
j
K d Maximum Rt Qt
t 1
where 1 i j 2T
6.1 Rippl Method
tQt
250
Jul 0 141 9.3 92.5 Jan 47 280 9.3 259.0
Aug 0 141 9.3 101.8 Feb 16 296 9.3 268.3 200
Sep 0 141 9.3 111.0 Mar 18 314 9.3 277.5
150
Oct 5 146 9.3 120.3 Apr 7 321 9.3 286.8
Nov 6 152 9.3 129.5 May 4 325 9.3 296.0 100
4.0
6.1 Minimum Capacity, Given Yield
Including Evaporation Lt
At
St 1 St Qt Rt Lt
– Lt Losses from reservoir
– A Surface area of reservoir 300
250
200
S St 1 A 0=160 km2
Aa t A0 et
175
Area (km2)
2 150
S St 1
125
Aa et t A0et 100
Total Storage
2 75
at St at St 1 bt 25
0
0 5000 10000 15000 20000 25000
Storage Volume (mln m3)
6.1 Minimum Capacity, Given Yield
Lt
Including Evaporation At
St 1 St Qt Rt Lt
Lt at St at St 1 bt
St 1 St Qt Rt (at St at St 1 bt )
(1 at ) St 1 (1 at ) St Qt Rt bt
Minimize k
subject to
(1 at ) St 1 (1 at ) St Qt Rt bt for all t
St K for all t
Rt Dt for all t
ST 1 S1
6.1 Maximum Yield Given Capacity
SETS
t TIME (MONTHS) / 1*9 / Maximize Y
PARAMETER Q(t) INFLOW
/
1 1.0
subject to
2
3
3.0
3.0 St 1 St Qt Rt t 1,..., T ; T 1 1
4 5.0
5 8.0 Rt Y t 1,..., T
6 6.0
7
8
7.0
2.0
St K t 1,..., T
9 1.0
/
;
SCALAR K CAPACITY /8/;
VARIABLES Y Yield;
POSITIVE VARIABLES
S(t) STORAGE * output
St
R(t) Excess RELEASE; file Spill /Max_Y.txt/
EQUATIONS Eq1(t) FLOW BALANCE
put Spill Q Y
Eq2(t) Release
put ' Results from Max_Y model', put // t
Eq3(t) CAPACITY;
Eq1(t).. S(t+1)$(ord(t) lt 9) + S('1')$(ord(t) eq 9) * write yield and capacity Rt
=E= S(t) + Q(t)- R(t); put ' Capacity ', put K, put / K
Eq2(t).. R(t) =G= Y; put ' Yield ', put Y.l, put //
Eq3(t).. S(t) =L= K; * write inflow, storage, release, and yield in each period
MODEL Max_Y /ALL/ ; put ' Inflow Storage Excess Release Yield ' put /
SOLVE Max_Y USING LP Maximize Y ; put ' Q(t) S(t) R(t) Y ' put /
loop( t, put Q(t), put S.l(t), put R.l(t), put Y.l, put /)
6.1 Maximum Yield Given Capacity
Q, S, R. Y
5
7 4.6 3.6 3.6
2 8 3.6 3.6 4
0
1 2 3 4 5 6 7 8 9
Period
6.2 Reservoir Operation
subject to
S t 1 S t Qt Rt Et Ot t
Rt Dt t
St K t
Rt 0 t
St 0 t
ST 1 S1
6.2 Reservoir Operation
The results from running the model using the average inflow
conditions are:
Storage Input Release Demand
t0 15000
t1 13723 426 1700 1700
t2 12729 399 1388 1388
t3 11762 523 1478 1478
t4 11502 875 1109 1109
t5 12894 2026 595 595
t6 15838 3626 637 637
t7 17503 2841 1126 1126
t8 17838 1469 1092 1092
t9 18119 821 511 511
t10 17839 600 869 869
t11 17239 458 1050 1050
t12 16172 413 1476 1476
6.2 Reservoir Operation
2500
FSL MCM
Storage in MCM
2000
Flood rule
curve MCM
1500
Conservation
rule curve MCM
1000
Dead storage
curve MCM
500
0
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Month
6.2 Reservoir Operation
where
B(Sj, Sj+1, Ij) = cost or contribution of the decision Xj given state Sj at the
initial stage,
fj+1n-1 = accumulated suboptimal cost (or contribution) by optimal operation
of the reservoir over the last n-1 stages,
Ij = inflow during period j,
Pp,qj =transition probabilities of inflows (defined previously),
Sj =system state at stage j,
Sj+1=t(Sj,Xj) = state transformation equation,
j = stage, and
Xj = decision taken at stage j.
Hydrologic DSS
Categories of Optimize
Analytical
6.3 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
Storage Discretization
Classical scheme
Capacity
S
SDN
Savaranskiy‟s scheme
Capacity
S
SDN 2
Moran‟s Scheme
Capacity
S
SDN 1
FIGURE Discrete representation of storage in 1000 m3 (for capacity equal to 16.8
million m3 and SDN = 8). (From Karamouz and Vasiliadis, 1992.)
Hydrologic DSS
Categories of Optimize
Analytical
6.3 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
Variable Time
t t+1
Q i j
S k l
Variable Time
t t+1
Q Qit Qj,t+1
S Skt Sl,t+1
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
• The loss Eklt, depends on the initial and final reservoir storages, Skt and
Sl,t+1
• Since the inflow Q is a random variable, the reservoir storage and the
release are also random variables
• Let fnt (k, i) denote the maximum expected value of the system
performance measure up to the end of the last period T (i.e. for periods t,
t + 1, ..., T), when n stages are remaining, and the time period
corresponds to t.
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
n = 14 n = 13 n = 12 n = 11 n=2 n=1
Stages
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
Time periods
t=1 t=2 t=1 t=2 t=1 t =2
• When the computations are carried out for stage 2, period T - 1, the
inflow during the period is known.
• Inflow during the succeeding period T is also needed since we are
interested in obtaining the maximum expected system performance up
to the end of the last period T.
• Since this is not known with certainty, the expected value of the system
performance is got by using the inflow transition probability PijT-1 for
the period T - 1.
• The term within the summation denotes the maximized expected value
of the system performance up to the end of the last period T, when the
inflow state during the period T - 1 is i.
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
• The search for the optimum value of the performance is made over
the end-of-the period storage l.
• Since f1T(k, i) is already determined in stage 1, for all values of k and
i, f2T-1(k, i) given by above equation may be determined.
• The term {feasible l}, indicates that the search is made only over
those end-of-the-period storages which result in a non-negative
release Rkilt or satisfy any other constraints.
• The relationship may be generalized for any stage n and period t as
f k , i Max Bkil T Pij f n 1 l. j
n
t t t 1
k , i
j
feasible l
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
• Solving the equation recursively will yield a steady state policy within a
few annual cycles, if the inflow transition probabilities Pijt are assumed
to remain the same every year, which implies that the reservoir inflows
constitute a stationary stochastic process.
• In general, the steady state is reached when the expected annual system
performance, [f t i) - f tn (k, i)] remains constant for all values of k,
n+T (k,
i, and t.
• When the steady state is reached, the optimal end-of-the-period storage
class intervals, l, are defined for given k and i for every period t in the
year.
• This defines the optimal steady state policy and is denoted by l*(k, i, t).
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
• Example
• Obtain steady state policy for the following data, when the objective is
to minimize the expected value of the sum of the square of deviations
of release and storage from their respective targets, over a year with
two periods. Neglect evaporation loss. If the release is greater than the
release target, the deviation is set to zero. Target Storage, TS=30;
Target Release, Tr=30; Bkilt = (Rkilt –Tr)2 + (Skt –Ts)2
Inflow transition probabilities
t=2 t=1
j j
1 30 1 15 1 20 0 25 0 25 25
For period 1
1 30 1 15 2 30 0 15 0 225 225
1 30 2 25 1 20 0 35 0 0 0
1 30 2 25 2 30 0 25 0 25 25
2 40 1 15 1 20 0 35 100 0 100
2 40 1 15 2 30 0 25 100 25 125
2 40 2 25 1 20 0 45 100 0 100
2 40 2 25 2 30 0 35 100 0 100
For period 2 k Skt i Qkt l Skt+1 Ekilt Rkilt (Skt- Ts)2 (Rkilt- Tr)2 Bkilt
1 20 1 35 1 30 0 25 100 25 125
1 20 1 35 2 40 0 15 100 225 325
1 20 2 45 1 30 0 35 100 0 100
1 20 2 45 2 40 0 25 100 25 125
2 30 1 35 1 30 0 35 0 0 0
2 30 1 35 2 40 0 25 0 25 25
2 30 2 45 1 30 0 45 0 0 0
2 30 2 45 2 40 0 35 0 0 0
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
• n=1, t=2
f12 k , i MinBkilT k , i
k i Bkilt f12 (k,i) l*
feasible l l =1 l =2
n=2, t=1 1 1 125 325 125 1
1 2 100 125 100 1
2 1 0 25 0 1
2 2 0 0 0 1, 2
f 21 k , i Min Bkil 1 pij1 f12 l. j k , i
j
feasible l
k 1; i 1; l 1; Bkil 1 pij1 f12 l. j 25 0.5 *125 0.5 *100 137.5
j
k 1; i 1; l 2; Bkil 1 pij1 f12 l. j 225 0.5 * 0.0 0.5 * 0.0 225
j
j l =1 l =2
25 0.3 * 0 0.7 * 0 25 1 1 137.5 225 137.5 1
1 2 107.5 25 25 2
k 2; i 1; l 1; Bkil 1 pij1 f12 l. j
j 2 1 212.5 125 125 2
100 0.5 *125 0.5 *100 212.5 2 2 207.5 100 100 2
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
• n=3, t=2
f 32 k , i Min Bkil 2 pij2 f 21 l. j k , i k i Bkil 1 pij1 f 21 l. j f32 (k,i) l*
j
j
l =1 l =2
feasible l 1 1 195 435 195 1
k 1; i 1; l 1; Bkil 2 pij2 f 21 l. j 1 2 215 245 215 1
j 2 1 70 135 70 1
125 0.4 *137.5 0.6 * 25 195 2 2 115 120 115 1
k 1; i 1; l 2;
325 0.4 *125 0.6 *100 435 k i Bkil 1 pij1 f 32 l. j f41 (k,i) l*
• n=4, t=1 l =1
j
l =2
1 1 230 317.5 230 1
1 2 209 126.5 126.5 2
f 41 k , i Min Bkil 1 pij1 f 32 l. j k , i 2 1 305 217.5 217.5 2
j
2 2 309 201.5 201.5 2
feasible l
k i Bkil 1 pij1 f 41 l. j f52 (k,i) l*
• n=5, t=2 j
l =1 l =2
1 1 292.9 532.9 292.9 1
f k , i Min Bkil 1 pij2 f 41 l. j
5
2
k , i 1 2 309.3 339.3 309.3 1
j 2 1 167.9 232.9 167.9 1
feasible l 2 2 209.3 214.3 209.3 1
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
•
n=6, t=1
k i Bkil 1 pij1 f 52 l. j f61 (k,i) l*
j
l =1 l =2
1 1 326.1 413.6 326.1 1
1 2 304.3 221.8 221.8 2
2 1 401.1 313.6 313.6 2
2 2 404.3 296.8 296.8 2
n=8, t=1 l =1 l =2
1 1 421.9 509.4 421.9 1
1 2 400.2 317.7 317.7 2
2 1 49.9 409.4 409.4 2
2 2 500.2 392.7 392.7 2
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
Steady state policy for period 1 Steady state policy for period 2
k i l* k i l*
1 1 1 1 1 1
1 2 2 1 2 1
2 1 2 2 1 1
2 2 2 2 2 1
Introduction
Hydrologic models
7.1 River Basin Modelling Approaches
Application
What is a Model?
• Analog models: uses electricity e.g. Ohm‟s law
analogous to Darcy‟s law
• Physical model: constructed in laboratory
• Numerical/ Mathematical models: phenomenon
described by a set of mathematical equations.
Introduction
Hydrologic models
7.1 Hydrologic modeling Approaches
Application
Lumped Distributed
Spatial
Catchment Method of
Scale
size disaggregation
Based
Time
Event Continuous Intra Daily Weekly/ Scale
Based Daily monthly Based
Introduction
Hydrologic models
7.1 Hydrologic modeling Approaches
Application
Boundary
Finite Finite Boundary mixed
fitted
difference element element
coordinate
I, THANK YOU!
Introduction
Hydrologic models
7.1 Hydrologic modeling Approaches
Application
• Hydrologic Modelling
• Process description
Define purpose
EC/Suit Ye
able s
Code
N
o
Numerical formulation
Computer program
Code verification
Code
development
Field data Model construction
Performance criteria
Calibration
Compariso
n with field Validation
data
Simulation
Presentation of results
Calibration of parameters
Introduction
Hydrologic models
7.5 Approach to Hydrologic modeling Approaches
Application
Sensitivity Analysis
Introduction
Hydrologic models
7.7 Application of Hydrologic models Approaches
Application
• ArcSWAT
• SMAR
• HECGEOHMS/HecHMS
• Tank model
• Topmodel
Introduction
Hydrologic models
7.7 Application of Hydrologic models Approaches
Application
GAMS website
www.gams.com
GAMS
Example The GAMS code to solve the Waste treatment plant problem is
=E= (equality)
=G= (greater than or equal to)
=L= (less than or equal to)
GAMS
Example The GAMS code to solve the Waste treatment plant problem is
2 f 2 f
0
x1x2 x2 x1
2 0
Hf ( x)
0 2
l 2 0
lI H 0 l1 2; l2 2.
0 l 2
Thus f(x) is a strictlyconvex.
Therefore the function - f(x) is concave and can be maximized.
Hydrologic DSS
Categories of Optimize
Analytical
5.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
First convert the problem to a form
Example
Maximize F(x)
Subject to g(x) 0
The original proble is rewritten as
Maximize f ( x) x12 x22 4 x1 4 x2 8
Subject to x1 2 x2 4 0 or x1 2 x2 4 s12 0
2 x1 x2 5 0 or 2 x1 x2 5 s22 0
L f ( x) x12 x22 4 x1 4 x2 8 l1 x1 2 x2 4 s12 l2 2 x1 x2 5 s22
L L
2 x1 4 l1 2l2 0 2 x2 4 2l1 l2 0
x1 x 2
L
2l1s1 0, i.e. either l1 or s1 is zero
s1
L
2l2 s2 0, i.e. either l2 or s2 is zero
s 2
L
l1
x1 2 x2 4 s12 0
L
l2
2 x1 x2 5 s22 0
Hydrologic DSS
Categories of Optimize
Analytical
5.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
(ii) Assume l1=0 and l2=0. Then the simultaneous equations gives x1=x2=2;
s12=-2 (not possible) s22=-1 (not possible) This is not a solution to the
problem. Similarly
These equations give x1=3/2, x2=2, s12=-3/2 (not possible), l2=1/2 > 0
2 x1 4 l1 2l2 0
2 x2 4 2l1 l2 0
x1 2 x2 4
2 x1 x2 5
These equations yield l1= 4/3 > 0, l2 = -2/3 (negative). As l2 < 0, this is not a
solution for a maximum.
Hence solution (i) i.e. x1=8/5, x2=6/5 is the only solution to the problem.
Thus –f(x) is a maximum of -0.8 at (8/5, 6/5), or f(x) is a minimum of 0.8 at
x=(8/5, 6/5).
Introduction
Hydrologic models
7.2 System type models Approaches
Application
X1 w11 w10
wΦ1 wΦ0
w21
h1
w12
Φ
X2 w22
w13
h2 wΦ2
w20
X3 w23
Bias node
Input layer Hidden layer Output layer
Introduction
Hydrologic models
7.2 System type models Approaches
Application
3 1
h1out f w1i X i w10 3
i 1 w1i X i w10
1 e i 1
3 1
h2out f w2i X i w20 3
i 1 w2 i X i w20
1 e i 1
Introduction
Hydrologic models
7.2 System type models Approaches
Application
The output node in the single output layer are determined using
nonlinear transfer function, the logistic function as:
2 1
out f wi hi w 0 2
i 1 wi hi w 0
1 e i 1
Solution: To begin with, the weight values are set to random values:
0.6, 0.4, 0.5,-0.2 for weight matrix 1, and 0.3 and 0.8 for weight
matrix 2. The input signal set to the neurons I1 and I2 of the input
layer which just pass the signal to the hidden layer.
Solution:
Change in weight
ΔWpq,k = ηδq,k Outp,j
and Wpq,k(n+ 1) = Wpq,k(n ) + ΔWpq,k
Solution:
Hence,
New value of weight 1: 0.6 + 0 = 0.6 (not changed)
New value of weight 2: 0.4 + 0 = 0.4 (not changed)
New value of weight 3: 0.5 + (-0.0372) = 0.4628
New value of weight 4: -0.2 + (-0.0392) =-0.2392.
2. Precipitation of
Average total
monthly
Eastern Nile
precipitation
2. Temperature of EN
Average Daily
Maximum
Temperature
1.3 Simplified systems diagram Concept
Classification
System Analysis
Downstream
River Reaches & Reservoirs Requirements
Instream Uses
Evapotranspiration
Consumptive Distribution
Use System
Precipitation
Groundwater
Pumping Drainage
Collection,
Treatment,
& Disposal
Precipitation
Aquifer
Structure
Spectral
M A A cos(2jt / ) B sin(2jt / )
m
t 0 j j
j 1
1 2 2
A M ,
0
t 1
t A M
j
t 1
t
cos(2jt / ), B j
M t 1
t
sin(2jt / )
The maximum number of harmonics which can be fitted to the data are
ω/2.
Structure
Spectral
Aj B j
2 2 2
var( h j )
C j
2 2
Simplex method:
Simplex method:
E=R+ (R – M)= 2R – M = 3M – 2W
Expansion
5.1 Optimization techniques
Simplex method:
C – Contraction point
C1= (W+M)/2
or
C2 = (M+R)/2
Contraction
S – Shrinkage point
S = (W + B)/2
Shrinkage
5.1 Optimization techniques
Simplex method:
Rosenbrock method:
Rosenbrock method:
General procedure: The procedure for the jth stage is:
1. The set of s1( j ) , s2( j ) ,, sn( j ) and the base point are known
at the beginning of the jth stage.
A step of length l1 is taken in the direction from the known
base point. If the step is successful l1 is multiplied by a, the
new point is retained, and a success is recorded. If the step is
a failure l1 is multiplied by –b and a failure is recorded. The
value of a and b are usually 3 and 0.5 respectively.
Rosenbrock method:
( j 1) ( j 1) ( j 1)
3. Compute the new set of directions 1 s , s 2 , , s n for
use in next or (j+1)th stage of minimization.
First compute a set of independent directions p1, p2, …, pn as
p p1 , p2 , , pn
1
0
2 2
[ s1 , s2 ,, sn ] 3 3 3
( j) ( j) ( j)
n n n n
where k is the algebraic sum of all the successful step
( j)
lengths in the corresponding direction s k .
P1 represents the vector joining the starting point and the final
point after the sequence of searches in the jth stage.
5.1 Optimization techniques
Rosenbrock method:
These linearly independent vectors p1, p2, …, pn can be
used to generate a new set of orthogonal directions by means
of Gram-Schmidt orthogonalization procedure.
(a) compute the matrix p
(b) set Q1=p1 and s1( j 1) Q1 / Q1
(c) compute
s
i
Qi 1 pi 1 pi 1sm
T ( j 1) ( j 1)
m , i 0,1,2,, n 1
m 1
Qi
si( j 1) , i 1,2, , n
Qi
4. Take the best point observed in the present stage (jth one)
as the base point for the next stage, set the new iteration
number as j+1 and repeat the procedure from step 1.
5. Assume convergence after satisfying i for all i,
where is a specified small number.
5.1 Optimization techniques
Rosenbrock method:
Example:
Minimize f ( x1 , x2 ) x1 x2 2 x1 2 x1 x2 x2 starting from
2 2
Solution:
Stage or iteration 1
1 0
1. The search directions are taken as (1)
s and s2(1)
1
0 1
5.1 Optimization techniques
Solution:
Stage or iteration 1
(1)
By taking a step length l1 in the direction 1 , we obtain
s
0 1 0.8
x xB l s(1)
1 1 0.8
0 0 0
0 0 0
x x B l2 s 2(1) 0.8
0 1 0.8
and f= - 0.16 <fB. This is a success and hence the new value of
l2 = (3)(0.8) = 2.4 and the new base point is x 0.8
0
B
5.1 Optimization techniques
Solution:
Next we take a step length of size l1 along s1(1) . Thus
1 0 1 0.4
x xB l1 0.4
0 0.8
0 0.8
0 .4 0
p1 p2
0 . 8
and 0.8
0.4
xB
4. Take the new base point as with fB = - 0.88, 0 . 8
the iteration number as i=2 and go to step 1.
5.1 Optimization techniques
Solution: Stage or iteration 2
(The original step lengths have to be used now)
ii. Next we take a step of size l1=2.4 from xB along s1( 2 ) . This
gives
0.758 0.448 1.833
x xB l1s1( 2) 2. 4
1 .516 0 .896 3.666
and f=f(x)= 1.221. As f > fB , this is a failure and hence the new
value of l1 = (-0.5)(2.4) = -1.2 . Since the previous search along
s 2( 2 ) is a failure, we take the new point as
0.758 0.902 1.140
x xB l2 s2( 2 ) 0.4
1 .516 0.430 1 .366
with f=f(x)=-1.156. Since f < fB, this step is a success and hence
we take the new base point as x 1.140 with fB=-1.156.
B
1.366
0.797 0.604
s( 3)
and s ( 3)
2
1
0 . 604 0 . 797
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
Annual Monthly
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
Aˆ SYX S XX
1
Bˆ Bˆ T SYY SYX S XX
1
S XY
Any solution for B which wil l produce
BB T D is a valid solution.
If B is assumed to be a lower triangular matrix, a unique solution can be
obtained by the square root method when D is a positive definite matrix
or by a method proposed by Lane when D is at least
a positive semidefinite matrix.
1 N 1 N
SXX
N - 1 v 1
( X T
v v )
X SYX
N - 1 v 1
(Y T
v v )
X
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
b jj
where b ij are elements of B, d ij are the elements of D
and n is the size of the matrices B and D.
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
and
d ki b ij b kj
j i
b ki 1/ 2
for all k i when
ii
d (b )
ij 2
j i
d ii (b ij ) 2 0
j i
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
Aˆ ( SYX SYZ S zz1S ZX ) S XX S XZ S zz1S ZX
1
C S Aˆ S S 1
YZ XZ ZZ
Bˆ Bˆ T SYY Aˆ S XX Aˆ T Aˆ S XZ Cˆ T Cˆ S ZX Aˆ T Cˆ S ZZ Cˆ T
or equivalent ly Bˆ Bˆ T SYY Aˆ S XY Cˆ S ZY
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
Cˆ SYY ( , 1) Aˆ S XY ( , 1) SYY
1
( 1, 1)
B B S ( , ) Aˆ S ( , ) Cˆ S ( 1, )
ˆ ˆ T
YY XY YY
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
ˆ 1 T
1 T
A [ SYX SYY (1) SYY S XY (1)] S XX S XY (1) SYY S XY (1)
1
C S (1) Aˆ S (1) S 1
YY XY YY
Bˆ Bˆ T SYY Aˆ S XY Cˆ SYY
T
(1)
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
. Substation
A
. Substation
B
. Substation
Outlet o C
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
Data used:
Annual 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940
A 183.1 234.4 251.2 156.2 160.4 176.6 278.5 345.7 321.6 248.8 219.7 201.1 215.9 213.6 186.1
B 158.1 220.3 233.6 134.7 134.8 152 240.2 303.7 304.5 233.2 207.3 174.3 192.3 183.2 153.5
C 126.1 184.6 227.1 131.7 132.1 108.5 188.1 264.6 275.5 223.5 207.1 142.3 190.5 170.3 110.6
Outlet 467.3 639.3 711.9 422.6 427.3 437.1 706.8 914 901.6 705.5 634.1 517.7 598.7 567.1 450.2
May
A 24.7 7.9 21.5 11.3 18.2 21.9 32.2 8.4 47.7 14.5 15.1 12 9.7 14.1 22.8
B 23.3 7.1 20.9 11.9 19.1 21.8 34 7.4 46.9 15.7 15.9 11.3 10.3 15 20.2
C 22.2 12 22.4 11.5 20.5 13.6 28.9 10.4 39.3 17.8 16.6 11.8 13.3 14.8 15.4
Outlet 70.2 27 64.8 34.7 57.8 57.3 95.1 26.2 133.9 48 47.6 35.1 33.3 43.9 58.4
June
A 30.3 19.1 21 15.3 36.9 26.1 32.4 18.1 48.2 15 34.9 22.4 34.7 29.2 33.4
B 29.2 22.4 22.1 16 34.5 24.3 34.4 20 47.6 16.8 38.1 21 33 30.1 30.3
C 19.8 25.4 22.5 15.4 36.7 24.6 35.9 19.5 29.2 19.7 42.7 21.4 28.9 26.7 20
Outlet 79.3 66.9 65.6 46.7 108.1 75 102.7 57.6 125 51.5 115.7 64.8 96.6 86 83.7
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
yt 1 yt 1 1
1
2 1/ 2
t
The f1 is the autoregressive parameter,
s is the standard deviation,
yt is the annual value at time t minus the mean,
et is the normal (mean zero, variance one) random term
Using the sample estimates f1=r=0.568 and s=s=160.9, the AR(1)
model becomes
yt 0.568yt 1 132.4 t
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
Soln:
The spatial disaggregation of the key station annual data into
annual data at the three substations is done using Lane model.
Calculate the sample moments required for the parameter
estimation.
8803
S XX 25880 SYX 8741 S XY (1) 5980 5407 3316
8340
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
Soln:
The spatial disaggregation parameters are now calculated as:
0.3532
 0.3372
0.3096
8.018 0. 0.
B̂ 1.933 4.167 0.
9.951 4.167 0.
Time series analysis
3.2 Disaggregation modeling Disaggregation
Markov model
Soln (cont’d):
The condensed seasonal disaggregation model is used to
disaggregate the annual data at the three substations to monthly
data. The procedure is demonstrated for month 6.
37.56 38.15 33.47
174.3 171.9 174.0
SYX (6,6) 91.86 96.61 95.29
S XY (6,5) 175.0 173.7 182.2
28.21 37.76 63.73
111.3 119.1 163.7
3101 3002 2701
67.49 67.13 48.38
SYY (6,5) 62.46 63.01 47.61
S XX 3002 2977 2762
18.92 23.44 21.12 2701 2762 2877
Soln (cont’d):
The parameter estimates are obtained as: