Question: Using MATLAB or equivalent program, simulate the trajectories of particles undergoing a one-dimensional random walk based on the equation in class: Xi(n) = Xi(n1) where

Using MATLAB or equivalent program, simulate the trajectories of particles undergoing a one-dimensional random walk based on the equation in class:

Xi(n) = Xi(n1)

where xi(n) represents the position of the ith particle after n steps, which has a 50% probability of moving forward by \delta and a 50% probability of moving backwards by \delta. Let = 12 and simulate M = 100 particles (all starting at x = 0), for 150 timesteps. Plot all 100 particle positions xi(n) from n = 1 to 151 timesteps.

HINT: MATLAB function randi returns random integer values chosen uniformly from between a specified interval. Alternatively, PYTHON function random.randint(a,b) will return a random integer between a specified interval (requires importing the random module)

HINT2: MATLAB programs run faster when vectorized. Note that Xi can be represented as a vector of (M x 1) particle positions, and that randi can output random integer values as a vector of (M x 1) forward or backward steps.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!