Example 00
Introduction to a Mathematica Workshop for Macintosh and NeXTStep

Copyright „ 1993 by Bill Titus, Carleton College, 
Department of Physics and Astronomy, Northfield, MN  55057-4025
September 6, 1993

Topics and Skills

1.  A bit about Mathematica, including some references.
2.  Workshop philosophy.
3.  Index to the individual MMA examples.

What is Mathematica?

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

1.  Allows you to do symbolical and numerical calculations.
2.  Allows you to display two and three dimensional functions and data sets.
3.  Has over 700 built-in functions, and the facility to allow you to write your own functions using MMA's programming language.
4.  Has a notebook font end on a number of computer platforms which allows the integrated presentation of calculations, graphics, and documentation.

Some Selected References

1.  Blachman, Mathematica:  A Pratical Approach (Prentice-Hall, NJ, 1992).

A very well-organized, self-learning text which stresses the structure of MMA.  It takes about a week to go through if you work all the exercises.

2.  Wolfram, Mathematica:  A System for doing Mathematics by Computer, Second Edition (Addison-Wesley, 1989, 1991).

The bible -- treat it as a reference.  It's not something you'd probably go through from cover to cover.

3.  User's Guide For the Macintosh  and  User's Guide For NeXT Computers (Wolfram Research, 1991, 1993).

Contains detailed information about using the notebook front end on the Macintosh and under NeXTStep.

4.  Guide to Standard Mathematica Packages (Wolfram Research, 1993).

A reference to the various packages which contains additional functions that can be used in MMA.  These functions are written in MMA's own programming language.

5.  Abell and Braselton, Mathematica by Example (Academic Press, 1992).

An example-driven text.  A nice place to go to see how to use MMA to tackle both simple and sophisticated mathematics problems.

6.  Abell and Braselton, The Mathematica Handbook (Academic Press, 1992).

A reference of the built-in MMA functions along with explicit examples of their use.

7.  Maeder, Programming in Mathematica, Second Edition (Addison-Wesley, 1991).

An advanced book on programming in Mathematica which stresses creating your own MMA packages.

8.  Two journals:  The Mathematica Journal and Mathematica in Education.

Philosophy of this Workshop - Empowerment

This set of interactive workshop examples is structured around a sequence of simple physics problems that require various MMA skills to solve.  It's written for the notebook front end for Macintosh and NeXTStep platforms.  In particular, participants

1.  Learn a subset of MMA by example.  
2.  Get a feeling for the structure of MMA and some of its potential.
3.  Learn how to find out information about MMA and its various commands.
4.  Hopefully develop the ability and confidence to pick MMA up again, even after they haven't used it for a while.

In general, participants load example notebooks that consist of a series of instructions and comments.  Then, depending on the number of people in the workshop, the participants can go through the example notebooks together as a group (lead by the instructor), or individually (with an instructor circulating to respond to questions that arise).  We have tried both techniques:  the first with a group of five and the second with a group of twelve.  It seems to take between fifteen to twenty hours to go through the set of sixteen examples.  Be forewarned that the notebooks are not polished.

Index

Example 01:  Mathematica as a Simple Calculator

1.   Launching MMA.
2.   Opening a MMA notebook from within MMA.
3.   Brief definition of the kernel and the notebook front end.
4.   MMA as a calculator.
5.   Simple arithmetic operators.
6.   Basic information on input and output cells.
7.   Editing contents of cells.
8.   Special MMA objects (atomic types).
9.   Saving a MMA notebook.
10. Opening a MMA notebook from a file name or icon.

Example 02:  Enhancing a MMA Notebook on the Macintosh

1.  The ruler:  cells types and alignment.
2.  Cell styles. 
3.  Style  and its attributes.
4.  Editing and closing cells.
5.  Printing a notebook or notebook selection.

Example 02:  Enhancing a MMA Notebook on the NeXT

1.  The ruler:  cells types and alignment.
2.  Cell styles. 
3.  The Style Inspector and its attributes.
4.  Editing and closing cells.
5.  Printing a notebook or notebook selection.

Exericse 03:  Set, Rule Assignments, and SetDelayed

1.  Using symbols for calculations.
2.  Immediate assignment with  Set.
3.  Multiple inputs in a single cell.
4.  Semicolon to suppress output.
5.  Help using  ?
6.  Immediate assignment with replacement rules.
7.  Table[]  and  TableForm[].
8.  Lists - a brief introduction.
9.  Clear[].
10.  MMA's symbol for the exponential constant  e.
11.  Assignment with  SetDelayed.

Example 04:  Functions

1.  Properties of a function:  square brackets and the head.
2.  Using  ??  for extended help.
3.  Function attributes:  Listable  and  Protected.
4.  Sqrt[],  N[],  and  Precision[].
5.  Nesting MMA functions.
6.  Trig functions and the MMA constant  Pi.
7.  Exp[],  Log[],  and  BesselJ[].
8.  Head[] and  FullForm[].
9.  List[].
10.  User-defined functions with  Set:  patterns,  SetAttributes[],  Remove[], and usage statements.

Example 05:  Two Dimensional Graphics Using  Plot[]

1.   The bare  Plot[]  command.
2.   The general function  Options[].
3.   Eliminating  -Graphics- .
4.   Resizing a plot area.
5.   Reading out graph coordinates.
6.   Displaying multiple graphs on a single plot using one  Plot[]  command.
7.   The general structure of  Plot[]  options.
8.   Curve options:  Compiled,  PlotPoints,  PlotDivision,
      MaxBend.
9.  "Appearance" Options
       a.  Axes:  Axes,  AxesLabel,  AxesOrigin,  AxesStyle.
       b.  Frame:  Frame,  FrameStyle,  FrameLabel, Ticks,
            FrameTicks.
       c.  General:  AspectRatio,  PlotLabel,  DefaultFont, 
            Background,   DefaultColor,  GridLines,  PlotRange,
            PlotStyle.
       d.  Graphics Directives:  RGBColor[],  Thickness[],  GrayLevel[].
10.  Assigning names to plots.
11.  Plotting multiple graphs on a single plot using  Show[].
12.  Miscellaneous option:  DisplayFunction.
13.  GraphicsArray[].
14.  Animation.

Example 06:  Two Dimensional Parametric Plots and Graphics Primitives

1.  ParametricPlot[].
2.  The MMA constant  Degree.
3.  Two dimensional graphics primitives, including global and local options.
4.  Removing input and output stored in memory.

Example 07:  Symbolic Integration, Differentiation, and Equation Solving

1.  Integrate[].
2.  D[].
3.  Solve[].
4.  Simplify[] and related functions.
5.  Postfix notation for functions.
6.  Double bracket notation for parts of a list or expression.

Example 08:  Series, Limits, Numerical Determination of Roots of Equations, and Numerical Integration

1.  Finding limits using  Limit[].
2.  Determining Taylor Series expansions with  Series[]  and  Normal[].
3.  Using  FindRoot[]  to determine the roots of an equation numerically.
4.  Other MMA "root" commands.
5.  Numerical integration with  NIntegrate[].

Example 09:  Iterative Equations and Modular Programming

1.  The  For  loop and its structure.
2.  Print[]. 
3.  ListPlot[], the option  PlotJoined, and the graphics directive   
     PointSize[].
4.  Comments using  (* ... *).
5.  Writing a function using  Module[]. 
6.  Aborting a calculation.

Example 10:  Symbolic and Numerical Solutions to Differential Equations I

1.  DSolve[].
2.  Brief mention of anonymous functions.
3.  NDSolve[].
4.  InterpolatingFunction[].  
5.  Short[].

Example 11:  Symbolic and Numerical Solutions to Differential Equations II

1.  Packages:  general information and loading packages with  Needs[].
2.  Manipulating complex exponentials:  ComplexToTrig[]  in the package  "Algebra`Trigonometry`".
3.  ParametricPlot3D[].

Example 12:  Matrices Applied to Two Dimensional Translations and Rotations

1.  Matrices as lists of lists.
2.  Matrix multiplication and addition.
3.  Formating with  MatrixForm[].
4.  Inverse[].
5.  Chop[].

Example 13:  Matrices Applied to the Moment of Inertia Tensor

1.  Creating symbolic matrices using  Array[].
2.  Using line sequences of equal input to compact code.
3.  Factor[].
4.  Eigenvalues[]  and   Eigenvectors[].

Example 14:  Importing One Dimensional Data Files and Formating Data

1.  Reading in a file with  ReadList[].
2.  Formating with  NumberForm[]  and its options  SignPadding, NumberSigns, and  NumberPadding.
3.  Formating with  ScientificForm[].

Example 15:  Importing and Manipulating Multi-Dimensional Data Files as Lists

1.  Using  !!  to read a file without storing it.
2.  List functions:  Partition[],  Transpose[],  and  Length[]
3.  Extended argument for  ReadList[].
4.  Round[]  to convert a real to an integer.
5.  ScatterPlot3D[]  in the package  Graphics`Graphics3D`.

Example 16:  Surface, Contour, and Density Plots

1.  Plot3D[] with options:  LightSource,  AxesLabel,  Boxed,  Axes,  PlotPoints,  and  ViewPoint.
2.  ContourPlot[]  with various options.
3.  DensityPlot[]  with various options.