Skip to content

scriptpapi/2D-Random-Walker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

2D-Random-Walker

Draws the path of random walkers in 2D space, and also plots the mean squared displacement.

Algorithm:

  • Generate a random number between 0 and 1.00 and assign to "r".
  • if r less than 0.25: go left.
  • if r between 0.25 and 0.50: go right.
  • if r between 0.50 and 0.75: go up.
  • if r more than 0.75: go down.
  • Repeat mutiple times.

The script also plots the mean squared displacement (MSD).

Reference Used: Computational Physics 2nd Edition - Nicholas J. Giordano and Hisao Nakanishi

Releases

No releases published

Packages

No packages published

Languages