Hello everyone,
I am calculating the PSD of water from VACF. I got my VACF data from LAMMPS. The result does not make sense comparing to the literature. The wavenumbers for the peaks are totally out of order. I am sending you the results for both VACF and PSD. I am trying to reproduce the PSD part of this paper: http://aip.scitation.org/doi/full/10.1063/1.4804300. Can anyone help me please? This is what I have done so far in Python:
mat = np.genfromtxt('vacf.txt')
t=mat[:,0]*1e-15 # Convert from femtosecond to second
y=mat[:,1]*1e7**2 # Convert from Angstrom/femtosecond to cm/second
dt=t[2]-t[1]
N=len(mat)
YN=fft.fft(y)
freq=fft.fftfreq(N,d=dt)
ind_freq=np.arange(1,N/2+1)
psd=YN[ind]+YN[-ind]
plt.plot(freq[ind],psd,'k')
plt.show()
ind,=np.where(psd>0.00005)
freq[ind_freq[ind]]
YN_cut=np.zeros_like(YN)
YN_cut[ind_freq[ind]]=YN[ind_freq[ind]]
YN_cut[-ind_freq[ind]]=YN[-ind_freq[ind]]
c=3e10
freqnew=freq/c
freqnew[ind]
freqnew[-ind]
plt.plot(freqnew[ind],psd)