DONLP2 with AMPL

This directory contains the DONLP2 executable for ********************* * Intel/Linux 32bit * ********************* This executable works together with the respective AMPL student binary "sampl" which is included for convenience here. In this the maximum number of variables and constraints is limited to 300. This means that the total number of bounds and general constraints is <= 300 for DONLP2.
 
  • donlp2.gz is the gzip compressed binary of donlp2 with the ampl interface in the student's version.
  • sampl.gz is the students ampl gzip compressed binary.
  • donlp2_options describes the options for the solver, see also below.
  • models is a subdirectory with many examples coded in ampl.
  • test is a directory with a standard test for donlp2 with results.
  • results is the directory with the results from the examples in the models directory.
  • amplbook chapter1 is chapter one from the AMPL textbook showing how to work with ampl respectively with sampl.
The directory
models contains AMPL models for some well known nonlinear optimization problems. They may be used as examples how to code a model in AMPL.

To use sampl with donlp2 one may proceed in two ways:
Either one writes the sequence of ampl-commands in a file file.mod and invokes
sampl [options] file.mod
with prior exporting of the environment variable
export OPTIONS_IN=filename ; (in the ksh)
or
setenv options donlp2_options "<....your desired settings>" ( in csh)
or one invokes
sampl -
and then types commands interactively.
for example this:
model {filename with .mod extension: the ampl coded problem} ;
option solver donlp2;
option donlp2_options 'tau0=1.e4 silent=0 del0=1.0 outlev=1 wantsol=7';
solve;
display {AMPL variables you want to see, if not in the output} ;
quit;
don't forget the semicolon !!!
In order to use DONLP2 with sampl the options to be set are
option solver donlp2;
option donlp2_options ".....your desired settings";
donlp2_options are the following:
maxfwd max vars in fwd automatic differentiation of common exprs (default 5)
tau0 sum of constraint violations allowed during iteration (default 1.d0)
del0 initially an inequality g is binding if g/max{1,||grad g||}<=del0 (defa ult 1.d0)
epsx required precision in primal solution (default 0.00001)
maxit iteration limit (<= 4000)
nreset allowed number of successive steps with insignificant changes in x or f
intakt write iteration protocol also to stdout =0 off (default) =1 on
silent write results and messages on special events to file *.pro and *.mes (d efault =1: no)
outlev composed from 4 bits:
bit 1 ="0" means no output , "1" one line per step,
bit 2 ="1" short iteration protocol
bit 3 ="1" detailed iteration protocol (primal and dual sol's, stepsize s etc.)
bit 4 ="1" print also gradients and hessian estimate
prou unit number for output protocol
meu unit number for special events messages protocol
wantsol solution report without -AMPL: 4 bit integer namely sum of
1 ==> write .sol file
2 ==> print primal variable values
4 ==> print dual variable values
8 ==> do not print solution message


For example, one may set
option donlp2_options "tau0=0.1 del0=0.1 silent=0 outlev=4 wantsol=7";

Possible solve_result_num values for donlp2:
0 Success! KKT conditions satisfied
100 nearly feasible with small directional deriv.
101 relaxed KKT conditions satisfied: singular point
110 small QP correction: nearly feasible and singular
200 tiny correction from QP at infeasible point
400 reached maxit steps
500 N too large (the Fortran donlp2 routines must be recompiled)
501 unknown termination reason
510 cannot evaluate constraints
511 cannot evaluate objective
520 dual extended QP failure: singular working set
521 infeasible QP (theoretically impossible)
522 no descent in QP (theoretically impossible)
523 tiny QP step from infeasible point
524 nondescent direction from QP
525 no acceptable step size
527 tiny step
528 more than NRESET small primal corrections
529 max(N,10) small penalty function differences
540 slow primal progress: singular or ill-conditioned problem?

Scaling (new 19980606): in an AMPL session, if you declare
option suffix vsclog10;
then variable.vsclog10 (default 0) is passed to donlp2, which scales the variable internally by 10^-variable.vsclog10. (x is the ampl name for the variable) Thus if variables x and y are distances in meters that have typical values of a few centimeters and a few kilometers, respectively, then
let x.vsclog10 := -2;
let y.vsclog10 := 3;
would probably be appropriate, since it would give the internal variables typical values around 1.

----------------------------------
Test example: As an example the file weapon.mod from the models directory was modified to the one stored in the directory test and the commands
sampl
model weapon.mod
were executed. As a result the ouput in weapon.out was printed to the screen and the two files XtmpXat1.MES XtmpXat1.PRO were generated.
This is contained in test ---------------------------------- The entire set of problems in the directory models was run with the exported option of intakt=1. The output is in the directory results .

The sampl command:


Usage: sampl [options] [file [file...]]

No file arguments means read from standard input, as does - by itself. that is you invoke sampl and then type your commands interactively

Options:
  • -Cn {0 = suppress Cautions; 1 = default; 2 = treat as error;}*
  • -L {fully eliminate linear definitional constraints and var = decls}*
  • -P {skip presolve -- same as "option presolve 0;" }
  • -S {substitute out definitional constraints (var = expression)}*
  • -T {show genmod times for each item}*
  • -enn {exit (if nn > 0) or abort command at |nn|-th error; 0 = no exit}*
  • -f {do not treat unavailable functions of constant args as variable}*
  • -ooutopt {specify -o? for details}*
  • -s[seed] {seed for random numbers; -s means current time}*
  • -t {show times}*
  • -v {show version; -v? shows other -v options}
  • -?? {show debug options}
* Equivalent option settings:
  • -Cn option Cautions n;
  • -L option linelim 1;
  • -P option presolve 0;
  • -S option substout 1;
  • -T option gentimes 1;
  • -enn option eexit nn;
  • -f option funcwarn 1;
  • -ofstub option outopt fstub;
  • -s option randseed '';
  • -snn option randseed nn;
  • -t option times 1;
-v options:
  • -v? {show -v options}
  • -v2 {merge stderr with stdout (subprocesses as well as ampl)}
  • -vd[nnn] {debug level nnn (default 3)}
  • -ve {write ampl error messages on stdout rather than stderr}
  • -vf {show available user-defined functions}
  • -vp {write prompts on stdout rather than stderr}
  • -vq {quit now}
  • -vr {show builtin random functions}
  • -vs {show statistics}
  • -vv {show version}


sampl -o?
  • -o0 {no files written}
  • -o! {no genmod and no output; not for use with write command}
  • -obstub {generic binary format -- line -og, but binary
  • after the first 10 lines}
  • -ogstub {generic ASCII format: no MPS file, no .spc file,
  • nonlinearities in .nl file, otherwise like -omstub}
  • -om {MPS format to stdout, no other files written}
  • -omstub {MPS format to stub.mps,
  • names to stub.row & stub.col,
  • fixed vars to stub.fix,
  • unused vars to stub.unv
  • slack constraints to stub.slc
  • objective adjustments to stub.adj,
  • MINOS SPECS to stub.spc}
  • -onstub {MPS format to , otherwise like -omstub}


debug options:
  • -# {precede -MDG output with #}
  • -D {print data read in}
  • -F {force generation of := sets}
  • -G {print generated data}
  • -M {print model}
  • -O {print compiled model}
  • -b {block I/O mode}
  • -pnn {use nn decimal places in converting numbers to symbols}
  • -q {always quote output literals (under -D, -G, -M, -O)}
  • -r {restricted mode}
  • -z {lazy mode -- treat := as default (evaluate only as needed); same as "option lazy 1;" }

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

A M P L

AMPL is a language and system for formulating, solving, and helping understand mathematical programming problems (of minimizing or maximizing a function subject to constraints). The AMPL book explains AMPL in much more detail and provides many examples: It is available in the departments library for more information see
AMPL The AMPL company.