# Class4 - PHYS 5900 Class 4 Zi-Wei Lin Complex Numbers Functions include Abs[z Arg[z Re[z Im[z Conjugate[z Example z In[1:= Out[1]= In[2:= Out[2]=

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

PHYS 5900 Class 4 (9/02/2009) Zi-Wei Lin Complex Numbers: Functions include Abs[z], Arg[z], Re[z], Im[z], Conjugate[z] ü Example: z = 7 + ln H 2 + 8i L In[1]:= myZ = Sqrt @ 7 D + Log @ 2 + 8 I D Out[1]= 7 + Log @ 2 + 8 Ç D In[2]:= N @ % D Out[2]= 4.75551 + 1.32582 Ç In[3]:= Conjugate @ % D Out[3]= 4.75551 1.32582 Ç In[4]:= Abs @ myZ D Out[4]= Im @ Log @ 2 + 8 Ç DD 2 + K 7 + Re @ Log @ 2 + 8 Ç DDO 2 In[5]:= N @ % D Out[5]= 4.93686 Random Numbers: Functions include Random[ ] RandomReal[ ] RandomInteger[ ] RandomComplex[ ] RandomChoice[ ] SeedRandom[ ] In[6]:= Random @D Out[6]= 0.715874 In[7]:= Random @D Out[7]= 0.494968

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

View Full Document
In[8]:= RandomInteger @8 1, 10 < ,12 D Out[8]= 8 9, 4, 7, 1, 3, 5, 5, 9, 3, 9, 1, 9 < In[9]:= RandomComplex @D Out[9]= 0.90185 + 0.437017 Ç In[10]:= ? SeedRandom SeedRandom @ n D resets the pseudorandom generator, using n as a seed. SeedRandom @D resets the generator, using as a seed the time of day and certain attributes of the current Mathematica session. à In[11]:= SeedRandom @ 5 D In[12]:= RandomReal @8 0, 1 < ,12 D Out[12]= 8 0.000790584, 0.0650192, 0.989555, 0.968768, 0.200866, 0.819521, 0.0897634, 0.970701, 0.22991, 0.612503, 0.096816, 0.548855 < In[13]:= SeedRandom @ 5 D In[14]:= RandomReal @8 0, 1 < ,12 D Out[14]= 8 0.000790584, 0.0650192, 0.989555, 0.968768, 0.200866, 0.819521, 0.0897634, 0.970701, 0.22991, 0.612503, 0.096816, 0.548855 < Numerical Solution of Polynomial Equations In[15]:= NSolve @ x^5 + 4 x^3 + 3 x^2 + 2 x == 10, x D Out[15]= 88 x →− 1. 1. Ç < , 8 x →− 1. + 1. Ç < , 8 x 0.5 2.17945 Ç < , 8 x 0.5 + 2.17945 Ç < , 8 x 1. << In[16]:= x =− 1. 1. I Out[16]= 1. 1. Ç In[17]:= x^5
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/25/2010 for the course PHYS 5900 taught by Professor Lin during the Fall '09 term at East Carolina University .

### Page1 / 6

Class4 - PHYS 5900 Class 4 Zi-Wei Lin Complex Numbers Functions include Abs[z Arg[z Re[z Im[z Conjugate[z Example z In[1:= Out[1]= In[2:= Out[2]=

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

View Full Document
Ask a homework question - tutors are online