Result does not similar with display command

8 views
Skip to first unread message

haizu...@gmail.com

unread,
Nov 13, 2017, 11:15:33 PM11/13/17
to AMPL Modeling Language
Hi everyone, 

I have a problem with my result. after running my model, the result comes out with 
optimal; objective 5880502608000

however, when I use display command, it gives me different result: 

ampl: display wealth;
ampl: 5880500000000

I don't know which data should be used to put in my report and I don't know why it happens. Is it because I modify the model using "fix" and "let" command. 

Regards, 
Wan 

Robert Fourer

unread,
Nov 15, 2017, 12:46:12 AM11/15/17
to am...@googlegroups.com
Solvers display the optimal objective value with a default of 10 significant digits, but the AMPL "display" command shows by default only 6 significant digits. Thus when you see 5880502608000 and 5880500000000, you are actually seeing the same value, but rounded to different numbers of significant digits. In the solver message, to see the objective value in the maximum number of significant digits possible on the computer, set

option objective_precision 0;

before solving. In the output "display", to see the objective value in the maximum number of significant digits possible on the computer, set

option display_precision 0;

before giving the command "display wealth;".

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages