[AMBER] 'Diffusion' calculation in Ptraj - could not understand a description of Ptraj code in Amber14

From: wei <lwstudy.sina.com>
Date: Thu, 05 Jan 2017 20:39:40 +0800

Dear all,
I want to verify that the translational diffusion constant I calculated for a sugar molecule is correct. I found that the magnitudes of mean square displacement (MSD) for one atom I computed using Ptraj/Cpptraj is fairly different from what I obtained from a small code I wrote (I just read in coordinates for all atoms directly then calculate MSDs as follows:
open(11,file='image.crd')do read(11,*) read(11,'(10f8.3)') (x(i),y(i),z(i),i=1,natom) nframe=nframe+1 cx(nframe)=x(1) cy(nframe)=y(1) cz(nframe)=z(1)enddoclose(11)
do t=0,2000 do i=1,nframe-t dvx(t+1)=dvx(t+1)+(cx(i+t)-cx(i))**2 dvy(t+1)=dvy(t+1)+(cy(i+t)-cy(i))**2 dvz(t+1)=dvz(t+1)+(cz(i+t)-cz(i))**2 enddo dvx(t+1)=dvx(t+1)/real(nframe-t) dvy(t+1)=dvy(t+1)/real(nframe-t) dvz(t+1)=dvz(t+1)/real(nframe-t)enddo).
Ptraj input was wrote as:
diffusion :1.C1 2 average output
Then I got (MSD for a specific t):Mine code (239.17)Ptraj (936.91)
Thus I am reading the code related to 'diffusion' command in Ptraj (please find it in AMBER14, 'actions.c'). I feel confused while seeing these lines of comments:
/* * if the particle moved more than half the box, assume * it was imaged and adjust the distance of the total * movement with respect to the original frame... */ if ( state->box[0] > 0.0 ) { if ( delx > state->box[0]/2.0 ) diffusionInfo->deltax[currentAtom] -= state->box[0]; else if ( delx < -state->box[0]/2.0 ) diffusionInfo->deltax[currentAtom] += state->box[0]; if ( dely > state->box[1]/2.0 ) diffusionInfo->deltay[currentAtom] -= state->box[1]; else if ( dely < -state->box[1]/2.0 ) diffusionInfo->deltay[currentAtom] += state->box[1]; if ( delz > state->box[2]/2.0 ) diffusionInfo->deltaz[currentAtom] -= state->box[2]; else if ( delz < -state->box[2]/2.0 ) diffusionInfo->deltaz[currentAtom] += state->box[2]; }
I am just trying to find the reason why I did not compute the same MSDs as Ptraj. I have two simple question:1. How to understand this description--"adjust the distance of the total movement with respect to the original frame"? Does 'total movement' refer to external degrees of freedom of the simulated box?2. Ptraj images atoms for all frames or just for those frames whose particle moved more than half the box?
Any help would be highly appreciated and thanks in advance!
Regards,Liu Wei--------------------------------

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Jan 05 2017 - 05:00:02 PST
Custom Search