Available:*
Library | Item Barcode | Call Number | Material Type | Item Category 1 | Status |
---|---|---|---|---|---|
Searching... | 30000010018812 | T57.7 F68 2003 | Open Access Book | Book | Searching... |
On Order
Summary
Summary
AMPL is a language for large-scale optimization and mathematical programming problems in production, distribution, blending, scheduling, and many other applications. Combining familiar algebraic notation and a powerful interactive command environment, AMPL makes it easy to create models, use a wide variety of solvers, and examine solutions. Though flexible and convenient for rapid prototyping and development of models, AMPL also offers the speed and generality needed for repeated large-scale production runs. This book, written by the creators of AMPL, is a complete guide for modelers at all levels of experience. It begins with a tutorial on widely used linear programming models, and presents all of AMPL's features for linear programming with extensive examples. Additional chapters cover network, nonlinear, piecewise-linear, and integer programming; database and spreadsheet interactions; and command scripts. Most chapters include exercises. Download free versions of AMPL and several solvers from www.ampl.com for experimentation, evaluation, and education. The Web site also lists vendors of the commercial version of AMPL and numerous solvers.
Table of Contents
Introduction | p. xv |
Chapter 1. Production Models: Maximizing Profits | p. 1 |
1.1 A two-variable linear program | p. 2 |
1.2 The two-variable linear program in AMPL | p. 5 |
1.3 A linear programming model | p. 6 |
1.4 The linear programming model in AMPL | p. 7 |
The basic model | p. 8 |
An improved model | p. 10 |
Catching errors | p. 12 |
1.5 Adding lower bounds to the model | p. 13 |
1.6 Adding resource constraints to the model | p. 15 |
1.7 AMPL interfaces | p. 18 |
Chapter 2. Diet and Other Input Models: Minimizing Costs | p. 27 |
2.1 A linear program for the diet problem | p. 27 |
2.2 An AMPL model for the diet problem | p. 30 |
2.3 Using the AMPL diet model | p. 32 |
2.4 Generalizations to blending, economics and scheduling | p. 37 |
Chapter 3. Transportation and Assignment Models | p. 43 |
3.1 A linear program for the transportation problem | p. 44 |
3.2 An AMPL model for the transportation problem | p. 45 |
3.3 Other interpretations of the transportation model | p. 49 |
Chapter 4. Building Larger Models | p. 55 |
4.1 A multicommodity transportation model | p. 56 |
4.2 A multiperiod production model | p. 59 |
4.3 A model of production and transportation | p. 63 |
Chapter 5. Simple Sets and Indexing | p. 73 |
5.1 Unordered sets | p. 73 |
5.2 Sets of numbers | p. 75 |
5.3 Set operations | p. 76 |
5.4 Set membership operations and functions | p. 78 |
5.5 Indexing expressions | p. 79 |
5.6 Ordered sets | p. 82 |
Predefined sets and interval expressions | p. 86 |
Chapter 6. Compound Sets and Indexing | p. 91 |
6.1 Sets of ordered pairs | p. 91 |
6.2 Subsets and slices of ordered pairs | p. 93 |
6.3 Sets of longer tuples | p. 96 |
6.4 Operations on sets of tuples | p. 98 |
6.5 Indexed collections of sets | p. 100 |
Chapter 7. Parameters and Expressions | p. 109 |
7.1 Parameter declarations | p. 110 |
7.2 Arithmetic expressions | p. 111 |
7.3 Logical and conditional expressions | p. 114 |
7.4 Restrictions on parameters | p. 116 |
7.5 Computed parameters | p. 118 |
7.6 Randomly generated parameters | p. 121 |
7.7 Logical parameters | p. 122 |
7.8 Symbolic parameters | p. 123 |
Chapter 8. Linear Programs: Variables, Objectives and Constraints | p. 129 |
8.1 Variables | p. 129 |
8.2 Linear expressions | p. 132 |
8.3 Objectives | p. 134 |
8.4 Constraints | p. 137 |
Chapter 9. Specifying Data | p. 143 |
9.1 Formatted data: the data command | p. 143 |
9.2 Data in lists | p. 145 |
Lists of one-dimensional sets and parameters | p. 145 |
Lists of two-dimensional sets and parameters | p. 146 |
Lists of higher-dimensional sets and parameters | p. 148 |
Combined lists of sets and parameters | p. 151 |
9.3 Data in tables | p. 154 |
Two-dimensional tables | p. 154 |
Two-dimensional slices of higher-dimensional data | p. 156 |
Higher-dimensional tables | p. 157 |
Choice of format | p. 159 |
9.4 Other features of data statements | p. 160 |
Default values | p. 160 |
Indexed collections of sets | p. 161 |
Initial values for variables | p. 162 |
9.5 Reading unformatted data: the read command | p. 163 |
Chapter 10. Database Access | p. 169 |
10.1 General principles of data correspondence | p. 169 |
10.2 Examples of table-handling statements | p. 174 |
10.3 Reading data from relational tables | p. 180 |
Reading parameters only | p. 180 |
Reading a set and parameters | p. 182 |
Establishing correspondences | p. 184 |
Reading other values | p. 185 |
10.4 Writing data to relational tables | p. 186 |
Writing rows inferred from the data specifications | p. 186 |
Writing rows inferred from a key specification | p. 189 |
10.5 Reading and writing the same table | p. 191 |
Reading and writing using two table declarations | p. 192 |
Reading and writing using the same table declaration | p. 193 |
10.6 Indexed collections of tables and columns | p. 193 |
Indexed collections of tables | p. 193 |
Indexed collections of data columns | p. 196 |
10.7 Standard and built-in table handlers | p. 197 |
Using the standard ODBC table handler | p. 198 |
Using the standard ODBC table handler with Access and Excel | p. 200 |
Built-in table handlers for text and binary files | p. 201 |
Chapter 11. Modeling Commands | p. 203 |
11.1 General principles of commands and options | p. 203 |
Commands | p. 204 |
Options | p. 204 |
11.2 Setting up and solving models and data | p. 206 |
Entering models and data | p. 206 |
Solving a model | p. 207 |
11.3 Modifying data | p. 209 |
Resetting | p. 209 |
Resampling | p. 209 |
The let command | p. 210 |
11.4 Modifying models | p. 212 |
Removing or redefining model components | p. 213 |
Changing the model: fix, unfix; drop, restore | p. 214 |
Relaxing integrality | p. 215 |
Chapter 12. Display Commands | p. 219 |
12.1 Browsing through results: the display command | p. 219 |
Displaying sets | p. 220 |
Displaying parameters and variables | p. 220 |
Displaying indexed expressions | p. 224 |
12.2 Formatting options for display | p. 227 |
Arrangement of lists and tables | p. 227 |
Control of line width | p. 229 |
Suppression of zeros | p. 231 |
12.3 Numeric options for display | p. 232 |
Appearance of numeric values | p. 233 |
Rounding of solution values | p. 236 |
12.4 Other output commands: print and printf | p. 238 |
The print command | p. 238 |
The printf command | p. 239 |
12.5 Related solution values | p. 240 |
Objective functions | p. 240 |
Bounds and slacks | p. 241 |
Dual values and reduced costs | p. 243 |
12.6 Other display features for models and instances | p. 245 |
Displaying model components: the show command | p. 246 |
Displaying model dependencies: the xref command | p. 247 |
Displaying model instances: the expand command | p. 247 |
Generic synonyms for variables, constraints and objectives | p. 249 |
Resource listings | p. 250 |
12.7 General facilities for manipulating output | p. 251 |
Redirection of output | p. 251 |
Output logs | p. 251 |
Limits on messages | p. 252 |
Chapter 13. Command Scripts | p. 255 |
13.1 Running scripts: include and commands | p. 255 |
13.2 Iterating over a set: the for statement | p. 258 |
13.3 Iterating subject to a condition: the repeat statement | p. 262 |
13.4 Testing a condition: the if-then-else statement | p. 264 |
13.5 Terminating a loop: break and continue | p. 266 |
13.6 Stepping through a script | p. 268 |
13.7 Manipulating character strings | p. 270 |
String functions and operators | p. 270 |
String expressions in AMPL commands | p. 273 |
Chapter 14. Interactions with Solvers | p. 275 |
14.1 Presolve | p. 275 |
Activities of the presolve phase | p. 276 |
Controlling the effects of presolve | p. 278 |
Detecting infeasibility in presolve | p. 279 |
14.2 Retrieving results from solvers | p. 282 |
Solve results | p. 282 |
Solver statuses of objectives and problems | p. 286 |
Solver statuses of variables | p. 287 |
Solver statuses of constraints | p. 291 |
AMPL statuses | p. 293 |
14.3 Exchanging information with solvers via suffixes | p. 295 |
User-defined suffixes: integer programming directives | p. 296 |
Solver-defined suffixes: sensitivity analysis | p. 298 |
Solver-defined suffixes: infeasibility diagnosis | p. 299 |
Solver-defined suffixes: direction of unboundedness | p. 300 |
Defining and using suffixes | p. 302 |
14.4 Alternating between models | p. 304 |
14.5 Named problems | p. 309 |
Defining named problems | p. 311 |
Using named problems | p. 314 |
Displaying named problems | p. 315 |
Defining and using named environments | p. 316 |
Chapter 15. Network Linear Programs | p. 319 |
15.1 Minimum-cost transshipment models | p. 319 |
A general transshipment model | p. 320 |
Specialized transshipment models | p. 323 |
Variations on transshipment models | p. 326 |
15.2 Other network models | p. 328 |
Maximum flow models | p. 328 |
Shortest path models | p. 329 |
Transportation and assignment models | p. 330 |
15.3 Declaring network models by node and arc | p. 333 |
A general transshipment model | p. 334 |
A specialized transshipment model | p. 335 |
Variations on transshipment models | p. 336 |
Maximum flow models | p. 337 |
15.4 Rules for node and arc declarations | p. 340 |
node declarations | p. 340 |
arc declarations | p. 340 |
Interaction with objective declarations | p. 341 |
Interaction with constraint declarations | p. 342 |
Interaction with variable declarations | p. 342 |
15.5 Solving network linear programs | p. 343 |
Chapter 16. Columnwise Formulations | p. 353 |
16.1 An input-output model | p. 354 |
Formulation by constraints | p. 354 |
A columnwise formulation | p. 355 |
Refinements of the columnwise formulation | p. 357 |
16.2 A scheduling model | p. 359 |
16.3 Rules for columnwise formulations | p. 362 |
Chapter 17. Piecewise-Linear Programs | p. 365 |
17.1 Cost terms | p. 366 |
Fixed numbers of pieces | p. 366 |
Varying numbers of pieces | p. 368 |
17.2 Common two-piece and three-piece terms | p. 369 |
Penalty terms for "soft" constraints | p. 369 |
Dealing with infeasibility | p. 373 |
Reversible activities | p. 377 |
17.3 Other piecewise-linear functions | p. 379 |
17.4 Guidelines for piecewise-linear optimization | p. 382 |
Forms for piecewise-linear expressions | p. 382 |
Suggestions for piecewise-linear models | p. 383 |
Chapter 18. Nonlinear Programs | p. 391 |
18.1 Sources of nonlinearity | p. 392 |
Dropping a linearity assumption | p. 393 |
Achieving a nonlinear effect | p. 396 |
Modeling an inherently nonlinear process | p. 397 |
18.2 Nonlinear variables | p. 397 |
Initial values of variables | p. 398 |
Automatic substitution of variables | p. 399 |
18.3 Nonlinear expressions | p. 400 |
18.4 Pitfalls of nonlinear programming | p. 403 |
Function range violations | p. 403 |
Multiple local optima | p. 407 |
Other pitfalls | p. 410 |
Chapter 19. Complementarity Problems | p. 419 |
19.1 Sources of complementarity | p. 419 |
A complementarity model of production economics | p. 420 |
Complementarity for bounded variables | p. 423 |
Complementarity for price-dependent demands | p. 425 |
Other complementarity models and applications | p. 426 |
19.2 Forms of complementarity constraints | p. 427 |
19.3 Working with complementarity constraints | p. 428 |
Related solution values | p. 428 |
Presolve | p. 429 |
Generic synonyms | p. 431 |
Chapter 20. Integer Linear Programs | p. 437 |
20.1 Integer variables | p. 438 |
20.2 Zero-one variables and logical conditions | p. 439 |
Fixed costs | p. 440 |
Zero-or-minimum restrictions | p. 444 |
Cardinality restrictions | p. 445 |
20.3 Practical considerations in integer programming | p. 448 |
Appendix A. AMPL Reference Manual | p. 453 |
A.1 Lexical rules | p. 453 |
A.2 Set members | p. 454 |
A.3 Indexing expressions and subscripts | p. 455 |
A.4 Expressions | p. 455 |
A.4.1 Built-in functions | p. 458 |
A.4.2 Strings and regular expressions | p. 459 |
A.4.3 Piecewise-linear terms | p. 460 |
A.5 Declarations of model entities | p. 461 |
A.6 Set declarations | p. 461 |
A.6.1 Cardinality and arity functions | p. 462 |
A.6.2 Ordered sets | p. 463 |
A.6.3 Intervals and other infinite sets | p. 463 |
A.7 Parameter declarations | p. 465 |
A.7.1 Check statements | p. 465 |
A.7.2 Infinity | p. 466 |
A.8 Variable declarations | p. 466 |
A.8.1 Defined variables | p. 467 |
A.9 Constraint declarations | p. 468 |
A.9.1 Complementarity constraints | p. 469 |
A.10 Objective declarations | p. 470 |
A.11 Suffix notation for auxiliary values | p. 470 |
A.11.1 Suffix declarations | p. 471 |
A.11.2 Statuses | p. 473 |
A.12 Standard data format | p. 473 |
A.12.1 Set data | p. 473 |
A.12.2 Parameter data | p. 475 |
A.13 Database access and tables | p. 477 |
A.14 Command language overview | p. 479 |
A.14.1 Options and environment variables | p. 481 |
A.15 Redirection of input and output | p. 481 |
A.16 Printing and display commands | p. 482 |
A.17 Reading data | p. 484 |
A.18 Modeling commands | p. 485 |
A.18.1 The solve command | p. 485 |
A.18.2 The solution command | p. 487 |
A.18.3 The write command | p. 487 |
A.18.4 Auxiliary files | p. 487 |
A.18.5 Changing a model: delete, purge, redeclare | p. 488 |
A.18.6 The drop, restore and objective commands | p. 489 |
A.18.7 The fix and unfix commands | p. 489 |
A.18.8 Named problems and environments | p. 489 |
A.18.9 Modifying data: reset, update, let | p. 490 |
A.19 Examining models | p. 491 |
A.19.1 The show command | p. 491 |
A.19.2 The xref command | p. 492 |
A.19.3 The expand command | p. 492 |
A.19.4 Generic names | p. 492 |
A.19.5 The check command | p. 492 |
A.20 Scripts and control flow statements | p. 492 |
A.20.1 The for, repeat and if-then-else statements | p. 493 |
A.20.2 Stepping through commands | p. 495 |
A.21 Computational environment | p. 495 |
A.21.1 The shell command | p. 495 |
A.21.2 The cd command | p. 495 |
A.21.3 The quit, exit and end commands | p. 496 |
A.21.4 Built-in timing parameters | p. 496 |
A.21.5 Logging | p. 496 |
A.22 Imported functions | p. 497 |
A.23 AMPL invocation | p. 499 |
Index | p. 501 |