Tutorial 00
Introduction to the Mathematica Workshop

Copyright © 2003 by Bill Titus, Carleton College,
Department of Physics and Astronomy, Northfield, MN  55057-4025
March 1, 2003

Topics and Skills

1.  A bit about Mathematica
2.  What's in your workshop binder
3.  The workshop philosophy
4.  The index to the nine tutorials

What is Mathematica?

Mathematica is a system for doing mathematics by computer.  Here are some of its capabilities:

1.  It allows you to do both symbolical and numerical calculations.
2.  It allows you to graphically display functions and data sets.
3.  It has as over thousand built-in functions and the facility to allow you to write you own functions using Mathematica's programming language.
4.  It has as a notebook front end that allows you to integrate and present calculations, graphs, and documentation as a single coherent package.

Primary References from Wolfram Research, Inc.

1.  Stephen Wolfram, The Mathematica Book, Fourth Edition for Version 4 (Wolfram Media, 1999).  This is the bible.  Treat it as a reference.  It's not something you'd go through cover-to-cover.
2.  Wolfram Research, Mathematica 4:  Standard Add-On Packages (Wolfram Media, 1999).  A reference to various packages that contain over 2000 additional Mathematica functions and constants written in Mathematica's own programming language.

What's in Your Binder

Tutorials

Here are the hard copies of Tutorials 01- 09, which hopefully will give you a good introduction to the range of Mathematica's abilities and some of the syntax for using this powerful software tool.  Toward the end of the workshop, you'll have to choose between doing either Tutorial 08 or Tutorial 09.  You won't have time to do both of them.

Training

If you want further exposure to Mathematica, here's a list of independent individuals who give training in Mathematica.  There's also a list of workshops run by Wolfram Research that will be given between now and mid-August.

Mathematica Site and Products

This section starts off with the index for the web site for Wolfram Research.  It then gives some information on webMathematica, a tool that allows Mathematica to run inside HTML pages as well as examples of two packages that you can purchase from Wolfram Research, Time Series and Digital Image Processing, that might be of interest to geologists.  These packages are written in Mathematica's own programming language on specific topics of interest.  Finally there's a list of books on Mathematica that you can purchase directly from Wolfram Research.  Of course, these books are also available from other book dealers as well.

Information Center

Wolfram Research has lots of information available on its web site.  In the Mathematica Information Center you can find out information on articles about Mathematica or articles that use Mathematica for research or teaching purposes; books; conference proceedings; courseware; demos; and MathSource, a site containing Mathematica notebooks and packages contributed by a wide variety of individuals.  The information included in your binder is all the materials from the Information Center that were obtained by doing a search on the keyword "geology".

Journals

Here's information on three journals.  The first one deals with all sorts of information and application of Mathematica while the latter two are devoted to the use of computers in geology.

Other Software

This section gives some information of two web locations where you can download software written especially for geologists.

MathGroup

MathGroup is a well-developed, moderated email list and internet newsgroup, where, for example, you can ask a wide audience of users explicit questions you might have about Mathematica.

Article Abstracts

Here are the abstracts of a number of geology articles that have used Mathematica for research or teaching purposes.  The articles should give you a sense how people in your field are using this software tool.

The Workshop Philosophy

This workshop is structured around a set of nine, self-paced tutorials that will expose you to various Mathematica tools and skills.  It's a basic introduction.  You are not being graded on it and if you don't finish all the tutorials, that's fine.   This experience is not meant to be a stressful situation; you are among friends.

During the course of the workshop, you'll:

1.  Learn a subset of Mathematica by example
2.  Get a feeling for the structure of Mathematica and some of its potential
3.  Learn how to find out information about Mathematica and its various commands
4.  Develop the ability and confidence to pick Mathematica up again, even if some time has gone by (but not too much time)
5.  Have a sense of the power and scope of Mathematica and whether you want to invest the time and effort in learning this software package.

In general, you'll work in pairs and load the tutorials that consist of a series of instructions and comments.  Hard copies of the tutorials are in the first section of your workshop binder.  You'll then go through the tutorials at your own pace, and I'll circulate around to respond to questions that arise.  Feel free to experiment with Mathematica and be sure to ask questions, not only of me, but your colleagues as well.  Collectively we know a lot.  Be forewarned that the notebooks are not polished at this state.

Index to the Tutorials

Tutorial 01 - Mathematica as an Expensive Calculator

Part 1 - Getting Started

1.  Launching Mathematica from the Mathematica icon
2.  Brief definition of the notebook front end and the kernel
3.  Opening a Mathematica notebook from within Mathematica
4.  Saving a Mathematica notebook under a different name

Part 2 - Multiplication and Input/Output Cells

1.  The multiplication operator  *
2.  Basic properties of input and output cells
3.  Round parentheses to group numerical operations
4.  Atomic type:  Integer

Part 3 - Addition and Division

1.  Atomic type:  Rational
2.  The addition operator  +
3.  Editing old cells
4.  Atomic type:  Real
5.  The division operator  /
6.  Forcing a numerical evaluation using  //N

Part 4 - Editing and Warning Messages

1.  The use of copy and paste as an editing procedure
2.  Mathematica warning messages

Part 5 - Subtraction

1.  The subtraction operator  -

Part 6 - Mathematica Constants

1.  Built-in Mathematica constants:  Pi  and  E
2.  Using the input palette for generating special symbols
3.  Another functional notation for  N
4.  The Mathematica command   ScientificForm[]
5.  Deleting cells

Part 7 - Power and Symbols

1.  The power operator  ^
2.  Atomic type:  Symbol
3.  User-defined symbols
4.  Algebra with Mathematica

Part 8 - Save Your Notebook

1.  Elimination of output cells before a final save

Tutorial 02 - Enhancing a Mathematica Notebook

Part 1 - Getting Started

1.  Opening a new Mathematica notebook
2.  Saving a new Mathematica notebook

Part 2 - Enhancing the Notebook

1.  Cell styles using the menu item  Style  and its submenus
2.  Editing and closing cells
3.  Inserting page breaks
4.  Printing a notebook or a notebook selection

Part 3 - Save Your New Notebook

Tutorial 03 - Symbols and Functions

Part 1 - Getting Started

Part 2 - The Problem of Interest

Part 3 - Mathematica Constants and Help

1.  Mathematica help using  ?
2.  The Help Browser (HB)

Part 4 - User-Defined Symbols

1.  Using symbols for calculations
2.  Immediate assignment with  Set[]
3.  The "context" for a symbol
4.  Multiple inputs in a single cell
5.  A semicolon to suppress output

Part 5 - Mathematica Defined Functions

1.  Notation for a function
2.  Some Mathematica functions:  N[],  ScientificForm[],  Plus[],  Power[],  Times[],  Divide[],  FullForm[],  Exp[],  Sin[],  Cos[],  Tan[],  and  Clear[]

Part 6 - User-Defined Functions

1.  User-defined functions using  Set[]  and simple patterns
2.  User-defined functions using  DelayedSet[]  and simple patterns
3.  The Mathematica  Table[] command
4.  A little bit on lists

Part 7 - Save Your Notebook (OPTIONAL)

Tutorial 04 - 2D Graphics for Continuous Functions

Part 1 - Getting Started

Part 2 - The Problem of Interest

Part 3 - The Bare Plot

1.  The bare  Plot[]  command
2.  Eliminating the  -Graphics-  cell
3.  Resizing a plot area
4.  Reading out graph coordinates
5.  Multiple graphs on a single plot using one  Plot[]  command

Part 4 - Options for  Plot[]

1.  The Mathematica command  Options[]
2.  The general structure of  Plot[]  options
3.  Curve options:  Compiled,  PlotPoints,  PlotDivision,  MaxBend
4.  Appearance Options
     a.	Axes:  Axes,  AxesLabel,  AxesOrigin,  AxesStyle
     b.	Frame:  Frame,  FrameStyle,  FrameLabel,  Ticks,  FrameTicks
     c.	General:  AspectRatio,  PlotLabel,  Background
            DefaultColor,  GridLines,  PlotRange,  PlotStyle
     d.	Graphics Directives:  RGBColor[],  StyleForm[],  Thickness[],  
            GrayLevel[]
5.  Atomic type:  String
6.  The Mathematica command  StringForm[]  and  PaddedForm[]
7.  The option  PlotRange->All

Part 5 - Multiple Plots

1.  Assigning names to plots
2.  Plotting multiple graphs on a single plot using  Show[]
3.  The strange options  DisplayFunction->Identity  and  DisplayFunction->$DisplayFunction

Part 6 - Some Practice

Part 7 - Save Your Notebook  (OPTIONAL)

Tutorial 05 - Working with Data:  Creating, Formatting, Plotting, and Fitting

Part 1 - Getting Started

Part 2 - The Problem

Part 3 - Creating a List of Data

1.  Producing 2D data lists in Mathematica

Part 4 - Commands that Format Data

1.  The Mathematica command  TableForm[]
2.  Formatting with  NumberForm[]  and its option  NumberPadding 
3.  The nesting properties of functions

Part 5 - Plotting Data

1.  The Mathematica command  ListPlot[],  its option  PlotJoined,  and the graphics directive  PointSize[].
2.  Using Mathematica help in conjunction with the "wild card"  *

Part 6 - Fitting Data to a Decreasing Exponential:  Attempt 1

1.  The Mathematica command  Fit[]

Part 7 - Fitting Data to a Decreasing Exponential - Attempt 2

1.  The Mathematica command  Log[]
2.  The purpose of Mathematica packages
3.  The Mathematica command  Regress[]  in the package  Statistics`LinearRegression`

Part 8 - Save Your Notebook  (OPTIONAL)

Tutorial 06 - Parametric Plot, Modular Programming, and Symbolic Equation Solving

Part 1 - Getting Started

Part 2 - Creating a Parametric Plot

1.  The Mathematica command  ParametricPlot[]
2.  The option  AspectRatio -> Automatic
3.  The Mathematica functions   Sqrt[]  and  ArcTan[]

Part 3 - Modular Programming and the Fundamental Strain Equation in 2D

1.  The Mathematica command   Module[]  and its structure

Part 4 - Symbolic Equation Solving and the Fundamental Strain Equation in 2D

1.  The Mathematica commands  Solve[],  NSolve[],  FindRoot[]
2.  Equations in Mathematica and the use of double equal signs, i.e.,   ==
3.  Replacement rules as solutions to equations
4.  Double bracket notation  [[]]  and the equivalent function  Part[]
5.  The Mathematica function  Chop[]

Part 5 - Save Your Notebook (OPTIONAL)

Tutorial 07 - 3D Graphics:  Surface, Contour, and Density Plots

Part 1 - Getting Started

Part 2 - Creating a Surface Plot

1.  The basic Mathematica command  Plot3D[]
2.  The options  PlotPoints,  PlotRange,  Mesh,  and  ViewPoint

Part 3 - Creating a Contour Plot

1.  The basic Mathematica command  ContourPlot[]
2.  The options  PlotPoints,  ContourShading,  Contours,  and  FrameLabel

Part 4 - Creating a Density Plot

1.  The basic Mathematica command  DensityPlot[]
2.  The options  PlotPoints,   Mesh,   ColorFunction,  and   FrameLabel
3.  The graphics directive   Hue

Part 5 - Save Your Notebook (OPTIONAL)

Tutorial 08 - Vectors, Tensors, and Transformations

Part 1 - Getting Started

Part 2 - Vectors

1.  A vector as a list of components
2.  The Mathematica commands  MatrixForm[]  and  Print[] 
3.  Basic vector operations:  addition and scalar multiplication
4.  Animation within Mathematica
5.  The Mathematica command  Flatten[]

Part 3 - Some Basic Properties and Operations on Tensors in 2D Space

1.  Matrices as lists
2.  Basic matrices operations:  addition, scalar multiplication, multiplication
3.  Special matrices:  transpose, inverse, identity
4.  The Mathematica commands  Dot[],  Transpose[],  Inverse[],  Det[],  Simplify[]
5.  Eigenvectors and values and the Mathematica commands  Eigenvector[],  Eigenvalue[],  Eigensystem[]

Part 4 - The Rotation Matrix in 2D Space

Part 5 - The Simple Shear Matrix in 2D Space

Part 6 - Other Transformations in 2D Space

Part 7 - Save Your Notebook (OPTIONAL)

Tutorial 09 - Symbolic and Numerical Solutions to Differential Equations and their Finite Difference Counterparts

Part 1 - Getting Started

Part 2 - Symbolic Solutions to Differential Equations

1.  The Mathematica commands  DSolve[]  and  Derivative[]
2.  Replacement rules

Part 3 - Numerical Solutions to Differential Equations

1.  The Mathematica commands  NDSolve[]  and  InterpolatingFunction[]
2.  The Mathematica commands  GraphicsArray[]  and  Partition[]

Part 4 - Finite Difference Equations

1.  One dimensional array variables
2.  Animation using  (apple)(y)

Part 5 - Save Your Notebook (OPTIONAL)