Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 14th, 2013  |  syntax: None  |  size: 0.22 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. dt = 1/1000
  2.  
  3. tmax = 100
  4.  
  5. n = Floor[tmax/dt]
  6.  
  7. dw = Table[{i, Random[NormalDistribution[0, Sqrt[dt]]]}, {i, 1, n}];
  8.  
  9. stepw[{i_, wi_}] := {i + 1, wi + dw[[i + 1, 2]]}
  10.  
  11. w = NestList[stepw, {0, 0}, n];
  12.  
  13. ListLinePlot[w]
clone this paste RAW Paste Data