Difference: AMPLProcess (3 vs. 4)

Revision 42008-02-27 - MichaelOSullivan

Line: 1 to 1
 
META TOPICPARENT name="AMPLGuide"

The AMPL Process

Line: 114 to 114
  src="dynamic_error.jpg"
Changed:
<
<
??? Up to here??? The previous example also showed how to use both the model and data environments in the same script file. Furthermore, rather than using {\tt model;} to enter the model environment (and leave the data environment), it jumps from the data environment to the model environment by using a command that is not valid in the data environment (the {\tt display} command).

Notes on AMPL Files<br />

Editing AMPL files


The easiest way to edit AMPL files is using a text editor such as Wordpad. To open Wordpad go to the start menu, select Programs, then Accessories and finally Wordpad.




When you have finished editing, save the file in the appropriate directory. Be sure to save them as a basic text file NOT in Rich Text Format.



Running AMPL files


Once you have finished editing your AMPL files, you can run them by

  1. Either starting a command line application or Starting AMPL;
  2. Typing AMPL commands, e.g.,
    \begin{verbatim}
    model .mod;
    \end{verbatim}
    \begin{verbatim}
    data .dat;
    \end{verbatim}
    \begin{verbatim}
    include .run;
    \end{verbatim}
>
>
The previous example also showed how to use both the model and data environments in the same script file. Furthermore, rather than using model; to enter the model environment (and leave the data environment), it jumps from the data environment to the model environment by using a command that is not valid in the data environment (the display command).

Return to top

Notes on AMPL Files

Editing AMPL files in Windows

The easiest way to edit AMPL files is using a text editor such as Wordpad. To open Wordpad go to the start menu, select Programs, then Accessories and finally Wordpad

src="run_wordpad.jpg"

When you have finished editing, save the file in the appropriate directory. Be sure to save your file as a basic text file *NOT* in Rich Text Format.

src="save_ampl.jpg"

Running AMPL files

Once you have finished editing your AMPL files, you can run them by

  1. Either starting a command line application or double-clicking on =setup_ampl.bat= (if you are at home);
  2. Navigating to the directory where you saved the files;
  3. Starting AMPL
  4. Typing AMPL commands, e.g., model <modelname>.mod;, data <dataname>.dat;, =include <runname>.run;

Return to top

  -- MichaelOSullivan - 25 Feb 2008 \ No newline at end of file
Added:
>
>
  • ampl.jpg:
    ampl.jpg

  • ampl_examples.jpg:
    ampl_examples.jpg

  • model_include.jpg:
    model_include.jpg

  • model_file.jpg:
    model_file.jpg

  • model_data.jpg:
    model_data.jpg

  • data_include.jpg:
    data_include.jpg

  • data_file.jpg:
    data_file.jpg

  • script_file.jpg:
    script_file.jpg

  • dynamic_error.jpg:
    dynamic_error.jpg

  • run_wordpad.jpg:
    run_wordpad.jpg

  • save_ampl.jpg:
    save_ampl.jpg

  • run_wordpad.jpg:
    run_wordpad.jpg

  • ampl.jpg:
    ampl.jpg

META FILEATTACHMENT attachment="ampl.jpg" attr="h" comment="" date="1204098473" name="ampl.jpg" path="ampl.jpg" size="21033" stream="ampl.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="ampl_examples.jpg" attr="h" comment="" date="1204098502" name="ampl_examples.jpg" path="ampl_examples.jpg" size="21186" stream="ampl_examples.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="model_include.jpg" attr="h" comment="" date="1204098531" name="model_include.jpg" path="model_include.jpg" size="13692" stream="model_include.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="model_file.jpg" attr="h" comment="" date="1204098552" name="model_file.jpg" path="model_file.jpg" size="11158" stream="model_file.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="model_data.jpg" attr="h" comment="" date="1204098578" name="model_data.jpg" path="model_data.jpg" size="11487" stream="model_data.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="data_include.jpg" attr="h" comment="" date="1204098599" name="data_include.jpg" path="data_include.jpg" size="12601" stream="data_include.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="data_file.jpg" attr="h" comment="" date="1204098620" name="data_file.jpg" path="data_file.jpg" size="12586" stream="data_file.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="script_file.jpg" attr="h" comment="" date="1204098649" name="script_file.jpg" path="script_file.jpg" size="22339" stream="script_file.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="dynamic_error.jpg" attr="h" comment="" date="1204098924" name="dynamic_error.jpg" path="dynamic_error.jpg" size="20744" stream="dynamic_error.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="run_wordpad.jpg" attr="h" comment="" date="1204098970" name="run_wordpad.jpg" path="run_wordpad.jpg" size="89746" stream="run_wordpad.jpg" tmpFilename="" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="save_ampl.jpg" attr="h" comment="" date="1204098999" name="save_ampl.jpg" path="save_ampl.jpg" size="30412" stream="save_ampl.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