class3 - PHYS 5900 Class 3 (8/31/2011) ü 2.1.4 Mathematica...

This preview shows pages 1–4. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: PHYS 5900 Class 3 (8/31/2011) ü 2.1.4 Mathematica Functions include Sqrt[x] Exp[x] Log[x] Log[b,x] Ç Sin[x] Cos[x] Tan[x] Cot[x] Sec[x] Csc[x] ArcSin[x] ArcCos[x] ArcTan[x] ArcCot[x] ArcSec[x] ArcCsc[x] Sinh[x] Cosh[x] Tanh[x] Coth[x] Sech[x] Csch[x] ArcSinh[x] ArcCosh[x] ArcTanh[x] ArcCoth[x] ArcSech[x] ArcCsch[x] Factorial[x] x! Round[x] Floor[x] Ceiling[x] Rationalize[x] Sign[x] Abs[x] In[1]:= Sin[30*Degree] Out[1]= 1 2 In[2]:= Exp[1.5] Out[2]= 4.48169 In[3]:= E^1.5 Out[3]= 4.48169 ü Cases: Built-in Mathematica objects all start with Capital letters; To avoid confusion, user-created variables should start with lowercase letters. In[4]:= Sqrt[2.0] Out[4]= 1.41421 In[5]:= sqrt[2.0] Out[5]= sqrt @ 2. D ü Brackets: In[6]:= (2+3)*2 Out[6]= 10 In[7]:= Sqrt[2.0] Out[7]= 1.41421 In[8]:= myList={1,4,3} Out[8]= 8 1, 4, 3 < In[9]:= myList[[2]] Out[9]= 4 In[10]:= (* Ignore these comments *) ü Refer to Previous Results In[11]:= t = 3 + 4 Out[11]= 7 In[12]:= t + 2 Out[12]= 9 In[13]:= %^2 Out[13]= 81 In[14]:= %%^2 Out[14]= 81 In[15]:= %42^2 Out[15]= % 42 2 To remove variable values, use In[16]:= Clear[t] or In[17]:= t = . In[18]:= t+2 Out[18]= 2 + t In[19]:= ? t Global`t 2 class3.nb In[20]:= Clear @ "Global` * " D ü Standard Computations: for example, to calculate I 1.1 ¥ 10- 23 M I 6.8 ¥ 10- 2 M 1.4 ¥ 10- 24 In[21]:= Sqrt[(1.1*10^(-23))*(6.8*10^(-2))/(1.4*10^(-24))] Out[21]= 0.730949 In[22]:= NumberForm @ % , 2 D Out[22]//NumberForm= 0.73 In[23]:= ScientificForm @ %% D Out[23]//ScientificForm= 7.30949 μ 10- 1 In[24]:= ScientificForm @ %%% , 3 D Out[24]//ScientificForm= 7.31 μ 10- 1 ü 2.1.8 Exact vs Approximate Values: In[25]:= ? Precision Precision @ x D gives the effective number of digits of precision in the number x . à In[26]:= Precision @ 5 D Out[26]= ¶ In[27]:= Precision @ 345 ê 678 D Out[27]= ¶ In[28]:= Precision...
View Full Document

This note was uploaded on 01/21/2012 for the course PHYS 6720 taught by Professor Hu during the Spring '10 term at East Carolina University .

Page1 / 9

class3 - PHYS 5900 Class 3 (8/31/2011) ü 2.1.4 Mathematica...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online