更新
我已经在 3D 中编写了多粒子 MD 模拟。它基于朗之万动力学,具有随机脉冲和耗散。我认为该程序现在可以正常工作了吗?我附上了动能图、势能图和总能量图。我相信在没有朗之万动力学的情况下,总能量应该在耗散关闭时守恒。但是当耗散打开时,人们不应该再指望总能量守恒了。在这一点上,我想知道我的结果是否合理。我已经包含了一些更重要的代码片段(如果需要,请询问更多)
物理参数:
//V0 is the potential depth, r0 is the effective radius for the potential
double const m = 1., V0 = 1., r0 = 1., boxLength = 15., kT = 0.5;
int const n_atoms = 12;
double gamma = 0.5; //damping coeff.
double var = 2.*gamma*m*kT*dt; //variance of the gaussian distributed I
double c = (2.-gamma*dt)/(2.+gamma*dt); //due to damping
double dt = 0.005; //time step
int N = (int)(1000 / dt); //simulation time
初始化系统
void init(struct Atom system[n_atoms]){
double rc = 0.9;
double xx = 0., yy = boxLength, zz = boxLength;
int atoms_in_row = (int)(boxLength / rc);
int n = 0;
for(int k = 0; k < (int)boxLength; k++) {
for(int i = 0; i <= atoms_in_row; i++) {
for(int j = 0; j <= atoms_in_row; j++) {
if(n >= n_atoms) break;
system[n].x = xx;
system[n].y = yy;
system[n].z = zz;
system[n].vx = system[n].vy = system[n].vz = 0.;
system[n].ax = system[n].ay = system[n].az = 0.;
xx += rc;
n++;
}
yy -= rc;
xx = 0.;
}
yy = 0.;
zz -= rc;
}
}
这是分别关闭和打开耗散/随机脉冲的能量图。第一个仅显示了非 LD 情况下两个原子的能量图。接下来的两个用于 12 个原子。特别是,我认为非 LD 情况的结果很好,因为总能量或多或少是守恒的。也许结果对 LD 案例也有好处?我不太确定这一点。


