[lammps-users] terminating a MD run


I am running a NPT MD and I want to run it till density becomes time independent, but in the run command i don’t see any provision for that. It will be of help to me, if somebody could guide me on this issue.



Hi Chetan,
For a small system size (even if you have a million atoms), there will be fluctuations in the density of the system. The only way to decide if the density has “converged” is to plot the volume (thermo output) against the step number; Get a feel if it has equilibrated to a certain value or not; then terminate the NPT job.

You could also plot the running average of the volume versus time (or step number); that would be a less noisy curve.



Time independent density is equivalent to NVT simulation. So if you
want exactly constant density, run NVT. You could run NPT until it
appears that the volume has come to reasonable convergence, then
switch to NVT.


There's no easy way to define "equlibrium" as a condition
to end an MD run. If you can define it in a variable
formula, you could put it an if command and use it
to terminate a loop that does successive runs.