@2014301020081
2017-01-07T05:29:32.000000Z
字数 5142
阅读 1051
kongdefeng 2014301020081
Calculate the diffusion constant and make comparison of random walk in three dimension for simple-cubic lattice ,face-centered and body-centered cubic lattice.
Simulate a random walk in three dimensions allowing the walker to make steps of unit length in random direction.
Investigate the behavior of a random walk in which the probabilities for different step directions are not equal.
random walk
Cubic crystal system
dimension
7.1 Caculate the diffusion constant analytically for the random-walk simulations in Figure 7.3 and Figure 7.4.Can you generalize your analytic results to a wilder class of lattice types such as a two-dimensional triangular lattice,or a there-dimensional face-centered or body-centered cubic lattice?
7.2 Simulate a random walk in three dimensions allowing the walker to make steps of unit length in random directions; don't restrict the walker to sites on a discrete lattice.show that the motion is diffussive,that is ,<>~t.Find the value of the proportionality constant.
7.3 investigate the behavior of a random walk in which the probabilities for different step directions are not equal.
A random walk is a mathematical object which describes a path that consists of a succession of random steps. For example, the path traced by a molecule as it travels in a liquid or a gas, the search path of a foraging animal, superstring behavior, the price of a fluctuating stock and the financial status of a gambler can all be approximated by random walk models, even though they may not be truly random in reality. As illustrated by those examples, random walks have applications to many scientific fields including ecology, psychology, computer science, physics, chemistry, and biology, and also to economics. Random walks explain the observed behaviors of many processes in these fields, and thus serve as a fundamental model for the recorded stochastic activity. As a more mathematical application, the value of pi can be approximated by the usage of random walk in agent-based modelling environment.1 The term random walk was first introduced by Karl Pearson in 1905.
random walk in two dimensions
random walk in three dimensions
A popular random walk model is that of a random walk on a regular lattice, where at each step the location jumps to another site according to some probability distribution. In a simple random walk, the location can only jump to neighboring sites of the lattice, forming a lattice path. In simple symmetric random walk on a locally finite lattice, the probabilities of the location jumping to each one of its immediate neighbours are the same. The best studied example is of random walk on the d-dimensional integer lattice .
If the state space is limited to finite dimensions, the random walk model is called bordered symmetric random walk and the transition probabilities depend on the location of the state, because on margin and corner states the movement is limited.
There are three main varieties of these crystals:
Primitive cubic (abbreviated cPand alternatively called simple cubic)
Body-centered cubic (abbreviated cIor bcc),
Face-centered cubic (abbreviated cF or fcc, and alternatively called cubic close-packed or ccp)
Each is subdivided into other variants listed below. Note that although the unit cell in these crystals is conventionally taken to be a cube, the primitive unit cell often is not. This is related to the fact that in most cubic crystal systems, there is more than one atom per cubic unit cell.
For problem 7.1:
for random walk in one dimension:
code
code
the slope of line is 1,from the pattern of 7.1 so D=1/2.
for a there-dimensional face-centered or body-centered cubic lattice:
we can see for every point,there are 6 points of peak and 12 points of face-centered.I assume 18 points is equally probable.Based on my assumtion,I make the code of in a there-dimensional face-centered cubic lattice.
for a there-dimensional body-centered cubic lattice:
we can see for every point,there are 6 points of peak and 8 points of body-centered.I also assume 14 points is equally probable.
to contrast:
I make a figure including the random walk(for one walker ,1000 steps)in three dimensions for simple-cubic lattice ,face-centered and body-centered cubic lattice.
code
code
code
for simple-cubic lattice ,face-centered and body-centered cubic lattice.
code
from figure,we can see for simple-cubic lattice. for face-centered cubic lattice.
for body-centered cubic lattice.
There are also diffusion,just the rate of diffusion is different.
For problem 7.2:
we don't restrict the directions.the dirctions is random in three dimensions.the steps is constant.so we can use spherical coordinate frame to express the position of every step.
for x=rcossin ,y=rsinsin,z=rcos.
we can make the code as fllow:
self.rad1=rd.uniform(0, np.pi)
self.rad2=rd.uniform(0, 2*np.pi)
#self.r=rd.uniform(0, 10)
self.x=self.x+self.r*np.cos(self.rad2)*np.sin(self.rad1)
self.y=self.y+self.r*np.sin(self.rad2)*np.sin(self.rad1)
self.z=self.z+self.r*np.cos(self.rad1)
self.r2ave[i+1]=self.r2ave[i+1]+self.x**2+self.y**2+self.z**2
It's also diffusion ,D=1/2
we can also make the r random just from 0 to 10,we can get :
It's also linear,just D is different.
For problem 7.3:
we can consider one-dimensional walk with Pleft=0.25and Pright=0.75.
from the code of problem 7.1,we can change the probabilities simply
and get the figure of Pleft=0.25and Pright=0.75.
It's not linear,but by observing the curve,we can make the figure of ogarithmic coordinates to slove the problem.
code
We can see .it's also diffusive,just the rate of diffusion is faster than equal probabilities.
Computational Physics using MATLAB®
Wikipedia