Clinton Wolfe - Getting Started With Mathematica.pdf
(
5165 KB
)
Pobierz
Getting Started with Mathematica
Getting Started with Mathematica
Clinton Wolfe, August 1999
Introduction
What is Mathematica?
Mathematica is a computer program for doing mathematics. It is often used for instruction, homework, research, and
writing. Mathematica is extraordinary well-rounded. It is suitable for both numeric and symbolic work, and it has
remarkable word-processing capabilities as well. Mathematicians can (and often do) search for a working model, do
intensive calculation, and write a dissertation on the project (including complex graphics) -- all from within
Mathematica.
Its weaknesses include a somewhat steep learning curve, an interface that is difficult to use from the command line,
and rather complex installation procedures.
Philosophical issues
Mathematica is more than just a program. It is an attempt to redefine the interaction between mathematician and
computer.
Every
command, function, option, button, menu, or object in Mathematica fits into this philosophy in a
standard way. In the mid-to-long term, this makes Mathematica a very easy-to-use, enjoyable tool. For the new user,
Mathematica can seem opaque and threatening.
Mathematica was created by a
mathematician
for other mathematicians. A user of Mathematica should be
comfortable dealing with abstraction, generalization, and pattern discovery. If you feel you do not fit this profile,
you might want to learn
Maple
first.
How to use this document
This document is intended for new users of Mathematica. No prior math software experience is assumed, though we
do point out differences between the major packages along the way. We assume you are familiar with your operating
system, so we will not cover clicking, dragging, etc. Since Mathematica is quite visually oriented, we assume you
will be using it on a computer with a windowing system (such as Windows, Macintosh, or X-windows). If you
intend to use Mathematica from the command line, it would be best to first learn it in a graphic environment, and
then learn to
Use Math Software under UNIX
.
We will use a few conventions throughout this document.
Example
Explanation
File -> Open
Select
Open
from the
File
menu.
3,Ctl-6,5
Press 3, then hold the Control key and press 6, then press 5.
2+2
Input to be typed at the Mathematica prompt.
4
Output from Mathematica
An important tip.
A tip for Maple users.
A tip for Matlab users.
Where to find Mathematica
Mathematica is available in all Macintosh, SGI, and Sun computer labs at IUB. It is also available on Steel and the
SP (node sp09).
Mathematica is also available for sale in the
IU Bookstore
.
How to start and exit Mathematica
To start mathematica, follow these instructions.
•
Unix: from a command line, type "mathematica &"
•
Macintosh: Apple Menu->Stat/Math->Mathematica
If you are using X windows and you get a stream of font errors, follow
these instructions
from the
Knowledge Base.
To exit Mathematica, you can:
•
Choose File->Exit
•
Type
Quit[]
.
Orientation
When you first start Mathematica, you should see a "splash" screen with the Mathematica logo, version, and license
information. When the program loads, you should see several objects on the screen. We will now describe what they
are and what they do.
You may wish to turn on your speakers (or bring headphones if you are in an STC). Mathematica uses audio
cues to notify the user of errors, finished calculations, etc.
Notebooks
A notebook is a collection of Mathematica statements, output, and graphics. The concept is like that of a "document"
in a word processor. You enter information and commands into the notebook window, and the output (if any) is
displayed there.
If the notebook has been modified since it was last saved, an asterisk (*) will appear in the title bar. To save your
work, choose File->Save As... or File->Save.
If Mathematica is ready for new input, the cursor will flip sideways (see above). Just start typing to enter
information. Try typing this (don't press return yet):
2+2
To tell Mathematica to evaluate this expression, hold down Shift and type Return. Since Mathematica is also a word
processor, it needs to know if you want to evaluate the expression, or just insert a carriage return-linefeed. This can
be quite confusing to the new user.
System
Evaluate
Linefeed
Macintosh
Enter
or
Shift-Return
Return
Windows
Shift-Enter
Enter
X
Shift-Return
Return
Next, look at the blue symbols along the right side of the notebook. Each group of statements enclosed by the
triangle-brackets ( ) is called a
cell
. The cell is the smallest unit of work in Mathematica. A cell may contain input
or output, math or comments, text or graphics.
Cells
in Mathematica are like
execution groups
in Maple.
Palettes
You should see a box with a lot of symbols floating on the right side of your Mathematica window.
This is called a
palette
. Palettes allow you to easily insert complicated mathematical notation. For
example, to compute the cube root of 34, you could click on the . Type
34
, which should
appear under the root sign. Then click on the small square above the root, and type
3
in the box.
Finally, evaluate the expression.
Using the default palette, you can enter fractions, integrals, summations, matrices, subscripts, and
most greek letters. Of course, there are many other palettes available - choose File->Palettes to see a
list.
Kernels
Mathematica is actually split into two conceptual pieces, the
front-end
and the
kernel
. When you start Mathematica,
you are actually only starting the front-end.
The front-end handles input and output to the user, access to the file system, and creates graphics on your screen.
Most users will deal primarily with the front-end.
The kernel does nearly all computation (excluding graphics rendering). When you evaluate any expression, the
kernel does the hard work and sends the results back to the front-end, which then displays it in an attractive format
for the user.
Most users will run the front-end and the kernel on the same computer. If your computer is connected to a network,
you can run the kernel on a more powerful machine, while running the front-end on your favorite computer. To learn
how to do this, choose Kernel->Kernel Configuration Options, click Add, and then click Help.
How to stop a runaway calculation:
Macintosh - Command-Comma or Control-C
Windows and X - Alt-Comma or Control-C
This will bring up a menu that allows you to view the state of the kernel, abort the calculation, etc.
Help system
Mathematica has an excellent help system. To get general help, choose Help->Help Browser. Browse among the
topics listed.
Mathematica comes with an excellent resource,
The Mathematica Book
. It is available through the Help Browser.
See also the Getting Started section, which contains several excellent tutorials.
•
•
Doing Math
Arithmetic
Basic arithmetic operations are easy to enter in Mathematica. You may use your choice of notation, and you may
choose to enter symbols via the palettes or the keyboard.
Keystrokes
Input Output
Comments
4, ,+, ,4
3,-,1,6
4+4
3-16
8
-13
Addition, subtraction.
Spaces are optional.
4,*,4
4, ,4
4,4
4,Esc,*,Esc,4
4*4
44
44
4 4
16
16
44
16
Multiplication.
A space can mean multiplication as well...
...but you should be careful.
You can also use the symbol.
3,/,4
3/4
3,Esc,d,i,v,Esc,4
3 4
Exact division.
3,Ctl-/,4
3,^,5
3,Ctl-^,5
3^5
3
5
243
243
The text version
The symbolic version
3,^,(,1,/,2,)
Ctl-@,3
N,[,Ctl-@,3,Ctl-Space,]
3^(1/2)
N[ ]
1.73205
An approximation.
%,Ctl-^,2
%
2
3.
Square last output.
Mathematica's data restrictions are as follows:
•
Integers can be of any size, up to your computer's memory.
•
Real and complex operations are carried out with arbitrary (limitless) precision, up to your computer's
memory, unless
N
is used.
•
See Help->Help Browser: Numerical Computation->Numerical Precision->N, and section 1.4.9 of
The
Mathematica Book
.
Mathematica does not set limits on the size of matrices, as Maple does.
•
N[...]
is just like Maple's
feval
.
If you want to use double precision, you must explicitly say so. See above.
•
Plik z chomika:
zxcvbnm174
Inne pliki z tego folderu:
(Wolfram Research) Mathematica Tutorial(1).pdf
(1743 KB)
Clinton Wolfe - Getting Started With Mathematica.pdf
(5165 KB)
tutoriale mathematica [M].zip
(32305 KB)
ReadMe.txt
(0 KB)
Mathematica_8.0.1_WIN.iso
(853900 KB)
Inne foldery tego chomika:
Matematyka
Matematyka korepetycje
Math
MATLAB
STATISTICA 10 PL + SERIAL
Zgłoś jeśli
naruszono regulamin