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.
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.