AMPL

from Wikipedia, the free encyclopedia

AMPL ( A M athematical P rogramming L anguage ) is a mathematical modeling language used by Robert Fourer , David Gay and Brian Kernighan at Bell Laboratories developed. It allows the formulation of mathematical models in an abstract form that is close to algebraic notation. Many optimization problems can be formulated with AMPL.

Since AMPL does not solve these problems directly, but translates them into a form that an optimization algorithm understands, AMPL needs suitable solvers in order to function.

Sufficiently difficult problems such as global optima, nonlinear mixed integer problems etc. therefore require special solvers .

example

The following mathematical model is given:

Variables:
  • : Number of product 1
  • : Number of product 2
Objective function:
  • Maximize
Constraints:
  • (Range from )
  • (Range from )
  • (Limitation for resource 1)
  • (Limitation for resource 2)

An equivalent formulation in AMPL could look like this:

 # Variablen:
 var x1 integer;
 var x2 integer;

 # Zielfunktion:
 maximize z: 400*x1 + 50*x2;

 # Nebenbedingungen:
 subject to Bereich_x1: 0 <= x1 <= 70;
 subject to Bereich_x2: 0 <= x2 <= 500;
 subject to Ressource1: 25*x1 + 10*x2 <= 5000;
 subject to Ressource2: 100*x1 + 20*x2 <= 8000;

 # wenn man dieses Problem loesen will
 # braucht man nur noch
 solve;
 # der Maximierer wird mit
 display x1, x2;
 # angezeigt

See also

literature

Web links