0% found this document useful (0 votes)
25 views

Mathematica Notebook

Uploaded by

dylandrake134
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Mathematica Notebook

Uploaded by

dylandrake134
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Hands-on Start to Mathematica

Basic input
In[3]:= 627 / 3
Out[3]= 209

In[5]:= 628 / 3
628
Out[5]=
3


628
In[6]:= N
3
Out[6]= 209.333

Free-form input
I n [ ] : =

 graph sin(x)/x
Plot[Sin[x] / x, {x, -9.4, 9.4}]

1.0

0.8

0.6

Out[7]= 0.4

0.2

-5 5

-0.2

I n [ ] : =

 pi to 100 digits
N[Pi, 100]

Out[8]= 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803
4825342117068
2 Mathematica Notebook.nb

I n [ ] : =

 solve 2x-7=0 and 3x-2y=0 for x and y


Solve[{2 *x - 7  0, 3 * x - 2 *y  0}, {x, y}]

x  ,y 
7 21
Out[9]=
2 4

I n [ ] : =

 integral of 1/(x^3+1)
Integrate[1 / (x ^ 3 + 1), x]


-1+2 x
Out[10]=

+ Log[1 + x] - Log1 - x + x2 
ArcTan 1 1
3

3 3 6

I n [ ] : =

 picture of caffeine molecule

caffeine CHEMICAL  molecule plot 

Out[11]=
Mathematica Notebook.nb 3

Wolfram Language input


In[13]:= Plot[2 x ^ 2 - 7, {x, -10, 10}]
Out[13]=
200

150

100

50

-10 -5 5 10

In[15]:= Plot3D[Sin[x * y], {x, -3, 3}, {y, - 3, 3}]


Out[15]=
4 Mathematica Notebook.nb

In[16]:= Table [i ^ 3, {i, 0, 10}];


ListPlot[%]
Out[17]=

1000

800

600

400

200

2 4 6 8 10

In[32]:= mat1 = {{1, 3, -2}, {2, 5, 0}, {-3, - 5, 7}};


Det[mat1]

-17
Out[33]=

In[37]:= Clear[mat1]

◼ Capital letters to start all function names


◼ Function arguments are enclosed by square []
◼ List (or ranges or domains) are enclosed by curly braces{}
◼ Shift - Enter to do a calculation
Mathematica Notebook.nb 5

Applying what we’ve learned


In[39]:= Manipulate[Plot[Sin[freq * x], {x, 0, 6 * Pi}, PlotRange  {- 4, 4}], {freq, 1, 5}]
Out[39]=

freq

1.

5 10 15

-2

-4

Manipulate[Plot[amp * func[freq * x], {x, 0, 6 * Pi}, PlotRange  {- 4, 4}],


{freq, 1, 5}, {amp, 1, 4}, {func, {Sin, Cos, Tan}}]
In[40]:=

Out[40]=

freq

amp

func Sin Cos Tan

5 10 15

-2

-4
6 Mathematica Notebook.nb

Documentation & saving


In[41]:= Plot[Sin[2 x], {x, 0, 6 Pi}]
Out[41]=

1.0

0.5

5 10 15

-0.5

-1.0

You might also like