Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
AMPL
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Algebraic modeling language}} {{Use dmy dates|date=November 2020}} {{Infobox programming language | name = AMPL | logo = [[File:AMPL (textbook cover).jpg]] | caption = | designers = [[Robert Fourer]]<br />David Gay<br />[[Brian Kernighan]]<br/>[[Bell Labs]] | paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[Declarative programming|declarative]], [[Imperative programming|imperative]] | developer = AMPL Optimization, Inc. | released = {{Start date and age|1985}} | latest release version = 20230430 | latest release date = {{Start date and age|df=yes|2023|04|30}} | latest test version = | latest test date = | typing = | implementations = | dialects = | influenced by = [[AWK]], [[C (programming language)|C]] | influenced = [[JuMP]], [[Pyomo]] | operating system = [[Cross-platform]]: [[Linux]], [[macOS]], [[Solaris (operating system)|Solaris]], [[IBM AIX|AIX]], [[Microsoft Windows|Windows]] | license = [[Proprietary software|Proprietary]] (translator),<br />[[Free and open source software|free and open-source]] (AMPL Solver Library) | genre = [[Algebraic modeling language]] (AML) | website = {{URL|www.ampl.com}} | file ext = .mod, .dat, .run }} '''AMPL''' ('''A Mathematical Programming Language''') is an [[algebraic modeling language]] to describe and solve high-complexity problems for large-scale mathematical computing (e.g. large-scale optimization and [[automated planning and scheduling|scheduling]]-type problems).<ref name="ampl-book"> {{cite book | last1 = Fourer | first1 = Robert | last2 = Gay | first2 = David M | last3 = Kernighan | first3 = Brian W | author-link1 = Robert Fourer | author-link3 = Brian Kernighan | title = AMPL: a modeling language for mathematical programming | date = 2003 | publisher = Duxbury Press/Brooks/Cole Publishing Company | location = USA | isbn = 978-0-534-38809-6 }} </ref> It was developed by [[Robert Fourer]], David Gay, and [[Brian Kernighan]] at [[Bell Labs|Bell Laboratories]]. AMPL supports dozens of [[solver]]s, both [[Open-source software|open source]] and [[commercial software]], including CBC, [[CPLEX]], [[FortMP]], [[MOSEK]], [[MINOS (optimization software)|MINOS]], [[IPOPT]], [[SNOPT]], [[KNITRO]], and LGO. Problems are passed to solvers as [[nl (format)|nl]] files. AMPL is used by more than 100 corporate clients, and by government agencies and academic institutions.<ref>{{cite web | title=Position Available | url=http://www.ampl.com/OPENINGS/2011July.html#Product | access-date=2011-07-29 | archive-date=11 September 2011 | archive-url=https://web.archive.org/web/20110911191129/http://www.ampl.com/OPENINGS/2011July.html#Product | url-status=dead }}</ref> One advantage of AMPL is the similarity of its syntax to the mathematical notation of [[Optimization (mathematics)|optimization]] problems. This allows for a very concise and readable definition of problems in the domain of [[mathematical programming|optimization]]. Many modern solvers available on the [[NEOS Server]] (formerly hosted at the [[Argonne National Laboratory]], currently hosted at the [[University of Wisconsin, Madison]]<ref name="neos-uwm">{{cite web|url=http://neos-guide.org/About/|title=About|access-date=11 August 2015}}</ref>) accept AMPL input. According to the NEOS statistics AMPL is the most popular format for representing mathematical programming problems. ==Features== AMPL features a mix of [[declarative programming|declarative]] and [[imperative programming|imperative]] programming styles. Formulating optimization models occurs via declarative language elements such as sets, scalar and multidimensional parameters, decision variables, objectives and [[constraint (mathematics)|constraints]], which allow for concise description of most problems in the domain of mathematical optimization. Procedures and [[control flow]] statements are available in AMPL for * the exchange of data with external data sources such as [[spreadsheet]]s, [[database]]s, [[XML]] and text files * data pre- and post-processing tasks around optimization models * the construction of hybrid algorithms for problem types for which no direct efficient solvers are available. To support re-use and simplify construction of large-scale optimization problems, AMPL allows separation of model and data. AMPL supports a wide range of problem types, among them: * [[Linear programming]] * [[Quadratic programming]] * [[Nonlinear programming]] * [[Linear programming#Integer unknowns|Mixed-integer programming]] * Mixed-integer quadratic programming with or without [[Convex function|convex]] quadratic constraints * Mixed-integer nonlinear programming * [[Second-order cone programming]] * [[Global optimization]] * [[Semidefinite programming]] problems with [[Bilinear form|bilinear]] matrix inequalities * [[Complementarity theory]] problems (MPECs) in discrete or continuous variables * [[Constraint programming]]<ref name="cp-support"> {{Cite journal |author-link = Robert Fourer | title = Extending an Algebraic Modeling Language to Support Constraint Programming | journal = INFORMS Journal on Computing | volume = 14 | issue = 4 | pages = 322β344 | year = 2002 | url = http://joc.journal.informs.org/content/14/4/322 | doi=10.1287/ijoc.14.4.322.2825| last1 = Fourer | first1 = Robert | last2 = Gay | first2 = David M. | citeseerx = 10.1.1.8.9699 }} </ref> AMPL invokes a solver in a separate process which has these advantages: * User can interrupt the solution process at any time * Solver errors do not affect the interpreter * 32-bit version of AMPL can be used with a 64-bit solver and vice versa Interaction with the solver is done through a well-defined [[nl (format)|nl interface]]. ==Availability== AMPL is available for many popular 32 & 64-bit [[operating system]]s including [[Linux]], [[macOS]], [[Solaris (operating system)|Solaris]], [[IBM AIX|AIX]], and [[Microsoft Windows|Windows]].<ref>{{cite web|url=https://ampl.com/products/platforms/|title=Platforms|website=AMPL Optimizations Inc.|access-date=1 November 2019|archive-date=14 May 2022|archive-url=https://web.archive.org/web/20220514181833/https://ampl.com/products/platforms/|url-status=dead}}</ref> The translator is proprietary software maintained by AMPL Optimization LLC. However, several online services exist, providing free modeling and solving facilities using AMPL.<ref name="neos">{{cite web|url=http://www.neos-server.org/neos/|title=NEOS Server for Optimization|access-date=11 August 2015}}</ref><ref>{{cite web|url=http://www.ampl.com/TRYAMPL/|title=Try AMPL!|access-date=11 August 2015}}</ref> A free student version with limited functionality and a free full-featured version for academic courses are also available.<ref>{{cite web|url=http://www.ampl.com/DOWNLOADS/index.html|title=AMPL Downloads|access-date=11 August 2015|archive-url=https://web.archive.org/web/20150526013237/http://www.ampl.com/DOWNLOADS/index.html|archive-date=26 May 2015|url-status=dead}}</ref> AMPL can be used from within [[Microsoft Excel]] via the [[SolverStudio]] Excel add-in. The AMPL Solver Library (ASL), which allows reading nl files and provides the automatic differentiation, is open-source. It is used in many solvers to implement AMPL connection. ==Status history== This table present significant steps in AMPL history. {| class="wikitable" |- ! Year ! Highlights |- | 1985 | AMPL was designed and implemented<ref name="ampl-book"/> |- | 1990 | Paper describing the AMPL modeling language was published in [[Management Science: A Journal of the Institute for Operations Research and the Management Sciences|Management Science]]<ref> {{Cite journal | author-link1 = Robert Fourer | author-link3 = Brian W. Kernighan | title = A Modeling Language for Mathematical Programming | journal = Management Science | volume = 36 | issue = 5 | pages = 519β554β83 | year = 1990 | url = http://www.ampl.com/REFS/amplmod.pdf | doi=10.1287/mnsc.36.5.519| last1 = Fourer | first1 = Robert | last2 = Gay | first2 = David M. | last3 = Kernighan | first3 = Brian W. }} </ref> |- | 1991 | AMPL supports [[nonlinear programming]] and [[automatic differentiation]] |- | 1993 | [[Robert Fourer]], David Gay and [[Brian Kernighan]] were awarded ORSA/CSTS Prize<ref>{{cite web|url=http://computing.society.informs.org/pdf/GreenbergHistory.pdf|title=ICS - INFORMS|author=INFORMS|access-date=11 August 2015|archive-date=7 October 2006|archive-url=https://web.archive.org/web/20061007164141/http://computing.society.informs.org/pdf/GreenbergHistory.pdf|url-status=dead}}</ref> by the [[Operations Research Society of America]], for writings on the design of mathematical programming systems and the AMPL modeling language |- | 1995 | Extensions for representing [[piecewise linear function|piecewise-linear]] and network structures |- | 1995 | Scripting constructs |- | 1997 | Enhanced support for nonlinear solvers |- | 1998 | AMPL supports [[complementarity theory]] problems |- | 2000 | Relational database and spreadsheet access |- | 2002 | Support for constraint programming<ref name="cp-support" /> |- | 2003 | AMPL Optimization LLC was founded by the inventors of AMPL, Robert Fourer, David Gay, and Brian Kernighan. The new company took over the development and support of the AMPL modeling language from [[Lucent|Lucent Technologies, Inc]]. |- | 2005 | AMPL Modeling Language Google group opened<ref>{{Cite web | url=https://groups.google.com/group/ampl | title=Google Groups}}</ref> |- | 2008 | Kestrel: An AMPL Interface to the NEOS Server introduced |- | 2012 | [[Robert Fourer]], David Gay, and [[Brian Kernighan]] were awarded the 2012 INFORMS Impact Prize as the originators of one of the most important algebraic modeling languages.<ref>{{cite web|url=http://www.informs.org/Blogs/E-News-Blog/INFORMS-Impact-Prize|title=INFORMS Impact Prize|author=INFORMS|access-date=11 August 2015|archive-url=https://web.archive.org/web/20131022091250/https://www.informs.org/Blogs/E-News-Blog/INFORMS-Impact-Prize|archive-date=22 October 2013|url-status=dead}}</ref> |- | 2012 | AMPL book becomes freely available online<ref>{{cite web|url=https://ampl.com/learn/ampl-book/|title=The AMPL Book: A comprehensive guide to building optimization models, for beginning or experienced users|access-date=5 March 2021}}</ref> |- | 2013 | A new cross-platform [[integrated development environment]] (IDE) for AMPL becomes available<ref>{{cite web|url=https://groups.google.com/forum/#!topic/ampl/y1FJcYZz-_Q|title=Google Groups|access-date=11 August 2015}}</ref> |} =={{anchor|example}}A sample model== A transportation problem from [[George Dantzig]] is used to provide a sample AMPL model. This problem finds the least cost shipping schedule that meets requirements at markets and supplies at factories.<ref> {{cite book |first=George |last=Dantzig |author-link=George Dantzig |chapter=3. Formulating a Linear Programming Model |title=Linear Programming and Extensions |chapter-url=https://books.google.com/books?id=hUWPDAAAQBAJ&pg=PA32 |date=2016 |orig-year=1963 |publisher=Princeton University Press |isbn=978-1-4008-8417-9 |pages=32β62}} </ref> <!-- See http://pygments.org/docs/lexers/#lexers-for-the-ampl-language --> <syntaxhighlight lang="ampl"> set Plants; set Markets; # Capacity of plant p in cases param Capacity{p in Plants}; # Demand at market m in cases param Demand{m in Markets}; # Distance in thousands of miles param Distance{Plants, Markets}; # Freight in dollars per case per thousand miles param Freight; # Transport cost in thousands of dollars per case param TransportCost{p in Plants, m in Markets} := Freight * Distance[p, m] / 1000; # Shipment quantities in cases var shipment{Plants, Markets} >= 0; # Total transportation costs in thousands of dollars minimize cost: sum{p in Plants, m in Markets} TransportCost[p, m] * shipment[p, m]; # Observe supply limit at plant p s.t. supply{p in Plants}: sum{m in Markets} shipment[p, m] <= Capacity[p]; # Satisfy demand at market m s.t. demand{m in Markets}: sum{p in Plants} shipment[p, m] >= Demand[m]; data; set Plants := seattle san-diego; set Markets := new-york chicago topeka; param Capacity := seattle 350 san-diego 600; param Demand := new-york 325 chicago 300 topeka 275; param Distance : new-york chicago topeka := seattle 2.5 1.7 1.8 san-diego 2.5 1.8 1.4; param Freight := 90; </syntaxhighlight> ==Solvers== Here is a partial list of [[solver]]s supported by AMPL:<ref>{{cite web|url=http://www.ampl.com/solvers.html|title=Solvers - AMPL|access-date=21 January 2018|archive-date=27 February 2014|archive-url=https://web.archive.org/web/20140227083015/http://www.ampl.com/solvers.html|url-status=dead}}</ref> {| class="wikitable sortable" |- ! width=20%| Solver ! width=80%| Supported problem types |- ! [[APOPT]] | mixed integer [[nonlinear programming]] |- ! [[Artelys Knitro]] | linear, quadratic and nonlinear programming |- ! Bonmin | mixed integer [[nonlinear programming]] |- ! BPMPD | [[Linear programming|linear]] and [[quadratic programming]] |- ! [[COIN-OR]] CBC | [[Linear programming#Integer unknowns|mixed integer programming]] |- ! [[COIN-OR#CLP|COIN-OR CLP]] | linear programming |- ! CONOPT | nonlinear programming |- ! [[Couenne]]<ref>{{cite web|url=https://projects.coin-or.org/Couenne |title=Couenne |access-date=2013-10-27 |url-status=dead |archive-url=https://web.archive.org/web/20131029190415/https://projects.coin-or.org/Couenne |archive-date=2013-10-29 }}</ref> | mixed integer nonlinear programming (MINLP) |- ! [[CPLEX]] | linear, quadratic, [[Second-order cone programming|second-order cone]] and mixed integer programming |- ! CPLEX CP Optimizer<ref>{{cite web|url=https://github.com/ampl/mp/tree/master/solvers/ilogcp|title=mp/solvers/ilogcp at master Β· ampl/mp Β· GitHub|work=GitHub|access-date=11 August 2015}}</ref> | [[constraint programming]] |- ! FILTER | nonlinear programming |- ! [[FortMP]] | linear, quadratic and mixed integer programming |- ! [[Gecode]]<ref>{{cite web|url=https://github.com/ampl/mp/tree/master/solvers/gecode|title=mp/solvers/gecode at master Β· ampl/mp Β· GitHub|work=GitHub|access-date=11 August 2015}}</ref> | constraint programming |- ! [[IPOPT]] | nonlinear programming |- ! [[JaCoP (solver)|JaCoP]]<ref>{{cite web|url=https://github.com/ampl/mp/tree/master/solvers/jacop|title=mp/solvers/jacop at master Β· ampl/mp Β· GitHub|work=GitHub|access-date=11 August 2015}}</ref> | constraint programming |- ! LGO<ref>{{cite web|url=http://ampl.com/products/solvers/solvers-we-sell/lgo/|title=LGO - AMPL|access-date=11 August 2015}}</ref> | global and local nonlinear optimization |- ! lp_solve<ref>{{cite web|url=http://www.ampl.com/SOLVERS/GUIDE.lpsolve.html|title=Using lpsolve from AMPL|access-date=11 August 2015}}</ref> | linear and mixed integer programming |- ! [[MINOS (optimization software)|MINOS]] | linear and nonlinear programming |- ! [[MINTO]] | mixed integer programming |- ! [[MOSEK]] | linear, mixed integer linear, quadratic, mixed integer quadratic, [[Quadratically constrained quadratic program|quadratically constrained]], conic and convex nonlinear programming |- ! [[Octeract Engine]] | All types of optimisation problems without differential or integral terms, including discontinuous problems with {{math|min}} and {{math|max}} elementary functions. |- ! [[SCIP (optimization software)|SCIP]] | mixed integer programming |- ! [[SNOPT]] | nonlinear programming |- ! Sulum<ref>{{cite web|url=https://github.com/ampl/mp/tree/master/solvers/sulum|title=mp/solvers/sulum at master Β· ampl/mp Β· GitHub|work=GitHub|access-date=11 August 2015}}</ref> | linear and mixed integer programming |- ! [[WORHP]] | nonlinear programming |- ! XA | linear and mixed integer programming |- ! [[FICO Xpress|Xpress]] | linear and convex [[Quadratically constrained quadratic program|quadratic optimization]] and their mixed integer counterparts |} ==See also== * [[sol (format)]] * [[GNU MathProg]] (previously known as GMPL) is a subset of AMPL supported by the [[GNU Linear Programming Kit]]<ref>{{cite web|url=https://www.gnu.org/software/glpk/|title=GLPK official site|access-date=17 September 2020}}</ref> ==References== {{Reflist|30em}} ==External links== * {{Official website|www.ampl.com}} * [https://web.archive.org/web/20061127232734/http://iems.northwestern.edu/~4er/ Prof. Fourer's home page] at [[Northwestern University]] {{Mathematical optimization software}} {{DEFAULTSORT:Ampl}} [[Category:1990 software]] [[Category:Computer algebra systems]] [[Category:Mathematical modeling]] [[Category:Mathematical optimization software]] [[Category:Numerical programming languages]] [[Category:Scripting languages]] [[Category:Text-oriented programming languages]] [[Category:Programming languages created in 1985]] [[Category:Proprietary cross-platform software]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Math
(
edit
)
Template:Mathematical optimization software
(
edit
)
Template:Official website
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Use dmy dates
(
edit
)