Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 2: Confined 2D random walk Brownian motion is the motion of a particle, such as a smoke or dust particle, in a gas, as
Question 2: Confined 2D random walk Brownian motion is the motion of a particle, such as a smoke or dust particle, in a gas, as it is buffeted by random collisions with gas molecules. Make a simple computer simulation of such a particle in two dimensions as follows. The particle is confined to a square grid or lattice LL squares on a side, so that its position can be represented by two integers i,j=0L1. It starts in the middle of the grid. In each step of the simulation, choose a random direction---up, down, left, or right---and move the particle one step in that direction. This process is called a random walk. The particle is not allowed to move outside the limits of the lattice---if it tries to do so, choose a new random direction to move in. (We choose an odd length for the side of the square so that there is one lattice site exactly in the center.) Write a program to perform a million steps of this process on a lattice with L=101. Plot the position of the particle for different numbers of steps (100,1000,10000,100000). [25 points] he following code is demostrated as follow
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started