GROMACS 专题

GROMACS NVE、随机动力学与退火

NVE、随机动力学与退火,包含终端操作、输入文件、实际数据和适用范围。

更新于 2026-10-26约 6 分钟阅读按任务与环境选择适用配置
阅读本篇目录

本文以鸢算科技集群 GROMACS 2026.4 实际结果为例。下载输入、参考轨迹、分析与绘图资料包,资料包约 529 MB,包含参考轨迹。解压后进入 gromacs-examples。参考输出在 cases;新计算由 new-case.py 建立独立目录。

本篇任务与操作要点#

NVE 关闭温控和压控,比较相同 10 ps 时长的 1 fs 与 2 fs 时间步。两者从同一水盒末态及检查点开始;观察总能量变化,不能用被恒温器控制住的温度曲线替代能量守恒检查。

随机动力学使用 integrator = sd,不额外叠加普通温控器,tau-t 决定阻尼相关参数;物理动力学性质需判断该耦合的影响。退火用 annealing = single,在 0、10、20 ps 设 300、350、300 K 的目标温度,真实温度不会瞬间精确跟上目标。

两种 NVE 步长的能漂仍受约束、截断、邻居表、精度和初始条件影响。这里只演示怎样检查,不把一次短测结论外推到所有力场和体系。

1 准备与提交#

python new-case.py nve-1fs
cd work/nve-1fs
sbatch run.sh

run.sh 申请资源后执行 workflow.sh。不要在登录节点直接执行完整模拟。下列每个算例可单独新建副本并提交。

算例目录 本次内容
nve-1fs 完整输入、前置文件与真实计算输出
nve-2fs 完整输入、前置文件与真实计算输出
langevin 完整输入、前置文件与真实计算输出
anneal 完整输入、前置文件与真实计算输出

2 实际终端命令#

以下是在对应算例目录中实际执行并生成结果的命令。分析命令在该算例的 analysis 子目录执行;交互回答已用 printf 写入,组名需随自己的体系核对。

nve-1fs

gmx grompp -f run.mdp -c start.gro -t md.cpt -p topol.top -o run.tpr
gmx mdrun -deffnm run -ntmpi 1 -ntomp 4 -nb gpu -pme gpu -update cpu
printf %s 'Potential
Total-Energy
Temperature
0
' | gmx energy -f run.edr -o energy.xvg

3 输入文件与关键设置#

nve-1fs/run.mdp 完整输入(点击展开)
cutoff-scheme = Verlet
nstlist = 20
coulombtype = PME
rcoulomb = 1.0
rvdw = 1.0
pbc = xyz
constraints = h-bonds
integrator = md
dt = 0.001
nsteps = 10000
nstenergy = 50
nstcalcenergy = 50
nstlog = 1000
nstxout-compressed = 50
tcoupl = no
tc-grps = System
tau-t = 0.5
ref-t = 300
pcoupl = no
gen-vel = no
gen-temp = 300
gen-seed = 76262
continuation = yes
pcoupltype = isotropic
tau-p = 5
ref-p = 1
compressibility = 4.5e-05
nstxout = 500
nstvout = 500
nstfout = 0
nve-2fs/run.mdp 完整输入(点击展开)
cutoff-scheme = Verlet
nstlist = 20
coulombtype = PME
rcoulomb = 1.0
rvdw = 1.0
pbc = xyz
constraints = h-bonds
integrator = md
dt = 0.002
nsteps = 5000
nstenergy = 50
nstcalcenergy = 50
nstlog = 1000
nstxout-compressed = 50
tcoupl = no
tc-grps = System
tau-t = 0.5
ref-t = 300
pcoupl = no
gen-vel = no
gen-temp = 300
gen-seed = 76262
continuation = yes
pcoupltype = isotropic
tau-p = 5
ref-p = 1
compressibility = 4.5e-05
nstxout = 500
nstvout = 500
nstfout = 0
langevin/run.mdp 完整输入(点击展开)
cutoff-scheme = Verlet
nstlist = 20
coulombtype = PME
rcoulomb = 1.0
rvdw = 1.0
pbc = xyz
constraints = h-bonds
integrator = sd
dt = 0.002
nsteps = 10000
nstenergy = 50
nstcalcenergy = 50
nstlog = 1000
nstxout-compressed = 50
tcoupl = no
tc-grps = System
tau-t = 0.5
ref-t = 300
pcoupl = no
gen-vel = no
gen-temp = 300
gen-seed = 76262
continuation = yes
pcoupltype = isotropic
tau-p = 5
ref-p = 1
compressibility = 4.5e-05
nstxout = 500
nstvout = 500
nstfout = 0
ld-seed = 87211
anneal/run.mdp 完整输入(点击展开)
cutoff-scheme = Verlet
nstlist = 20
coulombtype = PME
rcoulomb = 1.0
rvdw = 1.0
pbc = xyz
constraints = h-bonds
integrator = md
dt = 0.002
nsteps = 10000
nstenergy = 50
nstcalcenergy = 50
nstlog = 1000
nstxout-compressed = 50
tcoupl = v-rescale
tc-grps = System
tau-t = 0.5
ref-t = 300
pcoupl = no
gen-vel = no
gen-temp = 300
gen-seed = 76262
continuation = yes
pcoupltype = isotropic
tau-p = 5
ref-p = 1
compressibility = 4.5e-05
nstxout = 500
nstvout = 500
nstfout = 0
annealing = single
annealing-npoints = 3
annealing-time = 0 10 20
annealing-temp = 300 350 300

4 实际结果与画图#

鸢算科技集群实算数据:nve

鸢算科技集群实算数据:thermostats

用附件中的 Python 脚本重画所有参考图:

# 回到 gromacs-examples 根目录
module load ase/3.29.0
python plot.py --root .

plot.py 使用 NumPy 和 Matplotlib,直接读取 XVG/COLVAR/坐标数值,图片保存在 figures。对单项新结果,可照着脚本对应段替换文件路径;不要把不同模型或单位的数据直接拼在一起。

参数查阅#

以本集群 gmx 命令名 -h 为准;GROMACS 2026.4 命令手册和MDP 参数手册可查完整选项。

需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。

查看配图

放大后可滚动查看细节,按 Esc 关闭。

100%查看原图 ↗