Random Walk I-Stochastic Process-Lecture Slides, Slides of Stochastic Processes

Main topics for this course are Stochastic process, random variables, linear congruent generators, pdfs and cdfs, rejection method, metropolis methods, sampling techniques, random walks and genetic algorithm. This lecture includes: Random, Walk, Transport, Particles, Discrete, System, Bounded, Diffusing, 1-D, Source, State, Interval, Simulation, Equation, Model

Typology: Slides

2011/2012

Uploaded on 08/12/2012

ranganath
ranganath 🇮🇳

4.7

(3)

37 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
2
Lecture: Random Walk -
I
Monte Carlo Methods
Monte Carlo Methods
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Random Walk I-Stochastic Process-Lecture Slides and more Slides Stochastic Processes in PDF only on Docsity!

2

Lecture: Random Walk -

I

Monte Carlo Methods

Monte Carlo Methods

docsity.com

3

Transport of Particles in One-D •

Suppose a discrete system is bounded by two

B

o

and

B

N

states as

shown in Figure and

S

1

to

S

K

are all source states.

G

0

, G

1

, G

2

and so on all are possible one-D states in the system.

The random walk of particles diffusing in the system is assumed toobey the One-dimensional random walk.

RANDOM WALK:

S

1

S

2

S

3

S

4

S

k

S

k-

Bo

B

N

S

5

G

0

G

1

G

2

G

3

G

N docsity.com

5

A particle that entered

G

1

or

G

2

stays there for a short interval (say one

micro-second) and then moves to the left or right state with probability 0.5to each direction.

A particle originally at

G

o

goes to the

G

1

with a probability 0.5 or terminates

its life without going to

G

1

with probability 0.5. A similar rule applies to

G

N

too.

If a particle reaches

G

o

from

G

1

or

G

N

from

G

N-

, the life of the particle is

terminated.

The number of particles in the source states is always maintained to be

Q

i

One- Dimensional Random Walk

S

1

S

2

S

3

S

4

S

k

S

k-

Bo

B

N

S

5

G

0

G

1

G

2

G

3

G

N docsity.com

6

The one-D random walk simulation is done in following manner: A particle in

S

i

goes to

G

i

in next time interval and then to

G

i-

or

G

i+

The direction of motion is decided with the help of random number. The random walk of each particle is followed until the particle reaches

G

o

or

G

3

Every time a particle visits

G

i

, the score of

G

i

is increased by one.

If we denote the true value by

n

i

then the following equation is satisfied.

(

)

,

1 2

1

1

i

i

i

i

Q

n

n

n

=

It

shows

that

the

procedure

gives

an

approximate

solution

for

one

dimensional model.

One- Dimensional Random Walk

docsity.com

8

Result: One- Dimensional Random Walk

Here we startedwith ith position =50 for a grid of100 mesh pointsand as a functionof MC steps wesee above therandom walk.

Results:

One- Dimensional

Random Walk

One- Dimensional Random Walk

docsity.com

9

Here

we

consider

a

simple

two-dimensional

discrete

model.

Let

us

employ

an

equally

spaced two-dimensional mesh as shown here For

a

node

(i,

j),

the

nearest

neighbor

contributions (Figure) are used. The

heat

conduction

equation

in

discretized

form is given by the following equation:

j

,

i

1

j

,

i

1

j

,

i j , 1 i j , 1 i j

,

i

Q

4 1

  • φ + φ + φ + φ = φ

(i-1, j)

(i+1, j)

(i, j+1)

(i, j-1)

(i, j)

Two – Dimensional Random Walks

B
C A
D

docsity.com

11

For the point (1,2) let us first formulate the conditions to play the walkgame. Its conditions are following: the motion will be towards left side if

≤ ξ ≤

the motion will be towards upward direction if

ξ ≤

the motion will be towards right side if

ξ ≤

the motion will be towards downward direction if

ξ ≤

EXAMPLE: We have a sold bar with surface

temperatures known and fixed.

There are no internal heat sources presentin the system.

ind the temperature at a node (1, 2) usingthe procedure.

The cut-view of the bar in two-dimensionalmodel is shown in figure.

Two – Dimensional Random Walk

200

o

C

100

o

C

10

o

C

70

o

C

(1, 3) (1, 2) (1, 1)

(3, 3) (2, 2) (2, 1)

docsity.com

12

Figure shows the cross sectional view of the bar. We have assigned indices (1, 1), (2, 1), (1, 2), (2, 2),(1, 3) and (3, 3) respectively. The first trial’s results are shown below. The gameterminates when the we hit the boundary.

200

o

C

100

o

C

10

o

C

70

o

C

(1, 3) (1, 2) (1, 1)

(3, 3) (2, 2) (2, 1)

RandomNumber

(

r

)

Comparison & Decision

Next

Position

Temperature (

o

C)

0.

Right

(2,

2)

0

0.

Up

(2,

3)

0

0.

Up

Boundary

200

The next game starts again from the point (1,2). RandomNumber

(

r

)

Comparison & Decision

Next

Position

Temperature (

o

C)

0.

Left

Boundary

100

Two – Dimensional Random Walk

docsity.com

14

% Program name: monte_diffusion.m for k_trace = 0: 3 N = 200;

imax = 100;

jmax = 100;

nframes = 20; % number of frames for movie i = 50;

j = 50;

rand('state', k_trace) % this sets the generator to an initial state for k = 1: 8000 for kk = 1: 10

rr = rand;

%

if((rr >= 0 ) & ( rr < 0.25) & (right == 1))

if((rr >= 0 ) & ( rr < 0.25) ) i = i + 1;

j = j;

elseif((rr >= 0.25 ) & ( rr < 0.50) ) i = i;

j = j + 1;

elseif((rr >= 0.50 ) & ( rr < 0.75)) i = i - 1;

j = j;

elseif((rr >= 0.75 ) & ( rr <= 1.00)) i = i;

j = j - 1;

end

end

MATLAB Program

docsity.com

15

if i >= imax

break end if i <= 1 break end if j >= jmax break end if j <= 1 break end

axis([0 imax 0 jmax]); if k_trace == 0

plot(i, j, 'r:.'); elseif k_trace == 1 plot(i, j, 'b:.'); elseif k_trace == 2 plot(i, j, 'g:.'); elseif k_trace == 3 plot(i, j, ‘y:.');

end hold on F(k) = getframe;

end end % end of traces

MATLAB Program

docsity.com

17

In a random-walk simulation, such as that in Figure, anartificial

walker

takes many steps, usually with the

direction

of each step

independent

from the direction of

the previous one. This is illustrated in Figure. For ourmodel, we start at the origin and take

N

steps in the

x

y

plane of

lengths

(not coordinates).

More About RANDOM WALK

There are many physical processes, such as Brownian motion and electrontransport through metals, in which a particle appears to move randomly.

For example, consider a perfume atom released in the middle of a classroom. It collides randomly with other atoms in the air and eventuallyreaches the instructor's nose.

The problem is to determine how many collisions, on average, the

atom

must make to travel a radial distance of

R.
R
N

docsity.com

18

Here r(rms) is the average

(root-mean-squared)

step size.

Notice that that the same result obtains for a three-dimensional walk.According to above equation, even though the total distance walked after

N

steps is

Nr(rms),

on average, the radial distance from the starting point is

only sqrt(N) x r(rms).

When walk is random, the particle is equally likely toin any direction in each step. On average,

for a large number of random steps, all

the cross terms will vanish and we will be left with

More About RANDOM WALK

docsity.com

20

Random Walk Methods

Choose a random angle

in the range [0,

π

]. Set

x

= cos

θ

and

Y =

sin

θ

It is due to

dxdy

= sin

cos

d

not being uniform in

x

and

y.

Choose a random

x

in the range [-

sqrt(2), sqrt(2)] and a separate random

y

in the range [-sqrt(2), sqrt(2)]. In this way positive and negative steps in

each direction are equally likely.

Choose random values for

x

in the range [-1, 1] and

y = sqrt(1 -

x

2

(choose the sign randomly, too).

Choose the directions (N, E, S, W) randomly as the step directions (notrigonometric functions are then needed). Notice that choosing one of fourdirections is equivalent to choosing a random

integer

in [1,4].

Choose the directions (N, NE, E, SE, S, SW, W,NW) randomly as the stepdirections (no trigonometric functions are then needed). This is

equivalent to

choosing a random

integer

in the range [1,8].

We obtained the best results with the second method.

docsity.com

21

ASSESSMENT: DIFFERENT RANDOM WALKERS

docsity.com