Mathematica is a commercial symbolic algebra system which allows computations in many fields of mathematics and engineering. Packages can be used to extend the Mathematica language in areas where the basic language is weak.
UMBC appears to have a site license for Mathematica (OIT pages [1] [2]). As a result Mathematica is available in computer labs, on remotely accessible servers and for use on home machines by faculty, staff and students.
Mathematica is also available on UMBC servers which are accessible across the internet. Any UMBC employee or student has access using the account name and password they normally use for UMBC e-mail.
@umbc.edu email account you have access to Mathematica on the
server gl.umbc.edu. Details of logging into this server are
here. Once you have logged in you can run
Mathematica by typing the command math followed by pressing the
return key. (If you have set up an X-Windows (remote graphics) display the
appropriate version of Mathematica is run with the command mathematica.)http://my.umbc.edu, where
there should be a link to both download the program and a (yearly updated)
license key.
At the Mathematica command prompt (which usually looks something
like In[1]:=) type the command to be run,
and then press the Return
key to have Mathematica evaluate the command. As a simple
example, if you want to add two integers type:
3 + 12
Intermediate values can be saved by giving them a name
and assigning them a value with the "="
operator. If the following two commands are run the
second output will be 1:
thesum = 3 + 12
thesum - 14
Mathematica uses square brackets for functions and reserves the usual
round brackets for grouping operations. Thus, to take the sin of 3,
add it to 5, and divide the result by 2 we would write
(Sin[3] + 5)/2.
Mathematica is very careful about exact values. Exact values are things like symbols and integers. Thus Sin[3] is an exact value and when you evaluate Sin[3] you get Sin[3] back as an answer. Contrast this with the fact that 3.0 is an approximate value and thus Sin[3.0] evaluates to the approximate value 0.14122. The N[] operator will force a numerical evaluation.
In[1]:= Sin[3] Out[1]= Sin[3] In[2]:= Sin[3.0] Out[2]= 0.14112 In[13]:= N[Sin[3]] Out[13]= 0.14112
When you are done with Mathematica, type the command Quit
(remembering the capitalization) and press the return key.
There are several ways to find help in Mathematica. You can search by
the specific Mathematica command (if you know it). The basic help
request is
?cmd.
This only works if cmd is a correctly spelled (and capitalized)
Mathematica command. A slight improvement can be gained with the use
of the wildcard * (any string of characters).
In[9]:= ?Plus x + y + z represents a sum of terms.
In[12]:= ?Add* AddOnHelpPath AddTo
More detailed information (although generally not more helpful) can be gotten with the double question mark operator.
In[17]:= ??Plus
x + y + z represents a sum of terms.
Attributes[Plus] = {Flat, Listable, NumericFunction, OneIdentity, Orderless,
Protected}
Default[Plus] := 0
A more common situation is when you know your topic but don't know the name
of the appropriate command. Currently, the best solution for this is to
refer to the Mathematica Book, either in hard copy or the web-based version
freely available at
[http://reference.wolfram.com].
When working with Mathematica on the Windows/Mac interface you can edit a command using the usual mouse, click and type method. If you are working across a network connection Mathematica is clumsier to work with than say, Maple, as there is no way to edit a line short of backspacing to the error and retyping the end of the command. Arrow keys are not recognized and there isn't a simply accessible command history.
Mathematica does have a fairly complete way of referring to previous expressions. Each line is numbered. A command may be referred to by it's number or by how far back it was. Thus, command -1 is the previous command. The various mechanisms are:
Note that re-executing a command with In[n] may not give the same result as simply recalling its original output with Out[n].
In[1]:= x=2 Out[1]= 2 In[2]:= x+y Out[2]= 2 + y In[3]:= x=3 Out[3]= 3 In[4]:= x+y Out[4]= 3 + y In[5]:= In[2] Out[5]= 3 + y In[6]:= Out[2] Out[6]= 2 + y In[7]:= InString[2] Out[7]= x+y