þ7#$²"ª$$zzzˆ èèèè
òx¨@† ¦º*äzº¾üºº"ººººººIntroduction To Mathematica: Professor Olness
Physics 1303/1304 Fall 1996
The RETURN key is simply a carrige return. The ENTER key is what executes the actual statements.
Mathematica is case sensitive. All Mathematica commands start with capital letters. If your commands all start with lowercase letters, you will not conflict.
To see all commands that start with P, type: P and then ð k. Mathematica will then show you all the known commands starting with P. To see all commands that start with Plot, type: Plot and then ð k.
To see the template for Plot, type Plot, and then ð i.
Note, this was not working yet. I will try and fix it. You should see: Plot[f, {x, xmin, xmax}] )
If you forget what Plot does, type: ?Plot
If you want to see the options of Plot, Options[Plot]
The semicolon is used supress printing the output. It can also separate statements on a single line: a=b; c=d;
The single = is used to set x=4; The == is used to make an equation to be solved, x^2==4 which will have solutions x=2 and x=2.
There are 3 type of brackets: () , { }, [ ]
2(a+b) groups mathematics
{a,b,c} groups lists
Sqrt[2] groups functional arguments
There are 2 ways to write commands.
Expand[(a+b)^50]
(a+b)^50 //Expand
I prefer the second since it separates the expression from the operation.
The second form is harder to write when there is more than one argument in the function.
How to load in an auxilary package: Needs["Graphics`PlotField`"]
This defined the command
?PlotGradientField
PlotGradientField[f, {x, x0, x1, (xu)}, {y, y0, y1, (yu)},
(options)] produces a vector field plot of the gradient
vector field of the scalar function f by calculating
its derivatives analytically.
How to print. Select the expressions (cells) that you want to print by dragging the mouse along the right edge of the window. From the FILE menu, select PRINT SELECTION. Before you click the OK button on the print window, be sure that the output is going to the IMAGEWRITER and not the LASERPRINTER.
If the print output is going to the LASERPRINTER instead of the IMAGEWRITER, go to the APPLE MENU (upper left corner, ð) and select the Chooser. This will allow you to choose the proper printer.
If the computer claims that it is out of memory, you may have to quit Mathematica to open the chooser. Mathematica often takes all available memory.
How to save your document to a disk. From the FILE menu, select the SAVE command. The Save window will show you where the file is to be saved. Make sure that this is on your disk.
Where to find interesting documents: From the FILE menu, choose the OPEN command. Then go to the DESKTOP. There, you should see the NCMIT Applications disk which resides on the CMIT Lab Server computer. (For advanced users who use the Chooser, this is in the CMIT Lab Appletalk Zone.) Open this disk. There are 2 folders of interest here. PHYSICS contains a folder names PHY1304 which is where I will put our class specific material. Also, in the MATHEMATICA folder, there is a SAMPLE NOTEBOOK folder which contains intersting material.
Here are common commands:
//N Give numerical value
//Expand
//Factor
//Simplify
Solve[x^2==1,x]
Integrate[x^2 ,x] Indefinite Integral
Integrate[x^2 ,{x,0,1}] Definite Integral
D[x^2 ,x] Derivative
Plot[ x^2 ,{x,0,1}] 1D plot
Plot3D[ x^2 + y^2 ,{x,0,1},{y,0,1}] 2D plot
ContourPlot[ x^2 + y^2 ,{x,0,1},{y,0,1}] Contour plot
ParametricPlot[{fx, fy}, {t, tmin, tmax}] Parametric Plot
Series[Exp[x],{x,x0,5}] Series expansion about x0 to 5th order
//Normal Turn Series expansion into Normal expression
mat= {{a,b},{c,d}} A Matrix
mat //MatrixForm Print in pretty format
mat.mat Matrix Multiplication
Det[mat] Determinant of matrix
Inverse[mat] Inverse matrix
uIn the CMIT Lab AppleTalk Zone, Lab Serverfile server
à¶Œb8Jst}‡ˆŠÑÒ<@KLNQ‡³Ùà,9:AU]jq³×Øë a b s z‚”°¿À²µ¼ÄÕßê$HZacefhmyzúùù÷ùùù÷ùù÷ùòñùùùùùùùù÷ìùùñùæááæáÛÕÏá
À
À€
@@@€€
€ 0D.JK®NOQ´µßà‰Š
:UjŽ³Ä×!z{¾×Øëì'bš»½êë ® ¯
E
F
ü
ý
6
O
X
a
l

}
£øøîéäéäßäÚääääääéäéÐääääÐäääääÐÈÈÈÈÈäääÈ¾¶È®È¦Ð¦ÐžÐä–––––––'`°'`à'`à ÿ'`,à'`à @à'`à '` @à'` ÿ'`.'`'` '` Ià'`'`@;
£
Í
â
ãcžÞ1Yw–²føøøøøøøøøøøøøøøøð ÿ'`à'`°
Þ Open this as a Guest, and open the NCMIT Applications disk.
and Physics 1303 ª@²¼ªÿÿÿÿ½ H
Žª ÿ'`; ÿ'`'` ÿ'`q'`'`z
£f
ðñòóôöÐÑÒÓÔÕÖ×ØÚÛçéí÷øùþÿ Ó¿ÀÁÄÅÆÇÈÉ,þwèéêëìíîïðñòóôõö÷øùúûüýþÿ
!"#$%&'()*+,./012ü!Œ&p&r8à8á8â8ã9Ù:CHHÚ(ÿáÿâùFG(üHHÚ(d'@=à/Ð*8Ð8ÐBH:LaserWriter 8
†ChicagoNew YorkGenevaMonaco
Zapf DingbatsPalatinoTimes HelveticaCourierSymbolð3278Stdñ3278APLò3278StdBoldó3278APLBoldô3278ALAö3278ALABoldÐArial NarrowÑArialÒBook AntiquaÓBookman Old StyleÔCentury GothicÕCourier NewÖMonotype Corsiva×Monotype SortsØCentury SchoolbookÚTimes New RomanÛ WingdingsçBraggadocioéBritannic Boldí Desdemona÷Impactø
Wide LatinùMistralþSwingÿPlaybillStencil ÓMT Extra¿Arial Rounded MT BoldÀ
Bauhaus 93ÁBookman Old Style BoldÄ
Colonna MTÅFootlight MT LightÆKino MTÇMatura MT Script CapitalsÈVivaldiÉBrush Script MT,Bookshelf Symbol 2þMS LineDrawwCommercialScrDècmb10écmbsy10êcmbx5ëcmbx6ìcmbx7ícmbx8îcmbx9ïcmbx10ðcmbx12ñcmbxsl10òcmbxti10ócmcsc10ôcmdunh10õcmex10öcmff10÷cmfi10øcmfib8ùcminchúcmitt10ûcmmi5ücmmi6ýcmmi7þcmmi8ÿcmmi9cmmi10cmmi12cmmib10cmr5cmr6