Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I understand and finished everything up until question 4. I'm not uderstanding how the number density function can be turned into a python function. Write
I understand and finished everything up until question 4. I'm not uderstanding how the number density function can be turned into a python function.
Write a 1-D random walk code. Inputs to your code should include the following Nw: the number of walkers Ns: the number of steps dL: the step size dt the time that takes the walker to walk one step [second]. The outputs should include: t: the time series Xy: the position of each walker at each step [meter], where subscript i means the ith step and j means the jth walker 1. Assume dL -3.5 [mm] dt 1.0 [second], Ns 300, Nw 1000. Use you code to compute Xij (10 points) 2. Compute the mean distance (x) and the distance-squared X averaged over all the walkers at each step i (X) w j-1 w jel Plot the KX) and VXx2) ie. square-root of (x as a function of time t in the same plot (20 points 3. In the same plot, show that is approximately VX) 2Dt where D is the diffusion coefficient (10 points): D (dL) /(2dt) 4. Compute the number density function of walkers at each time step t P(x,ti) dN. where IN (x,ti) is the number of walkers located dr between r and r+dr at the time step t,. obviously, P(x,i) is normalized (20 points)
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