How to generate .lp file?

1,510 views
Skip to first unread message

arm

unread,
Jun 10, 2007, 11:13:58 AM6/10/07
to am...@googlegroups.com

Hi all,

How do I tell AMPL to generate a .lp file?

Thanks,

Arm
--
View this message in context: http://www.nabble.com/How-to-generate-.lp-file--tf3897719.html#a11049444
Sent from the AMPL mailing list archive at Nabble.com.

Steven Harrod

unread,
Jun 11, 2007, 10:33:52 PM6/11/07
to am...@googlegroups.com
Call this instead of "solve".

write ("g/[directory path]/[filename]);

--
Steven Harrod
Lexington, KY
859 225 1572

arm

unread,
Jun 12, 2007, 8:01:22 PM6/12/07
to am...@googlegroups.com

Thank you, Steve.

Arm

--
View this message in context: http://www.nabble.com/How-to-generate-.lp-file--tf3897719.html#a11090011

Hans Mittelmann

unread,
Jun 13, 2007, 12:16:46 AM6/13/07
to AMPL Modeling Language
Which type of .lp file do you mean? The g or b write commands produce
a .nl file usable by AMPL itself. The CPLEX-LP or other LP formats
cannot be produced by AMPL. It does produce MPS files for MILPs with
the write m* command.

arm

unread,
Jun 13, 2007, 9:15:04 AM6/13/07
to am...@googlegroups.com

Hi Hans,

I mean a .lp file that CPLEX can use. How MPS files differ from .lp files? I
believe CPLEX accepts .mps files, right?

Thanks,

Arm

--
View this message in context: http://www.nabble.com/How-to-generate-.lp-file--tf3897719.html#a11099108

Hans Mittelmann

unread,
Jun 13, 2007, 10:46:17 AM6/13/07
to AMPL Modeling Language
As I had said, the CPLEX-LP format cannot be generated but the MPS
can. It is important that you give the file the suffix .mps. For
descriptions, see http://neos.mcs.anl.gov/neos/solvers/milp:scip/MPS.html

Hans Mittelmann

unread,
Jun 13, 2007, 10:48:26 AM6/13/07
to AMPL Modeling Language
By the way, it is very much preferable if you have the CPLEX library
to generate the cplexampl binary with the free interface at NETLIB.

Willian Rolando Alguera López

unread,
Jun 13, 2007, 11:53:06 AM6/13/07
to am...@googlegroups.com
Hi Arm

If You´re using AMPL/CPLEX can try using the next commands :

model filename.mod;
data filename.dat;
option cplex_options "writeprob= filename.lp";
solve;


filename is your optimization model.

William Alguera

-----Mensaje original-----
De: am...@googlegroups.com [mailto:am...@googlegroups.com]En nombre de arm
Enviado el: Domingo, 10 de Junio de 2007 09:14
Para: am...@googlegroups.com
Asunto: [AMPL 1248] How to generate .lp file?

Hans Mittelmann

unread,
Jun 13, 2007, 1:25:28 PM6/13/07
to AMPL Modeling Language
Sorry. What you suggests requires that he has already the cplexampl
binary but then he can feed the model to it directly and there is no
need to generate another file to feed it to CPLEX.


On Jun 13, 8:53 am, Willian Rolando Alguera López <w...@ut.com.sv>
wrote:

Arm

unread,
Jun 22, 2007, 8:53:30 AM6/22/07
to AMPL Modeling Language
Thanks so much for your suggestion.

Arm

On Jun 13, 11:53 am, Willian Rolando Alguera López <w...@ut.com.sv>
wrote:

Reply all
Reply to author
Forward
0 new messages