[gmx-users] Re: g_msd additional information

Justin Lemkul jalemkul at vt.edu
Thu Jan 24 20:29:20 CET 2013

On 1/24/13 6:12 AM, dakoenig wrote:
> Hi Justin,
> thank you so far. Now I got some more specific questions regarding g_msd
> I got my trajectory from 0-30ns. So far it should to be "correct".
> I was analyzing this trajectory with g_msd and the following command:
> g_msd -f mdrun.xtc -s mdrun.tpr -nice 0 -b 0 -e 30000 -beginfit 15000
> -endfit 16000 -o D_coeff
> g_msd -f mdrun.xtc -s mdrun.tpr -nice 0 -b 0 -e 30000 -beginfit 15000
> -endfit 17000 -o D_coeff
> g_msd -f mdrun.xtc -s mdrun.tpr -nice 0 -b 0 -e 30000 -beginfit 15000
> -endfit 18000 -o D_coeff
> and so on
> I observed an slight linear decreasing diffusion coefficient. The error bars
> instead were increasing (starting at -beginfit 15000 -endfit 23000)
> dramatically. Why do I observe such a behavior?

I don't have a direct answer, but the quality of the resulting calculation 
depends on the quality of the fit.  I don't know how parsing out random parts of 
the MSD curve necessarily helps you.  It should be a fairly straight line with 
default values of -beginfit and -endfit doing a decent job unless the ends are 
really weird.

> Is this the reason:
> http://gromacs.5086.n6.nabble.com/MSD-and-self-diffusion-td4411869.html

I don't see how that's related.

> In addition to that I analyzed the trajectory every 1 ns:

Careful, you're not analyzing every ns, you're fitting over every ns and doing 
the calculation over 30 ns of data.

> g_msd -f mdrun.xtc -s mdrun.tpr -nice 0 -b 0 -e 30000 -beginfit 1000 -endfit
> 2000 -o D_coeff
> g_msd -f mdrun.xtc -s mdrun.tpr -nice 0 -b 0 -e 30000 -beginfit 2000 -endfit
> 3000 -o D_coeff
> g_msd -f mdrun.xtc -s mdrun.tpr -nice 0 -b 0 -e 30000 -beginfit 3000 -endfit
> 4000 -o D_coeff
> Here I observed extreme fluctuations starting at 25ns. The errors bars
> starting at 27ns were huge. Why do I observe these extreme error bars and
> fluctuation for the last 3/5 ns?

You're using less and less data and getting wider error bars, likely.

> I checked my whole trajectory (g_msd -f mdrun.xtc -s mdrun.tpr -nice 0 -b 0
> -e 30000) as well, but it is a straight line, without any observable curves.

That's the expected outcome.  If you zoom into the very beginning of the data 
(first few hundred ps or less), there is likely a small curvature that then 
leads into a long period of linear data.



Justin A. Lemkul, Ph.D.
Research Scientist
Department of Biochemistry
Virginia Tech
Blacksburg, VA
jalemkul[at]vt.edu | (540) 231-9080


More information about the gromacs.org_gmx-users mailing list