Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Mathematical Programming Language

Similar presentations


Presentation on theme: "A Mathematical Programming Language"— Presentation transcript:

1 A Mathematical Programming Language
AMPL: A Mathematical Programming Language 9-Dec-18

2 Introduction Language for large-scale mathematical computing
Generally used for large-scale optimization and scheduling-type problems Syntax closely resembles the symbolic algebraic notation that is often used to describe mathematical programs Model linear programming, integer programming, and nonlinear programming, etc.

3 Language Features Sets and indexing Objectives and constraints
Simple sets Compound sets Computed sets Objectives and constraints Linear Piecewise-linear Nonlinear Integer Network

4 Syntax Constants: N Variables: i, j, p, x, y
Keywords: param, var, let, in, minimize, subject to Operators: :=, *, etc. Expressions: i * j Statements: ; Comments: # Control: for Commands: solve, printf, display

5 Syntax Example File: Mult.mod Run using “model Mult.mod”

6 AMPL Files Each problem instance is coded in AMPL using three files:
A model file (extension .mod): contains the mathematical formulation of the problem A data file (extension .dat): contains the numerical values of the problem parameters A run file (extension .run): specifies the solution algorithm (external and/or coded by the user in the AMPL language itself).

7 Linear Problem Example
Tons per hour (rate): Bands Coils 140 Profit per ton (profit): Bands $ Coils $30 Maximum tons (market): Bands Coils 4000 If 40 hours of production time are available, how many tons of bands and how many tons of coils should be produced to bring in the greatest total profit?

8 Linear Problem Example: Cont.
bands: the number of tons of bands to be produced coils: the number of tons of coils to be produced Maximize: $25 * X + $30 * Y Subject to: 0 <= X <= 6000 0 <= Y <= 4000 (X / 200) + (Y / 140) <= 40 hours

9 Linear Problem Example: Data
File: steel.dat Tons per hour (rate): Bands Coils 140 Profit per ton (profit): Bands 25 Coils 30 Maximum tons (market): Bands 6000 Coils 4000 bands: the number of tons of bands to be produced coils: the number of tons of coils to be produced

10 Linear Problem Example: Model
File: steel.mod

11 Linear Problem Example: Run
File: steel.run Run by calling “include steel.run”

12 AMPL IDE Download:

13 References: AMPL Website: http://ampl.com/
AMPL Book:

14 The End


Download ppt "A Mathematical Programming Language"

Similar presentations


Ads by Google