0

I have a question concerning the Brownian motion of a dust particle in the air. The equation is modelled in the x-direction by Xj = (Xj-1) + (vx dt) + (sigma Wj sqrt(dt)) and in the y-direction by the same case. The Wj is a standard normal distribution. The path of the dust particle must be modelled until the magnitude of its displacement is greater than or equal to 1 then the path must be plotted in a suitable manner. I'm pretty bad at coding overall and the code keeps messing up when I try to implement the recursive part of the function.

  • 2
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Show your code. Describe exactly what you mean when you say it "messes up." – MrFlick Mar 12 '20 at 01:52
  • You probably don't need to write a recursive function. You can compute the `X(j)`s using a loop on `j`. – mastropi Mar 12 '20 at 10:11

0 Answers0