Difference: PrintingInAMPL (2 vs. 3)

Revision 32008-03-04 - MichaelOSullivan

Line: 1 to 1
 
META TOPICPARENT name="AMPLSyntax"
<-- Under Construction -->
Line: 9 to 9
 
  1. Printing Information
  2. Printing to a File
Changed:
<
<
How many decimal places?
>
>

How many decimal places?

 
Changed:
<
<
??? Up to here ??? When solving mathematical programming problems, the accuracy of your solutions should *never* be more than the accuracy of your data. You can set the precision that AMPL displays values via the {\tt display_precision} option. For example, if your inputs are specified to 4 significant digits, e.g., {\tt 0.013}, you can use

\begin{verbatim}

>
>
When solving mathematical programming problems, the accuracy of your solutions should never be more than the accuracy of your data. You can set the precision that AMPL displays values via the display_precision option. For example, if your inputs are specified to 4 significant digits, e.g., 0.013, you can use

 option display_precision 4;
Changed:
<
<
\end{verbatim}

>
>
 to get your solution values to the same number of significant digits.
Changed:
<
<

>
>
src="four_dp.jpg"
  Note that AMPL still keeps its numbers at full precision, so you need to be careful with your objective function values.
Changed:
<
<

>
>
src="five_dp.jpg"
 
Changed:
<
<
When we change the {\tt display_precision} to 5 significant digits, the displayed {\tt TotalCost} and the cost calculated by using the displayed {\tt Amount} values differ. If you are using rounded solution values, make sure to *check* the *objective value* before quoting your solution.
>
>
When we change the display_precision to 5 significant digits, the displayed TotalCost and the cost calculated by using the displayed Amount values differ. If you are using rounded solution values, make sure to check the objective value before quoting your solution.

??? Up to here ???

 

Displaying Information

You have already seen how to display a variable using the {\tt display} command. We can also display {a href="Expressioins in AMPL">AMPL expressions the same way, e.g., we might want to see how supply we are using in a transportation problem.
Line: 97 to 97
 \end{verbatim}

-- MichaelOSullivan - 02 Mar 2008 \ No newline at end of file

Added:
>
>
  • four_dp.jpg:
    four_dp.jpg

  • five_dp.jpg:
    five_dp.jpg

META FILEATTACHMENT attachment="four_dp.jpg" attr="h" comment="" date="1204604433" name="four_dp.jpg" path="four_dp.jpg" size="35091" stream="four_dp.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="five_dp.jpg" attr="h" comment="" date="1204604447" name="five_dp.jpg" path="five_dp.jpg" size="36558" stream="five_dp.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback