MODELING LANGUAGES in MATHEMATICAL OPTIMIZATION Applied Optimization Volume 88
Total Page:16
File Type:pdf, Size:1020Kb
MODELING LANGUAGES IN MATHEMATICAL OPTIMIZATION Applied Optimization Volume 88 Series Editors: Panos M. Pardalos University o/Florida, U.S.A. Donald W. Hearn University o/Florida, U.S.A. MODELING LANGUAGES IN MATHEMATICAL OPTIMIZATION Edited by JOSEF KALLRATH BASF AG, GVC/S (Scientific Computing), 0-67056 Ludwigshafen, Germany Dept. of Astronomy, Univ. of Florida, Gainesville, FL 32611 Kluwer Academic Publishers Boston/DordrechtiLondon Distributors for North, Central and South America: Kluwer Academic Publishers 101 Philip Drive Assinippi Park Norwell, Massachusetts 02061 USA Telephone (781) 871-6600 Fax (781) 871-6528 E-Mail <[email protected]> Distributors for all other countries: Kluwer Academic Publishers Group Post Office Box 322 3300 AlI Dordrecht, THE NETHERLANDS Telephone 31 78 6576 000 Fax 31 786576474 E-Mail <[email protected]> .t Electronic Services <http://www.wkap.nl> Library of Congress Cataloging-in-Publication Kallrath, Josef Modeling Languages in Mathematical Optimization ISBN-13: 978-1-4613-7945-4 e-ISBN-13:978-1-4613 -0215 - 5 DOl: 10.1007/978-1-4613-0215-5 Copyright © 2004 by Kluwer Academic Publishers Softcover reprint of the hardcover 1st edition 2004 All rights reserved. No part ofthis pUblication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photo-copying, microfilming, recording, or otherwise, without the prior written permission ofthe publisher, with the exception of any material supplied specifically for the purpose of being entered and executed on a computer system, for exclusive use by the purchaser of the work. Permissions for books published in the USA: P"§.;r.m.i.§J?i..QD.§.@:w.k~p" ..,.g.Qm Permissions for books published in Europe: [email protected] Printed on acid-free paper. Contents List of Figures xiii List of Tables xv Preface xvii Contributing Authors xxiii Introduction xxix Josef Kallrath Part I Theoretical and Practical Concepts of Modeling Languages 1 Mathematical Optimization and the Role of Modeling Languages 3 Josef Kallrath 1.1 Mathematical Optimization 3 1.2 Classes of Problems in Mathematical Optimization 6 1.2.1 A Deterministic Standard MINLP Problem 7 1.2.2 Constraint Satisfaction Problems 9 1.2.3 Multi-Objective Optimization 9 1.2.4 Multi-Level Optimization 10 1.2.5 Semi-Infinite Programming 11 1.2.6 Optimization Involving Differential Equations 12 1.2.7 Safety Programming 12 1.2.8 Optimization Under Uncertainty 13 1.2.8.1 Approaches to Optimization Under Uncertainty 13 1.2.8.2 Stochastic Optimization 15 1.2.8.3 Beyond Stochastic Programming 16 1.3 The History of Modeling Languages in Optimization 17 1.4 Conventions and Abbreviations 24 2 Models and the History of Modeling 25 Hermann Schichl 2.1 The History of Modeling 25 2.2 Models 28 2.3 Mathematical Models 29 2.4 The Modeling Process 31 2.4.1 The Importance of Good Modeling Practice 32 2.4.2 Making Mathematical Models Accessible for Computers 35 VI MODELING LANGUAGES IN MATHEMATICAL OPTIMIZATION 3 Mathematical Model Building 37 Arnold Neumaier 3.1 Why Mathematical Modeling? 37 3.2 A List of Applications 38 3.3 Basic numerical tasks 39 3.4 The Modeling Diagram 40 3.5 General Rules 41 3.6 Conflicts 42 3.7 Attitudes 43 4 Theoretical Concepts and Design of Modeling Languages 45 Hermann Schichl 4.1 Modeling Languages 45 4.1.1 Algebraic Modeling Languages 46 4.1.2 Non-algebraic Modeling Languages 51 4.1.3 Integrated Modeling Environments 54 4.1.4 Model-Programming Languages 55 4.1.5 Other Modeling Tools 55 4.2 Global Optimization 56 4.2.1 Problem Description 57 4.2.2 Algebraic Modeling Languages and Global Optimization 58 4.3 A Vision - What the Future Needs to Bring 59 4.3.1 Data Handling 59 4.3.2 Solver Views 60 4.3.3 GUI 60 4.3.4 Object Oriented Modeling - Derived Models 61 4.3.5 Hierarchical Modeling 61 4.3.6 Building Blocks 62 4.3.7 Open Model Exchange Format 62 5 The Importance of Modeling Languages for Solving Real-World Problems 63 Josef Kallrath and Josef Liesenfeld 5.1 Modeling Languages and Real World Problems 64 5.2 Requirements from Practitioners towards Modeling Languages and Modeling Systems 65 Part II The Modeling Languages in Detail 6 The Modeling Language AIMMS 71 Johannes Bisschop and Marcel Roelofs 6.1 AIMMS Design Philosophy, Features and Benefits 72 6.2 AIMMS Outer Approximation (AOA) Algorithm 78 6.2.1 Problem Statement 79 6.2.2 Basic Algorithm 79 6.2.3 Open Solver Approach 81 Contents vii 6.204 Alternative Uses of the Open Approach 83 6.3 Units of Measurement 84 6.3.1 Unit Analysis 86 6.3.2 Unit-Based Scaling 87 6.3.3 Unit Conventions 87 604 Time-Based Modeling 88 604.1 Calendars 90 604.2 Horizons 90 604.3 Data Conversion of Time-Dependent Identifiers 92 6.5 The AIMMS Excel Interface 93 6.5.1 Excel as the Main Application 94 6.5.2 AIMMS as the Main Application 94 6.6 Multi-Agent Support 96 6.6.1 Basic Agent Concepts 96 6.6.2 Examples of Motivation 97 6.6.3 Agent-Related Concepts in AIMMS 99 6.604 Agent Construction Support 101 6.7 Future Developments 101 Appendix 103 A AIMMS Features Overview 103 A.l Language Features 103 A.2 Mathematical Programming Features 103 A.3 End-User Interface Features 103 AA Connectivity and Deployment Features 104 B Application Examples 104 7 Design Principles and New Developments 105 in the AMPL Modeling Language Robert Fourer, David M. Gay and Brian W. Kernighan 7.1 Background and Early History 106 7.2 The McDonald's Diet Problem 107 7.3 The Airline Fleet Assignment Problem 111 704 Iterative Schemes 114 704.1 Flow of Control 114 704.2 Named Subproblems 115 704.3 Debugging 118 7.5 Other Types of Models 118 7.5.1 Piecewise-Linear Terms 119 7.5.2 Complementarity Problems 120 7.5.3 Combinatorial Optimization 123 7.504 Stochastic Programming 126 7.6 Communicating with Other Systems 128 7.6.1 Relational Database Access 128 7.6.2 Internet Optimization Services 129 7.6.3 Communication with Solvers via Suffixes 133 7.7 Updated AMPL Book 135 7.8 Concluding Remarks 135 V111 MODELING LANGUAGES IN MATHEMATICAL OPTIMIZATION 8 General Algebraic Modeling System (GAMS) 137 Michael R. Bussieck & Alex Meeraus 8.1 Background and Motivation 138 8.2 Design Goals and Changing Focus 139 8.3 A User's View of Modeling Languages 141 8.3.1 Academic Research Models 141 8.3.2 Domain Expert Models 145 8.3.3 Black Box Models 147 8.4 Summary and Conclusion 149 Appendix 150 A Selected Language Features 150 B GAMS External Functions 151 C Secure Work Files 151 D GAMS versus FORTRAN Matrix Generators 152 E Sample GAMS Problem 153 9 The LINGO Algebraic Modeling Language 159 Kevin Cunningham and Linus Schrage 9.1 History 159 9.2 Design Philosophy 160 9.2.1 Simplified Syntax for Small Models 160 9.2.2 Close Coupled Solvers 162 9.2.3 Interface to Excel 163 9.2.4 Model Class Identification 166 9.2.5 Automatic Linearization and Global Optimization 167 9.2.6 Debugging Models 168 9.2.7 Programming Interface 170 9.3 Future Directions 171 10 The LPL Modeling Language 173 Tony Hiirlimann 10.1 History 173 10.2 Some Basic Ideas 175 10.3 Highlights 176 10.4 The Cutting Stock Problem 178 10.5 Liquid Container 181 10.6 Model Documentation 182 10.7 Conclusion 183 11 The MINOPT Modeling Language 185 Carl A. Schweiger and Christodoulos A. Floudas 11.1 Introduction 186 11.1.1 Motivation 186 11.1.2 MINOPT Overview 188 Contents ix 11.2 Model Types and Solution Algorithms 189 11.2.1 Mixed-Integer Nonlinear Program (MINLP) 190 11.2.1.1 Generalized Benders Decomposition (GBD) 190 11.2.1.2 Outer ApproximationlEquality Relaxation! Augmented Penalty (OA/ER/AP) 192 11.2.2 Nonlinear Program with Differential and Algebraic Constraints (NLPIDAE) 195 11.2.3 Mixed-Integer Nonlinear Program with Differential and Al- gebraic Constraints (MINLPIDAE) 197 11.2.4 Optimal Control Problem (OCP) and Mixed Integer Optimal Control 200 11.2.5 External Solvers 204 11.3 Example Problems 204 11.3.1 Language Overview 205 11.3.2 MINLP Problem-Nonconvex Portfolio Optimization Prob- lem 205 11.3.3 Optimal Control Problem-Dow Batch Reactor 207 11.4 Summary 209 12 Mosel: A Modular Environment for Modeling and Solving Optimization 211 Problems Yves Colombani, Bob Daniel & Susanne Heipcke 12.1 Introduction 211 12.1.1 Solver Modules 212 12.1.2 Other Modules 212 12.1.3 User Modules 213 12.1.4 Contents of this Chapter 213 12.2 The Mosel Language 213 12.2.1 Example Problem 214 12.2.2 Types and Data Structures 215 12.2.3 Initialization of DatalData File Access 217 12.2.4 Language Constructs 218 12.2.4.1 Selections 218 12.2.4.2 Loops 219 12.2.5 Set Operations 219 12.2.6 Subroutines 220 12.3 Mosel Libraries 220 12.4 Mosel Modules 222 12.4.1 Available Modules 223 12.4.2 QP Example with Graphical Output 224 12.4.3 Example of a Solution Algorithm 225 12.5 Writing User Modules 230 12.5.1 Defining a New Subroutine 231 12.5.2 Creating a New Type 233 12.5.2.1 Module Context 234 12.5.2.2 Type Creation and Deletion 235 12.5.2.3 Type Transformation to and from String 235 12.5.2.4 Overloading of Arithmetic Operators 236 12.6 Summary 238 x MODELING LANGUAGES IN MATHEMATICAL OPTIMIZATION 13 The MPL Modeling System 239 Bjarni Kristjansson & Denise Lee 13.1 Maximal Software and Its History 239 13.2 Algebraic Modeling Languages 241 13.2.1 Comparison of Modeling Languages 242 13.2.1.1 Modeling Language 243 13.2.1.2 Multiple Platforms 243 13.2.1.3 Open Design 243 13.2.1.4 Indexing 244 13 .2.1.5 Scalability 244 ] 3.2.].6 Memory Management 244 13.2.1.7 Speed 245 13.2.1.8 Robustness 245 ] 3.2.].9 Deployment 245 13.2.1.1 0 Pricing 245 13.3 MPL Modeling System 245 13.3.] MPL Integrated Model Development Environment 246