Hi,

I got some problems when I calculated the volecity autocorrelation coefficient.
Here is my input file

Si EMD test

units metal
dimension 3
boundary p p p
atom_style atomic
neighbor 1.0 bin
neigh_modify delay 5 check yes

lattice custom 5.431 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 &
basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 &
basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 basis 0.25 0.25 0.25
region box block 0.0 200.0 0.0 8.0 0.0 4.0
create_box 1 box
create_atoms 1 box basis 1 1 basis 2 1 basis 3 1 basis 4 1 basis 5 1 basis 6 1 basis 7 1 basis 8 1
mass 1 28.085

velocity all create 300.0 43454 dist gaussian mom yes
fix 1 all nvt temp 300.0 300.0 0.005

pair_style sw
pair_coeff * * SiGe.sw Si

neighbor 0.3 bin
neigh_modify every 5 delay 0 check no

compute 2 all vacf
fix 5 all vector 1 c_2[4]
variable diff equal dt*trap(f_5)
thermo_style custom step v_diff
thermo 10
timestep 0.0003

fix 3 all print 10 “\${diff}” file vacf.txt

run 10000
clear

I used the input file above, and got the result that I thought was wrong.
My question is that I want to calculate volecity autocorrelation coefficient by using the formula

But, the command vacf seems like not use this formula.
It seems like that LAMMPS calculate vacf as

Not use v=v(t).
Is this understanding correct?

And if I want to calculate as the definition of first equation, is there any command in LAMMPS that I can use?

Thank a lot,
Michael I-Ta Hsieh

The compute vacf in LAMMPS needs to compute the VACF from

a reference point in time. In the formula it is called time 0.

In reality it is the point in time you defined the compute vacf

command. The formula is the same as yours with tau = 0.

If you are asking to compute an averaged VACF from a bunch

of different starting points, then LAMMPS doesn’t do that.

It would require storing many velocity snapshots (maybe 1000s)

which would be inefficient. For that I suggest your post-process

a dump file with velocities in it.

Steve