Академический Документы
Профессиональный Документы
Культура Документы
System Representation
Some Systems in
Parameters, β WRPM:
Watershed
Aquifer
Development Area
Detention Basin
Transformation function
Inputs, I Outputs, Q
Q(t) = Ω(α
α, β) * I(t)
• Mathematical model
Policies or controls, α • 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
•Continuity equation
•Convolution equation
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
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
60 Land 6
Flow
(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
ts
en
In
m
st
ru
itu
t
ns
ti o
ti
na
en
lR
Enabling
em
ol
ag
Environment
es
an
M
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
2.4 River Basin Management
Nile Basin Decision Support System-components:
2.4 River Basin Management
Nile Basin Decision Support System-components:
3.1 Economics in water resources
Costs 40
500
Cash flow diagram
A A A A A
A [(1 + i)4 + (1 + i)3 + (1 + i)2 + (1 + i) + 1] - F = 0
Now multiply each side by (1 + i) deduct from previous equation:
A [ (1 + i)5 + (1 + i)4 + (1 + i)3 + (1 + i)2+ (1 + i)] - F( 1 + i) = 0
A [ (1 + i)5 - 1] - Fi = 0
F = A{ [ (1 + i)5 - 1] / i} In general, F = A{ [ (1 + i)n - 1] / i}
3.3 Economic analysis
Discount factors:
The term { [ (1 + i)n - 1] / i} is called the uniform series compound
amount factor.
A = F{ i / [ (1 + i)n - 1]}
The term { i / [ (1 + i)n - 1]} is called the sinking fund factor.
Sinking fund is the annual amount invested by a company to finance a
proposed expenditure.
Substitute P (1 + i)n for F in the previous equation:
A = P (1 + i)n{ i / [ (1 + i)n - 1]} = P [i(1+ i)n/ (1 + i)n - 1]
The term [i(1 + i)n/ (1 + i)n - 1] is called the capital recovery factor. It is
the amount of money required each year to offset an initial investment.
3.3 Economic analysis
Discount factors:
To compute a present amount from a uniform series. Solve for P:
P = A {[(1 + i)n - 1] / i( 1 + i)n}
The term { [ (1 + i)n - 1] / i ( 1 + i)n} is called the uniform series
present worth factor.
Present amount from a linear gradient series. An arithmetic gradient is a
cash flow series that either increases or decreases by a constant amount:
G (1 + i ) − 1 n
n
P= −
i i (1 + i )n (1 + i )n
• Sunk cost: Money spent already which has no economic relevance in
deciding future alternatives
• Salvage value: Value of the unused life of an element at the end of the period
of analysis. Salvage value, S = I (1 – U/L), where I = initial value, U = unused
life and L = total life.
3.3 Economic analysis
Spreadsheet Function
P = PV(i,N,A,F,Type)
F = FV(i,N,A,P,Type)
i = RATE(N,A,P,F,Type,guess)
Where, i = interest rate, N = number of interest periods, A = uniform amount, P = present
sum of money, F = future sum of money, Type = 0 means end-of-period cash payments,
Type = 1 means beginning-of-period payments, guess is a guess value of the interest rate
1 2 3 4 5 6 7 8 9 10 11 12
A=15,000 A A A A
Example.
Example.
where
Bt and Ct are the monetary values of benefits and costs incurred at
time t respectively
i is the discount rate
n is the life of the project in time steps (years or months or weeks).
It is also possible to use ratios of annualized benefits and costs.
3.4 Benefit-cost ratio method
Steps for choosing the best alternative are:
1. Calculate the BC ratio for each alternative
2. Retain all alternatives with BC>1 and reject the rest. If sets of mutually
exclusive alternatives are involved then go to steps 3, 4 and 5.
3. Rank the set of mutually exclusive alternatives in the order of increasing
cost. Calculate the BC ratio using incremental cost and incremental
benefit of the next alternative above the least costly alternative.
4. Choose the more costly alternative of the incremental BC >1. Otherwise
choose the less costly alternative.
5. Repeat the analysis for all alternatives in the order of rank.
3.4 Benefit-cost ratio method
Example.
A flood control district can construct several alternative control works to
alleviate flooding. These alternatives include the construction of dam A,
dam B, and a system of levees C. Each of these works can be built to
function alone or together with any other or all other projects. Thus we
have a possibility of the following combinations: ABC, A, B, C, AB, AC,
and BC. The life of each dam is 80 years and the life of the levee system is
60 years. The cost of capital is 4% .
3.4 Benefit-cost ratio method
Example.
Information on total investment, operation and maintenance costs, and
average annual flood damages is given in the table. Which flood control
undertaking is the most economical?
Project Total Investment Annual operation Average annual
(million $) and maintenance flood damages
(thousand, $) (million $)
A 6 90 1.10
B 5 80 1.30
C 6 100 0.70
AB 11 170 0.90
AC 10 190 0.40
BC 9 180 0.50
ABC 15 270 0.25
Do nothing 0 0 2.00
3.4 Benefit-cost ratio method
Solution.
The annual investment costs can be computed for each alternative by
multiplying the investment cost by the appropriate capital recovery factor:
Project Total Investment CRF Annual Investment costs Annual operation and Total annual
($ mln) ($ mln) maintenance ($ mln) cost ($ mln)
Where Bj is the unit benefit associated with the corresponding coordinates of the
output vector and Ci is the unit cost associated with the corresponding coordinates of
the input vector.
The curve is concave if the outputs are joint The curve is convex if the production of one output
products of the same productive process. hinders production of another, MRT not suitable
3.5 Conditions for project optimality
Optimum Condition 3: Optimum level of output
Net benefit is maximized if output is increased up to the point where the
marginal costs equal the marginal benefits (supply equals demand). It is
maximized where the slopes of the total benefit and total cost are equal.
Partitioning of time
series
Structure
Spectral
)
M = A + ∑ [A cos(2πjt / ω ) + B sin(2πjt / ω )]
m
t 0 j j
j =1
ω ω ω
1 2 2
A =ω ∑M ,
0
t =1
t A =ω ∑M
j
t =1
t
cos(2πjt / ω ), B j
= ∑
ω M t =1
t
sin( 2πjt / ω )
The maximum number of harmonics which can be fitted to the data are
ω/2.
Structure
Spectral
2 2 2
var(h j ) =
C j
=
Aj + B j
2 2
var(h j )
∆Pj =
var(M t )
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
j=0
White noise zt
Linear filter
at
Structure
Spectral
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 − ρ1φ1 − ρ 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
γˆk ∑ (Z
t =1
t − Z )(Z t + k − Z )
ρk = =
ˆ n
, k = 0,1,2, L
γˆ0
∑ (Z −Z)
2
t
t =1
ρˆ1 =
(13 − 10)(8 − 10) + (8 − 10)(15 − 10) + L + (7 − 10)(14 − 10) + (14 − 10)(12 − 10)
(13 − 10)2 + (8 − 10)2 + L + (14 − 10)2 + (12 − 10)2
− 27
= = −0.188
144
Structure
Spectral
ρˆ 2 =
(13 − 10)(15 − 10) + (8 − 10)(4 − 10) + L + (11 − 10)(14 − 10) + (7 − 10)(12 − 10)
144
− 29
= = −0.201
144
ρˆ 3 =
(13 − 10)(4 − 10) + (8 − 10)(4 − 10) + L + (12 − 10)(14 − 10) + (11 − 10)(12 − 10)
144
26
= = 0.181
144 n−k
∑ (Z t − Z )(Z t +k −Z )
ρˆ k = t =1 n ,
∑ t (Z − Z )2
t =1
n−k
∑ (Z
t = k +1
t − Z )(Z t − k − Z )
= n
= ρˆ − k
∑ (Z −Z)
2
t
t =1
− 1 < ρ1 < 1
− 1 < ρ2 < 1
2 1
ρ < (1 + ρ 2 )
1
2
Structure
Spectral
2 σ 2a
σ =
z
1 − ρ1φ1 − ρ 2 φ2
1 − φ2 σ 2a
=
1 + φ 2 {(1 − φ 2 ) 2
− φ1}
2
Structure
Spectral
1 − ρ1φ1 − ρ 2φ2
1 − φ2 σ a2
= = 3.704
{ 2
}
1 + φ2 (1 − φ2 ) − φ1
2
Structure
Spectral
( Z t − k − µ )( Z t − µ ) = φ1 (Z t − k − µ )(Z t −1 − µ ) + φ2 (Z t − k − µ )(Z t − 2 − µ ) + L
+ φ p (Z t − k − µ )(Z t − p − µ ) + (Z t − k − µ )at
ρ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.458 ×1.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.856 2
ε t = 0.582 × 0 − 0.271× 0 + 0.856 ×1.352 = 1.157,
xt = 0.182ε t + 1 = 1.211
ε t +1 = 0.582 ×1.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.271×1.157 + 0.856 × 0.789 = 0.489,
xt + 2 = 0.182ε t + 2 + 1 = 1.089
Structure
Spectral
∑ θ jθ j + k
j =0 (k ≤ q)
q
ρk =
1 + ∑j =1
θ 2
j
0 (k > q)
− θ k + θ1θ k +1 + ... + θ q − kθ q
k = 1,2,..., q
ρk = 1 + θ12 + ... + θ q2
0 k >q
• Thus, the autocorrelation function for a moving-average process of
order q has a cutoff after lag q.
• Unlike the Yule-Walker equations for an autoregressive process,
which are linear, the equations are nonlinear, and therefore, have to be
solved iteratively by any technique such as the Newton-Raphson
algorithm. These estimates of the parameters are rough estimates at the
identification stage.
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
1
0 k >1 (1 − θ12 ( k +1) )
Structure
Spectral
• where ϕ(B) and ϴ(B) are the AR(p) and the MA(q) operator,
respectively.
(1 − φ1θ1 )( φ1 − θ1 )
ρ1 =
1 + θ12 − 2φ1θ1
ρ 2 = φ1ρ1
ρ k = φ1ρ k-1 k>2
Structure
Spectral
ρ 2 < ρ1
ρ 2 > ρ1 ( 2ρ1 + 1) ρ1 < 0
ρ 2 > ρ1 (2ρ1 - 1) ρ1 > 0
Structure
Spectral
σˆ a2 =
σ 2
z (
1 − φˆ
1
2
)
(
1 − 2φˆ1θˆ1 + θˆ12 )
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
• Autoregressive Integrated Moving Average (ARIMA)
processes
Structure
Spectral
d θ (B )
(∇ Z t − µ ) = at
φ (B )
Seasonal integrated autoregressive moving average
(SARIMA) processes
• The general notation of a SARIMA (p,d,q)×(P,D,Q) model is
d D
(∇ ∇ s Z t − µ ) =
θ ( B )Θ (B s
) at
φ (B )Φ (B )s
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
Key Subseries
Annual Semi-annual
Semi-annual Biweekly
Monthly Biweekly
Annual Monthly
Time series analysis
4.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 will produce
BBT = 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 X T
v v ) SYX = ∑
N - 1 v =1
(Y T
v v )
X
Time series analysis
4.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
4.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
4.2 Disaggregation modeling Disaggregation
Markov model
(
Aˆ = ( SYX − SYZ S zz−1S ZX ) S XX − S XZ S zz−1S 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 equivalently Bˆ Bˆ T = SYY − Aˆ S XY − Cˆ S ZY
Time series analysis
4.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
4.2 Disaggregation modeling Disaggregation
Markov model
YY YY XY XX [
ˆA = [ S − S (1) S −1 S T (1)] S − S (1) S −1 S T (1) −1
YX XY YY XY ]
[
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
4.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
4.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 φ1=r=0.568 and σ=s=160.9, the
AR(1) model becomes
yt = 0.568 yt −1 + 132.4ε t
Time series analysis
4.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
4.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
4.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:
∑P
j =1
ij =1 for i = 1,2,L, m
Time series analysis
4.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 = [P(Yt = j )] = (P1 L Pk )
Time series analysis
4.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
4.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
4.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
1.000
Time series analysis
4.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
1.000
Time series analysis
4.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(a) Hence, the one step transition matrix is given by:
Time series analysis
4.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
4.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
4.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(b ii) where
Hence
Time series analysis
4.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
4.3 Markov Models Disaggregation
Markov model
Example 3:
Solution:
(c i) The adjusted matrix of transition probabilities is given by:
Time series analysis
4.3 Markov Models Disaggregation
Markov model
Solution:
(c i)
Hence
Time series analysis
4.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).
5.1 Modelling Techniques
ii. Dynamic (takes into account the change in the parameters of the
system and the operational policy with time) in nature.
5.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+ Qt
5.3 Hedging Rule
hedging D
K
5.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
2 Compute
Release Release demand
demand + excess Rt, Xit, i=1,…n
0
Data
0 2 4 6 8 10 12 14 16
Dt K Dt+K St+ Qt Release, R Storage
St+1 = St +Qt -Rt
• Create network representation of system
• Need inflows for each period for each node
No
• For each period: Done?
Perform mass balance calculations for Yes
each node
Stop
Determine releases from reservoirs
Allocate water to users
5.3 Performance Evaluation
Dt
Vulnerability = ∑
Dt >0 # of times Dt > 0 occured
5.3 Simulate the System
Release available x1
6
Allocation, Xi
water x2
x3
Dt 4
0
Dt K Dt+K St+ Qt 0 2 4 6 8 10 12 14 16
Release, R
Policies
Model
5.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
5.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+ Qt 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
5.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
Year
• Using unregulated river for irrigation
• Proposed Reservoir Flow statistics
• Capacity: K = 40 million m3 (active)
• Demand: D = 30 40 45 million m3
• Winter instream flow: 5 mil. m3 min.
• 45 year historic flow record available
• Evaluate system performance for a 20 year period
• Simulate
• Two seasons/year, winter (1) summer(2)
• Continuity constraints
• Operating policy
5.3 Summer Operating Policy
R2,t
Release available
water
Dt
Release Release demand
demand + excess
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
6
# of Failures
4 -0.184 1 0.050
5 -1.159 2 0.100 5
6 -10.747 8 0.400
4
7 -4.627 6 0.300
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 0.165
Std. Dev. 2.93704 0.118163 Actual Reliability [100%, 60%]
6.1 Optimization Problems
30
Bi ( xi ) = ai xi − bi xi2
25
i = 1,2,3
Benefit, B
20
15 B1
B2
10
B3
5
0
Bi(xi) = benefit to user i from 0 1 2 3 4 5 6 7 8 9 10
Allocation, x
using amount of water xi
6.1 Optimization Problems
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
Hydrologic DSS
Categories of Optimize
Analytical
6.1 Optimization Linear programs
Dynamic programs
Stochastic Dynamic
Benefit Bi (xit )
Objective:
T 3
Maximize ∑ ∑ Bi (xit )
t=1 i=1
Constraints:
x1t + x 2t + x 3t ≤ Rt t = 1,2,L
St+1 = St + It − Rt t = 1,2,L
St ≤ K t = 1,2,L
Optimization model
Hydrologic DSS
Categories of Optimize
Analytical
6.1 Optimization Problems Linear programs
Dynamic programs
Stochastic Dynamic
f(x)
minimize f(x) Objective function x1
x minimum
x Decision variables x = 2
M
subject to
xn
x* x
Constraint set
x ∈ X f(x) Feasible region
X={x: a<x< b}
Find the decision variables, x, that
optimize (maximize or minimize) an
objective function x*
f(x) = f(x1,x 2,L ,x n ) a X b x
while satisfying
constraints
x∈X
Hydrologic DSS
Categories of Optimize
Analytical
6.1 Optimization techniques Linear programs
Dynamic programs
Stochastic Dynamic
Analytical/Numerical differentiation,
Linear Programming (LP),
Dynamic Programming (DP),
Non-Linear Programming (NLP),
Integer Programming (IP),
Goal Programming,
etc
General
Direct Search
Analytical
6.1 Optimization techniques Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method:
Simplex method:
E=R+ (R – M)= 2R – M = 3M – 2W
Expansion
General
Direct Search
Analytical
6.1 Optimization techniques Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method:
C – Contraction point
C1= (W+M)/2
or
C2 = (M+R)/2
Contraction
S – Shrinkage point
S = (W + B)/2
Shrinkage
General
Direct Search
Analytical
6.1 Optimization techniques Linear programs
Dynamic programs
Stochastic Dynamic
Simplex method:
Simplex method:
Simplex method:
Simplex method:
Rosenbrock method:
Rosenbrock method:
General procedure: The procedure for the jth stage is:
1. The set of s1( j ) , s2( j ) ,L , sn( j ) and the base point are known
at the beginning of the jth stage.
A step of length λ1 is taken in the direction from the known
base point. If the step is successful λ1 is multiplied by α, the
new point is retained, and a success is recorded. If the step is
a failure λ1 is multiplied by –β and a failure is recorded. The
value of α and β 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 , L , 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 ,L , pn ]
Λ1
Λ Λ 0
2 2
= [ s1 , s2 , L, sn ]Λ 3 Λ 3 Λ 3
( j) ( j) ( j)
M
Λ n Λ n Λ n L Λ n
where Λ k is the algebraic sum of all the successful step
( j)
lengths in the corresponding direction sk .
P1 represents the vector joining the starting point and the final
point after the sequence of searches in the jth stage.
General
Direct Search
Analytical
6.1 Optimization techniques Linear programs
Dynamic programs
Stochastic Dynamic
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 Q = p − i [ pT s ( j +1) ]s ( j +1) , i = 0, 1, 2,L, n − 1
i +1 i +1 ∑
m =1
i +1 m m
Qi
si( j +1) = , i = 1, 2, L, 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.
General
Direct Search
Analytical
6.1 Optimization techniques Linear programs
Dynamic programs
Stochastic Dynamic
Rosenbrock method:
Example:
2 2
Minimize f ( x 1 , x 2 ) = x1 − x 2 + 2 x1 + 2 x x
1 2 + x 2 starting from
the base x = 00 . Take the initial step lengths as λ1=λ2=0.8
B
the minimum permissible step length ε=0.15 α=3 and
β=0.5.
Solution:
Stage or iteration 1
1 0
1. The search directions are taken as s(1)
= and s2(1) =
1
0 1
General
Direct Search
Analytical
6.1 Optimization techniques Linear programs
Dynamic programs
Stochastic Dynamic
Solution:
Stage or iteration 1
(1)
s
By taking a step length λ1 in the direction 1 , we obtain
(1) 0 1 0.8
x = xB + λ s
1 1 = + 0.8 =
0 0 0
Solution:
(1)
Next we take a step length of size λ1 along s1 . Thus
1 0 1 − 0.4
x = xB + λ1 = − 0.4 =
0
0.8 0
0.8
and f = f(x) = - 0.88 < fB. Hence this step is a success we thus
obtain the new base point as x = − 0.4
B
0.8
from xB we take a step length of λ2 along s2(1) and obtain
Solution:
( 2) ( 2)
s
3. We now calculate the new set of search directions 1 and 2s
Λ1 0
p = [ p1 p2 ] = s[ (1)
1 s (1)
2 ]
Λ Λ
2 2
− 0.4 0
p1 = p2 =
0.8 and 0.8
Solution:
( 2) Q2
s 2 =
Q2
where
T
0 0 − 0.448 − 0.448 0.321
Q2 = p2 − p2T s1( 2 ) s1( 2) = − =
0.8 0.8 0.896 0.896 0.153
( 2) 1 0.321 0.902
∴ s = =
2
((0.321) 2
+ (0.153) 2 )
1/ 2
0.153 0.430
− 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.
General
Direct Search
Analytical
6.1 Optimization techniques Linear programs
Dynamic programs
Stochastic Dynamic
ii. Next we take a step of size λ1=2.4 from xB along s1( 2) . This
gives
− 0.758 − 0.448 − 1.833
x = xB + λ1s1( 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 λ1 = (-0.5)(2.4) = -1.2 . Since the previous search along
s2( 2) is a failure, we take the new point as
− 0.758 0.902 − 1.140
x = xB + λ2 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
Solution:
( 3) ( 3)
s
3. We now calculate the new set of search directions 1 and 2s
( 2) 1
Λ 0 where Λ = 0.8 and Λ = −0.4 .
p = [ p p ] = [s s ]
1 2
( 2)
1 2 Λ Λ 1 2
2 2
− 0.448 0.902 0.8 0 − 0.7192 − 0.3608
p= =
0 .896 0 .430 − 0.4 − 0.4 0.5448 − 0.1720
Solution:
( 3) Q2
s 2 =
Q2
where
T
− 0.3608 − 0.3608 − 0.797 − 0.797 − 0.2141
Q2 = p2 − p2T s1(3) s1(3) = − =
− 0. 1720 − 0. 1720 0.604 0.604 − 0.2830
( 3) 1 − 0.2141 − 0.604
∴ s = =
2
((−0.2141) 2
+ (−0.2830) 2 )
1/ 2
− 0. 2830 − 0.797
− 0.797 ( 3) − 0.604
s( 3)
=
and s 2 =
1
0 .604 − 0 .797
General
Direct Search
Analytical
6.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
f ′( x ) < 0 ,
f ′( x ) = 0 , f ′′( x ) < 0 f ′( x ) < 0 f ′( x ) < 0
f ′′( x ) = 0 f ′( x ) = 0
f(x)
Global
• First-order conditions Tangent is
minimum
• First-order conditions
∂f ( x )
for a local optimum =0
∂x1
M at x = x*
∂f ( x )
=0
∂xn
• n - simultaneous equations
General
Direct Search
Analytical
6.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
Convexity and Concavity: If all eigen values of the Hessian matrix are
positive for all possible values of X, the function is strictly convex and
X0 is global minimum.
If all eigen values are negative for all possible values of X, the function
is strictly concave and X0 is the global maximum.
Example: 1. f ( x) = x12 + x22 − 4 x1 − 2 x2 + 5
2. f ( x) = − x12 − x22 − 4 x1 − 8
Soln 1:
∂f ∂f
= 2 x1 − 4, = 2 x2 − 2,
∂x1 ∂x2
The Hessian matrix is 2 0
H [ f (x )] =
0 2
Eigen values are λ − 2 0
λI − H = = 0 Thus λ = 2
0 λ − 2
The function has a global minimum at X=(2, 1).
General
Direct Search
Analytical
6.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
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, λ) 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 λ.
General
Direct Search
Analytical
6.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
Single Constraint
Multiple Decision Variables
Lagrangian
minimize f ( x)
L( x , λ ) = f ( x ) − λ[h( x )]
Vector
x
subject to
Notice what
h( x) = 0 happens to h(x)
One constraint ∂f ∂h
−λ =0 when we have a
∂x1 ∂x1 feasible vector x
∂f ∂h
First-order conditions −λ =0
∂x2 ∂x2
N+1 equations
M
∂f ∂h
−λ =0
∂xn ∂xn
h( x ) = 0
General
Direct Search
Analytical
6.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
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 λ 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
General
Direct Search
Analytical
6.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
Sufficiency condition
Sufficiency condition :
If all the roots are positive and independent of X, then X0 is the global
minimum.
General
Direct Search
Analytical
6.1 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
λ j g j ( x) = 0, j = 1,..., m
g j ( x) ≤ 0, j = 1,..., m
and λ 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.
General
Direct Search
Analytical
6.2 Analytical Optimization Linear programs
Dynamic programs
Stochastic Dynamic
Example
Maximize Z = 6x + 5 y
subject to 2x − 3y ≤ 5
x + 3 y ≤ 11
4 x + y ≤ 15
x, y ≥ 0
6.2 Graphical method: Step - 1
This is known as
‘feasible region’
6.2 Graphical method: Step - 3
2. An unbounded solution,
• Proportionality assumptions
• Additivity assumption
• Divisibility assumption
• Deterministic assumption
Hydrologic DSS
Categories of Optimize
Analytical
6.2 Linear Programming Linear programs
Dynamic programs
Stochastic Dynamic
Example 1 : A farmer produces two crops: rice and wheat. The farmer
has a production capacity of 40 ton of crops. Because of limited sale
opportunity, he can sell a maximum of 24 tons of rice and 30 tons of
wheat. The gross margin from the sale of 1 ton rice is 80 units and for
wheat, it is 40 units. Find the optimal production.
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
6.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
6.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
6.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
6.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
6.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
6.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
6.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
6.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
6.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
6.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
6.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 ,L , cn + m )
a11 a12 L a1n b1
a a22 L a2 n b
A= 21
, b= 2
M M M M
am1 am 2 L amn bm
Input Output
Characteristics of DP problem: S1 S2
Stage 1
Xn Xn-1 X2 X1
Stage 1
R1
f1* (S1 ) = max[R1 ( 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
6.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
6.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
6.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
6.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
6.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
6.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 5 10
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
6.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.
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Multi-Objective Planning Linear programs
Dynamic programs
Stochastic Dynamic
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
Hydrologic DSS
Categories of Optimize
Analytical
6.4 Multi-Objective Planning Linear programs
Dynamic programs
Stochastic Dynamic
Weighting method:
Constraint method:
Max Zj (X)
s.t.
gi(X) ≤ bi i = 1, 2, ……, m and
Zk(X) ≥ Lk for all k ≠ j
j
K d = Maximum ∑ (Rt − Qt )
t =1
where 1 ≤ i ≤ j ≤ 2T
7.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
Including Evaporation Lt
At
St +1 = St + Qt − Rt − Lt
– Lt Losses from reservoir
– A Surface area of reservoir 300
250
S + St +1 A 0=160 km
= Aa t + A0 et
175
Area (km2)
2 150
125
S + St +1
= Aa et t + A0et 100
Total Storage
2 75
25
= at St + at St +1 + bt
0
0 5000 10000 15000 20000 25000
Storage Volume (mln m3)
7.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
7.1 Maximum Yield Given Capacity
SETS
t TIME (MONTHS) / 1*9 / Maximize Y
PARAMETER Q(t) INFLOW
/
1 1.0
subject to
2 3.0
3 3.0
S = S +Q −R
t +1 t t t t = 1,..., T ; T + 1 =1
4 5.0
5 8.0 R ≥Y t t = 1,..., T
6 6.0
7 7.0 S ≤K t t = 1,..., T
8 2.0
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;
* write yield and capacity
Rt
Eq1(t).. S(t+1)$(ord(t) lt 9) + S('1')$(ord(t) eq 9)
=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 /)
7.1 Maximum Yield Given Capacity
Capacity 8
Yield 3.6
Result from running model
Inflow Storage Release Yield one time with capacity
Q(t) S(t) R(t) Y K = 8, then Yield Y = 3.6
1 3.8 3.6 3.6
3 1.2 3.6 3.6
9
3 0.6 3.6 3.6 Q(t)
8
5 0 5 3.6
7 S(t)
8 0 5.8 3.6
6 2.2 3.6 3.6 6 R(t)
Q, S, R, Y
7 4.6 3.6 3.6 5 Y
2 8 3.6 3.6 4
1 6.4 3.6 3.6 3
2
1
0
1 2 3 4 5 6 7 8 9
Period
7.2 Reservoir Operation
subject to
St +1 = St + Qt − Rt − Et − Ot ∀t
Rt ≤ Dt ∀t
St ≤ K ∀t
Rt ≥ 0 ∀t
St ≥ 0 ∀t
ST +1 = S1
7.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
7.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
7.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
7.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
7.3 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
7.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
• 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
7.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 nt (k , i ) = Max Bkil T + ∑ Pijt f nt−+11 (l. j ) ∀k , i
j
{ feasible l}
Hydrologic DSS
Categories of Optimize
Analytical
7.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
7.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
Inflow and Storage i 1 2 i 1 2
t=1 1 0.5 0.5 t=2 1 0.4 0.6
k Skt i Qkt l Skt+1 Ekilt Rkilt (Skt- Ts)2 (Rkilt- Tr)2 Bkilt
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
7.4 Stochastic Dynamic Programs Linear programs
Dynamic programs
Stochastic Dynamic
• n=1, t=2
f12 (k , i ) = Min[BkilT ] ∀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
7.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*
j
n=4, t=1 l =1 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
7.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
7.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
8.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
8.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
8.1 Hydrologic modeling Approaches
Application
Boundary
Finite Finite Boundary mixed
fitted
difference element element
coordinate
Introduction
Hydrologic models
8.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
8.2 System type models Approaches
Application
3 1
h1out = f ∑ w1i X i + w10 = 3
i =1 −σ ∑ w1i X i + w10
i =1
1+ e
3 1
h2out = f ∑ w2i X i + w20 = 3
i =1 −σ ∑ w2 i X i + w20
i =1
1+ e
Introduction
Hydrologic models
8.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 ∑ wφi hi + wφ 0 = 2
i =1 −σ ∑ wφi hi + wφ 0
i =1
1+ e
Given an ANN structure, the back propagation method starts out
with random draws on the weights near zero. Then the initial
observation of the training data set is run through the network.
Using the error, the connection and bias weights are “updated” by
a fraction of the output error.
It is required to avoid overtraining of ANN models.
Introduction
Hydrologic models
8.2 System type models Approaches
Application
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.
Introduction
Hydrologic models
8.3 Conceptual models Approaches
Application
Conceptual
SMAR
model
Introduction
Hydrologic models
8.3 Conceptual models Approaches
Application
Define purpose
Field data Conceptual model
Code selection
EC/Suita Yes
ble Code
No
Numerical formulation
Computer program
Code verification
Code
development
Field data Model construction
Performance criteria
Calibration
Comparison
with field Validation
data
Simulation
Presentation of results
Calibration of parameters
Introduction
Hydrologic models
8.5 Approach to Hydrologic modeling Approaches
Application
Sensitivity Analysis
Introduction
Hydrologic models
8.6 Application of Hydrologic models Approaches
Application
GAMS website
www.gams.com
GAMS
) 32ݔ 22 +ݔ 12 +ݔ( 3 −ݔ 2ݔ 3 +ݔ1 + 2ݔ = ܼ ݔܽܯ
GAMS
Optimization Problems
The GAMS code to solve the allocation problem is The result for a release of R = 10 is
Example SETS i / 1, 2, 3/ Release 10.00
SCALAR r RELEASE /10.0/; Downstream flow 2.00
PARAMETER Objective 41.41
a(i) /1 6.0, 2 7.0, 3 8.0/ i x(i)
b(i) /1 -1.0, 2 -1.5, 3 -0.5/; 1 1.55
VARIABLES obj OBJECTIVE; 2 1.36
POSITIVE VARIABLES x(i) USE, s DOWNSTREAM FLOW; 3 5.09
S.lo=2.0; d(obj)/dr = 2.91
EQUATIONS objective, cap;
objective..obj =E= SUM(i,a(i)*x(i)+b(i)*x(i)**2);
cap..sum(i,x(i))+s-r =E= 0.0;
MODEL user /ALL/ ;
SOLVE user USING NLP MAXIMIZE obj ;
FILE res /WaterUser.txt/
PUT res
PUT 'Release ', PUT r, PUT /
PUT 'Downstream flow ', PUT s.l, PUT /
PUT 'Objective ', PUT obj.l, PUT //
PUT 'i x(i) ' PUT /
loop( (i), PUT i.TL, PUT x.l(i), PUT /)
PUT //, 'd(obj)/dr = ', PUT cap.m, PUT //
Analytical Optimization
Minimize f ( x) = x12 + x22 − 4 x1 − 4 x2 + 8
Example
Subject to − x1 − 2 x2 + 4 ≥ 0
2 x1 + x2 ≤ 5
Solution :
∂f ∂2 f
= 2 x1 − 4, = 2,
∂x1 ∂x12
∂f ∂ 2f
= 2 x2 − 4, 2
= 2,
∂x 2 ∂x 2
∂2 f ∂2 f
= =0
∂x1∂x2 ∂x2 ∂x1
2 0
Hf ( x) =
0 2
λ −2 0
λI − H = =0 λ1 = 2; λ2 = 2.
0 λ −2
Thus f(x) is a strictly convex.
Therefore the function - f(x) is concave and can be maximized.
Analytical Optimization
First convert th e problem to a form
ExampleMaximize F(x)
Subject to g(x) ≤ 0
The original problem 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 + s 22 = 0
( ) (
L[− f ( x ) ] = − x12 − x22 + 4 x1 + 4 x2 − 8 − λ1 x1 + 2 x2 − 4 + s12 − λ2 2 x1 + x2 − 5 + s22 )
∂L ∂L
= −2 x1 + 4 − λ1 − 2λ2 = 0 = −2 x2 + 4 − 2λ1 − λ2 = 0
∂x 1 ∂x 2
∂L
= −2λ1 s1 = 0, i.e. either λ1 or s1 is zero
∂s 1
∂L
= −2λ2 s 2 = 0, i.e. either λ2 or s2 is zero
∂s 2
∂L
∂λ1
( )
= − x1 + 2 x2 − 4 + s12 = 0
∂L
∂λ 2
( )
= − 2 x1 + x2 − 5 + s 22 = 0
Analytical Optimization
(ii) Assume λ1=0 and λ2=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), λ2=1/2 > 0
This is not a solution.
Analytical Optimization
These equations yield λ1= 4/3 > 0, λ2 = -2/3 (negative). As λ2 < 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).