Date post: | 30-Oct-2014 |
Category: |
Documents |
Upload: | mani-gandan |
View: | 44 times |
Download: | 2 times |
Medium Term Stochastic Hydrothermal Coordination
Model
Engineering Systems Division
Andres Ramos
http://www.iit.upcomillas.es/aramos/
MIT, Cambridge, MA, Jan 23-27, 2012
ModelESD.S30 Electric Power System Modeling for a Low Carbon
Economy
Topic objectives
• To understand
– What is a medium term hydrothermal coordination model
• Purpose
• How to use
– How stochasticity is modeled
• Scenario tree
Medium Term Stochastic Hydrothermal Coordination Model 1
• Scenario tree
– What techniques are used for solving the stochastic problem
• Stochastic optimization
References• State-of-the-art in hydro scheduling
– J.W. Labadie Optimal Operation of Multireservoir Systems: State-of-the-Art Review JOURNAL OF WATER
RESOURCES PLANNING AND MANAGEMENT MARCH/APRIL 2004 pp. 93-111
• Hierarchy of planning models
– A. Ramos, S. Cerisola, J.M. Latorre A Decision Support System for Generation Planning and Operation in
Electricity Markets in the book P.M. Pardalos, S. Rebennack, M.V.F. Pereira and N.A. Iliadis (eds.) Handbook of
Power Systems pp. 797-817 Springer December 2009 ISBN 9783642024924
• Stochastic optimization
– S. Cerisola, J.M. Latorre, A. Ramos Stochastic Dual Dynamic Programming Applied to Nonconvex Hydrothermal
Models European Journal of Operational Research 218 (2012) 687–697 10.1016/j.ejor.2011.11.040
– A. Ramos, S. Cerisola, J.M. Latorre, R. Bellido, A. Perea and E. Lopez A decision support model for weekly
Medium Term Stochastic Hydrothermal Coordination Model 2
– A. Ramos, S. Cerisola, J.M. Latorre, R. Bellido, A. Perea and E. Lopez A decision support model for weekly
operation of hydrothermal systems by stochastic nonlinear optimization in the book G. Consiglio, M. Bertocchi
(eds.) Stochastic optimization methods in finance and energy Springer
• Scenario tree generation
– J.M. Latorre, S. Cerisola, A. Ramos Clustering Algorithms for Scenario Tree Generation. Application to Natural
Hydro Inflows European Journal of Operational Research 181 (3): 1339-1353 Sep 2007
• Object-oriented simulation
– J.M. Latorre, S. Cerisola, A. Ramos, R. Bellido, A. Perea Creation of Hydroelectric System Scheduling by
Simulation in the book H. Qudrat-Ullah, J.M. Spector and P. Davidsen (eds.) Complex Decision Making: Theory
and Practice pp. 83-96 Springer October 2007 ISBN 9783540736646
Contents
Medium term stochastic hydrothermal coordination model
• Stochastic optimization
• Mathematical formulation
Medium Term Stochastic Hydrothermal Coordination Model 3
• Mathematical formulation
• Case study
Generation planning functions
Functions
New liberalized
market functions
• Strategic bidding:- Energy- Power reserve- Other ancillary services
• Objectives:- Market share
- Price
• Budget planning • Future derivatives market bids
• Capacity investments
• Risk management • Long term contracts:
- Fuel acquisition- Electricity selling
Medium Term Stochastic Hydrothermal Coordination Model 4
Scope
Traditional regulated operation functions
Short termMedium termLong term
• Fuel management• Annual reservoir and seasonal pumped storage hydro management- Water value assessment
• Capacity investments- Installation- Repowering
• Maintenance• Energy management- Nuclear cycle- Multiannual reservoirs
• Startup and shut-down of thermal units
• Pumped storage hydro operation
• Economic dispatch
Hydro scheduling models
• Nowadays, under a deregulated framework electric companies manage their own generation resources and need detailed operation planning tools
• In the next future, high penetration of intermittent generation is going to stress the electric system operation
Medium Term Stochastic Hydrothermal Coordination Model 5
electric system operation
• Storage hydro and pumped storage hydro plantsare going to play a much more important role due to their flexibility and complementary use with intermittent generation
Medium term optimization model. Characteristics
• Hydroelectric vs. hydrothermal models
– Hydroelectric model deals only with hydro plants
– Hydrothermal model manages simultaneously both hydro and thermal plants
• Thermal units considered individually. So rich marginal cost information for guiding hydro scheduling
Medium Term Stochastic Hydrothermal Coordination Model 6
scheduling
• No aggregation or disaggregation process for hydro input and output is needed
• It is very difficult to obtain meaningful results for each hydro plant because:
– It requires a huge amount of data and
– The complexity of hydro subsystems
Optimization-simulation combination
• Use the model in an open-loop control mechanism with rolling horizon
1. First, planning by stochastic optimization
2. Second, simulation of the random parameters
1. Stochastic optimization
– Determines optimal scheduling policies taking into account the uncertainty
Medium Term Stochastic Hydrothermal Coordination Model 7
2. Simulation
– Evaluates possible future outcomes of random parameters given the optimal policies obtained previously
• We are going to focus on
– STOCHASTIC OPTIMIZATION MODELS
Medium term optimization model. Overview
• Determines:– The optimal yearly operation
of all the thermal and hydro power plants
– Taking into account multiple basins and multiple cascaded reservoirsconnected among them
START
Stochastic MarketEquilibrium ModelStochastic MarketEquilibrium Model
HydrothermalCoordination Model
HydrothermalCoordination Model
Monthly hydro basin and thermal plant production
Adj
ustm
ent
START
Stochastic MarketEquilibrium ModelStochastic MarketEquilibrium Model
HydrothermalCoordination Model
HydrothermalCoordination Model
Monthly hydro basin and thermal plant production
Adj
ustm
ent
START
Stochastic MarketEquilibrium ModelStochastic MarketEquilibrium Model
HydrothermalCoordination Model
HydrothermalCoordination Model
Monthly hydro basin and thermal plant production
Adj
ustm
ent
START
Stochastic MarketEquilibrium ModelStochastic MarketEquilibrium Model
HydrothermalCoordination Model
HydrothermalCoordination Model
Monthly hydro basin and thermal plant production
Adj
ustm
ent
Medium Term Stochastic Hydrothermal Coordination Model 8
– Satisfying the demand and other technical constraints
• Cost minimization model because the main goal is medium term hydro operation. Suitable for profit maximization for a market agent (known prices) END
Stochastic Simulation Model
Stochastic Simulation Model
Weekly hydro plant production
Daily hydro unit production
Coincidence?
Adj
ustm
ent
Adj
ustm
ent
yes
no
END
Stochastic Simulation Model
Stochastic Simulation Model
Weekly hydro plant production
Daily hydro unit production
Coincidence?
Adj
ustm
ent
Adj
ustm
ent
yes
no
END
Stochastic Simulation Model
Stochastic Simulation Model
Weekly hydro plant production
Daily hydro unit production
Coincidence?
Adj
ustm
ent
Adj
ustm
ent
yes
no
END
Stochastic Simulation Model
Stochastic Simulation Model
Weekly hydro plant production
Daily hydro unit production
Coincidence?
Adj
ustm
ent
Adj
ustm
ent
yes
no
Medium term optimization model. Results
• Operation planning
– Fuel consumption, unit (thermal, storage hydro and pumped storage hydro) and/or technology operation
– CO2 Emissions
– Reservoir management
– Targets for short term models (water balance)
Medium Term Stochastic Hydrothermal Coordination Model 9
• Economic planning
– Annual budget
– Operational costs
– System marginal costs
– Targets for short term models (water value)
Medium term optimization model. Main modeling assumptions
• System characteristics and data that are known with certainty (deterministic)
– Technical characteristics of existing power plants
– Multiple cascaded reservoirs
– Net load demand (includes intermittent generation and imported/exported power)
– Availability of generation units as a reduced rated power
Medium Term Stochastic Hydrothermal Coordination Model 10
– Availability of generation units as a reduced rated power
– Fuel costs
• Uncertain or stochastic data
– Unregulated hydro inflows
• Hydro plants are limited in both energy and power output
• Transmission network doesn’t affect the optimal operation of the units (it is not represented)
Solution methods
• Deterministic approaches:
– Network Flows
– LP
– NLP
– MILP
• commitment of thermal or hydro units
• piecewise linear approximation of water head effects
Medium Term Stochastic Hydrothermal Coordination Model 11
• piecewise linear approximation of water head effects
• Stochastic approaches:
– Stochastic Dynamic Programming (SDP)
– Stochastic Linear Programming. Decomposition approaches (Benders, Lagrangian Relaxation, Stochastic Dual Dynamic Programming)
– Stochastic Nonlinear Programming
Contents
• Medium term stochastic hydrothermal coordination model
Hydroelectric system modeling
• Mathematical formulation
Medium Term Stochastic Hydrothermal Coordination Model 12
• Mathematical formulation
• Case study
Hydroelectric Dam
Medium Term Stochastic Hydrothermal Coordination Model 13
Source: Environment Canada
Hydro unit modeling difficulties
• Stochasticity in natural water inflows
• Topological complexities in waterways
• Nonlinearities in production function. Head dependency: energy production depends on the water reserve at the reservoir and originally on the water inflows
Medium Term Stochastic Hydrothermal Coordination Model 14
on the water inflows
– Important when changes in reservoir levels are significant for the time scope of the model
• Complex operation constraints by other uses of water (irrigation, minimum and maximum river flow, minimum and maximum reservoir levels, sporting activities)
Contents
• Medium term stochastic hydrothermal coordination model
Hydroelectric system modeling Topology
Water head effect
Inflow stochasticity
Medium Term Stochastic Hydrothermal Coordination Model 15
Inflow stochasticity
• Mathematical formulation
• Case study
Lower Tagus basin
Medium Term Stochastic Hydrothermal Coordination Model 16
Source: Iberdrola
Lower Tagus basin
Medium Term Stochastic Hydrothermal Coordination Model 17
Source: Iberdrola
Spanish Duero basin
Medium Term Stochastic Hydrothermal Coordination Model 18
Source: Iberdrola
Sil basin
Medium Term Stochastic Hydrothermal Coordination Model 19
Source: Iberdrola
Multiple basins
• Hydro subsystem is divided in a set of independent hydro basins:
Medium Term Stochastic Hydrothermal Coordination Model 20
InflowBasin 1
Basin 2
Basin 3
Storage hydro plant
Run of the river plant
Spanish hydro subsystem
• Very diverse system:
– Hydro reservoir volumes from 0.15 to 2433 hm3
– Hydro plant capacity from 1.5 to 934 MW
Medium Term Stochastic Hydrothermal Coordination Model 21
Almendra reservoir (2433 hm3)
Contents
• Medium term stochastic hydrothermal coordination model
Hydroelectric system modeling Topology
Water head effect
Inflow stochasticity
Medium Term Stochastic Hydrothermal Coordination Model 22
Inflow stochasticity
• Mathematical formulation
• Case study
Nonlinearity
• The power output of each hydro generatordepends on the flow (water discharge)through the turbine and on the water head(difference between the reservoir and drainlevels).
Medium Term Stochastic Hydrothermal Coordination Model 23
efficiency theoretical value
p g q hη ρ= ⋅ ⋅ ⋅ ⋅
Waterdensity
Gravity acceleration
Flow
Net water head
Characteristic curve
Maximumoutput
elec
tric
al p
ow
erp
[MW
]
elec
tric
al p
ow
erp
[MW
]
Medium Term Stochastic Hydrothermal Coordination Model 25
water dischargeq [m3/s]
water dischargeq [m3/s]
Some times, head dependency canbe neglected.But in some plants this dependencycan be significant even in a week.
Characteristic surface
Maximumoutput
water dischargeq [m3/s]
elec
tric
al p
ow
erp
[MW
]
ele
ctric
al p
ower
[M
W]
Medium Term Stochastic Hydrothermal Coordination Model 26
q [m /s]
120 140 160 180
water dischargeq [m3/s]
net hydraulic headh [m]
ele
ctric
al p
ower
p [M
W]
( , )i i i ip q h= Φ
outputWaterflow
Net water head
Contents
• Medium term stochastic hydrothermal coordination model
Hydroelectric system modeling Topology
Water head effect
Inflow stochasticity: Definition
Medium Term Stochastic Hydrothermal Coordination Model 27
Inflow stochasticity: Definition
• Mathematical formulation
• Case study
Stochasticity or uncertainty
• Origin
– Future information (e.g., prices or future demand)
– Lack of reliable data
– Measurement errors
• In electric energy systems planning
– Demand (yearly, seasonal or daily variation, load growth)
Medium Term Stochastic Hydrothermal Coordination Model 28
growth)
– Hydro inflows
– Availability of generation or network elements
– Electricity or fuel prices
• Uncertainty relevance for each time scale
Stochasticity sources
• Natural hydro inflows (clearly the most important factor in the Spanish electric system) Year Hydro energy Index % of being
TWh exceeded
2000 26.2 0.90 62%
2001 33.0 1.14 27%
2002 21.0 0.73 88%
2003 33.2 1.15 26%
2004 24.6 0.85 68%
2005 12.9 0.45 100%
2006 23.3 0.82 74%
Medium Term Stochastic Hydrothermal Coordination Model 29
• Changes in reservoir volumes are significant because of:
– stochasticity in hydro inflows
– chronological pattern of inflows and
– capacity of the reservoir with respect to the inflows
2006 23.3 0.82 74%
2007 18.3 0.64 93%
2008 18.8 0.67 91%
2009 22.1 0.78 77%
Hydro inflows and hydro output
Medium Term Stochastic Hydrothermal Coordination Model 30
Source: REE
Output: stochastic reservoir levels
Wet year
Dry yearMean year
Medium Term Stochastic Hydrothermal Coordination Model 31
Source: REE
Natural hydro inflows: (monthly) historical series
25000
30000
35000
40000
Medium Term Stochastic Hydrothermal Coordination Model 32
0
5000
10000
15000
20000
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
113
120
127
134
141
148
155
162
169
176
183
190
197
204
211
218
225
232
239
246
253
260
267
274
281
288
295
302
309
316
323
330
Cau
dal [
m3/
s] 1970-1997
media
mínima
máxima
Natural hydro inflows: (monthly) historical series
20000
25000
30000
19701971197219731974197519761977197819791980198119821983
Medium Term Stochastic Hydrothermal Coordination Model 33
0
5000
10000
15000
1 2 3 4 5 6 7 8 9 10 11 12
Cau
dal [
m3/
s]
198319841985198619871988198919901991199219931994199519961997mediamedia+2 desv tipicamedia-desv tipicamaximominimo
Probability density function f(x)
0.100
0.120
0.140
0.160
0.180f(x)
Medium Term Stochastic Hydrothermal Coordination Model 34
0.000
0.020
0.040
0.060
0.080
0.100
010
0020
0030
0040
0050
0060
0070
0080
0090
0010
000
1100
012
000
1300
014
000
1500
016
000
1700
018
000
1900
020
000
2100
022
000
2300
024
000
2500
026
000
2700
028
000
2900
030
000
3100
032
000
3300
034
000
3500
036
000
3700
038
000
3900
0
Caudal [m3/s]
Cumulative distribution function F(x)
0.600
0.700
0.800
0.900
1.000F(x)
Medium Term Stochastic Hydrothermal Coordination Model 35
0.000
0.100
0.200
0.300
0.400
0.500
010
0020
0030
0040
0050
0060
0070
0080
0090
0010
000
1100
012
000
1300
014
000
1500
016
000
1700
018
000
1900
020
000
2100
022
000
2300
024
000
2500
026
000
2700
028
000
2900
030
000
3100
032
000
3300
034
000
3500
036
000
3700
038
000
3900
0
Caudal [m3/s]
Water inflows
• Several measurement points in main different river basins
• Partial spatial correlation among them
• Temporal correlation in each one
• No establish method for obtaining a unique multivariate probability tree
Medium Term Stochastic Hydrothermal Coordination Model 36
Contents
• Medium term stochastic hydrothermal coordination model
Hydroelectric system modeling Topology
Water head effect
Inflow stochasticity: Modeling alternatives
Medium Term Stochastic Hydrothermal Coordination Model 37
Inflow stochasticity: Modeling alternatives
• Mathematical formulation
• Case study
Deterministic vs. Stochastic Optimization
• Deterministic
– Parameters known with certainty (it can be the mean value)
• Stochastic
– Parameters modeled as stochastic variables with known distributions
Medium Term Stochastic Hydrothermal Coordination Model 38
known distributions
• Historical
• Discrete
• Continuous ⇒ simulation
Alternatives for modeling the uncertainty (i)
• Wait and see o scenario analysis o what-if analysis
– Decisions are taken once solved the uncertainty
– The problem is solved independently for each scenario
– The scenario with mean value of the parameters is just an special case
– A priori, decisions will be different for each scenario
Medium Term Stochastic Hydrothermal Coordination Model 39
– A priori, decisions will be different for each scenario (anticipative, clairvoyant, non implementable)
– Solution of an scenario can be infeasible in the others
Alternatives for modeling the uncertainty (ii)
• Heuristic criteria
– Robust decisions will be those appearing in multiple deterministic optimal plans (for many scenarios)
– Flexible decisions will be those than can be changed along time once the uncertainty is being solved
Medium Term Stochastic Hydrothermal Coordination Model 40
Alternatives for modeling the uncertainty (iii)
• Here and now
– Decisions have to be taken before solving uncertainty
– Non anticipative decisions (only the available information so far can be used, no future information)
– The only relevant decisions are those of the first stage, given that are the only to be taken immediately
Medium Term Stochastic Hydrothermal Coordination Model 41
given that are the only to be taken immediately
– Stochastic solution takes into account the stochasticitydistribution
– It allows to include risk averse attitudes, penalizing worst cases
– STOCHASTIC OPTIMIZATION
Example: hydrothermal coordination problem
• Scenario analysis
– Run the model supposing that the natural inflows will be the same as any of the previous historical inflows(i.e., year 1989 or 2004, etc.) for the time scope
– Run the model supposing that the natural inflows for each period will be exactly the mean of the historical values (i.e., average year) for the time scope
Medium Term Stochastic Hydrothermal Coordination Model 42
• Stochastic optimization
– Run the model taking into account that the distribution of future natural inflows will be the same as it has been in the past
Multistage stochastic optimization
• Taking optimal decisions in different stages in presence of random parameters with known distributions
• General formulation of the problem:
∫Ω∈∈= )()·,(min),(min ωωω dPxfxfE
XxP
Xx
Medium Term Stochastic Hydrothermal Coordination Model 52
• Uncertainty is represented by a scenario tree
Solution of a stochastic model
Stochastic parameters
Scenario tree generation
Medium Term Stochastic Hydrothermal Coordination Model 53
Stochastic optimization
Stability of thestochastic solution?
YES
NO
Stability of the stochastic solution
• The main stochastic solutions (i.e., the first-stage ones) must be robust against the uncertainty modeling (structure and number of scenarios of the tree)
• A tree must be generated such as the solution of the stochastic model ought to be independent
Medium Term Stochastic Hydrothermal Coordination Model 54
of the stochastic model ought to be independent of it
• Analyze the stochastic solutions for different scenario trees
Contents
• Medium term stochastic hydrothermal coordination model
Hydroelectric system modeling Topology
Water head effect
Inflow stochasticity: Scenario tree definition
Medium Term Stochastic Hydrothermal Coordination Model 55
Inflow stochasticity: Scenario tree definition
• Mathematical formulation
• Case study
Alternatives for modeling the stochastic parameters
• Discrete probability function (i.e., scenario tree)
• Continuous or historical probability function that generates the tree by sampling (simulating) in each time period
Medium Term Stochastic Hydrothermal Coordination Model 56
Probability tree or scenario tree
• Tree: represents how the stochasticity is revealed over time, i.e., the different states of the random parameters and simultaneously the non anticipative decisions over time. Correlation among parameters should be taken into account
• Scenario: any path going from the root to the
Medium Term Stochastic Hydrothermal Coordination Model 57
• Scenario: any path going from the root to the leaves
• The scenarios that share the information until a certain period do the same into the tree (non anticipative decisions)
Scenario tree
• Nodes: where decisions are taken.
• Scenarios: instances of the random process.
Medium Term Stochastic Hydrothermal Coordination Model 58
Stage 1 Stage 2 Stage 3 Stage 4 scenario
Scenario tree example
wet
wet
dry
Period 1 Period 2
Inflow: 25 m3/s Prob: 0.55
Inflow: 35 m3/s Prob: 0.60
Inflow: 25 m3/s Prob: 0.40
In each node a decision is made and afterwards stochastic
Medium Term Stochastic Hydrothermal Coordination Model 59
wet
wet
dry
dry
Inflow: 20 m3/s Prob: 0.35
Inflow: 10 m3/s Prob: 0.65
Inflow: 20 m3/s Prob: 0.45
stochastic parameters are revealed
Scenario recombining tree example
wet
dry
Period 1 Period 2
Inflow: 25 m3/s Prob: 0.55
Inflow: 30 m3/sProb: 0.60
Inflow: 15 m3/sProb: 0.40
In each node a decision is made and afterwards stochastic
wet
Medium Term Stochastic Hydrothermal Coordination Model 60
dry
dry
Inflow: 30 m3/sProb: 0.35
Inflow: 15 m3/sProb: 0.65
Inflow: 20 m3/s Prob: 0.45
stochastic parameters are revealed
wet
Scenario recombining tree example
wet
dry
Period 1 Period 2
Inflow: 25 m3/s Prob: 0.55
Inflow: 30 m3/sProb: 0.60
Inflow: 30 m3/sProb: 0.35
In each node a decision is made and afterwards stochastic
wet
Medium Term Stochastic Hydrothermal Coordination Model 61
dry
dry
Inflow: 15 m3/sProb: 0.65
Inflow: 20 m3/s Prob: 0.45
Inflow: 15 m3/sProb: 0.40
stochastic parameters are revealed wet
Recombining tree
• The inflows depend on the scenarios in each period.
– In the tree in period 2 there are four outcomes, 30, 25, 20 y 10 m3/s.
– In the recombining tree, in period 2 there are only two outcomes, 30 y 15 m3/s.
Medium Term Stochastic Hydrothermal Coordination Model 62
Issues on uncertainty representation
• Tree based in
– Historical series (usually in a reduced number)
– Synthetic series
• Tree
– Recombining
– Not recombining
Medium Term Stochastic Hydrothermal Coordination Model 63
• Comparison
– Statistical properties (moments, distances) of the original series and the scenario tree
– Results of the stochastic optimization in the first stage
Scenario tree trade-off
• Big scenario tree and
simplified electric system operation problem
– Where do we branch the tree?
• Small scenario tree and
Medium Term Stochastic Hydrothermal Coordination Model 64
• Small scenario tree and
realistic electric system operation problem
Where is it important to branch the tree?
• Where there are huge variety of stochastic values
– Winter and spring in hydro inflows
• Short-term future will affect more that long-term future
– If the scope of the model is from January to December branching in winter and spring will more relevant than branching in autumn
Medium Term Stochastic Hydrothermal Coordination Model 65
branching in autumn
Contents
• Medium term stochastic hydrothermal coordination model
Hydroelectric system modeling Topology
Water head effect
Inflow stochasticity: Scenario tree generation
Medium Term Stochastic Hydrothermal Coordination Model 66
Inflow stochasticity: Scenario tree generation
• Mathematical formulation
• Case study
Scenario tree generation (i)
• Univariate series (one inflow)
– Distance from the cluster centroid to each series from a period to the last one
• Multivariate series (several inflows)
– Distance from the multidimensional cluster centroid to each series of each variable from a period to the
Medium Term Stochastic Hydrothermal Coordination Model 67
to each series of each variable from a period to the last one
Scenario tree generation (ii)
• There is no established method to obtain a unique scenario tree
• A multivariate scenario tree is obtained by neural gas clustering technique that simultaneously takes into account the main stochastic series and their spatial and temporal dependencies.
Medium Term Stochastic Hydrothermal Coordination Model 68
• Very extreme scenarios can be artificially introduced with a very low probability
• Number of scenarios generated enough for yearly operation planning
Common approach for tree generation
• Process divided into two phases:
– Generation of a scenario tree.
Neural gas method.
– Reduction of a scenario tree.
Using probabilistic distances.
Medium Term Stochastic Hydrothermal Coordination Model 69
Clustering in two dimensions
Inflow 2 [m3/s]
45
Centroid
Historical inflows
Historical density function
Medium Term Stochastic Hydrothermal Coordination Model 70
Centroids have the minimum distance to their corresponding points
Their probability is proportional to the number of points included in the centroid
Inflow 1 [m3/s]5025
25functionDiscrete density function
Scenario tree generation
• Idea
– Minimize the distance of the scenario tree to the original series
– Predefined maximum tree structure(2x2x2x2x1x1x1x1x1x1x1x1, for example)
– Extension of clustering technique to consider many inflows and many periods
Medium Term Stochastic Hydrothermal Coordination Model 71
inflows and many periods
• J.M. Latorre, S. Cerisola, A. Ramos Clustering Algorithms for Scenario Tree Generation. Application to Natural Hydro InflowsEuropean Journal of Operational Research 181 (3): 1339-1353 Sep 2007
Neural gas algorithm (i)
• Soft competitive learning method
– All the scenarios are adapted for each new series introduced
– Decreasing adapting rate
• Iterative adaptation of the centroid as a function of the closeness to a new series randomly chosen
• Modifications to this method:
Medium Term Stochastic Hydrothermal Coordination Model 72
• Modifications to this method:
– Initialization: considers the tree structure of the centroids
– Adaptation: the modification of each node is the average of the corresponding one for belonging to each scenario
Natural inflows (V)
• Data series for one hydro inflow:
3500
4000
4500
5000
Aportaciones [m3/s]
Medium Term Stochastic Hydrothermal Coordination Model 80
1 5 9 13 17 21 25 29 33 37 41 45 490
500
1000
1500
2000
2500
3000
Etapa
Natural inflows (VI)
• Initial scenario tree for one hydro inflow:
3500
4000
4500
5000
Aportaciones [m3/s]
Medium Term Stochastic Hydrothermal Coordination Model 81
1 5 9 13 17 21 25 29 33 37 41 45 490
500
1000
1500
2000
2500
3000
Etapa0 4 8 12 16 20 24 28 32 36 40 44 48
Etapa
Natural inflows (VII)
• Reduced scenario tree for one hydro inflow:
3500
4000
4500
5000
Aportaciones [m3/s]
Medium Term Stochastic Hydrothermal Coordination Model 82
0 4 8 12 16 20 24 28 32 36 40 44 48Etapa
1 5 9 13 17 21 25 29 33 37 41 45 490
500
1000
1500
2000
2500
3000
Etapa
Natural inflows: scenario tree
800
1000
1200
1400N
atu
ral
In
flo
ws [
m3/
s]
Serie1
Serie2
Serie3
Serie4
Serie5
Serie6
Serie7
Serie8
800
1000
1200
1400N
atu
ral
In
flo
ws [
m3/
s]
Serie1
Serie2
Serie3
Serie4
Serie5
Serie6
Serie7
Serie8
Medium Term Stochastic Hydrothermal Coordination Model 83
-200
0
200
400
600
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51
Week
Natu
ral
In
flo
ws [
m
Serie8
Serie9
Serie10
Serie11
Serie12
Serie13
Serie14
Serie15
Serie16
-200
0
200
400
600
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51
Week
Natu
ral
In
flo
ws [
m
Serie8
Serie9
Serie10
Serie11
Serie12
Serie13
Serie14
Serie15
Serie16
Contents
• Medium term stochastic hydrothermal coordination model
• Stochastic optimization
Mathematical formulation
Medium Term Stochastic Hydrothermal Coordination Model 84
Mathematical formulation
• Case study
Mathematical formulation
• Objective function
– Minimize the total expected variable costs plus penalties for energy and power not served
• Variables– BINARY: Commitment, startup and shutdown of thermal units
– Thermal, storage hydro and pumped storage hydro output
– Reservoir levels
• Operation constraints
Medium Term Stochastic Hydrothermal Coordination Model 85
• Operation constraints
– Inter-period
• Storage hydro and pumped storage hydro scheduling
Water balance with stochastic inflows
– Intra-period
• Load and reserve balance
• Detailed hydro basin modeling
• Thermal, storage hydro and pumped-storage hydro operation constraints
• Mixed integer linear programming (MIP)
Indices
• Time scope
– 1 year
• Period
– 1 month
• Subperiod
Period
Subperiod
p
s
Medium Term Stochastic Hydrothermal Coordination Model 86
• Subperiod
– weekdays and weekends
• Load level
– peak, shoulder and off-peak
Subperiod
Load level
s
n
Demand (5 weekdays)
Chronological Load Curve (5 Working Days)
5000
10000
15000
20000
25000
30000
35000
40000
45000
50000
Dem
and
[MW
]
Load Duration Curve
5000
10000
15000
20000
25000
30000
35000
40000
45000
50000
Dem
and
[MW
]
Load Duration CurveChronological Load Curve
Medium Term Stochastic Hydrothermal Coordination Model 87
01 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 101 105 109 113 117
Hours
0
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 101 105 109 113 117
HoursLoad Duration Curve in 3 Load Levels
0
5000
10000
15000
20000
25000
30000
35000
40000
45000
50000
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 101 105 109 113 117
Hours
Dem
and
[MW
]
Load Duration Curve in 3 Load Levels
Demand
• Monthly demand with several load levels
– Peak, shoulder and off-peak for weekdays and weekends
• All the weekdays of the same month are similar (same for weekends)
4500
5000
Demand [ ]
Duration [ ]psn
psn
MW D
h d
Medium Term Stochastic Hydrothermal Coordination Model 88
0
500
1000
1500
2000
2500
3000
3500
4000
4500
p01 p02 p03 p04 p05 p06 p07 p08 p09 p10 p11 p12
Dem
and
[MW
]
Month
WeekDay.n01
WeekDay.n02
WeekDay.n03
WeekEnd.n01
WeekEnd.n02
WeekEnd.n03
Technical characteristics of thermal units (t)
• Maximum and minimum output
• Fuel cost
• Slope and intercept of the heat rate straight line
• Operation and maintenance (O&M) variable cost
– No load cost = fuel cost x heat rate intercept
– Variable cost = fuel cost x heat rate slope + O&M cost
• Cold startup cost
Medium Term Stochastic Hydrothermal Coordination Model 89
• Cold startup cost
• Equivalent forced outage rate (EFOR)
Max and min output [ ] ,
No load cost [€ / ]
Variable cost [€ / ]
Startup cost [€]
[ . .]
t t
t
t
t
t
MW p p
h f
MWh v
sr
EFOR p u q
Technical characteristics of hydro plants (h)
• Maximum and minimum output
• Production function (efficiency for conversion of water release in m3/s to electric power MW)
• Efficiency of pumped storage hydro plants
– Only this ratio of the energy consumed to pump the water is recovered by turbining this water
Medium Term Stochastic Hydrothermal Coordination Model 90
3
Max and min output [ ] ,
Production function [ / ]
Efficiency [ . .]
h h
h
h
MW p p
kWh m c
p u η
Technical characteristics of hydro reservoirs (r)
• Maximum and minimum reserve
• Initial reserve
– Final reserve = initial reserve
• Stochastic inflows
3Max and min reserve [ ] ,r r
hm r r
Medium Term Stochastic Hydrothermal Coordination Model 91
3
3
Max and min reserve [ ] ,
Initial and final
Stochasti
rese
c inf
r
lows
ve [ ]
[ / ]
r r
r
pr
hm r r
hm r
m s iω
′
Scenario tree example
wet
wet
dry
Period 1 Period 2
Inflow: 25 m3/s Prob: 0.55
Inflow: 35 m3/s Prob: 0.60
Inflow: 25 m3/s Prob: 0.40
In each node a decision is made and afterwards stochastic
Medium Term Stochastic Hydrothermal Coordination Model 92
wet
wet
dry
dry
Inflow: 20 m3/s Prob: 0.35
Inflow: 10 m3/s Prob: 0.65
Inflow: 20 m3/s Prob: 0.45
stochastic parameters are revealed
Scenario tree. Ancestor and descendant
( ) ( 02, 03) ( 03, 03)a p sc a p scω ω ′ ∈ ∈
Scenario 1Scenario 1
Scenario 2( 02, 01)p sc
( 03, 01)p sc
Tree relations
Scenario
Period
Scenario tree ( , )
p
p
ω
ω
Tree structure
Medium Term Stochastic Hydrothermal Coordination Model 93
Scenario 3
Scenario 4
Scenario 3
Scenario 2( 02, 01)p sc
( 02, 03)p sc
( 03, 04)p sc
( 03, 03)p sc( 01, 01)p sc
( 03, 02)p sc
3
Scenario probability [ . .]
[ /Stochastic i s ]nflowp
pr
p u p
m s i
ω
ω
Tree data
Hydro topology
r1 r2
r3
h1 h2
Medium Term Stochastic Hydrothermal Coordination Model 94
r3
h3 Hydro plant upstream of reservoir ( ) ( , ) ( 1, 3)
Pumped hydro plant upstream of reservoir ( ) ( , ) ( 3, 2)
Reservoir upstream of hydro plant ( ) ( , ) ( 2, 2)
Reserv
h up r hur h r h r
h up r hpr h r h r
h dw r ruh r h r h
∈
∈
∈
oir upstream of pumped hydro plant ( ) ( , ) ( 3, 3)
Reservoir upstream of reservoir ( ) ( , ) ( 1, 3)
h dw r rph r h r h
r up r rur r r r r
∈
′ ∈
Other system parameters
• Energy not served cost
• Operating power reserve not served cost
• Operating power reserve
Energy not served cost [€ / ]
Operating power reserve not served cost [€ / ]
Operating reserve [ ]
MWh v
MW v
MW O
′
′′
Medium Term Stochastic Hydrothermal Coordination Model 95
1Operating reserve [ ]
psMW O
Variables
• Commitment, startup and shutdown of thermal units (BINARY)
• Production of thermal units and hydro plants
• Consumption of pumped storage hydro plants
Production of a thermal or hydro unit [ ] ,psnt psnh
MW P Pω ω
Commitment, startup and shut 0,own ,1d ,pst pst pstA SR SDω ω ω
Medium Term Stochastic Hydrothermal Coordination Model 96
• Consumption of pumped storage hydro plants
• Reservoir levels
• Energy and power not served
Consumption of a hydro plant [ ]psnh
MW C ω
Energy and power not served [ ] ,psn ps
MW ENS PNSω ω
3Reservoir level [ ]pr
hm Rω
Constraints: Operating power reserve
Committed output of thermal units
+ Maximum output of hydro plants
+ Power not served
>= Demand
+ Operating reserve for peak load level, subperiod, period and scenario
Committed output of thermal units
+ Maximum output of hydro plants
+ Power not served
>= Demand
+ Operating reserve for peak load level, subperiod, period and scenario
Medium Term Stochastic Hydrothermal Coordination Model 97
+ Operating reserve for peak load level, subperiod, period and scenario+ Operating reserve for peak load level, subperiod, period and scenario
1 1t pst h ps ps pst h
p A p PNS D O psω ωω+ + ≥ + ∀∑ ∑
Constraints: Generation and load balance
Generation of thermal units
+ Generation of storage hydro plants
– Consumption of pumped storage hydro plants
+ Energy not served
= Demand for each load level, subperiod, period and scenario
Generation of thermal units
+ Generation of storage hydro plants
– Consumption of pumped storage hydro plants
+ Energy not served
= Demand for each load level, subperiod, period and scenario
Medium Term Stochastic Hydrothermal Coordination Model 98
= Demand for each load level, subperiod, period and scenario= Demand for each load level, subperiod, period and scenario
/psnt psnh psnh h psn psn
t h h
P P C ENS D psnω ω ω ωη ω+ − + = ∀∑ ∑ ∑
Constraints: Production in consecutive load levels
Output of a unit in shoulder ≤ Output of a unit in peak
Output of a unit in off-peak ≤ Output of a unit in shoulder
Output of a unit in shoulder ≤ Output of a unit in peak
Output of a unit in off-peak ≤ Output of a unit in shoulder
1
1
psn t psnt
psn h psnh
P P psnt
P P psnh
ω ω
ω ω
ω
ω
+
+
≤ ∀
≤ ∀
Medium Term Stochastic Hydrothermal Coordination Model 99
Demand
Hours
Peak
Shoulder
Off-peak
• All the weekdays of the same month are similar (same for weekends)
• Commitment decision of a thermal unit
Constraints: Commitment, startup and shutdown
Period p-1 Period p Period p+1
1
Medium Term Stochastic Hydrothermal Coordination Model 100
Weekdays Weekdays WeekdaysWeekend Weekends s+1 s s+1 s
1
0
• Startup of thermal units can only be made in the transition between consecutive weekend and weekdays
Constraints: Commitment, startup and shutdown
1 1( )
pst p s t pst pstA A SR SD p astω ω ωω
ω ωω− +
′ ′ ∈− = − ∀
Commitment of a thermal unit in a weekday
– Commitment of a thermal unit in the weekend of previous period
≥ Startup of a thermal unit in this weekday
Commitment of a thermal unit in a weekday
– Commitment of a thermal unit in the weekend of previous period
≥ Startup of a thermal unit in this weekday
Medium Term Stochastic Hydrothermal Coordination Model 101
• Shutdown only in the opposite transition
Commitment of a thermal unit in a weekend
– Commitment of a thermal unit in the previous weekday
≥ Startup of a thermal unit in this weekend
- Shutdown of a thermal unit in this weekend
Commitment of a thermal unit in a weekend
– Commitment of a thermal unit in the previous weekday
≥ Startup of a thermal unit in this weekend
- Shutdown of a thermal unit in this weekend
1 1pst p s t pst pst− +
1 1 1ps t pst ps t ps tA A SR SD pstω ω ω ω
ω+ + +− = − ∀
Constraints: Commitment and production
Production of a thermal unit
≤ Commitment of a thermal unit x the maximum output reduced by availability rate
Production of a thermal unit
≤ Commitment of a thermal unit x the maximum output reduced by availability rate
Production of a thermal unit
≥ Commitment of a thermal unit x the minimum output
Production of a thermal unit
≥ Commitment of a thermal unit x the minimum output
Medium Term Stochastic Hydrothermal Coordination Model 102
(1 ) (1 )pst t t psnt pst t tA p q P A p q psntω ω ω
ω− ≤ ≤ − ∀
≥ Commitment of a thermal unit x the minimum output reduced by availability rate
≥ Commitment of a thermal unit x the minimum output reduced by availability rate
• If the thermal unit is committed (Aϖpst = 1) it can produce
between its minimum and maximum output• If the thermal unit is not committed (Aϖ
pst = 0) it can’t produce
Constraints: Water balance for each reservoirReservoir volume at the beginning of the period
– Reservoir volume at the end of the period
+ Natural inflows
– Spills from this reservoir
+ Spills from upstream reservoirs
+ Turbined water from upstream storage hydro plants
– Turbined (and pumped) water from this reservoir
+ Pumped water from upstream pumped hydro plants = 0 for each reservoir,
Reservoir volume at the beginning of the period
– Reservoir volume at the end of the period
+ Natural inflows
– Spills from this reservoir
+ Spills from upstream reservoirs
+ Turbined water from upstream storage hydro plants
– Turbined (and pumped) water from this reservoir
+ Pumped water from upstream pumped hydro plants = 0 for each reservoir,
Medium Term Stochastic Hydrothermal Coordination Model 103
+ Pumped water from upstream pumped hydro plants = 0 for each reservoir,
period and scenario
+ Pumped water from upstream pumped hydro plants = 0 for each reservoir,
period and scenario
1( )
( ) ( )
( )
(
/ /
0 )/
p r pr pr pr prr up r
psn psnh h psn psnh hsn sn
h up r h dw r
psn psnh hsn
h up r
R R i S S
d P c d P c
C c r ad p
ω ω ω ωω
ω ω
ωω ω ω
′−′∈
∈ ∈
∈
′− + − +
+ −
′ ∈+ = ∀
∑
∑ ∑
∑
Constraints: Operation limits
Reservoir volumes between limits for each hydro reservoirReservoir volumes between limits for each hydro reservoir
Power output between limits for each unitPower output between limits for each unit
0
r pr r
r Pr r
r R r pr
R R r r
ω
ω
ω
ω
≤ ≤ ∀
′= = ∀
Medium Term Stochastic Hydrothermal Coordination Model 104
0 (1 )
0 ,psnt t t
psnh psnh h
P p q psnt
P C p psnh
ω
ω ω
ω
ω
≤ ≤ − ∀
≤ ≤ ∀
Commitment, startup and shutdown for each unitCommitment, startup and shutdown for each unit
, , 0,1pst pst pstA SR SD pstω ω ω
ω∈ ∀
Multiobjective function
• Minimize
– Thermal unit expected variable costs
– Expected penalties introduced in the objective function for energy and power not served
p t pst p psn t pst p psn t psntpst psnt psnt
p srSR p d f A p d v Pω ω ω ω ω ω
ω ω ω
+ +∑ ∑ ∑
Medium Term Stochastic Hydrothermal Coordination Model 105
for energy and power not served
p psn psn p pspsn ps
p d v ENS p v PNSω ω ω ω
ω ω
′ ′′+∑ ∑
Short Run Marginal Cost (SRMC)
• Dual variable of generation and load balance [€/MW]
– Change in the objective function due to a marginal increment in the demand
• Short Run Marginal Cost = dual variable / load level
:psnt psnh psnh psn psn
t h hpsn
P P C ENS D psnω ω ωω ωσ ω+ − + = ∀∑ ∑ ∑
Medium Term Stochastic Hydrothermal Coordination Model 106
• Short Run Marginal Cost = dual variable / load level duration. Expressed in [€/MWh]
/psnpsn psn
SRMC d psnω ωωσ= ∀
Water value
• Dual variable of water balance for each reservoir [€/hm3]
– Change in the objective function due to a marginal increment in the reservoir inflow
1( )
/ /
p r pr pr pr prr up r
psn psnh h psn psnh h
R R i S S
d P c d P c
ω ω ω ω
ω ω
ω
′−′∈
′− + − +
+ −
∑
∑ ∑
Medium Term Stochastic Hydrothermal Coordination Model 107
• Turbining water has no variable cost. However, an additional hm3 turbined allows to substitute energy produced by thermal units with the corresponding variable cost (this is called water value)
( ) ( )
( ) ( )
/ /
/ / 0 : ( )
psn psnh h psn psnh hsn sn
h up r h dw r
psn h psnh h psn h psnh hsn sn
h dw r h up
p
r
r
d P c d P c
d P c d P c p arω ω ωη η ωπ ω ω
∈ ∈
∈ ∈
+ −
− + = ∀ ′ ∈
∑ ∑
∑ ∑
Contents
• Medium term stochastic hydrothermal coordination model
• Stochastic optimization
• Mathematical formulation
Medium Term Stochastic Hydrothermal Coordination Model 108
• Mathematical formulation
Case study
StarGen Lite Medium Term Stochastic Hydrothermal Coordination Model
(http://www.iit.upcomillas.es/aramos/StarGenLite_SHTCM.zip)
• Files
– Microsoft Excel interface for input and output data StarGenLite_SHTCM.xlsm
– GAMS file StarGenLite_SHTCM.gms
• How to use it
– Select the GAMS directory
– Run the model Run
Medium Term Stochastic Hydrothermal Coordination Model 109
– Run the model
– The model creates
• tmp.xlsx with the output data and
• StarGenLite_SHTCM.lst as the listing file of the GAMS execution
– Load the results into the Excel interface
Run
Load results
StarGenLite_SHTCM (i)
$Title StarGen Lite Medium Term Stochastic Hydrothermal Coordination Model (SHTCM)
$ontext
Developed by
Andrés RamosInstituto de Investigación TecnológicaEscuela Técnica Superior de Ingeniería - ICAIUNIVERSIDAD PONTIFICIA COMILLASAlberto Aguilera 2328015 Madrid, Spain
Model name
Authorship and version
Medium Term Stochastic Hydrothermal Coordination Model 110
28015 Madrid, [email protected]
January 6, 2012
$offtext
$onempty onmulti offlisting
* solve the optimization problems until optimalityoption OptcR = 0 ;
Allow declaration of
empty sets and multiple
declaration. Suppress
listing
Obtain the optimal solution
StarGenLite_SHTCM (ii)
* definitions
setsp periodp1(p) first periodpn(p) last periods subperiods1(s) first subperiodn load leveln1(n) first load levelsc scenariosca (sc ) scenarioscp (sc,p ) tree defined as scenario and periodscscp(sc,p,sc) ancestor sc2 of node (sc1 p)
Set definition
Medium Term Stochastic Hydrothermal Coordination Model 111
scscp(sc,p,sc) ancestor sc2 of node (sc1 p)scsch(sc,sc,p) descendant (sc2 p) of node sc1scscr(sc,p,sc) representative sc2 of node (sc1 p)spsn(sc,p,s,n) active load levels for each scenariopsn ( p,s,n) active load levels
g generating unitt (g) thermal unith (g) hydro plantr reservoirrs(r) storage reservoirruh(r,g) reservoir upstream of hydro plantrph(r,g) reservoir upstream of pumped hydro planthur(g,r) hydro plant upstream of reservoirhpr(g,r) pumped hydro plant upstream of reservoirrur(r,r) reservoir 1 upstream of reservoir 2
alias (sc,scc,sccc), (r,rr)
StarGenLite_SHTCM (iii)
parameterspDemand ( p,s,n) hourly load [GW]pOperReserve( p,s,n) hourly operating reserve [GW]pDuration ( p,s,n) duration [h]pCommitt (sc,g,p,s ) commitment of the unit [0-1]pProduct (sc,g,p,s,n) production of the unit [GW]pEnergy (sc,g,p,s,n) energy of the unit [GWh]pReserve (sc,r,p ) reservoir level [hm3]pSRMC (sc, p,s,n) short run marginal cost [M€ per GWh]pWV (sc,r,p ) water value [M€ per hm3]
pEFOR (g) EFOR [p.u.]pMaxProd (g) maximum output [GW]pMinProd (g) minimum output [GW]
Medium Term Stochastic Hydrothermal Coordination Model 112
pMinProd (g) minimum output [GW]pMaxCons (g) maximum consumption [GW]pSlopeVarCost(g) slope variable cost [M€ per GWh]pInterVarCost(g) intercept variable cost [M€ per h]pStartupCost (g) startup cost [M€]pMaxReserve (r) maximum reserve [km3]pMinReserve (r) minimum reserve [km3]pIniReserve (r) initial reserve [km3]pProdFunct (g) production function [GWh per km3]pEffic (g) pumping efficiency [p.u.]pInflows (r,sc,p) inflows [km3]pInflOrg (r,sc,p) inflows original [km3]pENSCost energy non-served cost [M€ per GWh]pPNSCost power non-served cost [M€ per GW ]
pProbsc (sc,p) probability of a given node
lag(p) backward counting of periodscaux scenario number
Parameter
definition
StarGenLite_SHTCM (iv)
variablesvTotalVCost total system variable cost [M€]
binary variablesvCommitt (sc,p,s, g) commitment of the unit [0-1]vStartup (sc,p,s, g) startup of the unit [0-1]vShutdown (sc,p,s, g) shutdown of the unit [0-1]
positive variablesvProduct (sc,p,s,n,g) production of the unit [GW]vConsump (sc,p,s,n,g) consumption of the unit [GW]vENS (sc,p,s,n ) energy non served [GW]
Variables
Medium Term Stochastic Hydrothermal Coordination Model 113
vENS (sc,p,s,n ) energy non served [GW]vPNS (sc,p,s ) power non served [GW]vReserve (sc,p, r) reserve at the end of period [km3]vSpillage (sc,p, r) spillage [km3]
equationseTotalVCost total system variable cost [M€]eOpReserve(sc,p,s,n ) operating reserve [GW]eBalance (sc,p,s,n ) load generation balance [GW]eMaxOutput(sc,p,s,n,g) max output of a committed unit [GW]eMinOutput(sc,p,s,n,g) min output of a committed unit [GW]eProdctPer(sc,p,s,n,g) unit production in same period [GW]eStrtUpPer(sc,p,s, g) unit startup in same periodeStrtUpNxt(sc,p,s, g) unit startup in next periodeWtReserve(sc,p, r) water reserve [km3] ;
Equation
definition
StarGenLite_SHTCM (v)* mathematical formulation
eTotalVCost .. vTotalVCost =e= sum[(spsn(sc,p ,s,n) ), pProbSc(sc,p)*pDuration(p,s,n)*pENSCost *vENS (sc,p,s,n )] +sum[(scp (sc,p),s ), pProbSc(sc,p) *pPNSCost *vPNS (sc,p,s )] +sum[(scp (sc,p),s, t), pProbSc(sc,p) *pStartupCost (t)*vStartup(sc,p,s, t)] +sum[(spsn(sc,p ,s,n),t), pProbSc(sc,p)*pDuration(p,s,n)*pInterVarCost(t)*vCommitt(sc,p,s, t)] +sum[(spsn(sc,p ,s,n),t), pProbSc(sc,p)*pDuration(p,s,n)*pSlopeVarCost(t)*vProduct(sc,p,s,n,t)] ;
eOpReserve(spsn(sc,p,s,n1(n))) .. sum[t, pMaxProd(t)*vCommitt(sc,p,s, t)] + sum[h, pMaxProd( h) ] + vPNS(sc,p,s ) =g= pDemand(p,s,n) + pOperReserve(p,s,n) ;eBalance (spsn(sc,p,s, n )) .. sum[g, vProduct(sc,p,s,n,g)] - sum[h, vConsump(sc,p,s,n,h)/pEffic(h)] + vENS(sc,p,s,n) =e= pDemand(p,s,n) ;
eMaxOutput(spsn(sc,p,s,n),t) $pMaxProd(t) .. vProduct(sc,p,s,n,t) / pMaxProd(t) =l= vCommitt(sc,p,s,t) ;eMinOutput(spsn(sc,p,s,n),t) $pMinProd(t) .. vProduct(sc,p,s,n,t) / pMinProd(t) =g= vCommitt(sc,p,s,t) ;
eProdctPer(spsn(sc,p,s1(s),n),g) .. vProduct(sc,p,s+1,n,g) =l= vProduct(sc,p,s,n,g) ;
eStrtUpPer(scp(sc,p),s1(s),t) .. vCommitt(sc,p,s+1,t) =e= vCommitt(sc ,p ,s ,t) + vStartup(sc,p,s+1,t) -vShutdown(sc,p,s+1,t) ;eStrtUpNxt(scp(sc,p),s1(s),t) $[not p1(p)] .. vCommitt(sc,p,s ,t) =e= sum[scscp(sc,p,scc), vCommitt(scc,p-1,s+1,t)] + vStartup(sc,p,s ,t) -
Medium Term Stochastic Hydrothermal Coordination Model 114
eStrtUpNxt(scp(sc,p),s1(s),t) $[not p1(p)] .. vCommitt(sc,p,s ,t) =e= sum[scscp(sc,p,scc), vCommitt(scc,p-1,s+1,t)] + vStartup(sc,p,s ,t) -vShutdown(sc,p,s ,t) ;
eWtReserve(scp(sc,p), r) .. sum[scscp(sc,p,scc), vReserve(scc,p-1,r)] + pIniReserve(r) $p1(p) - vReserve(sc,p,r) +pInflows(r,sc,p) - vSpillage(sc,p,r) + sum[rur(rr,r), vSpillage(sc,p,rr)] +sum(s,n), pDuration(p,s,n)*sum[hur(h,r), vProduct(sc,p,s,n,h)/pProdFunct(h)] -sum(s,n), pDuration(p,s,n)*sum[ruh(r,h), vProduct(sc,p,s,n,h)/pProdFunct(h)] +sum(s,n), pDuration(p,s,n)*sum[hpr(h,r), vConsump(sc,p,s,n,h)/pProdFunct(h)] -sum(s,n), pDuration(p,s,n)*sum[rph(r,h), vProduct(sc,p,s,n,h)/pProdFunct(h)] =e= 0 ;
model SHTCM / all / ;SHTCM.solprint = 0 ; SHTCM.holdfixed = 1 ;
Mathematical
formulation of
equationsModel includes
all the equationsReduced solution output Eliminate fixed variables
StarGenLite_SHTCM (vi)* read input data from Excel and include into the model
file TMP / tmp.txt /$onecho > tmp.txt
i="%gams.user1%.xlsm"r1=indiceso1=indicesr2=paramo2=paramr3=demando3=demandr4=oprreso4=oprresr5=durationo5=durationr6=thermalgeno6=thermalgenr7=hydrogeno7=hydrogenr8=reservoiro8=reservoirr9=inflowso9=inflowsr10=tree
Read input from Excel
named ranges and
write into text files
Medium Term Stochastic Hydrothermal Coordination Model 115
r10=treeo10=tree
$offecho$call xls2gms m @"tmp.txt"
sets$include indices;$include paramtable pDemand(p,s,n)$include demandtable pOperReserve(p,s,n)$include oprrestable pDuration(p,s,n)$include durationtable pThermalGen(g,*)$include thermalgentable pHydroGen(g,*)$include hydrogentable pReservoir(r,*)$include reservoirtable pInflows(r,sc,p)$include inflowstable pScnTree(sc,*)$include tree
execute 'del tmp.txt indices param demand oprres duration thermalgen hydrogen reservoir inflows tree' ;
Input from text files
into GAMS
Delete read text files
StarGenLite_SHTCM (vii)
* determine the first and last period and the first subperiod
p1(p) $[ord(p) = 1] = yes ;s1(s) $[ord(s) = 1] = yes ;n1(n) $[ord(n) = 1] = yes ;pn(p) $[ord(p) = card(p)] = yes ;psn(p,s,n) $pDuration(p,s,n) = yes ;lag(p) = card(p) - 2*ord(p) + 1 ;
* assignment of thermal units, storage hydro and pumped storage hydro plants
t (g) $ pThermalGen(g,'FuelCost' ) = yes ;
First period, first subperiod
first load level, …
Defining thermal and hydro
Medium Term Stochastic Hydrothermal Coordination Model 116
t (g) $ pThermalGen(g,'FuelCost' ) = yes ;h (g) $[not pThermalGen(g,'FuelCost' ) ] = yes ;rs(r) $[ pReservoir (r,'MaxReserve') > 0] = yes ;
Defining thermal and hydro
units and reservoirs
StarGenLite_SHTCM (viii)
* scaling of parameters
pDemand (p,s,n) = pDemand (p,s,n) * 1e-3 ;pOperReserve(p,s,n) = pOperReserve(p,s,n) * 1e-3 ;pENSCost = pENSCost * 1e-3 ;pPNSCost = pPNSCost * 1e-3 ;
pEFOR (t) = pThermalGen(t,'EFOR' ) ;pMaxProd (t) = pThermalGen(t,'MaxProd' ) * 1e-3 * [1-pEFOR(t)] ;pMinProd (t) = pThermalGen(t,'MinProd' ) * 1e-3 * [1-pEFOR(t)] ;pSlopeVarCost(t) = pThermalGen(t,'OMVarCost' ) * 1e-3 +
pThermalGen(t,'SlopeVarCost') * 1e-3 * pThermalGen(t,'FuelCost') ;pInterVarCost(t) = pThermalGen(t,'InterVarCost') * 1e-6 * pThermalGen(t,'FuelCost') ;pStartupCost (t) = pThermalGen(t,'StartupCost' ) * 1e-6 * pThermalGen(t,'FuelCost') ;
Scaling of parameters
Medium Term Stochastic Hydrothermal Coordination Model 117
pMaxProd (h) = pHydroGen (h,'MaxProd' ) * 1e-3 ;pMinProd (h) = pHydroGen (h,'MinProd' ) * 1e-3 ;pMaxCons (h) = pHydroGen (h,'MaxCons' ) * 1e-3 ;pProdFunct (h) = pHydroGen (h,'ProdFunct' ) * 1e+3 ;pEffic (h) = pHydroGen (h,'Efficiency' ) ;pMaxReserve (r) = pReservoir (r,'MaxReserve' ) * 1e-3 ;pMinReserve (r) = pReservoir (r,'MinReserve' ) * 1e-3 ;pIniReserve (r) = pReservoir (r,'IniReserve' ) * 1e-3 ;
pInflows(r,sc,p) = pInflows (r,sc,p ) * 1e-6 * 3.6*sum[(s,n), pDuration(p,s,n)] ;pInflOrg(r,sc,p) = pInflows (r,sc,p ) ;
* if the production function of a hydro plant is 0, it is changed to 1 and scaled to 1000* if the efficiency of a hydro plant is 0, it is changed to 1
pProdFunct(h) $[pProdFunct(h) = 0] = 1e3 ;pEffic (h) $[pEffic (h) = 0] = 1 ;
StarGenLite_SHTCM (ix)
* bounds on variables
vProduct.up (sc,p,s,n,g) = pMaxProd(g) ;vConsump.up (sc,p,s,n,g) = pMaxCons(g) ;
vENS.up (sc,p,s,n ) = pDemand(p,s,n) ;
vReserve.up(sc,p,r) = pMaxReserve(r) ;vReserve.lo(sc,p,r) = pMinReserve(r) ;vReserve.fx(sc,p,r) $pn(p) = pIniReserve(r) ;
Bounds on variables
Medium Term Stochastic Hydrothermal Coordination Model 118
StarGenLite_SHTCM (x)
* define the nodes of the scenario tree and determine ancestor sc2 of node (sc1 p) and descendant (sc2 p) of node sc1
scp ( sc,p ) $[ord(p) >= pScnTree(sc,'FirstPeriod') ] = yes ;scscp(scp(sc,p),scc) $[ord(p) > pScnTree(sc,'FirstPeriod') and ord(scc) = ord(sc) ] = yes ;scscp(scp(sc,p),scc) $[ord(p) = pScnTree(sc,'FirstPeriod') and ord(scc) = pScnTree(sc,'Ancestor')] = yes ;scsch(sc,scp(scc,p)) $scscp(scc,p,sc) = yes ;
pProbSc(sc,pn(p)) = pScnTree(sc,'Prob') ;loop (p $[not p1(p)],
pProbSc(scp(sc,p+lag(p))) = sum[scsch(sc,scc,p+(lag(p)+1)), pProbSc(scc,p+(lag(p)+1))] ;) ;
* delete branches with probability 0 and define the active load levels
scp ( sc,p ) $[pProbSc(sc,p) = 0 ] = no ;scscp( sc,p ,scc) $[pProbSc(sc,p) = 0 or pProbSc(scc,p-1) = 0] = no ;
Medium Term Stochastic Hydrothermal Coordination Model 119
scscp( sc,p ,scc) $[pProbSc(sc,p) = 0 or pProbSc(scc,p-1) = 0] = no ;scsch(sc,scc,p ) = yes $scscp(scc,p,sc) ;spsn (scp(sc,p),s,n) $psn (p,s,n) = yes ;
* determine the representative sc2 of node (sc1 p) for non existing scenarios in the tree
loop (sc,scaux = ord(sc) ;loop (p,
scscr(sc,p+lag(p),scc) $[ord(scc) = scaux] = yes ;SCA(scc) $[ord(scc) = scaux] = yes ;scaux = sum[scscp(sca,p+lag(p),scc), ord(scc)] ;SCA(scc) = no ;
) ;) ;SCA(sc) $sum[p, pProbSc(sc,p)] = yes ;
Building the scenario tree
StarGenLite_SHTCM (xi)* solve stochastic hydrothermal coordination model
solve SHTCM using MIP minimizing vTotalVCost ;
* scaling of results
pCommitt(sca,t, p,s ) = sum[scscr(sca,p,scc), vCommitt.l (scc,p,s, t) ] + eps ;pProduct(sca,g,psn(p,s,n)) = sum[scscr(sca,p,scc), vProduct.l (scc,p,s,n,g) ]*1e3 + eps ;pEnergy (sca,g,psn(p,s,n)) = sum[scscr(sca,p,scc), vProduct.l (scc,p,s,n,g)*pDuration(p,s,n) ]*1e3 + eps ;pReserve(sca,rs(r),p ) = sum[scscr(sca,p,scc), vReserve.l (scc,p, r) ]*1e3 + eps ;pSRMC (sca, psn(p,s,n)) = sum[scscr(sca,p,scc), eBalance.m (scc,p,s,n )/pDuration(p,s,n)/pProbSc(scc,p)]*1e3 + eps ;pWV (sca,rs(r),p ) = sum[scscr(sca,p,scc), eWtReserve.m(scc,p, r) /pProbSc(scc,p)] + eps ;
* data output to xls file
put TMP putclose 'par=pProduct rdim=2 rng=Output!a1' / 'par=pEnergy rdim=2 rng=Energy!a1' / 'par=pReserve rdim=2 rng=WtrReserve!a1' / 'par=pWV rdim=2 rng=WtrValue!a1' / 'par=pSRMC rdim=1 rng=SRMC!a1' / 'par=pCommitt rdim=2 rng=UC!a1'execute_unload 'tmp.gdx' pProduct pEnergy pReserve pWV pSRMC pCommittexecute 'gdxxrw.exe tmp.gdx SQ=n EpsOut=0 O="tmp.xlsx" @tmp.txt'
Solve the optimization
problem
Medium Term Stochastic Hydrothermal Coordination Model 120
execute 'gdxxrw.exe tmp.gdx SQ=n EpsOut=0 O="tmp.xlsx" @tmp.txt'execute 'del tmp.gdx tmp.txt'
$onlisting Scaling the results
Write output to Excel
Menu
Medium Term Stochastic Hydrothermal Coordination Model 121
Input Data. Indices
Medium Term Stochastic Hydrothermal Coordination Model 122
Input Data. Cost of energy or power not served
Medium Term Stochastic Hydrothermal Coordination Model 123
Input Data. Demand, operating reserve and duration
Medium Term Stochastic Hydrothermal Coordination Model 124
Input Data. Thermal and hydro parameters
Medium Term Stochastic Hydrothermal Coordination Model 125
Scenario tree
( 01, 01)p sc
Scenario 1
( 02, 01)p sc
( 03, 01)p sc
( 04, 01)p sc
( 05, 01)p sc
( 06, 01)p sc
Scenario 2
( 03, 02)p sc ( 05, 02)p sc
Medium Term Stochastic Hydrothermal Coordination Model 126
( 03, 03)p sc
( 01, 01)p sc
Scenario 3
( 02, 03)p sc
( 04, 03)p sc
( 05, 03)p sc
( 06, 03)p sc
( 02, 02)p sc ( 04, 02)p sc ( 06, 02)p sc
Input Data. Inflows and scenario tree
Medium Term Stochastic Hydrothermal Coordination Model 127
Medium term optimization model. Results
• Operation planning
– Fuel consumption, unit (thermal, storage hydro and pumped storage hydro) and/or technology operation
– CO2 Emissions
– Reservoir management
– Targets for short term models (water balance)
Medium Term Stochastic Hydrothermal Coordination Model 128
• Economic planning
– Annual budget
– Operational costs
– System marginal costs
– Targets for short term models (water value)
Output Data. Thermal unit commitment
5
6
7
8
9C
omm
itted
The
rmal
Uni
ts
FuelOilGas
OCGT_3
OCGT_1
CCGT_4
CCGT_3
CCGT_2
Medium Term Stochastic Hydrothermal Coordination Model 129
0
1
2
3
4
p01 p01 p02 p02 p03 p03 p04 p04 p05 p05 p06 p06 p07 p07 p08 p08 p09 p09 p10 p10 p11 p11 p12 p12
Com
mitt
ed T
herm
al U
nits
Period
CCGT_1
ImportedCoal_Bituminous
ImportedCoal_SubBituminous
BrownLignite
DomesticCoal_Anthracite
Nuclear
Output Data. Production
50
60
70
80
90
100
2500
3000
3500
4000
4500
Mar
gina
l Cos
t [€/
MW
h]
Out
put [
MW
]
StorageHydro3_Basin1
StorageHydro2_Basin1
StorageHydro1_Basin1
FuelOilGas
OCGT_3
OCGT_2
OCGT_1
CCGT_4
CCGT_3
Medium Term Stochastic Hydrothermal Coordination Model 130
0
10
20
30
40
50
0
500
1000
1500
2000
p01
p01
p01
p01
p01
p01
p02
p02
p02
p02
p02
p02
p03
p03
p03
p03
p03
p03
p04
p04
p04
p04
p04
p04
p05
p05
p05
p05
p05
p05
p06
p06
p06
p06
p06
p06
p07
p07
p07
p07
p07
p07
p08
p08
p08
p08
p08
p08
p09
p09
p09
p09
p09
p09
p10
p10
p10
p10
p10
p10
Mar
gina
l Cos
t [
Out
put [
MW
]
Load Level
CCGT_2
CCGT_1
ImportedCoal_Bituminous
ImportedCoal_SubBituminous
BrownLignite
DomesticCoal_Anthracite
Nuclear
RunOfRiver
SRMC
Output Data. Energy
800000
1000000
1200000
1400000E
nerg
y [M
Wh]
StorageHydro3_Basin1
StorageHydro2_Basin1
StorageHydro1_Basin1
RunOfRiver
FuelOilGas
OCGT_3
OCGT_2
OCGT_1
CCGT_4
Medium Term Stochastic Hydrothermal Coordination Model 131
0
200000
400000
600000
p01
p01
p01
p01
p01
p01
p02
p02
p02
p02
p02
p02
p03
p03
p03
p03
p03
p03
p04
p04
p04
p04
p04
p04
p05
p05
p05
p05
p05
p05
p06
p06
p06
p06
p06
p06
p07
p07
p07
p07
p07
p07
p08
p08
p08
p08
p08
p08
p09
p09
p09
p09
p09
p09
p10
p10
p10
p10
p10
p10
Ene
rgy
[MW
h]
Load Level
CCGT_4
CCGT_3
CCGT_2
CCGT_1
ImportedCoal_Bituminous
ImportedCoal_SubBituminous
BrownLignite
DomesticCoal_Anthracite
Nuclear
Output Data. Reservoir level and water value
20
25
30
35
500
600
700
800
Wat
er v
alue
[€/
hm3]
Res
ervo
ir le
vel [
hm3]
Reservoir1_Basin1 Reservoir2_Basin1 Reservoir3_Basin1 Reservoir1_Basin1 Reservoir2_Basin1 Reservoir3_Basin1
Medium Term Stochastic Hydrothermal Coordination Model 132
0
5
10
15
0
100
200
300
400
p01 p02 p03 p04 p05 p06 p07 p08 p09 p10 p11 p12
Wat
er v
alue
[
Res
ervo
ir le
vel [
hm3]
Period
Output Data. Short Run Marginal Cost (SRMC)
40
50
60
70€/
MW
h]
Medium Term Stochastic Hydrothermal Coordination Model 133
0
10
20
30
p01
p01
p01
p01
p01
p01
p02
p02
p02
p02
p02
p02
p03
p03
p03
p03
p03
p03
p04
p04
p04
p04
p04
p04
p05
p05
p05
p05
p05
p05
p06
p06
p06
p06
p06
p06
p07
p07
p07
p07
p07
p07
p08
p08
p08
p08
p08
p08
p09
p09
p09
p09
p09
p09
p10
p10
p10
p10
p10
p10
SR
MC
[€
Load Level
Stochastic measures
• Expected value with perfect information (EVWPI) o Wait and See(WS)– Weighted mean of the objective function of each scenario knowing that is
going to happen (for minimization problems always lower or equal than the objective function for the stochastic problem)
• Value of the stochastic solution (VSS)– Difference between the objective function of the expected value for the
mean value solution of the stochastic parameters EEV and that of the stochastic problem RP
Medium Term Stochastic Hydrothermal Coordination Model 134
stochastic problem RP
• Expected value of perfect information (EVPI) o mean regret– Weighted average of the difference between the stochastic solution for
each scenario and the perfect information solution in this scenario (always positive for minimization)
• EVPI = RP - WS
• VSS = EEV - RP
• WS <= RP <= EEV EVPI >= 0 VSS >= 0
Stochastic measures
sc01 sc02 sc03 Expected StochasticGeneration RunOfRiver in p01 MWh 107136 107136 107136 107136 107136Generation StorageHydro_Basin1 in p01 MWh 79200 67356 82629 79200 78741Generation StorageHydro_Basin2 in p01 MWh 37466 17600 44903 37466 12602Generation StorageHydro_Basin3 in p01 MWh 124281 86400 148800 118110 92787Reserve StorageHydro_Basin1 end p01 hm3 328 368 317 328 330Reserve StorageHydro_Basin2 end p01 hm3 452 518 427 452 535Reserve StorageHydro_Basin3 end p01 hm3
779 800 734 800 800Total Hydro Generation in p01 MWh 348083 278492 383467 341912 291265Total Reserve end p01 hm3 1560 1686 1478 1581 1665Total System Variable Cost M€ 1123.997 1144.447 1103.624 1129.624 1130.284
Medium Term Stochastic Hydrothermal Coordination Model 135
EWPI or WS EEV VSS EVPI1130.140 1130.360 0.077 0.144
• Stochasticity in hydro inflows is not relevant from the point of view of total variable cost
• But it is important for defining the operation of the first period
How to use of a medium term stochastic hydrothermal coordination model
• Run in a rolling mode (i.e., the model is run each week with a time scope of several months up to one year)
• Only decisions for the closest period are of interest (i.e., the next week). The remaining
Medium Term Stochastic Hydrothermal Coordination Model 136
interest (i.e., the next week). The remaining decisions are ignored
Summary
• Purpose of a medium term stochastic hydrothermal coordination model
– Characteristics
– Overview
– Results for operation planning and economic planning
– Main modeling assumptions
• Mathematical formulation
Medium Term Stochastic Hydrothermal Coordination Model 137
• Mathematical formulation
– General structure
– Parameters, variables, equations, objective function
– Short run marginal cost, water value
• Case study with StarGenLite_SHTCM
– Input data
– Output data
Task assignment
• Compute numerically the water value for a particular period and reservoir by running twice the hydrothermal model and compare this value with the water value determined by the model as the dual variable of the water balance constraint. Apply it to one reservoir in period 1 and another reservoir in period 7.
Medium Term Stochastic Hydrothermal Coordination Model 138
period 7.
• Introduce intermittent generation into the model
– Play with the number to observe the complementaritybetween hydro and intermittent generation
• Evaluate all the stochastic measures of considering stochasticity of hydro inflows
Medium Term Stochastic Hydrothermal Coordination Model 139
Prof. Andres Ramos
http://www.iit.upcomillas.es/aramos/