RiverWare Optimization

Similar documents
Technical Documentation Version 7.4. Release Notes

MULTIOBJECTIVE OPERATIONS OF RESERVOIR SYSTEMS VIA GOAL PROGRAMMING

Technical Documentation Version 7.3 RPL Data Types and Palette

RPL Data Types and Palette

Technical Documentation Version 6.9. Release Notes

Technical Documentation Version 7.2 Slots

Fundamentals of Integer Programming

Technical Documentation Version 7.3 Diagnostics

Optimization with Multiple Objectives

NOTATION AND TERMINOLOGY

Technical Documentation Version 7.2 RPL Language Structure

Technical Documentation Version 7.3 RPL Debugging and Analysis Tools

RIVERWARE DEMONSTRATION TUTORIAL

Technical Documentation Version 7.4. Performance

The MIP-Solving-Framework SCIP

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation

Agenda. Understanding advanced modeling techniques takes some time and experience No exercises today Ask questions!

Object-Oriented Programming Framework

1.0 INTRODUCTION. Subject: Peaking Analysis

Technical Documentation Version 7.3 RPL Predefined Functions

Technical Documentation Version 7.3 Object User Interface

Outline. Column Generation: Cutting Stock A very applied method. Introduction to Column Generation. Given an LP problem

Column Generation: Cutting Stock

Technical Documentation Version 7.2 Multiple Run Management

Appendix J. Connecticut River Optimization Model

Experience with CGL in the PICO Mixed- Integer Programming Solver

Foundations of Computing

Introduction to RTC-Tools. Jorn Baayen

Software Development, Maintenance, Releases and Tech Transfer

UML CS Algorithms Qualifying Exam Fall, 2003 ALGORITHMS QUALIFYING EXAM

A Deterministic Dynamic Programming Approach for Optimization Problem with Quadratic Objective Function and Linear Constraints

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Version 15.1 October Contact:

Chapter 3: Search. c D. Poole, A. Mackworth 2010, W. Menzel 2015 Artificial Intelligence, Chapter 3, Page 1

CSE 417 Network Flows (pt 4) Min Cost Flows

Linear Programming. Slides by Carl Kingsford. Apr. 14, 2014

Solving lexicographic multiobjective MIPs with Branch-Cut-Price

Data Analysis and Solver Plugins for KSpread USER S MANUAL. Tomasz Maliszewski

Combinatorial Auctions: A Survey by de Vries and Vohra

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

Stochastic Separable Mixed-Integer Nonlinear Programming via Nonconvex Generalized Benders Decomposition

3 INTEGER LINEAR PROGRAMMING

Hardware-Software Codesign

MINLP applications, part II: Water Network Design and some applications of black-box optimization

Operations Research and Optimization: A Primer

Integer Programming Chapter 9

CMSC 451: Linear Programming

CSE 417 Branch & Bound (pt 4) Branch & Bound

Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?)

B553 Lecture 12: Global Optimization

The use of simulation in commissioning a hydropower generator

Developing Optimization Algorithms for Real-World Applications

LaGO. Ivo Nowak and Stefan Vigerske. Humboldt-University Berlin, Department of Mathematics

StochDynamicProgramming Documentation

Benders Decomposition

3 No-Wait Job Shops with Variable Processing Times

Selected Topics in Column Generation

Figure : Example Precedence Graph

Constraint Programming for Timetabling

Numerical Methods in Scientific Computation

Introduction. Chapter 15. Optimization Modeling: Applications. Integer Programming. Manufacturing Example. Three Types of ILP Models

Index. optimal package assignments, 143 optimal package assignments, symmetrybreaking,

Introduction to Mathematical Programming IE406. Lecture 20. Dr. Ted Ralphs

Lecture 11: Maximum flow and minimum cut

Optimal Crane Scheduling

MLR Institute of Technology

Graph Theory and Optimization Approximation Algorithms

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.3, Page 1

Minimum Weight Constrained Forest Problems. Problem Definition

Solving a Challenging Quadratic 3D Assignment Problem

Blackbox optimization of inflow scenario trees

APPENDIX E POST PROCESSOR OBJECT-ORIENTED DESIGN

Tools for Modeling Optimization Problems A Short Course. Algebraic Modeling Systems. Dr. Ted Ralphs

Chapter 10: Network Flow Programming

: Principles of Automated Reasoning and Decision Making Midterm

Mixed Integer Programming Class Library (MIPCL)

A Generic Separation Algorithm and Its Application to the Vehicle Routing Problem

Introduction. Linear because it requires linear functions. Programming as synonymous of planning.

February 19, Integer programming. Outline. Problem formulation. Branch-andbound

MVE165/MMG631 Linear and integer optimization with applications Lecture 7 Discrete optimization models and applications; complexity

Heuristics in Commercial MIP Solvers Part I (Heuristics in IBM CPLEX)

Advanced Use of GAMS Solver Links

arxiv: v1 [cs.dm] 6 May 2009

Approximation Algorithms

ABC basics (compilation from different articles)

Modeling of RAS and Relays in Power Flow Contingency Analysis. Jamie Weber

Algorithms for Integer Programming

Precision Routing. Capabilities. Precision Queues. Capabilities, page 1 Initial setup, page 5

The Efficient Modelling of Steam Utility Systems

Wireless frequency auctions: Mixed Integer Programs and Dantzig-Wolfe decomposition

Design and Analysis of Algorithms

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Contents. Introduction

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Linking GAMS to Solvers Using COIN-OSI. Michael Bussieck Steve Dirkse GAMS Development Corporation

CS 188: Artificial Intelligence. Recap Search I

5 Classifications of Accuracy and Standards

SUBSTITUTING GOMORY CUTTING PLANE METHOD TOWARDS BALAS ALGORITHM FOR SOLVING BINARY LINEAR PROGRAMMING

Discrete Optimization. Lecture Notes 2

9. Heap : Priority Queue

Transcription:

RiverWare Optimization RiverWare User Group Meeting February 6-7, 2007 Tim Magee and Patrick Lynn

Reimplementation of Optimization Goals of reimplementation Replace the Constraint editor with the Rules editor Editable, shared code, one interface for users Code had outgrown the original controller Reduce the gap between Rules and Optimization Remove the artificial differences Lay the groundwork for combining them Replicated the results of the old optimization This year: Add an open source solver Make it easier to do a little optimization February 6-7, 2007 2007 RiverWare User Group Meeting 2

Overview Describe the Optimization framework Limitations of the old controller New optimization controller Demonstration TVA s 6-hour model Future Development 2007 Combining Optimization and Rules Discussion Are there parts of your model that seem like an optimization problem? February 6-7, 2007 2007 RiverWare User Group Meeting 3

Similarity Between Optimization and Rule Based Simulation Prioritized policy From extreme conditions to normal operations Gradually remove the degrees of freedom from the solution February 6-7, 2007 2007 RiverWare User Group Meeting 4

Main Differences Between Optimization and Simulation Best solution vs. evaluating inputs or following rules Solve all time steps simultaneously vs. stepping through time steps Degrees of freedom Equations and Unknowns vs. If-Then Approximation vs. Exact calculation Nonlinear functions February 6-7, 2007 2007 RiverWare User Group Meeting 5

Goal Programming Example 1. Pool Elevation Elev Guide 1 2. Outflow Flow Guide 1 3. Pool Elevation Elev Guide 2 4. Outflow Flow Guide 2 5. Outflow Flow Guide 3 February 6-7, 2007 2007 RiverWare User Group Meeting 6

Goal Programming Example Mass Balance with Minimal Inflow February 6-7, 2007 2007 RiverWare User Group Meeting 7

Goal Programming Example Pool Elevation Elev Guide 1 February 6-7, 2007 2007 RiverWare User Group Meeting 8

Goal Programming Example Outflow Flow Guide 1 February 6-7, 2007 2007 RiverWare User Group Meeting 9

Goal Programming Example Pool Elevation Elev Guide 2 February 6-7, 2007 2007 RiverWare User Group Meeting 10

Goal Programming Example Outflow Flow Guide 2 February 6-7, 2007 2007 RiverWare User Group Meeting 11

Goal Programming Example Outflow Flow Guide 3 February 6-7, 2007 2007 RiverWare User Group Meeting 12

Components of a Preemptive Goal Program Variables with bounds Hard Constraints Prioritized policies Objective functions and/or Soft constraints February 6-7, 2007 2007 RiverWare User Group Meeting 13

Automatic Generation of Optimization Modeler Policy Constraints and Objectives Build Model (topology, data, methods) Translated to Successive Objectives for LP Objects Generate Linearized Physical Process Constraints (mass balance, hydrogeneration, canal flow, etc.) Optimization Input Matrix Send to CPLEX Solver Post-Optimization Rule Set References Optimization Results Rule Based Simulation Run February 6-7, 2007 2007 RiverWare User Group Meeting 14

Variables Subset of the slots are decision variables Could include more slots in the future Only time steps without values Only those referenced directly or indirectly by the policy Internal variables to assist with linearization of nonlinear functions Internal variables to convert soft constraints to objectives February 6-7, 2007 2007 RiverWare User Group Meeting 15

Physical Model (Optimization) Mass Balance Links Lags on Reaches, Aggregate Reaches Canal Flow (linearization) Profile Storage (Headwater, Backwater and Intermediate Backwater Elevations) Power Plant (including Pumping) Turbine Capacity, varying efficiency Could include more objects and processes February 6-7, 2007 2007 RiverWare User Group Meeting 16

Linearization Many non-linear functions, for example: Elevation = f(storage) Power = f(turbine release, operating head) Optimization uses substitution, linear approximation and piecewise linear approximation February 6-7, 2007 2007 RiverWare User Group Meeting 17

Replacement Some equations can be used to eliminate both a variable and a constraint Example Reservoir A.Inflow = Reservoir B.Outflow Could replace Reservoir A.Inflow with Reservoir B.Outflow throughout the model and eliminate the constraint In general, any equation can be used for replacement if the bounds on the variables are consistent Smaller problem, usually more efficient to solve February 6-7, 2007 2007 RiverWare User Group Meeting 18

Satisfying competing demands for limited resources Goal Programming Simultaneously solve all objects and time periods Prioritized sequence of objectives and soft constraints Highest priority: Move towards normal region Flood control, minimum flows, etc. Lowest priority: In the normal region e.g. Optimizing hydropower February 6-7, 2007 2007 RiverWare User Group Meeting 19

Goal Programming continued Freeze each objective at the optimal value Equivalent to writing a constraint Use remaining flexibility for other objectives. Objectives Minimize or Maximize function Derived Objectives: Minimize constraint violations Summation minimize total deviations MiniMax minimize the largest violation Repeated MiniMax February 6-7, 2007 2007 RiverWare User Group Meeting 20

Thermal Object Economic Object would be a better name Links to other objects to calculate system totals Block value of hydropower Incorporates outside power (Min, Max & Total) Pumped storage Policy referencing the thermal object can drive the whole system February 6-7, 2007 2007 RiverWare User Group Meeting 21

Block Value of Hydropower For each time period: Blocks of 50 MW of power Value of generating each block decreases as blocks increase. Value reflects the expected savings from turning off other sources of power, reducing purchases, or increasing sales. Objective function credits each block generated. February 6-7, 2007 2007 RiverWare User Group Meeting 22

End Conditions: Two Options for Each Reservoir 1. Constrain final pool elevation or storage: Pool Elevation >= Desired Value, or Pool Elevation = Desired Value OR 2. Add cumulative value of storage to the objective Piecewise linear function February 6-7, 2007 2007 RiverWare User Group Meeting 23

Limitations of the Old Controller Constraint Editor Actually was create or delete Incredibly unforgiving of mistakes Aggregate Series 3 Columns: Sim, Opt In, and Opt Out Disconnected the optimization from the rest of RiverWare Post-Optimization Simulation Placed inputs on all outflows Brittle: enhancements had outgrown the original controller February 6-7, 2007 2007 RiverWare User Group Meeting 24

New Controller: RPL-based Optimization Optimization Rule Set Optimization Controller CPLEX Problem Representation February 6-7, 2007 2007 RiverWare User Group Meeting 25

New Controller: RPL-based Optimization Output values not cleared Run iterates through optimization rules (not time steps) Optimization rule execution: Adds a constraint to the problem, or Solves the problem, or Freezes the problem Run result: final problem solution values (accessible from RPL) February 6-7, 2007 2007 RiverWare User Group Meeting 26

New RPL Statements ADD CONSTRAINT <boolean expr> ADD CONSTRAINT Fish Lake.Outflow[Jan 2007] 100 [cfs] Expression linearized, not evaluated: Lookup values Replace non-decision variables Add physical constraints Result: a 1 x 1 + a 2 x 2 + + a n x n < b February 6-7, 2007 2007 RiverWare User Group Meeting 27

New RPL Statements (continued) MAXIMIZE <numeric expr> MAXIMIZE Fish Lake.Power[Jan 2007] + Fish Lake.Power[Feb 2007] MINIMIZE <numeric expr> MINIMIZE TotalSpill() February 6-7, 2007 2007 RiverWare User Group Meeting 28

New RPL Statements (continued) SUMMATION ADD CONSTRAINT <boolean expr> END SUMMATION SUMMATION ADD CONSTRAINT Fish Lake.Outflow[Jan 2007] 100 [cfs] ADD CONSTRAINT Ice Lake.Outflow[Feb 2007] 200 [cfs] END SUMMATION February 6-7, 2007 2007 RiverWare User Group Meeting 29

New RPL Statements (continued) REPEATED MAXIMIN ADD CONSTRAINT <boolean expr> END MAXIMIN SINGLE MAXIMIN ADD CONSTRAINT <boolean expr> END MAXIMIN FREEZE February 6-7, 2007 2007 RiverWare User Group Meeting 30

New RPL Statements (continued) IF (<boolean expression> <statements> END IF IF (<boolean expression> <statements> ELSE <statements> END IF February 6-7, 2007 2007 RiverWare User Group Meeting 31

Other RPL enhancements Save Policy with Model Disable RPL Statements or List Items New Operators: SUM, AVE NUMERIC OptValue(SLOT, DATETIME) February 6-7, 2007 2007 RiverWare User Group Meeting 32

A Typical Use of RPL-based Optimization Simulation Optimization Rulebased Simulation Compute consequences of input values Solve a series of LP problems Compute consequences of input values and selected optimal values February 6-7, 2007 2007 RiverWare User Group Meeting 33

The Post-Optimization rule set Automatically created by switching from RPL-based optimization controller Sets reservoir Outflow values to the value computed by optimization Will drive a simulation based on inputs followed by optimal solution values Corrects for approximation errors in solution February 6-7, 2007 2007 RiverWare User Group Meeting 34

Future Work Porting TVA Models - Current Performance Improvement - Next Integer Programming for Power - FY 2007 Alternative Solver 2007 Potential Enhancements Run Analysis GUI Many others February 6-7, 2007 2007 RiverWare User Group Meeting 35

Port of TVA 6-Hour Model Model was used to debug the new code Matched the optimal objective function within 0.25% Mildly different timing Soon to be a regression test February 6-7, 2007 2007 RiverWare User Group Meeting 36

Immediate Tasks Finish port of TVA s Hourly Model Policy written Filling in additional data Performance Current run time is approximately 2 hours Zero effort on this so far Old optimization was approximately 5 minutes Side by side testing February 6-7, 2007 2007 RiverWare User Group Meeting 37

Integer Programming for Power Currently, piecewise linear approximation Leads to manual post-processing Time consuming Can violate constraints Suboptimal February 6-7, 2007 2007 RiverWare User Group Meeting 38

Alternative Solver Update CPLEX is great, but expensive Researched commercial and open source alternatives Selected COIN-OR Project Open source, C++ solvers, and more COIN Linear Programming (CLP) COIN Branch and Cut (CBC) Integer Programming CLP and CBC based on commercial IBM OSL Continued support from IBM staff Support of the operations research community, INFORMS Critical Mass in 2006. First Workshop Versions 1.0+ Will add CLP and CBC to RiverWare in 2007 February 6-7, 2007 2007 RiverWare User Group Meeting 39

Optimization Analysis What drove the solution? Hints In the old optimization Needs to be reimplemented Galaxy February 6-7, 2007 2007 RiverWare User Group Meeting 40

Additional GUI Physical Constraints Optimization Problem Optimal Solution Only solution access right now is via a RPL predefined function February 6-7, 2007 2007 RiverWare User Group Meeting 41

Combining Optimization and Rules Design that opened this possibility Both in RPL Treat the slots the same way Optimization only affects the workspace through rules Partially there already If-then logic in optimization Conditional on pre-run conditions AND/OR Conditional on the last optimization solution Rules allowed before and after the run February 6-7, 2007 2007 RiverWare User Group Meeting 42

Rules Before and After the Run Pre-optimization Rules To enforce consequences of input values Optimization Post-optimization Rules Pre-optimization rules Additional high priority rules To selectively override optimization results Return part or all of the optimization solution Additional low priority rules To set slots or time steps that were not optimized February 6-7, 2007 2007 RiverWare User Group Meeting 43

Future: Hypothetical Optimization Function similar to Hypothetical Simulation Subset of objects Subset of time steps Creates optimization problem instead of cloning Returns values to a rule The calling rule may set current slots or take other action based on the optimization results February 6-7, 2007 2007 RiverWare User Group Meeting 44

Future: Iterative Optimization Similar to Iterative MRM Start with the existing framework Sim/Rules Optimization Rules Add iteration to the sequence as a whole Could include an MRM RPL Set February 6-7, 2007 2007 RiverWare User Group Meeting 45

Discussion Are there parts of your model that seem like an optimization problem? February 6-7, 2007 2007 RiverWare User Group Meeting 46