Mathematica


Mathematica 3.0 is available in the public Mathematics Computer Lab (Macintosh version) and on private Project Vincent (X-Windows version).


Using Mathematica on a Project Vincent WorkStation

Please, contact to Jon Roden(jonroden@iastate.edu) to request access.


	Mathematica 3.0.2 now runs on a Math Department Alpha Station
(mercury.math.iastate.edu, alias "mercury"). 

	You have the choice of running Mathematica in a terminal window (this 
is the 'kernel') or in its own notebook window (called the 'front-end').

	NOTE 1: To use the programs described here--and even to see
the description you are now reading--you must have access to the "math
locker" where they reside.  You do this by typing the command 'add
math' at the vincent prompt every time you login.  When that gets to
be a drag, put the command into your .startup.tty file.  (You don't
have such a file?  Then enter the command

		% echo 'add math' > ~/.startup.tty

and your troubles will be over.)

	NOTE 2: To see graphical output from Mathematica's Plot, Show,
and related commands, you must first give mercury permission to display
graphics windows on your console.  In an xterm window on your machine
type

		% xhost +mercury

to grant this permission.  Mathematica can now display graphics in new
windows on your screen.  At the end of your Mathematica session, you
should--for security reasons--revoke this permission by entering the
command

		% xhost -mercury

in an xterm window for your machine (or just logout of your PV workstation).  
If you don't make any graphs during your session, you do not need to issue 
the 'xhost' command.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  Running the Mathematica kernel
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	To run the Department's copy of Mathematica you must (1) login
to mercury and (2) start Mathematica.  To login to mercury, type

		% telnet mercury

at the Vincent prompt in a terminal window. This will give you the 
familiar 'login:' prompt. Enter your login name and password. Next, 
type

		% math

at the Vincent prompt in the Mercury window.  This will start
the Mathematica kernal and display the prompt In[1]:=. 

	Enter mathematica commands just as on the Mac.  Algebraic
(i.e. non-graphical) answers will appear in the mathematica window.
Graphical output is displayed in new windows (did you remember to
enter the command 'xhost +mercury'?). Graphics windows can be 
resized, iconized and moved as usual.

	To end your session type the mathematica command 'Quit'.  Then
the Vincent command 'exit'. This will close the Mercury window.


Command editing and other remarks:
----------------------------------
	A moderately annoying aspect of the interface is the lack of
command editing.  A mis-typed command must be reentered in full.  To
get around this, try editing commands in a separate window and pasting
the corrected commands into Mathematica.

	Here is one method, that uses the usual X-windows
copy-and-paste facility. First start the xclipboard (type 'xclipboard
&' at the vincent prompt).  To correct a mis-typed command, put the
mouse pointer at the beginning of the command, hold down the left
button and drag the mouse to the end of the command.  Now move to the
clipboard window, and click the middle button.  This pastes the
highlighted text into the clipboard.  Edit the text in the clipboard
(fairly intuitive), and reverse the process.

	You can also create one or more commands using an editor (vi,
emacs, xedit), save them in a file, say /tmp/foo, and then read them
into mathematica with the command '<</tmp/foo'.  There is more
information on this in the short users guide that came with the
software.  Contact Cliff Bergman for a copy.

	If you set the mathematica variable $ClickKillsWindow to True,
then clicking in a graphics window will delete it.

	To enter a command that is too long for one line, enter an
incomplete expression on one line, and complete it on the next.  For
example:

	In[5]:=  2+3+
	6+7
	Out[5]=  18

	This works because Mathematica doesn't evaluate an expression
until it "makes sense".  Another trick is to open a parenthetical
expression on one line and close it on the next:

	In[7]:= (Expand[(x+y)^99]
	+x^5)

To create a session log, enter the mathematica command

	'<&ltUtilities/Record.m'.  

This will record each line of input in a file called math.record in your
current directory.  There is also a "log to file" switch in the main
xterm menu.  We haven't tried that yet.

	As with other UNIX tasks, Control-Z suspends a session and
Control-C interrupts a Mathematica calculation.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  Running the Mathematica front-end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	One-time setup: Assuming you are using another PV workstation, you 
must have the following line in your '.startup.x11' file:

	xset fp+ /math/mercury/mathematica/SystemFiles/Fonts/Type1

This ensures that Mathematica can find the fonts it needs.
After editing the file, type 'source .startup.x11' and 'xset fp rehash'.

	You can now run the Mathematica front-end in its own GUI window
by using the command (on mercury)

		% mathematica

(did you remember to enter the command 'xhost +mercury'?).

	The notebook interface is very similar to the one on the Mac.  
In particular, commands can be edited by using the mouse and keyboard, 
and many commands are available using menus and palettes.

	You can print the entire notebook or selected cells.  However, in 
the print dialog, you must enter 'mprint -Plw451' for the destination, 
not 'lpr'.


%%%%%%%%%%%%%%%%%
  Documentation
%%%%%%%%%%%%%%%%%

The relevant man pages are: 

	math        mcc         rasterps    ttyps       x11ps
	mathremote  psfix       tekps       vtps

in the "Math Stuff" section of the man pages.

	The main mathematica directory is located on mercury in
/local/mathematica.  The Packages subdirectory contains all of the
packages.  The file init.m is located in the StartUp subdirectory.
You may customize it for your own use and store it in either your
current directory or your home directory.


  Maintained by webmaster@math.iastate.edu
Last updated: October 8, 2002