1) Basics:
Exact and Approximate Results
With no decimal point in an expression, Mathematica gives you an exact result.
In[1]:=
Out[1]=
On the other hand, if you put an decimal point in an expression, then Mathematica gives an approximate numerical result.
In[2]:=
Out[2]=
π to many decimal places
In[3]:=
Out[3]=
There are thousands of mathematical functions
The arguments of a function are contained within square brackets. Functions can be nested. (You can use I or i to represent )
In[4]:=
Out[4]=
Inverse[] works on both symbolic and numerical matrices. There are many other linear algebra functions.
In[5]:=
Out[5]=
There is a function for just about anything you can think of...
In[6]:=
Out[6]=
In[7]:=
Out[7]=
Sequences of Operations
If an expression ends in ";", then its result is not displayed. This often necessary in order suppress lengthy output.
In[8]:=
Out[9]=
The List is the most basic data structure
Lists are very general objects that represent collections of expressions. Lists are used to represent sets, vectors, matrices, tensors. Lists are given in curly brackets and their elements are separated by commas. They are analogous to arrays in other computer languages, but much more powerful.
List of numbers
In[10]:=
Out[10]=
List of symbols
In[11]:=
Out[11]=
List of Lists
Note that the lists within a list do not have to be the same length.
In[12]:=
Out[12]=
Table[] is the function for making Lists
In[13]:=
Out[13]=
Table[] can be nested to make Lists of Lists
In[14]:=
Out[14]=
Getting a piece of a List
In[15]:=
Out[15]=
In[16]:=
Out[16]=
Length[] is very useful for determining the size of a list
Length[expr] gives the number of elements in expr.
In[17]:=
Out[19]=
Out[20]=
Killing Mathematica
Mathematica will attempt to perform a calculation that might take several human lifetimes to complete, and sometimes it simply goes crazy. You will probably have to kill the kernel. Click at Kernel -> Quit Kernel -> Local
Created by Mathematica (June 17, 2004)