softmatter:Calculating the diffusion coefficient

From NSDL Materials Digital Library Wiki

Jump to: navigation, search

To calculate the diffusion coefficient of a system the Mean squared displacement and Velocity autocorrelation function are typically used. The general procedures for calculating the diffusion coefficient using both of these methods are outlined below.

Contents

Mean squared dispacement

We have that the Einstein equation is  \left \langle r^2(t) \right \rangle =2dDt , where d is the dimensionality. For a three dimensional system this can easily be related this to the Mean Squared Displacement to get:

 D = \frac{1}{6}\lim_{t \to \infty}\frac{d}{dt}(MSD)

Accuracy

It is important to note that this relation is valid as t approaches infinity. As such, to arrive at the best answer, one must run for sufficiently long time and calculate the slope of the long time region.

You do not want to calculate the slope of the entire curve, but rather only the portion that is fully within the diffusive regime (see the Mean squared displacement entry for details on where this regime occurs). In the plot below, the regions in blue indicate where the slope was calculated. In the plots below you will find the calculation of the diffusion coefficient. The diffusion coefficient was calculated for a system run for only 4000 time steps verses one for 40000; the system run for 40000 timesteps produces a value closer to the accepted value.

Image:MSD statistics.jpg

Caveat

  • Often times software outputs data in the form of : MSD vs. number of timesteps. The relation for calculating the diffusion coefficient requires time not number of timesteps.
  • In order to arrive at the proper value, you must do one of two things:
    • Multiply the number of timesteps by the size of the timestep (Δt). time = Δt * number of timesteps. Then calculate using the relation above.
    • Calculate the slope of the line, divide by 6, AND divide by the size of the timestep, Δt.

Velocity autocorrelation function

To arrive at the diffusion coefficient using the VACF, you must integrate the area under the curve, and multiple by the temperature, as detailed by the Green-Kubo relation:

 D = T \lim_{t \to \infty} \int_{0}^t dt' C_{vv}(t')

The general algorithm is to intergrate the VACF curve (sum up the values of the curve) and multiple by the temperature.

Accuracy

The the longer time the VACF is calculated, the better the statistics. Below you will see you plots for the diffusion coefficient as calculated from the VACF over 4000 timesteps and 40000 timesteps. The diffusion coefficient as calculated from the run using 40000 timesteps gives a value closer to the accepted value.

Image:VACF statistics.jpg

Additionally, by averaging the VACF over several time windows (i.e. averaging multiple VACF curves together) statistics can also be increased and one will approach the accepted value.

Caveat

  • Often times software outputs data in the form of : VACF vs. number of timesteps. The relation for calculating the VACF requires time not number of timesteps.
  • In order to arrive at the proper value, you must do one of the following two things:
    • Multiple the number of timesteps by the size of the timestep (Δt). time = Δt * number of timesteps. Then calculate as shown in the relation above.
    • Integrate the the VACF curve, multiply by temperature, AND multiple by Δt.
  • Glotzilla outputs datafiles that are also a function of the number of time windows averaged.
Personal tools

Kent State University NIST MIT University of Michigan Purdue Iowa State University