24小时热门版块排行榜    

查看: 4306  |  回复: 8
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

安安安子

新虫 (初入文坛)

[求助] 从LAMMPS得到的原子速度,如何计算速度自相关函数(VAF)?求助 已有3人参与

比如说我的系统里有4000个原子,在某个状态下跑了100步,每一步的时间间隔是确定的(2fs),每一步时每个原子的三维速度都会输出。我想计算这个系统的速度自相关函数VAF,计算公式是<v(0)·v(t)> 。我不太明白这个公式的含义是计算什么,用FORTRAN或MATLAB应该如何编程实现呢?紧急求助,不胜感激。
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

brucefan

专家顾问 (著名写手)

【答案】应助回帖

sorry, v_all should be v in some line of the code.
5楼2016-06-27 18:52:22
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 9 个回答

chuntao118

新虫 (著名写手)

【答案】应助回帖

感谢参与,应助指数 +1
可以参考这本书《Understanding Molecular Simulation From Algorithms to Applications》
2楼2016-03-22 14:32:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

challenger9

银虫 (初入文坛)

引用回帖:
2楼: Originally posted by chuntao118 at 2016-03-22 14:32:44
可以参考这本书《Understanding Molecular Simulation From Algorithms to Applications》

这个问题你应该早就破解了吧!!我现在在做苯的自相关,求助,求分享
3楼2016-06-24 10:06:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

brucefan

专家顾问 (著名写手)

【答案】应助回帖

% a matlab script for calculating VACF from velocity data
clear;
load v.txt;
% assume your velocity data are in the above file and assume the format is (N is the number of atoms, M is the number of time points):
% vx_1 vy_1 vz_1      % time point 1
% vx_2 vy_2 vz_2      % time point 1
% ...                            % time point 1
% vx_N, vy_N, vz_N   % time point 1
% vx_1 vy_1 vz_1      % time point 2
% vx_2 vy_2 vz_2      % time point 2
% ...                            % time point 2
% vx_N, vy_N, vz_N  % time point 2
% ...                           
% vx_1 vy_1 vz_1     % time point M
% vx_2 vy_2 vz_2     % time point M
% ...                           % time point M
% vx_N, vy_N, vz_N  % time point M

N = xxx; % number of atoms in your system
M = length(v)/N; % number of time points for your velocity data
dt = xxx; % the time interval between two set of velocities (in some unit)
Nt = xxx; % maximum length of the correlation your want (usually Nt = M/10 is a good choice)
time = dt*(0:Nt-1);
M = M-Nt; % you have to waste a small portion of data

vacf=zeros(Nt,1);
for nt=0:Nt-1
   for m=1:M
       vacf(nt+1,=sum(sum(v_all((m-1)*N+1:m*N,.*v_all((m+nt-1)*N+1m+nt)*N,));
   end
end
%vacf=vacf/M;  % you can also normalize it by using [vacf=vacf(1);] if you want

% now you can plot the result:
close all;
figure;
plot(time, vacf,'o-');
xlabel('time (some unit)');
ylabel('VACF (some unit)');
4楼2016-06-27 18:45:07
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 085600材料与化工306 +4 z1z2z3879 2026-03-21 4/200 2026-03-21 23:44 by ms629
[考研] 材料与化工(0856)304求B区调剂 +3 邱gl 2026-03-20 7/350 2026-03-21 19:05 by 15709483992
[考研] 材料学硕333求调剂 +3 北道巷 2026-03-18 3/150 2026-03-21 18:17 by 学员8dgXkO
[考研] 279求调剂 +5 红衣隐官 2026-03-21 5/250 2026-03-21 14:59 by lature00
[考研] 材料与化工(0856)304求 B区 调剂 +3 邱gl 2026-03-21 3/150 2026-03-21 13:47 by lature00
[考研] 22 350 本科985求调剂,求老登收留 +3 李轶男003 2026-03-20 3/150 2026-03-21 13:28 by 搏击518
[考研] 一志愿重庆大学085700资源与环境专硕,总分308求调剂 +3 墨墨漠 2026-03-18 3/150 2026-03-21 00:39 by JourneyLucky
[考研] 321求调剂 +9 何润采123 2026-03-18 11/550 2026-03-20 23:19 by JourneyLucky
[考研] 一志愿中海洋材料工程专硕330分求调剂 +8 小材化本科 2026-03-18 8/400 2026-03-20 23:16 by JourneyLucky
[考研] A区线材料学调剂 +5 周周无极 2026-03-20 5/250 2026-03-20 21:33 by laoshidan
[考研] 一志愿 南京航空航天大学大学 ,080500材料科学与工程学硕 +5 @taotao 2026-03-20 5/250 2026-03-20 20:16 by JourneyLucky
[考研] 招收调剂硕士 +4 lidianxing 2026-03-19 12/600 2026-03-20 12:25 by lidianxing
[考研] 288求调剂,一志愿华南理工大学071005 +5 ioodiiij 2026-03-17 5/250 2026-03-19 18:22 by zcl123
[考研] 材料与化工求调剂 +7 为学666 2026-03-16 7/350 2026-03-19 14:48 by 尽舜尧1
[考研] 0854,计算机类招收调剂 +3 胡辣汤放糖 2026-03-15 6/300 2026-03-18 12:09 by 上岸上岸……..
[考研] 277调剂 +5 自由煎饼果子 2026-03-16 6/300 2026-03-17 19:26 by 李leezz
[考研] 308求调剂 +4 是Lupa啊 2026-03-16 4/200 2026-03-17 17:12 by ruiyingmiao
[考研] 有没有道铁/土木的想调剂南林,给自己招师弟中~ +3 TqlXswl 2026-03-16 7/350 2026-03-17 15:23 by TqlXswl
[考研] 333求调剂 +3 文思客 2026-03-16 7/350 2026-03-16 18:21 by 文思客
[考研] 0856求调剂 +3 刘梦微 2026-03-15 3/150 2026-03-16 10:00 by houyaoxu
信息提示
请填处理意见