2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

12
2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Transcript of 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Page 1: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

2-D & 3-D Random Walk Simulations of Stochastic Diffusion

Bob Brazzle (Jefferson College)

Page 2: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

HexCellEnt: A 2-D Random Walk Game

Game Basics: Place your marker in the center hexagon; roll a die; move one space in the direction indicated by the 6-point rose. Repeat.

Goal: Move your marker off the game board (minimum number is 4 rolls).

Questions: What is the probability of exiting the board in exactly 4 rolls? How could you calculate this probability?

Page 3: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Typical Student Answers (Introductory Lab)

Questions: What is the probability of exiting the board in exactly 4 rolls? How could you calculate this probability?

Most Common Answer: play a bunch of games and count.

Alternate answer: count the “successful” 4-step escape paths.

Page 4: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

11

1

1

1162

2 2

2

22

2

2

2

2

2

2 1

1

1

1

1

1

An Elegant Path-Counting Method

After Roll #1 After Roll #2

Page 5: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Setting up the Excel Spreadsheet

A B C D E

1 Roll # Center 1st Ring 2 Main 2 Neighbor

2 2nd 6 2 1 2

3 3rd =6*C2 =2*(C2+E2)+B2+D2 =2*(E2+G2)+C2+F2 =2*(C2+D2+G2)

Setting up the spreadsheet:

Every type of cell gets its own column (it helps to name them, as shown)

Each row is a new roll

For a given cell, set up the equation to add the values from the previous roll in the neighboring cells. (Not shown: Column F is “3rd Ring Main”,column G is “3rd Ring neighbor”,column H is “Number escaping”)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3M

3M 3M

3n3n3n

3n2M

2M2M2n2n

111

111

C

Page 6: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Major Conceptual Shift from path counting {single particle} to relative concentration {infinitely many}

Occupation numbers Occupation probabilities, OR…Relative Concentrations

Page 7: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Example Calculations using the Spreadsheet(most are probably beyond the introductory course)

0 2 4 6 8 10 12 14 16 180

1

2

3

4

5

f(x) = 0.968955765239785 x^0.500707088161058

17-Ring Hexagon Simulation Results

Number of Steps

Dis

tan

ce

Tra

ve

led

We can use the relative concentrations to calculate a weighted average of distance traveled by a particle.

The equation for the best-fit curve is consistent with the well-known result for a random walk – a power law relationship between distance traveled and number of steps taken.

Page 8: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Example Calculation: Flux across a Border

Outbound flux: Notice that all cells in ring #1 have three sides exiting to ring #2. For each cell:Fluxout = (2 * 3/6) ÷ 36

Inbound flux: Some cells have 1 side leading in and some have 2 sides. Total inbound flux is:Fluxin = [(1*6*1/6)+(2*6*2/6)] ÷ 36

Page 9: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Fick’s 1st Law of Diffusion

Compare the net flux across some boundary with the total difference between the relative concentrations across the same boundary. This yields the graph below.

-1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 00

0.05

0.1

0.15

0.2

0.25

Rings 2 and 3

Radial Concentration (Probability) Gradient

Flux

: Rin

gs 2

to 3

Page 10: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

The Continuity Equation…

For any given ring, the rate of change of concentration from one roll to the next {1st time difference}…

Equals the net flux into that ring (must perform calculation across each boundary).

{2nd spatial difference}

  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Page 11: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

… becomes the diffusion equation (Fick’s 2nd Law)

-0.18 -0.16 -0.14 -0.12 -0.1 -0.08 -0.06 -0.04 -0.02 0

-0.03

-0.025

-0.02

-0.015

-0.01

-0.005

0

f(x) = 0.166666666666667 x

Rings 1 - 3

2nd Partial Differences (radial)

1st P

artia

l Diff

eren

ces

(tm

e)

Page 12: 2-D & 3-D Random Walk Simulations of Stochastic Diffusion Bob Brazzle (Jefferson College)

Extensions

I have created Excel files to study the following alternatives:• Larger hexagon boards – up to 17 concentric rings• Other plane tiling arrangements (e.g. a “great

rhombitrihexagonal” tiling: dodecagon, hexagon & square)• Soccer-ball-shaped HexCellEnt board• A 3-D space-filling shape – the truncated octahedron