Hi,
We are having problems with measurements using fix nvt/slllod. The potential energy (and therefore the forces) after the first time step appear incorrect (jumps discontinuously). This can most easily be seen by plotting the potential energy every time step and examining the difference between steps (LJeq.lmp attached). If the time step size is shrunk, the effect continues to be only in the first step (LJ_shorter_timestep attached). Similarly if we run the system for 1 timestep, then run it again for 1 timestep, the potential energy jumps going from 0-1, but then is correct at time 1 for the beginning of the next time step, before jumping again from 1-2 (LJ_run_loop.lmp attached). We have also seen a similar effect in the remapping of the box, which may be associated with the same problem.
We have performed MD simulations using our own code (4th order Runge-Kutta), and it appears to be associated with the boundary conditions; the force profile appears consistent with the boundaries not moving on the first time step, suggesting that the boundaries are continually lagging the system state.
The effect is relatively small in the energy, so I have attached scripts for 128 particle LJ system that will generate the error.
LJeq.lmp
-
Equilibrates the system.
-
Does 10 time steps with a strain rate of 0.
-
Imposes a velocity profile consistent with a strain rate of 0.5 and saves the system state (restart.start.lmp).
-
Does 10 time steps with a strain rate of 0.5 and dt=0.001.
Note that Delta_PE between timesteps both with a strain rate of zero and of 0.5 is of approximately 0.0013, except for the first time step that is 0.0023.
LJ_shorter_timestep.lmp
-
Loads system initial system state from LJeq.lmp
-
Does 10 timesteps with a strain rate of 0.5 and dt=0.0001.
Note that delta PE is now of the order of 0.0001 for all time steps except the first.
LJ_run_loop.lmp
-
Loads system initial system state from LJeq.lmp
-
Does a loop of 1 timestep 10 times with a strain rate of 0.5 and dt=0.001.
Note that the PE between the end of the last step and the beginning of the next step changes discontinuously, and the start value looks more consistent with the trend from LJeq.lmp (eg Delta PE for the first time step taken between the start of the second time step and the start of the first is approximately 0.001). Performing simulations with this loop structure matches significantly better with our code.
Any suggestions would be appreciated.
James Reid
LJ_run_loop.lmp (680 Bytes)
LJ_shorter_timestep.lmp (702 Bytes)
LJeq.lmp (1.43 KB)