I’ve been assigned the project of creating a simple console app. that models brownian motion in a 2D plane. I wasn’t given much information on how to do so (and I’m hoping that it’s a pretty popular assignment so that I could get some insight) just that it relies on random number generation. I researched brownian motion for a little bit and saw some formulas that looked complicated, but by the description is just seems to have to move randomly within a certain number interval. Can anyone clarify? Am I to create a program that continually creates a random number in an interval and then modify the particles “x” and “y” coordinate or is there more to it?
Thanks for any help.
Keep in mind that the random motion is not “uniform”, but rather if you plot the frequency of movements vs movement distance you’ll see that most are short, some are longer, and a few are very long, creating something resembling an exponential decline.
I can’t remember what statistical curve the motion observes, but you can probably figure that out, and then you need to craft a random number generator that generates values to fit that curve.
What I would do is calculate distance using this RNG, then use a uniform RNG to calculate angle, from zero to 2*pi, and make the motion polar. You could calculate a random X and a random Y separately, but I’m not sure you’d get the same distribution.