![]() |
Beginning with Mathematica |
| See the mathematics department Mathematica page for
To start mathematica
|
After you start Mathematica, Mathematica generates a new blank document. This is where you type.
Type 2+2 followed by ENTER...............nothing
happens.......don't worry, be happy.
Lets try again.
Type 2+2 followed by SHIFT
ENTER (that's shift and enter at the same time)
after a few seconds you should see the output
4
Well done, you are mastering Mathematica.
You must type SHIFT ENTER to execute commands.
Now type
Plot[Sin[x],{x,-1,4}]
followed by, (...you guessed it...) SHIFT ENTER
Now you see a plot of Sin(x) starting at x = - 1 and ending at x = 4.
You should be able to modify the command Plot[Sin[x],{x,-1,4}]
to plot Cos(x) starting at x = 2 and ending at x = 5.
Go ahead...try it....don't forget.....SHIFT ENTER
If you make typos Mathematica may BEEP at you,
don't worry Mathematica will return to quiet good humor if you go back and fix
the typo.
Type
Plot[sIn[x],{x,-1,4}]
you should hear a healthy BEEP and maybe get a
written warning.
Fix the tpoy and Mathematica chills out.
To get a plot of Sin(x) with x running from -2Pi to Pi type
Plot[Sin[x],{x,-2Pi,Pi}]
followed by the usual SHIFT ENTER
To get the same plot but with y restricted to -0.5 < y <0.5 type
Plot[Sin[x],{x,-2Pi,Pi}, PlotRange->{-0.5,0.5}]
followed by the usual SHIFT ENTER
(to make the arrow ->
use - followed by >)
You can probably formulate a command to plot Cox(x) with x running from Pi
to 2Pi and with y restricted to -0.2 < y < 0.3
Go ahead try it. What's a BEEP or two.
You need to be careful to get the brackets and commas right.
If you type Plot[1/(x-1),{x,-1,3}]
Mathematica plots 1/(x-1)
Mathematica is very very sensitive to typsos.Just go back and fix your typsos.
Mathematica uses Abs[x] for the function |x|.
Plot[Abs[x],{x,-2,7}]
plots |x| from x=3 to x=5
Mathematica can show two plots at once
Show[ Plot[Sin[x],{x,-Pi,Pi}], Plot[Cos[x],{x,-Pi,Pi}]
]
shows a simultaneous plot of Sin(x) and Cos(x)
Experiment by typing something to plot Tan(x) and Sec(x), with x running from -Pi to 2Pi. Then Show both plots at once.
You are now a Mathematica Wizzard Extraordinaire and Mathematica would sing for you if it knew how.