Variable Langevin Integrator timestep after local energy minimization
Posted: Mon Sep 09, 2019 7:11 am
I was troubleshooting the fact that our system ends up with a very large Ep and Ek after running local energy minimization, and I came across a very strange observation.
I tried advancing the integrator step-by-step after running local energy minimization. I'm using Variable Langevin Integrator. With a system I'm currently simulating, I'm observing the following timesteps and energies:
At the end of energy minimization, Ek = 1.5 kT/particle; Ep = 0.02 kT/particle
After one timestep, the time advances by 815 fs. Kinetic and potential energy shoot up: Ek=94.92 kT/particle; Ep=12.68
After the second timestep, the time advances by 17 fs, energies are: Ek=0.97 Ep=12.83
We expect the timestep to be at most 50-100fs given the potentials we have. So it looks like the first step of the integrator was very large, which leads to large integration error and hence to very large energies. This is with error_tol of 0.001 - issue persists with error_tol of 0.0001 as well, and we really need 0.01 for this system.
It also looks like if I decrease tolerance of energy minimization(0.001 vs 0.3), then the first step of variable langevin integrator ends up even larger (1500 fs for example), and the energy shoots up to 1000+kT/particle. Not sure why exactly this happens - maybe variableLangevin measures the forces to be too small and adjusts the timestep to be too large? On the contrary, if I don't do the energy minimization at all, in this particular system everything goes just fine: the system starts and continues with 40fs timestep, extra 3kT/particle of potential energy we've been trying to minimize is pumped into kinetic energy and gets absorbed by the thermostat. Yet we often need to dissipate much more Ep at the start of a simulation, and then this becomes an issue.
I tried using setStepSize of variableLangevinIntegrator, but it does nothing, and the description warns you that this might be the case.
I can try to make a self-contained example, but it will take time to make it because I'm running this using our polymer simulation library.
I tried advancing the integrator step-by-step after running local energy minimization. I'm using Variable Langevin Integrator. With a system I'm currently simulating, I'm observing the following timesteps and energies:
At the end of energy minimization, Ek = 1.5 kT/particle; Ep = 0.02 kT/particle
After one timestep, the time advances by 815 fs. Kinetic and potential energy shoot up: Ek=94.92 kT/particle; Ep=12.68
After the second timestep, the time advances by 17 fs, energies are: Ek=0.97 Ep=12.83
We expect the timestep to be at most 50-100fs given the potentials we have. So it looks like the first step of the integrator was very large, which leads to large integration error and hence to very large energies. This is with error_tol of 0.001 - issue persists with error_tol of 0.0001 as well, and we really need 0.01 for this system.
It also looks like if I decrease tolerance of energy minimization(0.001 vs 0.3), then the first step of variable langevin integrator ends up even larger (1500 fs for example), and the energy shoots up to 1000+kT/particle. Not sure why exactly this happens - maybe variableLangevin measures the forces to be too small and adjusts the timestep to be too large? On the contrary, if I don't do the energy minimization at all, in this particular system everything goes just fine: the system starts and continues with 40fs timestep, extra 3kT/particle of potential energy we've been trying to minimize is pumped into kinetic energy and gets absorbed by the thermostat. Yet we often need to dissipate much more Ep at the start of a simulation, and then this becomes an issue.
I tried using setStepSize of variableLangevinIntegrator, but it does nothing, and the description warns you that this might be the case.
I can try to make a self-contained example, but it will take time to make it because I'm running this using our polymer simulation library.