I’m trying to calculate Normalized Velocity Autocorrelation Function from XDATCAR. Everything seems okay but the final results increase slightly higher than 1. While they’ve been normalized and should decay from 1 (because the velocity is being damped). I explain the python code I’ve written for calculating VAC. Can anyone say what is wrong about it?
First, I calculate velocities in each step: Vx=X(t+1)-X(t); Vy=Y(t+1)-Y(t); Vz=Z(t+1)-Z(t).
Then I calculate Kinetic Energy: E=0.5*m*(Vx^2+Vy^2+Vz^2)
Then I calculate VAC using this formula:
C(t)= / < ΔE(0)^2>
Which
ΔE(t) = E(t) -
Angular brackets denote averaging over a statistical ensemble. I use Arithmetic mean of kinetic energy of all atoms in each step for and then calculate ΔE(t) by above equation.
Then I use ΔE at first step for ΔE(0) and calculate C(t). But C(t) doesn’t decay from 1 (As expected) and increases slightly above 1 and then decays:
1.0
1.0411723327434699
1.0712715905255132
1.0869666718390047
1.086815165390184
1.0734484829458877
1.048255640992866
1.0137467150895072
0.9668091110022087
0.906007463426958
0.8319494116214141
0.7513883561991619
0.666062512398385
…