A Multi-Stage Stochastic Programming Model for Managing Risk-Optimal Electricity Portfolios SLIDE 1
Outline Multi-stage stochastic programming modeling Setting - Electricity portfolio management Electricity Spot & Demand Process Specifying underlying uncertainty - Scenario tree generation Model Description & Application Scenarios Numerical results Supply contracts (Swing option) Real option (Power Plant) and Risk Management Conclusions SLIDE 2
Multistage modeling - Postmodernism Reject objective truth and global cultural narrative: complete decoupling of the multi-stage modeling process and the solution approach! 1 Optimization under uncertainty modeling approach: expectation-based multi-stage stochastic programming, worst-case robust optimization,... 2 Underlying solution technique: scenario tree-based deterministic equivalent formulation, primal/dual linear decision rules,... SLIDE 3
Multistage modeling - Old School Complete decoupling of scenario tree modeling and handling from the decision problem modeling process: Decision problem layer. Decision problem modeler only concerned with actions/decisions at stages. In case of trees and deterministic equivalent formulations: explicit decoupling of modeling and (scenario) tree handling. Scenario tree layer. Creating a scenario tree which optimally represents the subjective beliefs of the decision taker at each node. Data layer. Data structures, how to (memory-)optimally store large trees, and access ancestor tree nodes fast,... SLIDE 4
Multistage modeling - Old School (1) Modeler View (Stage) (2) Stochastic View (Tree) (3) Data View (Node) Root Stage Recourse Stage Terminal Stage SLIDE 5
Multistage modeling - New Age Complete decoupling of scenario tree modeling and handling from the decision problem modeling process: Decision problem layer. Decision problem modeler only concerned with actions/decisions at stages. In case of linear decision rules: 1 A. Georghiou, W. Wiesemann, and D. Kuhn. Generalized Decision Rule Approximations for Stochastic Programming via Liftings. Optimization Online. 2010. 2 D. Kuhn, W. Wiesemann, and A. Georghiou. Primal and Dual Linear Decision Rules in Stochastic and Robust Optimization. Mathematical Programming, online first. 2009. SLIDE 6
Multistage modeling - New Age (1) Modeler View (Stage) (2) Stochastic View (Upper/Lower Approximation) Root Stage Recourse Stage Terminal Stage SLIDE 7
Multi-stage modeling Complete decoupling of scenario tree modeling and handling from the decision problem modeling process: Decision problem layer. Decision problem modeler only concerned with actions/decisions at stages. In this talk, we will conduct an old-school approach using multi-stage scenario trees and use deterministic equivalent formulations to solve the problem, with a focus on communicability of models (electrical engineers and optimization wizards), and modular modeling structure (using an abstract model generator). SLIDE 8
Electricity Portfolio Optimization Classical bi-critertia risk-return portfolio optimization problems (minimize risk, maximize return) in a multi-stage stochastic setting. Example: Large consumer satisfies demand by: 1 buying at the uncertain spot market on day-ahead basis, 2 buying energy futures (base or peak), 3 buying contracts for delivery of energy in advance, 4 (optional) own production with some power plant. Stochastic optimization: 1 Uncertainty: spot price and demand. 2 Decision: composition of the electricity portfolio. SLIDE 9
Electricity Portfolio Optimization Daily (day-ahead hourly) electricity portfolio changes massively multi-stage! Trade-off between level of model detail (variables and constraints) and underlying uncertainty (dimension of underlying scenario tree), and solvability of the problem. Design of uncertainty: Instead of modeling price and demand as uni-variate time series (i.e. 8760 stages per year), we define one stage per day (24 dimensional time series with 365 stages per year). Hour-Blocks: To simplify the model we group the uncertainty in 6 4-hour blocks, i.e. we are dealing with a 6-dimensional instead of a 24-dimensional process. SLIDE 10
Electricity Portfolio Optimization 1 Model the uncertain spot price process. 2 Generate possible scenarios for the spot price movement and the demand by simulating disturbance in the respective models. 3 Construct a scenario tree from the fan of simulated trajectories. 4 Choose an appropriate risk measure. 5 Model decision problem as multi-stage stochastic optimization program. 6 Solve the optimization problem. Goals: Semi-automatization (workflow orchestration), and (multi-stage) modeling simplification/modularization. SLIDE 11
Spot & Demand Process The hourly spot prices at the EEX are modeled via linear regression. The main explainationary factors are 1 weekday, hour of the day, season and all combinations thereof 2 temperature 3 future prices The above factors model the average behavior of the price process. The peaks are captured by fitting a stable distribution to the residuals. The model is calibrated with data ranging from 01.01.2006-28.02.2007. Demand is modeled in a similar setting (fitted with one year of data). SLIDE 12
Simulations Both models may now be used to simulate possible future price and demand scenarios. Since we assume independence in the error terms of the two models we can pairwise merge the scenarios for demand and price developement. The resulting scenarios are merged into a tree structure. SLIDE 13
Model: Portfolio The energy portfolio in every hour block h and in every stage t consists of 1 contracted volume c t,h, 2 energy out of future contracts f t,h, 3 energy bought on the spot market s t,h and 4 energy produced with a power plant p t,h (optional). Note: We do not use (scenario tree) node-based formulations, which greatly enhances the readability. The conversion to a node-based formulation is done semi-automatically. SLIDE 14
Model: Objective Function The expenditure (over the whole time horizon) is given by e T = t T,h H e t,h where e t,s is the expenditure at stage t in hour block h given by e t,h = c t,h C + f t,h F t,h + s t,h S t,h + p t,h P with no recourse, where C, F h, S t,h, P are the prices of one MWh of energy from the supply contract, the future contract, the spot market and the power plant respectively. Our aim is to minimize e T + κavar α (e T ) i.e. to perform a bi-criteria optimization whichs keeps expected expenditure and its AV@R (risk) low. SLIDE 15
Model: Constraints Demand d t,h (stochastic variable) has to be met at every stage t and every hour h c t,h + f t,h + s t,h + p t,h d t,h, t T, h H Supply contract. Amount bought every hour is restrained by the constant γ u and γ h and the overall contracted volume C h for that hour block h (over the whole planning horizon) in the following way γ l C h c t,h γ u C h, t T, h H Supply contract. amount of energy bought in every scenario has to be within a certain range around the contracted value, i.e. δ l C h c t,h δ u C h t T,h H SLIDE 16
Model: Stylized Power Plant production p t,h is limited by a maximum amout π, i.e. p t,h π, t T, h H production of the power plant cannot change more than β MWh per hour block, i.e. p t,h p t,h 1 β, h = 2,..., 5, t T and p t,1 p t 1,6 β, t = 2,..., T. SLIDE 17
Model: Putting it all together minimize e T + AVaR α (e T ) subject to d t,h c t,h + f t,h + s t,h + p t,h c t,h C + f t,h F t,h + s t,h S t,h + p t,h P = e t,h γ l C h c t,h γ u C h δ l C h T,H c t,h δ u C h p t,h π p t,h p t,h 1 β p t,1 p t 1,6 β T,H e t,h = e T In the above program all variables are non-negative. SLIDE 18
Model: Putting it all together minimize s S P sc s + κ(q α + P s(n) z n n N (T) 1 α ) subject to d n,h c n,h + f n,h + s n,h + p n,h c n,h C + f n,h F n,h + s n,h S n,h + p n,h P = e n,h γ l C h c n,h γ u C h δ l C h n N (s),h=1,...,6 c n,h δ u C h p n,h π p n,h p n,h 1 β p n,1 p pred(n),6 β n N (s),h=1,...,6 e n,h = e s c s q α z n In the above program all variables are non-negative. SLIDE 19
Numerical Results The basic model defined above will be adapted to two application examples: pricing supply contracts (swing option), real options (power plant) and risk management. Even in this basic model, the number of possible applications and parameter studies is huge - disregarding different approaches to modeling underlying uncertainty (different scenario trees), i.e. only one specific tree was used: 184 stages, 44712 nodes, 426 scenarios, 12 dimensions (6 spot, 6 demand). SLIDE 20
Numerical Results - Implementation Workflow, Simulation/Estimation: MatLab R2007a (7.4) Scenario Generator: MatLab Model Generator: Python (Multi-stage) Modeling: AMPL Solver: MOSEK 4 (LP IPM), parameter tweaked Intel(R) Pentium(R) 4 CPU 3.00GHz 4 GB RAM Debian Stable (Etch) SLIDE 21
Numerical Results - Main parameters Risk Parameters: α = 0.85, κ = 1 EEX Future Prices 07/2007 08/2007 09/2007 10-12/2007 41.88 38.78 41.81 48.2 63.42 62.11 63.86 70.1 Supply Contract: Contract Price: 70 EUR/MWh (Total) Factor Upper/Lower: δ = (0.9, 1.1) (Daily) Gamma Upper/Lower: γ = (0, 0.025) SLIDE 22
Results - Supply contract (without γ) SLIDE 23
Results - Supply contract (without γ) SLIDE 24
Results - Supply contract (with γ) SLIDE 25
Results - Supply contract (with γ) SLIDE 26
Results - Supply contract (with γ) SLIDE 27
Results - Supply contract (with γ) SLIDE 28
Results - Supply contract (with γ) SLIDE 29
Results - Supply contract (with γ) SLIDE 30
Results - Supply contract (with γ) SLIDE 31
Pricing Supply Contracts The aim is to price a energy supply contract for a large energy consumer. The contract is issued by a energy broker, that obtains energy from the EEX (spot and future markets). The price is chosen such that the AV@R α of the expected costs is lower than µ. The supply contract has to cover all the (stochastic) energy demand d t,h. Nominal consumption is limited by upper and lower bounds for every hour block. Consumption that exceeds these limits is priced at a higher price X. The consumption of energy has to be matched by the energy bought on the spot and the future markets. SLIDE 32
Pricing Supply Contracts - Model The aim is to minimize the price of the contract C. The overshooting over the maximum allowed consumption ν h is measured with the variable x n,h [d n,h ν h ] + = x n,h The expenditure in every node is given by e n,h = f n,h F n,h + s n,h S n,h d n,h C x n,h X The AV@R α constraint reads qα + n N (T) P s(n) z n 1 α µ SLIDE 33
Pricing Supply Contracts - Model minimize C + n N,h=1,...,6 x n,hx subject to d n,h f n,h + s n,h f n,h F n,h + s n,h S n,h d n,h C x n,h X = e n,h d n,h ν h x n,h n N (s),h=1,...,6 e n,h = e s µ c ( s q α z n q α + ) P s(n) z n n N (T) 1 α Besides the minimal price the model yields an optimal hedge in terms of EEX futures. SLIDE 34
Pricing Supply Contracts - Results SLIDE 35
Results - Power Plant (real option) Stylized Power Plant: Cost of production: 50 EUR/MWh Minimum production per hour block: 0 Maximum production per hour block π: 10-40 Maximum change of production from hour block to the next: π/5 SLIDE 36
Results - Power Plant (real option) SLIDE 37
Results - Solver Run-Time Size of LPs and run-time with our specific scenario tree: Power Plant No No Yes Contract Gamma No Yes Yes Constraints 541710 809982 1346524 Variables 805687 805687 1342230 Nonzeros 2036883 3860207 31689184 Solution Time [sec] 450-700 1000-5000 13000-19500 Pricing Supply Contracts: 1073140 variables, 1073952 constraints, 2242173 non-zeros, 1500-2500 seconds SLIDE 38
Thank you for your attention Content of this talk appeared as: R. Hochreiter and D. Wozabal. A multi-stage stochastic programming model for managing risk-optimal electricity portfolios. Handbook of Power Systems II. Volume 4 of Energy Systems: 383-404. Springer, 2010. Download at: http://dx.doi.org/10.1007/978-3-642-12686-4_14 SLIDE 39
Thank you for your attention Ronald Hochreiter Department of Finance, Accounting and Statistics Institute for Statistics and Mathematics email: ronald.hochreiter@wu.ac.at URL: http://www.hochreiter.net/ronald/research/ WU Wirtschaftsuniversität Wien Augasse 2 6, A-1090 Wien SLIDE 40