Question: 2. Random Walk Collisions Write a MATLAB script to model the behavior of two random walkers on a 2D grid of tiles with a wall,
2. Random Walk Collisions Write a MATLAB script to model the behavior of two random walkers on a 2D grid of tiles with a wall, as depicted in Fig. 1. To be more precise, do the following: 1. Start by simulating the path that the single random walker A takes on an n n grid of tiles where n 13 is an odd number. Let this random walker use a compass with a disturbance. The disturbance is given by the disturbance parameter d, which is a constant random number in the interval .0:04; 0:04/ that affects the North-, East-, South-, and West-directions throughout the entire simulation. The probability p of each of these directions is given by 0:2 when using an undisturbed compass. To visualize the moving random walker, use the DrawRect-function provided earlier in this course (it can thus be copied from one of the lecture MATLAB files), and use different colors for the updated position and the initial position, as shown in Fig. 1. If the random walker tries to move "past" one of the boundaries on its turn, its position does not change (you can think of this as a particle bumping into a wall
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
