The (Original) AMPL Book

AMPL: A Modeling Language for Mathematical Programming by Robert Fourer, David M. Gay, and Brian W. Kernighan

An analysis of optimization models that are routinely used in electricity market operations

The AMPL Book

Beginners to advanced

Written by the creators of AMPL, this book is a complete guide for modelers at all levels of experience.

More than a user manual

Begin with a tutorial on widely used linear programming models and expand through a more detailed tutorial exposition of all of AMPL’s features.

In-depth programming and feature education

Advanced chapters cover network, nonlinear, piecewise-linear, and integer programming; database and spreadsheet interactions; and command scripts.

Knowledge in action

Most chapters include exercises for study or classroom use. Extensive examples show how each feature is used in meaningful contexts.

Chapter Downloads ↓

Introduction

The introduction provides an overview of AMPL, its purpose as a high-level modeling language for mathematical programming, and how it simplifies the process of expressing and solving optimization problems.

Chapter 1: Production Models: Maximizing Profits

Introduces linear programming through production models, demonstrating profit maximization under resource constraints

Chapter 2: Diet and Other Input Models: Minimizing Costs

Explores cost minimization problems, such as the diet problem, emphasizing the formulation of input-based models.

Chapter 3: Transportation and Assignment Models

Discusses models for optimizing transportation and assignment tasks, focusing on efficient resource allocation.

Chapter 4: Building Larger Models

Covers techniques for constructing complex models by integrating multiple components and constraints.

Chapter 5: Simple Sets and Indexing

Introduces the use of sets and indexing in AMPL to structure and simplify model formulation.

Chapter 6: Compound Sets and Indexing

Expands on simple sets by exploring compound sets and advanced indexing methods for more intricate models.

Chapter 7: Parameters and Expressions

Details the declaration and use of parameters and expressions to define model data and relationships.

Chapter 8: Linear Programs: Variables, Objectives and Constraints

Delves into the core components of linear programs, including variable definitions, objective functions, and constraints.

Chapter 9: Specifying Data

Explains methods for inputting and managing data within AMPL models to ensure accuracy and flexibility.

Chapter 10: Database Access

Demonstrates how to connect AMPL models to external databases for dynamic data retrieval and storage.

Chapter 11: Modeling Commands

Provides an overview of AMPL’s modeling commands to control model execution and solution processes.

Chapter 12: Display Commands

Covers commands for displaying and interpreting model results and outputs effectively.

Chapter 13: Command Scripts

Introduces scripting capabilities in AMPL for automating model tasks and workflows.

Chapter 14: Interactions with Solvers

Discusses how AMPL interfaces with various solvers to find optimal solutions to models.

Chapter 15: Network Linear Programs

Focuses on modeling and solving network-based linear programming problems.

Chapter 16: Columnwise Formulations

Explores columnwise model formulations and their applications in optimization.

Chapter 17: Piecewise-Linear Programs

Examines the formulation and solution of piecewise-linear programming models.

Chapter 18: Nonlinear Programs

Introduces nonlinear programming concepts and their implementation in AMPL.

Chapter 19: Complementarity Problems

Discusses the modeling of complementarity problems within the AMPL framework.

Chapter 20: Integer Linear Programs

Covers the formulation and solution of integer linear programming models.

Appendix A: AMPL Reference Manual

The appendix includes detailed reference materials, such as syntax summaries, solver-specific notes, and additional resources to support readers in effectively utilizing AMPL for diverse modeling tasks.

Free licenses for Academic Research and Education

AMPL is committed to democratizing optimization software for non-commercial settings. Get the full AMPL system with industry leading solvers for free use in Academia.

The AMPL Book