Mathematica 4.0
Mathematica is a software which lets you perform highly complex numerical, symbolic and algebraic computations easily and displays the results with sophisticated graphical plots to output devices and files.
1. Functions and features
Mathematica has over 843 built-in functions for numerical and symbolic calculations, processing and plotting of 2D and 3D graphics, as well as for users to create their own libraries for the specific needs. Mathematica also provides interfaces for linking external software e.g. TEX or user programs written in C or Fortran. Thus, within a processing session using Mathematica, you can pass information to or receive information from other applications and programs.
Note: Mathematica is made of two parts: a kernel and a front
end. The kernel is the part which does calculations while the front end
is the part which handles Mathematica notebook files and interacts with
the user.
If you wish to display graphical plots using Mathematica kernel , set up your terminal as follows:
hkusua% math
Mathematica 4.0 for Solaris
Copyright 1988-1999 Wolfram Research,
Inc.
-- Terminal graphics initialized
--
In[1]:=
Make sure that the above set of commands are executed without error,
and that you may see the mathematica font paths added (/mnt/Type1 and /mnt/X)
A. You have to enter Mathematica function names in their exact form (mindful of the upper and lower cases):
For instance, you must enter "Show" instead of show or SHOW
B. Use correct Metacharacters to separate your symbols and perform special functions
N [Log[4 Pi]] as log(4pi)
N [Pi,7] as
pi to 7 significant digits
%, %%, ... as
last result, second last result...
>> filename
write expressions to filename
>>> filename
append to filename
<< filename
receive from/load filename
?Show
on-line help on the Show function
??Show
more information
?Sh*
list of functions beginning with Sh
?$*
list all global variables
!! filename
display content of filename
!
spawn a new shell
(* ... *) as comment
x^y
as x to the power y
-x
as minus x
x/y
as x divided by y
x+y
as x plus y
x y or x*y as
x times y
f[x]
as f(x)
f[[x]] as
Part(f,x) - indexing
{a,b,...}
as list of values
(term) as
for grouping
; command separator which prohibit input
x=value
assign value to variable x
x=.
clear value of x
x=y=value
value get assigned to both x and y
y:=f[x]
deferred assignment (Definition)
C. Input/Output
FileGraphics.m - direct
Graphics output (Postscript commands) to the file pstmp
PSDirect.m
- direct Graphics output to stdout
VT340.m
- Graphics output for VT340 terminal
Tek.m
- Graphics output for Tektronic 4014
series terminals
Motif.m
- Graphics output to X-Window
You can load any one of them in a Mathematica session using the << operator.
psfix is a utility program which can convert the default Mathematica
PostScript output file to Encapsulated Post Script file
A. Numerical/Symbolic calculations
hkusua% math
Mathematica 4.0 for Solaris
Copyright 1988-1999 Wolfram Research, Inc.
-- Terminal graphics initialized --In[1]:= Expand[(1+x)^2]
2
Out[1]= 1+ 2 x + xIn[2]:= Factor[%]
2
Out[2]= (1 + x)In[3]:= x = 2
Out[3]= 2
In[4]:= Evaluate[%%]
Out[4]= 9
ln[5]:= Simplify[%1]
Out[5]= 9
In[6]:= x =.
In[7]:= Simplify[%1]
2
Out[7]= (1 + x)In[8]:= D[%,x]
Out[8]= 2 (1 + x)
In[9]:= Integrate[%,x]
2
x
Out[9]= 2 (x + --)
2In[10]:= h = (1+x)^2 ==0
2
Out[10]= (1 + X) == 0In[11]:= Solve[%10,x]
Out[11]= {{x -> -1}, {x -> -1}}
In[12]:= Solve[x^2+x+1==0,x]
1/3 2/3
Out[12]= {{x -> -(-1) }, {x -> (-1) }}
In[13]:= NSolve[x^2+x+1==0,x]
Out[13]= {{x -> -0.5 - 0.866025 I}, {x -> -0.5 + 0.866025 I}}
In[14]:= Quit
hkusua%
B. Simple Plots
hkusua% math
Mathematica 4.0 for Solaris
Copyright 1988-1999 Wolfram Research, Inc.
-- Terminal graphics initialized --
Out[1]= -Graphics-
In[2]:= <<
FileGraphics.m
(*Load the FileGraphics package *)
-- File graphics
initialized --
In[3]:= Plot3D[Sin[x
y],{x,0,3},{y,0,3}] (*output to the file pstmp *)
Out[3]= -SurfaceGraphics-
In[4]:= Quit
‘setenv DISPLAY your_ip_address:0.0’
Should you have any enquiries related to the the procedure in using the SPSS software, please contact the undersigned.
and
and Kenneth Yip
Tel: 2859 7973
Email: kkyyip@hkusua.hku.hk