Random Walk Model

We saw from our MD model on the previous page that when many particles interact together, the distribution of velocities is symmetrical around 0. This means that at a randomly chosen time, any given particle is equally likely to be moving in any direction. This observation allows us to make a huge simplification: instead of modeling our atoms as moving deterministically according to Newton's laws as they do in MD, we will just treat them as taking jumps in random directions.

Imagine taking a snapshot of the MD model every few hundred time steps and connecting the positions of one of the atoms with lines. This is essentially what Perrin did with his colloidal particles Figure 7.3.1 - measuring the distance and direction of jumps every 30 seconds. If we only care about the long term behavior of particles and not their detailed trajectories, this is an adequate and more manageable model! This type of model is known as a Random Walk model, and it greatly simplifies our code and also allows us to simulate much longer time scales with many more atoms. Here is one of the simplest versions of random walk code in NetLogo:

to go
    ask particles [
        right random-float 360
        forward 1
    ]
    tick
end

In this code, each particle first turns right by a random amount between 0 and 360 degrees. random-float 360 returns a random "float", i.e. a decimal number as opposed to an integer. This number is then given to the right-turn command.

The model below implements this code, along with some extra code that lets you draw "concentration profiles" to determine the concentration of atoms at each position. Play around with the model in NetLogo model 7.4.1 and answer the questions in Exercise 7.4.2. Note - these questions aren't easy, so you have to play around to discover what's going on. Take about 20 minutes on this task. We'll review in class. It's OK if it doesn't all make sense yet, we just want you to explore the model.

Exercise 7.4.1: Random Walk Model
Not Currently Assigned

  1. Try to describe in words what the above NetLogo code does.

  2. Try to come up with at least one situation in which random walk would not be a good model of particle motion.

Demonstration of how to sketch a concentration profile in @ref(CB10488)

Figure 7.4.1 Demonstration of how to sketch a concentration profile in NetLogo model 7.4.1

Exercise 7.4.2: Random Walk
Not Currently Assigned

Let's explore this random walk model. Take about 10-15 minutes to explore NetLogo model 7.4.1 and complete the questions below.


  1. What happens to the concentration profile at short times (10s of ticks)? (You may want to slow down the model for this.)

    How about long times (100s of ticks)? Should the long-term behavior depend on the initial concentration profile? Why or why not? Note - the edges (far left and far right) of the world are "closed". An atom will not pass over the edge of the world.

  2. What happens to the concentration profile at long times (100s of ticks)? Should the long-term behavior depend on the initial concentration profile? Why or why not?

    Note: the edges (far left and far right) of the world are "closed". An atom will not pass over the edge of the world.

  3. Try drawing different profiles with different types of shapes using the "draw-profile" option in "go-mode". Drag your mouse across the world to define concentrations in different regions. Try a number of different shapes.

    Which regions of your concentration profile change the fastest? Which change the slowest? (You may want to slow down the model in this case)

  4. Using the random walk model, try to explain the behavior you observed in the previous question - that is, why might some regions change faster than others?