MPS FILE ERROR

52 views
Skip to first unread message

Thiago Nogueira

unread,
Mar 29, 2012, 9:49:20 PM3/29/12
to am...@googlegroups.com
Hi all,

I  am using the MPS file (generated from AMPL) that gets a significantly different optimal value from what I get solve the .mod problem. What I do?

Thaks for Attention,

Thiago



Paul

unread,
Mar 30, 2012, 11:56:35 AM3/30/12
to am...@googlegroups.com
I'm assuming here that the solver you use on the MPS file is the same one used by AMPL when you solve the model in AMPL.

One possibility is that your model has numerical stability issues.  When you use the MPS file, you convert coefficient values from binary to ASCII (truncating along the way) and back to binary.  That can alter the problem slightly, and if the model is numerically unstable, small variations in the coefficients can produce large variations in the results. 

Another possibility is that you are running the MPS version with different parameter settings than those in force when you run the problem through AMPL.  Convergence and tolerance parameters would be the most important to check. 

A third possibility is that the AMPL presolver is somehow having an impact.  By default, when you solve the problem through AMPL, it presolves before passing the model to the solver.  When you dump the MPS file, it does not presolve.  To check this, you can turn off the AMPL presolver and see if you still get a different solution that way.

Paul

Robert Fourer

unread,
Mar 30, 2012, 5:27:06 PM3/30/12
to am...@googlegroups.com

MPS files (at least the standard ones that AMPL generates) do not specify a direction of optimization, so it is always a good idea to check that you are not, say, maximizing in AMPL but minimizing outside of AMPL.

 

Also MPS files do not accommodate a constant in the objective function.  If you give an AMPL command of the form "solexpand <obj-name>;" and it shows something like "... + 3.3327" at the end, then there is a constant term in the problem sent to the solver, but this constant will not show up in the MPS file.

 

MPS files allow 12 characters for numerical values, so fractional coefficients will be rounded somewhat.  Often this results in only minor differences in the solution, but much greater differences are possible.

 

Bob Fourer

4...@ampl.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of Thiago Nogueira
Sent: Thursday, March 29, 2012 8:49 PM
To: am...@googlegroups.com
Subject: [AMPL 5635] MPS FILE ERROR

Thiago Nogueira

unread,
Mar 31, 2012, 1:31:18 PM3/31/12
to am...@googlegroups.com
Robert,

I used the solexpand. My FO is FO +Constant. Is there a way to get the Constant value in some param of AMPL?

thanks,

Thiago

2012/3/30 Robert Fourer <4...@ampl.com>
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to am...@googlegroups.com.
To unsubscribe from this group, send email to ampl+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ampl?hl=en.

Robert Fourer

unread,
Apr 3, 2012, 2:16:52 PM4/3/12
to am...@googlegroups.com

There isn't any convenient way to arrange for an AMPL parameter that will automatically equal the constant term in the objective that is sent to the solver.

 

With option presolve set to 0, you can generally use your knowledge of the objective to deduce an AMPL expression for the constant term, which you can use to adjust the objective.  But when presolve is turned on, it may find many variables that can be fixed prior to optimization, and fixing those variables may lead to a constant term whose value is hard to predict.

 

Bob Fourer

4...@ampl.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of Thiago Nogueira
Sent: Saturday, March 31, 2012 12:31 PM
To: am...@googlegroups.com
Subject: Re: [AMPL 5639] MPS FILE ERROR

 

Robert,

 

I used the solexpand. My FO is FO +Constant. Is there a way to get the Constant value in some param of AMPL?

 

thanks,

 

Thiago

 

.

Reply all
Reply to author
Forward
0 new messages