# class5 - PHYS 5900 Class 5 (9/06/2011Tue) Zi-Wei Lin This...

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

PHYS 5900 Class 5 (9/06/2011Tue) Zi-Wei Lin This is a make-up class for the missed class due to Labor Day. Complex Numbers: Functions include Abs[z], Arg[z], Re[z], Im[z], Conjugate[z] ü Example: z = 7 + ln H 2 + 8 i 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 + I 7 + Re @ Log @ 2 + 8 Â DDM 2 In[5]:= N @ % D Out[5]= 4.93686 In[6]:= Arg @ 1 + I D Out[6]= p 4

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

View Full Document
Functions include Random[ ] RandomReal[ ] RandomInteger[ ] RandomComplex[ ] RandomChoice[ ] SeedRandom[ ] In[7]:= Random @D Out[7]= 0.315967 In[8]:= Random @D Out[8]= 0.443438 In[9]:= RandomInteger @8 1, 10 < , 12 D Out[9]= 8 10, 4, 5, 3, 2, 8, 3, 6, 2, 1, 4, 6 < In[10]:= RandomComplex @D Out[10]= 0.603781 + 0.544495 Â In[11]:= ? 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[12]:= SeedRandom @ 5 D In[13]:= RandomReal @8 0, 1 < , 12 D Out[13]= 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[14]:= RandomReal @8 0, 1 < , 12 D Out[14]= 8 0.132548, 0.232332, 0.776135, 0.550949, 0.0586896, 0.960602, 0.0982487, 0.0343521, 0.806562, 0.439186, 0.142284, 0.027687 < In[15]:= SeedRandom @ 5 D In[16]:= RandomReal @8 0, 1 < , 12 D Out[16]= 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[17]:= NSolve @ x^5 + 4 * x^3 + 3 * x^2 + 2 * x == 10, x D Out[17]= 88 x Ø - 1. - 1. Â < , 8 x Ø - 1. + 1. Â < , 8
This is the end of the preview. Sign up to access the rest of the 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 / 6

class5 - PHYS 5900 Class 5 (9/06/2011Tue) Zi-Wei Lin This...

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

View Full Document
Ask a homework question - tutors are online