Starting the Math Software

Modes of Use

Before you use the math software, you should be aware of the different ways of using it.  On a desktop computer, it is only possible to use it in a fully interactive setting.  On UNIX, it may be preferable to use it in a different way.
There are three ways of running most software under UNIX:
  • Interactive mode.  You type in input directly, and output is displayed on your screen.  The interface may be a full window with pretty graphics, or it could be a terminal-based system.
  • Non-interactive mode.  Over a terminal, you can put all of your input into one file, then have the software process the commands and save the output to a file.  You can be doing other tasks while it runs.  Graphics output is limited to saving plots as images.
  • Batch mode.  You create an input file as for non-interactive mode, but you also create a "job script", which tells the system software to execute the math software (with your input) at a later time.  Jobs are queued, so you may have to wait a while for your results.  Batch jobs allow you access to more memory and processor power than the other modes, so it is best for extensive number crunching.
At IU, most batch jobs should be done on the SP system.  We'll discuss batch mode later, in the Batch Processing Section.  In addition, we'll discuss only terminal-based modes here, and we'll cover interactive graphics later, in the X Windows Section.

Maple

Interactive Mode
To start maple, just type maple at the UNIX prompt.  Maple will start, and you will see the familiar ">" Maple prompt.
To leave Maple, type quit; at the Maple prompt.
All of the standard packages are available, and you should find that Maple behaves just like it does on your desktop.

Non-interactive Mode
You can load plain text files with maple commands (one per line, ending in a semicolon - the usual).  Be sure the last command is quit;. Then type at the UNIX prompt:
    maple filename > results.txt
This will return you to the UNIX prompt while Maple executes the commands in filename and saves the results in results.txt .
To learn more about Maple's file input and output abilities, run Maple interactively and type the following:
    ?writeto
    ?echo
    ?save
    ?read
    ?interface
 

Matlab

Interactive Mode
To start Matlab, type matlab.  Matlab will start, and you will see the familiar ">>" prompt.
Type quit at the Matlab prompt to exit.
IUB has licenses to most of the Matlab toolboxes.  Use them as you would at your desktop.  Be forewarned that most graphics functions simply won't do anything if your terminal doesn't support graphics.  Matlab always looks for m-files in the directory from which it started (as well as the standard library locations).

Non-interactive Mode
Put all of your commands in a plain text file as if you had typed them into Matlab. Be sure the last command is quit.  Then type
    matlab < filename > results.txt &
This runs Matlab, executes the commands in filename and saves the results to results.txt , while you are returned to the UNIX prompt.
To load and save Matlab variables, type the following at the Matlab prompt:
    help load
    help save
    help diary
 

Mathematica

Interactive Mode
To start Mathematica, type math.  You should see the familiar Mathematica prompt, "In[1]=".  To exit Mathematica, type Quit.

This actually starts the Mathematica Kernel and lets you type directly into it.  There is no terminal-based front-end, since the kernel itself can function in this manner.  However, you will have primitive graphics or plotting capabilities (but you will not have the ability to export to an image file). 

Non-interactive Mode
Save all your commands, one per line, in a file.  Be sure the last command is Quit.  Then type
    math < filename > results.txt &
This runs Mathematica, executes the commands in filename and saves the results to results.txt , while you are returned to the UNIX prompt.

For more information on saving and loading work, type at the Mathematica prompt:
    ?Save
    ?>>
    ?<<


Previous: UNIX - the least you need to know
Next: Using Graphics over the Network