It is possible to solve AMPL problems with Ipopt directly from the command line. However, this requires a file in format .nl produced by ampl. If you have a model and data loaded in Ampl, you can create the corresponding .nl file with name, say, myprob.nl by using the Ampl command:
write gmyprob
There is a small .nl file available in the Ipopt distribution. It is located at Ipopt/test/mytoy.nl. We use this file in the remainder of this section. We assume that the file mytoy.nl is in the current directory and that the command ipopt is a shortcut for running the ipopt binary available in the bin directory of the installation of Ipopt.
We list below commands to perform basic tasks from the Linux prompt.
ipopt mytoy
ipopt -=
ipopt mytoy 'print_options_documentation yes'
ipopt mytoy 'max_iter 2 print_level 4'
If many options are to be set, they can be collected in a file ipopt.opt that is automatically read by Ipopt if present in the current directory, see Section 5.
Andreas Waechter 2010-12-22