error of energy as "nan" without overlapping of atoms, with class2 forcefield


I am modeling perfluoropolyether/carbon bi-layer system. I build up the model in Materials Studio, converted to LAMMPS input via “msi2lmp” tool with pcff potential. Then I am equilibrating the model via classII forcefield. Some of my input script is as follows. However, I met energy ‘nan’ problem at minimize step as below. I check the dump file output & find that only one atom has the force vector as ‘nan’ at “timestep 0”.

I have carefully checked the coordinates of atoms & believe there is no overlapping or over-close pair of atoms. The atom shown (in dump file) with ‘nan’ force vectors actually has a distance of 2.01 Anstrong to the nearest neighbor. To avoid random reason, I have tried to set the zero force at the beginning (fix setforce), but the problem still exists.

I believe there is no coordinate overlapping because only one atom shows force as ‘nan’. Because any actual overlapping atom pairs will at least cause two ‘nan’ cases.

Would highly appreciate if any advise!

Input script:



pair_style lj/class2/coul/cut 10.

bond_style class2

angle_style class2

dihedral_style class2

improper_style class2

Atom definition

read_data NS.inp

Parameter of simulation

neighbor 5 bin

neigh_modify every 10 delay 0 check yes

timestep 0.1



minimize 0.0 1.0e-8 1000 100000


fix 1 all nvt temp 300.0 300.0 100.0

run 10000

Output (log.lammmps):



minimize 0.0 1.0e-8 1000 100000

WARNING: Resetting reneighboring criteria during minimization (min.cpp:173)

Memory usage per processor = 90.6056 Mbytes

Step Temp E_pair E_mol TotEng Press

0 209.32771 55407.949 nan nan nan

1 209.32771 55407.949 nan nan nan

Dump data:



ITEM: ATOMS id type x y z vx vy vz fx fy fz mol


10968 4 6.8552 1.0056 22.2926 4.9888e-03 -5.6215e-03 -6.4112e-03 0.0000 0.0000 0.0000 31

10997 4 0.6333 4.8765 22.0531 -1.9312e-03 -1.7868e-03 1.6617e-03 0.0000 0.0000 0.0000 31

1 1 17.6363 6.9447 28.9946 -7.5721e-03 -6.0609e-03 1.7162e-03 nan nan nan 1

2 2 19.0314 6.5512 28.8435 6.0839e-03 -2.1043e-03 -7.8102e-03 -28.2966 22.3860 13.3885 1

3 3 19.3154 5.5499 29.7162 -2.0617e-03 -1.4510e-04 -5.4143e-04 2.9177 -21.2351 16.9181 1


Thanks & Best Regards!

Dai Ling


Institue of High Performance Computing, A*STAR


Tel: +65-64191428

The nan is in Emol which means a molecular energy from
a bond/angle/etc. You can list ebond, eangle, etc in your
thermo_style custom list of keywords to see which it is.
I am guessing when you do that you will find some molecular
topology interaction that is bogus.