[Coin-ipopt] Is there any free AMPL parser can work with IPOPT ?

Dominique Orban Dominique.Orban at polymtl.ca
Thu Aug 4 09:53:35 EDT 2005


Hoxide Ma wrote:
> I'm newbie to IPOPT. IPOPT is great. It can work with
> AMPL  as a solver. I had try it with AMPL Student
> Version , but,Is there any free AMPL parser? 

No, there doesn't seem to be any. There is a full version of AMPL that
you can use for free by visiting http://neos.mcs.anl.gov. You can send
your problems via e-mail, http or tcp/ip, select an available solver and
the results of the solve will be returned to you.

> GNU MathProg Language maybe a "can work" Parser , but
> just for linear programming. 

Indeed, it only understands linear programming.

> If there is no such parser, why not write a free one?

Tell us when you're ready.

> Another question is , is there any document described
> the NL(nonlinear) format used in AMPL?

No that I know of. The nl files contains info on the problem, data for
the linear parts of all expressions and the expression tree of each
nonlinear expression appearing in the model. Using the very simple model

    var x {1..3};
    minimize objective:
	x[1]^2 + 2*x[2]^4 - sin( x[3] );

    let {i in 1..3} x[i] := 1;

and the ampl commands

    model simplemod.mod;
    data simplemod.dat;
    option nl_comments 1;
    write gsimplemod;

you will see the following in the nl file:

O0 0    #objective

	(this defines the first objective: it has number 0)

o54     #sumlist

	(operator #54 is a sum and this one has 3 terms)

o5      #^      (power operator)
v0      #x[1]   (variable number 0 is our x[1])
n2              (raised to the power 2)
o2      #*      (second term of the sum is 2*x[2]^2
o5      #^
v1      #x[2]
o16     #-      (third term is -sin(x[3])
o41     #sin
v2      #x[3]

You basically write those trees in so-called reverse Polish notation. A
series of tools is available to read nl files. Check the AMPL Library at
  http://netlib.bell-labs.com/netlib/ampl/ (download solvers.tar). There
is a "manual" at http://www.ampl.com/REFS/HOOKING/index.html


More information about the Coin-ipopt mailing list