recent links:
Main Page
|
From NewWiki
Simulating diffusion
This notebook performs a simple simulation of a collection of particles being released in a partitioned container where gaps in the container allow particles to pass through.
First of all we simulate brownian motion. A brownian motion step, will move a random direction, but fixed distance, from the current position.
Now we define the container. This is done with a test to decide whether a barrier has been crossed. The brownian motion function only allows the motion if no barrier is crossed.
In this example the container is bounded by x==0, y==0, x==10, y==10 and with a partition at x==5 but a hole in thepartition between y==4 and y==5
Here we show the paths of 50 particles over 300 steps. Most are contained in the start area, but some pass through the hole.
We can watch an animation of the particles gradually escaping, and sometimes returning, until equal numbers can be found in each half of the box.
| Created by Mathematica (May 26, 2005) |
Main Page
discussion
