Next: Using Ipopt from the
Up: Interfacing your NLP to
Previous: Interfacing your NLP to
Contents
Using the AMPL solver executable is by far the easiest way to
solve a problem with IPOPT. The user must simply formulate the problem
in AMPL syntax, and solve the problem through the AMPL environment.
There are drawbacks, however. AMPL is a 3rd party package and, as
such, must be appropriately licensed (a free student version for
limited problem size is available from the AMPL website,
www.ampl.com). Furthermore, the AMPL environment may be prohibitive
for very large problems. Nevertheless, formulating the problem in AMPL
is straightforward and even for large problems, it is often used as a
prototyping tool before using one of the code interfaces.
This tutorial is not intended as a guide to formulating models in
AMPL. If you are not already familiar with AMPL, please consult
[1].
The problem presented in equations
(4)-(8) can be solved with IPOPT with
the AMPL model file given in Figure 1.
Figure 1:
AMPL model file hs071_ampl.mod
 |
The line, ``option solver ipopt;'' tells AMPL to use IPOPT as
the solver. The IPOPT executable (installed in
Section 2.3) must be in the PATH for AMPL to
find it. The remaining lines specify the problem in AMPL format. The
problem can now be solved by starting AMPL and loading the mod file:
$ ampl
> model hs071_ampl.mod;
.
.
.
The problem will be solved using IPOPT and the solution will be
displayed.
At this point, AMPL users may wish to skip the sections about
interfacing with code, but should read Section 5
concerning IPOPT options, and Section 6 which
explains the output displayed by IPOPT.
Subsections
Next: Using Ipopt from the
Up: Interfacing your NLP to
Previous: Interfacing your NLP to
Contents
Andreas Waechter
2008-08-26