## How Do I Use Formulas That I Found Elsewhere in
*Mathematica*?
Using formulas is very simple. Just retype the formula, name it as a function,
define your variables, and you are done.
For example, suppose you have found the formula for the magnitude of a dipole
field in Cartesian coordinates.
The easiest way to input this formula is to use the BasicInput.nb palette.
- Open a new
notebook or create a new cell in an open one by clicking below the last blue cell bracket.
- Open the BasicInput.nb
palette by clicking the hyperlink, or select BasicInput
from File->Palettes.
- Click .
- Type 1, and use the tabulator key to jump to the denominator.
- Click .
- Type (x+.
- Click .
- Type x, use the tabulator key to jump to
the next placeholder, type 0, and press CONTROL-SPACE
to jump out of the subscript.
- Type ), select the expression
with the mouse, click
, and type 2.
To find out how you can type this input using keyboard shortcuts, see
the documentation for keyboard shortcuts for either Microsoft
Windows, Macintosh,
or X.
After you input the rest of the formula in a similar manner, you can use plotting
functions to visualize it immediately. Just plug in values for
and .
To use a formula more generally, you can easily represent it as a *Mathematica*
function. Here is the textbook formula for the electric field of a number of
radial wires carrying opposing currents organized on a unit circle.
Here is the same formula written as
a *Mathematica* function. Note that function names are uppercase by
convention, function arguments are enclosed in square brackets, and the
independent variable is followed by an underscore in the function
definition. All the other typeset elements were input using the BasicInput.nb palette.
Return to Top
| |