Mathematica Notes


 

 

Notes on Using Mathematica in Physics Networked Computing Environment

Information about Mathematica

Mathematica is a symbolic mathematical analysis program from Wolfram Research.

The University of Maryland has a site license with Wolfram for Mathematica.

How to Run Mathematica

Mathematica generally consists of two programs, a front-end which provides the user interface, and a back-end or kernel which does the actual calculations and symbolic manipulations. Furthermore, the latest version of Mathematica (3.0) started using their own X fonts, which complicates the matter for users sitting at an X-terminal and running Mathematica on a remote machine. As a result, there may be several options as to how you can run Mathematica from a given machine, and the exact instructions vary depending on these options as well as the machine you are running and the machine you are sitting at. We have tried to enumerate the more common situations here; if you are having difficulty with these instructions or your situation is not described, please submit a physhelp request.

Some common situations are:


Running Mathematica 2.2

Mathematica 2.2 is available on many of the machines in the department, the most notable exception being the PCs in the OWL lab which only run 3.0 and higher. Note that PCS is encouraging users to upgrade to Mathematica 3.0 as we are trying to phase out version 2.2. Because of the relatively low use of version 2.2 and the incompatiblility of licenses for 2.2 and 3.0, PCS is not automatically renewing 2.2 licenses and passwords--- if you receive an error regarding a 2.2 license please submit a physhelp and we will look into acquiring a password for you.

Mathematica 2.2 has a command line interface, which should run over any kind of remote connection as well as at the console, and a somewhat friendlier notebook interface, which can be run from PCs, at Unix consoles, or over an X connection by simply setting the DISPLAY environment variable appropriately.

Running Mathematica 2.2 in Faculty PNCE-PC environment

Under Mathematical Applications in PNCE Physics Menu, there exists a Mathematica 2.2 submenu. Selecting the icon "Front End" will bring up the notebook interface, or you can select "Kernel" to bring up the command line interface.

Running Mathematica 2.2 on Unix systems

The following table lists the commands necessary to start the command line or notebook interface to Mathematica 2.2 on the departmentally maintained Unix clusters. The notebook version will only run if you are sitting at a machine's X console or at an X terminal of some sort--- for information on setting X display for remote execution of X applications.
NSCP-I cluster PNCE-Unix/NSCP-II/Glue
Command line mode math.2.2 tap mathematica
math
Notebook mode mathematica.2.2 tap mathematica
mathematica

Running Mathematica 3.0 on local machine

The information in this section is to instruct users on how to start up Mathematica 3.0 on the machine they are sitting in front of. Because of changes in the way in which Mathematica handles fonts with version 3.0, if you are using the notebook interface there may be complications in situations in which you want some or all of Mathematica 3.0 running on a machine other than the one you are sitting at. These are discussed in subsequent sections. In particular, note that this section does not directly apply to running Mathematica 3.0 on former quark machines that have been converted to X terminals.

As with version 2.2, Mathematica 3.0 has both a command line interface and a (much improved over 2.2) notebook interface. The command line interface should be able to be run remotely via telnet, rsh , etc without problems, but there are problems with running the notebook version remotely over X.

Running Mathematica 3.0 locally on PC in PNCE-PC faculty environment

Under Mathematical Applications in PNCE Physics Menu, select submenu Mathematica 3.0, and click on either Front End or Kernel to get notebook and command line interfaces, respectively. The Mathematica Front (latest version) in Mathematical Applications Menu should also start the 3.0 notebook interface.

Note that if you haven't run Mathematica 3.0 on that mahcine before, or if you are getting strange error messages when trying to start it, please try running the icon "Set up Mathematica 3.0 to run off server" and reboot before contacting PCS.

Running Mathematica 3.0 locally on PC in Physics OWL

Click on the Mathematica icon in the Novell Application Launcher Menu.

Running Mathematica 3.0 on Unix systems

The following table lists the commands necessary to start the command line or notebook interface to Mathematica 3.0 on the departmentally maintained Unix clusters. The notebook version will only run if you are sitting at a machine's X console--- because of problems with Mathematica's fonts and X complications arise if you try to set the DISPLAY environment variable to display application on a machine other than one running Mathematica. This is addressed in subsequent sections.
NSCP-I cluster PNCE-Unix/NSCP-II/Glue
Command line mode math tap mathematica3.0
math
Notebook mode mathematica tap mathematica3.0
mathematica

Running Mathematica 3.0 across machines

Although the easiest situation is to run all of Mathematica on the machine you are seated at, there are common situations when this is not the optimal way to proceed, e.g. when you wish to make use of the faster CPU of an Unix machine which you are not able to sit at. This includes the case of former Quark workstations converted into X terminals.

There are basically three means of running Mathematica across machines. The first is to use the command line interface to Mathematica over a telnet or rsh connection. This is rather simple to do; just establish a telnet or rsh connection to the Unix machine you wish to run on, and start the command line version of Mathematica as if you were running it locally. Although simple, this is limited to the command line interface and is generally not acceptable.

A second approach uses the fact that Mathematica runs as an X application on Unix machines, and X has built in networking and remote display features. This works rather simply in previous versions of Mathematica (prior to 3.0), but because the recent versions require a special font from Wolfram be installed on the machine displaying the application, the procedure is somewhat more involved, and depends on the machine you are sitting at (which is displaying the application) rather than the machine which is actually running Mathematica. Because there are many varieties of machines sitting on peoples' desks in the Physics department, and PCS does not have the responsibility or manpower to support many of these, we cannot cover all the intracacies of all the combinations possible. Instead, we list some general instructions on what needs to be done, with specific instructions for some of the platforms PCS does support.

General instructions on running Mathematica 3.0 on a remote X terminal

The general procedure for running Mathematica on a remote X terminal is as follows:
  1. Start the X server daemon on your local machine, if necessary.
  2. Find the Mathematica fonts on the Unix machine you wish to run Mathematica on, and copy them to the local machine if not already available to it. Note that it is your responsibility to ensure compliance with any copyright laws with regard to copying Mathematica fonts. The current (1998) site license agreement between the University of Mayland and Wolfram is such that this is not a problem for university-owned machines on the College Park campus. See following steps for locations of fonts on various systems.
  3. Telnet to the Unix machine you wish to run Mathematica on, and set the DISPLAY environmental variable to the machine you are sitting at.
  4. Use the xset command on the remote Unix system to add to the X server's font path the path to the copied Mathematica fonts on the local system; e.g.: xset +fp local_path_to_math_fonts
  5. Run Mathematica on the remote machine as per the instructions for running it locally. There may be a couple of xset errors generated as Mathematica fails in its attempt to add the remote system's path to the Mathematica fonts, but these can be safely ignored. Mathematica should start up and find the fonts it needs on the local system.

Note that if the machine you are sitting at is also an Unix machine and has Mathematica 3.0 installed, step 2 is already done (by virtue of Mathematica 3.0 being installed), and step 4 can be done by starting the local version of Mathematica 3.0 before running the remote version.

Platform specific instructions for running Mathematica on a remote X terminal

PCS has tried to perform some of these tasks and even to provide some scripts to make this procedure more convenient. Please find in the table below the instructions corresponding to the type of machine you are sitting at (row) and are running on (column) for the name of the script to run if present. Some combinations are not currently possible, some are possible but do not have scripts available---for the latter use the listed path to mathematica fonts and follow steps 4 and 5 in general instructions.
Local Machine Remote Machine
Type Font Directory * PNCE-Unix/NSCP-II/Glue NSCP-I
PNCE-Unix/
NSCP-II/
Glue
/:/software/mathematica/current NO script No script
NSCP-I /software/mathematica No script No script
PNCE-PC
Faculty env
w:\math3.0\xfonts Need ASAP Need ASAP
Ultrix X-term
(ex-quark)
Need ASAP Need ASAP Need ASAP
* NOTEThe required X fonts are found in SystemFiles/Fonts/Type1 and SystemFiles/Fonts/X beneath the listed directory.

If you are running Mathematica on (the machine whose CPU is doing the work):