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.

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