180 likes | 363 Views
Stochastic optimization in high dimension. Sophia 21/10/08. EDF and its customers. The assets 58 nuclear power plants on 19 areas (86.6%) 14 thermal power plants (4.6%) 440 hydro plants and 220 dams (8.8%) Solar energy, wind power (< 0.5%) Customers Different kind of customers
E N D
Stochastic optimization in high dimension Sophia 21/10/08
EDF and its customers The assets • 58 nuclear power plants on 19 areas (86.6%) • 14 thermal power plants (4.6%) • 440 hydro plants and 220 dams (8.8%) • Solar energy, wind power (< 0.5%) Customers • Different kind of customers • A lot of style of contracts (for example swing where the producer can suspend delivery) Entité d'appartenanceEDF R&D
Assets management at EDF • Manage water stocks, fuel , customers contracts. • Goal : • maximize the expected cash flow • minimize risk • Under constraints • Satisfy the customer load • Respect pollution constraints Entité d'appartenanceEDF R&D
Asset management at EDF • Hazards : • Demand • Hydraulicity (inflows) • Weather patterns (cold means high demand) • Market prices • Assets outages. Stochastic control problem in high dimension : Number of state variable linked to : • Number of hazards • Number of stock to be dealt with Entité d'appartenanceEDF R&D
Numerical methods associated • Decomposition methods (Lemaréchal) • Very effective for time resolution • Duality gap (non convexity) • Dynamic programming (Bellman 1957) • Very general (non convex, binary …) • Face curse of dimensionnality, global risk constraints difficult to implement • Stochastic Dual Dynamic programming (Pereira) • Approximate convex Bellman values for stocks (needs convexity) • Bender cuts leads to Linear Programming problem • Global risk constraints difficult to implement Entité d'appartenanceEDF R&D
EDF process • Optimize the cost function J with approximation and keep all the optimal commands at each step (no asset constraints as ramp constraint, minimum time before restarting etc…) • Use a Monte Carlo simulator with all the assets and constraints to calcule accurate average earnings, risk measure Goal Incorporate more stocks in the optimizer to be more accurate A way to do it : • Use parallelism fo Stochastic Programming optimization • See influence of optimisation parallelisation on simulation Entité d'appartenanceEDF R&D
Dynamic programming implementation • Use Monte Carlo for simulations for hazards (flexible, easy to use for risk) • Backward algorithm (Longstaff Schwarz version) • At t = 0 interpolate J for current stock c and current uncertainty s Entité d'appartenanceEDF R&D
Algorithm problematic • Sequential in time • Rather sequential for nc nest • Parallel for c nest if all are available in memory for all (c,s) • number of points discretization in each direction. • Is the number of c to explore IDEA : parallelize the C nest by splitting the hypercube Use of communication scheme for optimisation and simulation too (commands spreads with stocks levels on processors) Entité d'appartenanceEDF R&D
Pi Pi Stock-2 levels Stock-3 levels Stock-1 levels Example splitting for 3 stocks tn+1 Influence area on tn computations tn Entité d'appartenanceEDF R&D
P0 P1 P2 P3 P5 P5 P6 P6 P4 P5 P6 P7 P8 P9 P10 P6 P6 P11 P12 P13 P14 P15 P5 Routing plan: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Proc Recv Send 2D example for routing (receive) What happens on P5 (for example) ? P5 P6 It determines all 2D-subcubes it has to receive from other processors Entité d'appartenanceEDF R&D
P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P5 Routing plan: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Proc Recv Send 2D example for routing (send) P0 What happens on P5 (for example) ? It determines all 2D-subcubes it has to send to other processors: • compute « influence area » of P0 • compute the intersection with its • tn+1 2D-subcube of data Entité d'appartenanceEDF R&D
P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P5 Routing plan: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Proc Recv Send 2D example for routing What happens on P5 (for example) ? It determines all 2D-subcubes it has to send to other processors: • repeat with other processors… The routing plan of P5 is complete! Execute it quickly! Entité d'appartenanceEDF R&D
C+ implementation Parallelization: • MPI: Mpich-1, OpenMPI, IBM MPI communication routines: MPI_Issend, MPI_Irecv, MPI_Wait overlap all communications when executing a routing plan (to speedup) do not use “extra communication buffers” (to size up) • + multithreading: Intel TBB or OpenMP to speedup and to size up more (than using only message passing) Scientific computing libraries: Blitz++, Boost, Clapack, Sprng. Total: • 57000 lines of C++ code • 10% for parallelization management • Parallelization can be withdrawn by preprocessing for small cas debug • Same source code on PC-cluster and Blue Gene/L and Blue Gene/P Entité d'appartenanceEDF R&D
Test case presentation • Optimization and simulation on 518 days with time step of one day • One stock of water : • 225 points discretizations (c) • 5 commands (0 to 5000 MW each day for nc ) • 6 stocks of month future products with delivery of energy (peak and off peak hours) • 5 points discretization for each one • 5 commandes ( -2000 MW (sell) to 2000Mw (buy) tested every 2 weeks • Aggregated view of thermal assets. • Up to 225*5^6 points discretizations and 5^7 commands to tests Entité d'appartenanceEDF R&D
Results Intel 256 *2 cores, BG 8192*4 cores Comparison BG, cluster without multithreading Entité d'appartenanceEDF R&D
Results Comparison Blue Gene, Cluster multithreading Entité d'appartenanceEDF R&D
Results • Some optimizations carried out for Blue Gene • Should improve the results in intel. • ICC should be used instead of ICC on intel • Some more optimizations on Blue Gene should bring the optimization part around 1000s on 8192 mpi sessions with 4 threads Entité d'appartenanceEDF R&D
Conclusion • Tool developped for stochastic optimization with a limited number of stocks (< 10) • Will bring some reference calculation for some other methods (supposing convexity for example) giving some results on how far of optimality we are. • To be tested on EDF data without approximation for asset • Will be a candidate for GPU cluster optimization Entité d'appartenanceEDF R&D