Mathematica Troubleshooting Guide
(adapted from a troubleshooting handout developed by
Jeff Holt and
David Olson at
MTU)
Common Errors
- Check Capitalization.
All built-in Mathematica commands start with a capital letter,
including ``E'' (the number 2.7182...). Many also have internal
capitalization, like ``FindRoot''.
- Did you use the correct Parentheses/Brackets/Braces?
- Parentheses for arithmetic grouping: (a+b)*c
- Curly brackets for lists: {a,b,c}
- Square brackets for arguments of functions: f[x_,y_]
- Did you use an underscore for dummy variables
when defining a function?
For example, f[x_,y_]=x*y^2
- Did you Clear functions and variables before defining them?
If you have been using primes for differentiation, you should also
clear the derivative when you redefine the function.
For example,
if you have been using a function f[x]
and its derivative f'[x],
running ``Clear[f,Derivative]'' will guarantee that f'[x]
will correspond to the current definition of f[x].
- Check for spaces between variables.
``ab'' is interpreted as a word (a single variable name)
and is NOT the multiplication of a and b. Add a
space for multiplication (a b) or, better yet,
use an asterisk for multiplication to avoid the confusion.
- Did you re-run the input cells, if you re-opened a notebook?
When you re-open a notebook, the typing is still
there, but Mathematica will have forgotten all the
definitions (in fact, ALL of the output ...) until you run
those cells again.
- Did you run the initialization cells?
You should always run the initialization cells. They contain
hidden commands and definitions
(functions, constants, etc.) that the instructor
has entered and which you will need to run the notebook.
- Stopping a Runaway Process
Try to abort the process using the ``Abort Evaluation'' command in
the pull-down menu under ``Kernel'' at the top of
the Mathematica notebook or by holding down both
the diamond(or Alt) key and the period simultaneously.
More advice