
Diffusion ConstantTable of contentsNo headersUsing a GROMACS trajectory you can calculate diffusion constants both with Einstein (g_msd) and GreenKubo (g_velacc and then g_analyze) equations. While g_msd is selfexplanatory, using g_velacc starting from the version 4.0 is a bit trickier. To calculate the diffusion constant of the particle via GreenKubo equation the following commands should be supplied: g_velacc acflen 1001 nonormalize mol n atoms.ndx s topol.tpr where 'atoms.ndx' should contain the numbers of the atoms which form the particle of interest. By default, you will obtain 'vac.xvg' with a linear velocity autocorrelation function (VACF). Then to obtain the diffusion constant type: g_analyze f vac.xvg integrate This will give an integral of the VACF in [nm^{2}/ps]. Finally, to get the diffusion constant the value should be (by hand) divided by 3 (see GreenKubo equation) and multiplied by 1000 (converts [nm^{2}/ps] to more usual [10^{9}*m^{2}/s] or [10^{5}*cm^{2}/s]). For example, if you've obtained the solution for the integral value of 6e5 nm^{2}/ps from VACF, multiplying this quantity by 10^{6} and dividing it by 3 (according to greenkubo equation) would yield 2e11 m^{2}/s. This is the value of diffusion constant. 