Simulation of 1D Diffusion Using the Monte Carlo Method

This Demonstration simulates the diffusion process in one dimension, which obeys the equation , using a Monte Carlo method.

THINGS TO TRY

SNAPSHOTS

  • [Snapshot]
  • [Snapshot]
  • [Snapshot]

DETAILS

At time , there are 1000 points at the left edge of the box, representing the initial condition at . At each time step, these 1000 points will diffuse by a random walk (Monte Carlo simulation) along the box. The concentration at distance is the density (number of points) at that position.
The analytical solution of the equation is , where is the diffusion coefficient and is the initial concentration, shown as the red curve. The concentration profiles using Monte Carlo simulation are shown as blue dots.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.