read .nl file

513 views
Skip to first unread message

lianis101

unread,
Jan 12, 2015, 9:22:18 AM1/12/15
to gur...@googlegroups.com
Hi,

I have generated an .nl fiel, form ampl, corresponding to an instance of a problem I want to solve. I want to solve this instance using the standalone gurobi solver.
So far I get an error: Unknown file type for file vertical.nl.

Can the standalone gurobi solver read and of course solve .nl files generated form ampl?

Regards,
Liana

Renan Garcia

unread,
Jan 12, 2015, 9:41:43 AM1/12/15
to gur...@googlegroups.com
Gurobi cannot read the '.nl' file format, so you should export the model to a file format Gurobi does recognize. For example, you could add writeprob mymodel.mps to gurobi_options in order to export to an MPS file.

Renan

--

---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lianis101

unread,
Jan 12, 2015, 9:51:32 AM1/12/15
to gur...@googlegroups.com
Thanks for your reply.

My problem in an MINLP, therefore the mps format doesn't work.
As far as I understand only mps and nl file can be generated form ampl. Therefore my interest in running the .nl file form gurobi.

Regards,

Greg Glockner

unread,
Jan 12, 2015, 10:20:48 AM1/12/15
to gur...@googlegroups.com
Gurobi Optimizer does not solve general nonlinear programming problems (NLP). As for the .nl file format, that requires an AMPL solver.

Robert Fourer

unread,
Jan 12, 2015, 10:21:01 AM1/12/15
to gur...@googlegroups.com
For reading .nl files, you need to use gurobi_ampl -- the version of Gurobi that is compiled with the AMPL interface. Usually gurobi_ampl is run from within the AMPL program, but you can also run it standalone by giving a command like

gurobi_ampl yourfile.nl -AMPL

where "yourfile.nl" is replaced by the actual name of your .nl file. When the gurobi_ampl run is finished, it will write a file like "yourfile.sol" which you will need to read back into AMPL (using AMPL's "solution" command) to examine the solution.

If you received the Gurobi program files from Gurobi Optimization, then you may already have gurobi_ampl. If not, you can contact their support to get it.

Bob Fourer
4...@ampl.com

=======

Hur Butun

unread,
Nov 1, 2018, 5:24:05 AM11/1/18
to Gurobi Optimization
Hello,

Is it possible to add Gurobi options when running .nl files with gurobi_ampl? 

I tried the following:

gurobi_ampl myproblem.nl -AMPL --outlev=1

But it just displays an error message saying that outlev=1 is an unrecognised keyword. Could you please give me an example with multiple Gurobi options?

Thanks in advance,

Hur

Robert Fourer

unread,
Nov 1, 2018, 10:27:31 AM11/1/18
to gur...@googlegroups.com
Just write the options as outlev=1, etc. Append as many option
specifications as you like. For example:

gurobi_ampl myproblem.nl -AMPL outlev=1 nodelim=20000 mipgap=.0001

Bob Fourer
4...@ampl.com


Hur Butun

unread,
Nov 1, 2018, 2:35:34 PM11/1/18
to Gurobi Optimization
Thanks a lot Bob!

Best,

Hur
Reply all
Reply to author
Forward
0 new messages