12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

monte carlo simulations (nonthermal) 117v1vy 1vy 2x 1R2 43NFigure 5.3 Some of the N steps in a random walk that end up a distance R from the origin.Notice how the ∆x’s for each step add algebraically.If the walk is random, the particle is equally likely to travel in any direction at eachstep. If we take the average of a large number of such random steps, all the crossterms in (5.16) will vanish and we will be left withR 2 rms ≃〈∆x 2 1 +∆x 2 2 + ···+∆x 2 N +∆y 2 1 +∆y 2 2 + ···+∆y 2 N〉= 〈∆x 2 1 +∆y 2 1〉 + 〈∆x 2 2 +∆y 2 2〉 + ···= N〈r 2 〉 = Nr 2 rms,⇒ R rms ≃ √ Nr rms , (5.17)where r rms = √ 〈r 2 〉 is the root-mean-square step size.To summarize, if the walk is random, then we expect that after a large numberof steps the average vector distance from the origin will vanish:〈 ⃗ R〉 = 〈x〉⃗i + 〈y〉⃗j ≃ 0. (5.18)However, (5.17) indicates that the average scalar distance from the origin is √ Nr rms ,where each step is of average length r rms . In other words, the vector endpoint willbe distributed uniformly in all quadrants, and so the displacement vector averagesto zero, but the length of that vector does not. For large N values, √ Nr rms ≪ Nr rmsbut does not vanish. In our experience, practical simulations agree with this theory,but rarely perfectly, with the level of agreement depending upon the details of howthe averages are taken and how the randomness is built into each step.5.4.2 Implementation: Random WalkThe program Walk.java on the instructor’s CD is our random-walk simulation. It’skey element is random values for the x and y components of each step,✞x += ( randnum . nextDouble () − 0.5 ) ;y += ( randnum . nextDouble () − 0.5 ) ;sq[i] += x∗x + y∗y;✝/ / Radius☎−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!