[MMTK] constrained bonds - nan problem

Konrad Hinsen hinsen at cnrs-orleans.fr
Wed May 6 07:43:10 UTC 2009

On 06.05.2009, at 03:59, Qadir Timerghazin wrote:

> Recently, I've been trying to perform simulations with some bonds  
> constrained,
> but it looks like there is an elusive bug which leads to nan's during
> the integration (or segfaults at some systems, 64-bit Linux  
> mostly). The bug is
> quite subtle - it shows up and disappears depending on the  
> molecular system,
> force field, restraints applied, thermostat and the computer/OS.   
> When a

Neither the NaNs nor the crashes are actually the real problem with  
your simulation. Looking at the simulation protocol, it is clear the  
total energy of the system grows rapidly right from the start. This  
leads to growing forces as well, which in turn make the coordinates  
and velocities very large. Your system is very unstable. Since for  
efficiency reasons there are no checks on the numerical operations,  
this sooner or later leads to system-dependent symptoms such as NaN  
values or crashes. You will see the same kind of behaviour with any  
molecular simulation program.

The cause of an instability requires careful analysis, but the  
biggest problem with your system is that you start an NVT simulation  
at 300 K right from an energy-minimized structure. You are thus  
adding a big amount of energy in a single step, which will crash  
nearly any molecular system.

What you should do is heat up your system slowly. You can initialize  
the velocities to a low temperature, say 20 K, and then run NVE MD  
with a heater. There is an example script coming with MMTK that shows  
how to do it. Once your NVE MD is stable at the desired temperature  
of 300 K (absence of a notable energy drift), you can add the  
thermostat to do NVT simulations. You should never add a Nose  
thermostat to a system that is at a very different temperature - this  
is almost a guarantee for disaster.

Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: hinsen at cnrs-orleans.fr

More information about the mmtk mailing list