📄 timestep.xm
字号:
######################################################################## ## Example: Find optimum step size ## ######################################################################### ## XMD requires the user to choose a time step size when doing ## dynamics. The best step size is the largest one that is still ## stable. This optimum value can be found by trial and error. ## ## This is done by running molecular dynamics with the ## configuration and temperature that one wants to simulate. A ## small time step is used initially, and after 20 steps or so this ## time step size is double. This doubling repeats 5 times in the ## following example. ## ## Meanwhile, during the molecular dynamics run, the clamp is set ## to -1, and the energy is written out at every step. This clamp ## setting results in an adiabatic simulation, which means that the ## total energy will remain constant for a stable time step. When ## the time step becomes too large, the total energy will instead ## drift upward. ## ## You can see the value of the total energy by using the ESAVE ## command, writing the energies out to a file at every step. ESAVE ## saves the energies in a text file. In this example, the name of ## the file is timestep.e. Inside this text file, the first column ## holds the step number, the second holds the total energy. The ## next two columns hold the potential and kinetic energy ## respectively, which add together to give the total energy. ## ######################################################################### Trial and error to find optimum time step size# Read potential for nialread ../nial.txt# Make repeating box and lattice (in units of a0)box 6 6 6particle 21 0.25 0.25 0.252 0.75 0.75 0.75dup 5 1 0 0dup 5 0 1 0dup 5 0 0 1# Scale up to units of angstroms (2.8712 unit cell)scale 2.8712# Save energies from every dynamics step in file "timestep.e'esave 1 timestep.e# Set particle masses (in atomic mass units)select type 1mass 58.71select type 2mass 26.982# Set adiabtic simulation at starting temperature of 200Kclamp -1itemp 200# Vary time step# Set initial timestep size variablecalc STEPSIZE = 4e-16# Do 6 separate runs of 20 steps eachrepeat 6 # Set timestep size using dtime command dtime STEPSIZE # 20 steps of dynamics (energies are written to tempstep.e file) cmd 20 # Double the time step size calc STEPSIZE = 2 * STEPSIZEend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -