[lammps-users] About energy conservation: an example of LJ potential

Dear Lammps users,

I am doubting the very basic concept of energy conservation in MD simulations. In nature, if the system is isolated total energy is conserved. In simulation, I am not sure that the developers of many empirical potentials consider the energy conservation during their development process. For me it looks they only want to fit them to experimental properties. The energy conservation is closely related with the functional forms of potentials?

Does anybody give me some references for this concerns?

Below shows input script and output for two LJ particles in the box, and shows total energy does not conserve but fluctuate under NVE. Is it correct?

Thank you.

Joe

##Input Script##

boundary f f f

atom_style atomic

units metal

lattice diamond 3.567

region box block -50 +50 -50 +50 -50 +50 units box

atom_modify map array

neighbor 2.0 nsq

create_box 2 box

create_atoms 1 single 0 0 0 units box

create_atoms 2 single 2.7 0 0 units box

mass 1 12.011

mass 2 12.011

timestep 0.001

pair_style lj/cut 2.5

pair_coeff * * 1.0 1.0

group myatom id 2

velocity myatom set -50.0 0 0 units box

variable dimerdistance equal x[2]-x[1]

Setup output

thermo 1

thermo_style custom step temp pe ke etotal v_dimerdistance

thermo_modify norm no

compute sys_pe all pe

shell mkdir Dump

dump mindump all custom 1 ./Dump/*.dump id type xs ys zs

fix 11 all nve

run 60

###Output ###

Lattice spacing in x,y,z = 3.567 3.567 3.567

Created orthogonal box = (-50 -50 -50) to (50 50 50)

2 by 2 by 2 processor grid

Created 1 atoms

Created 1 atoms

1 atoms in group myatom

Setting up run …

Memory usage per processor = 1.25893 Mbytes

Step Temp PotEng KinEng TotEng dimerdis

0 12038.246 0 1.5560654 1.5560654 2.7

1 12038.246 0 1.5560654 1.5560654 2.65

2 12038.246 0 1.5560654 1.5560654 2.6

3 12038.246 0 1.5560654 1.5560654 2.55

4 12038.246 0 1.5560654 1.5560654 2.5

5 12046.929 -0.01840987 1.5571877 1.5387779 2.45

6 12065.653 -0.020825329 1.559608 1.5387827 2.3999279

7 12087.334 -0.023622031 1.5624106 1.5387886 2.3497726

8 12112.527 -0.026871283 1.565667 1.5387957 2.299521

9 12141.906 -0.030660062 1.5694645 1.5388044 2.2491574

10 12176.299 -0.035095044 1.5739102 1.5388152 2.1986636

11 12216.73 -0.040307835 1.5791363 1.5388285 2.1480172

12 12264.468 -0.046461839 1.5853069 1.5388451 2.0971917

13 12321.101 -0.053761336 1.5926273 1.538866 2.0461553

14 12388.629 -0.062463612 1.6013559 1.5388923 1.9948691

15 12469.592 -0.072895337 1.6118213 1.538926 1.9432859

16 12567.247 -0.085474911 1.6244442 1.5389693 1.8913479

17 12685.804 -0.10074329 1.6397689 1.5390256 1.8389841

18 12830.764 -0.11940696 1.6585064 1.5390995 1.7861061

19 13009.391 -0.14239846 1.6815958 1.5391973 1.7326043

20 13231.383 -0.17096217 1.7102905 1.5393283 1.6783405

21 13509.815 -0.20677578 1.7462806 1.5395049 1.6231408

22 13862.458 -0.25212005 1.7918634 1.5397433 1.5667841

23 14313.506 -0.31010402 1.8501659 1.5400619 1.5089887

24 14895.441 -0.38491877 1.9253869 1.5404681 1.4493957

25 15649.52 -0.48194935 2.0228592 1.5409098 1.3875521

26 16618.564 -0.60702985 2.148118 1.5410881 1.3229059

27 17807.955 -0.76209454 2.3018588 1.5397642 1.2548509

28 19026.014 -0.92700278 2.4593053 1.5323025 1.1829572

29 19323.896 -0.99330982 2.4978096 1.5044998 1.1078499

30 15855.195 -0.59831636 2.0494448 1.4511284 1.0342825

31 7689.8417 0.581329 0.99399005 1.5753191 0.98001656

32 8004.2491 0.52714785 1.0346304 1.5617783 0.98159773

33 16145.168 -0.63502786 2.0869268 1.451899 1.0374451

34 19355.553 -0.99618216 2.5019016 1.5057194 1.1113017

35 18972.123 -0.92023901 2.4523393 1.5321003 1.1862965

36 17744.497 -0.75458279 2.2936562 1.5390735 1.2579978

37 16563.807 -0.60076919 2.1410401 1.5402709 1.325868

38 15605.333 -0.47708149 2.0171477 1.5400662 1.3903558

39 14860.094 -0.38119479 1.9208179 1.5396231 1.4520673

40 14284.932 -0.30725169 1.8464724 1.5392207 1.5115504

41 13838.957 -0.24991936 1.7888257 1.5389063 1.5692534

42 13490.108 -0.20506217 1.7437333 1.5386711 1.6255314

43 13214.531 -0.16961521 1.7081122 1.538497 1.6806629

44 12994.709 -0.14133011 1.6796979 1.5383678 1.7348668

45 12817.746 -0.11855246 1.6568237 1.5382712 1.7883153

46 12674.076 -0.10005458 1.6382529 1.5381983 1.841145

47 12556.528 -0.084915913 1.6230586 1.5381427 1.8934645

48 12459.669 -0.072438705 1.6105386 1.5380999 1.9453614

49 12379.338 -0.062088405 1.600155 1.5380666 1.996906

50 12312.317 -0.053451371 1.5914919 1.5380405 2.0481557

51 12256.093 -0.046204498 1.5842244 1.5380199 2.0991573

52 12208.687 -0.040093201 1.5780966 1.5380034 2.1499493

53 12168.527 -0.034915265 1.5729055 1.5379902 2.2005633

54 12134.355 -0.030508881 1.5684885 1.5379796 2.2510257

55 12105.159 -0.026743679 1.5647146 1.5379709 2.3013585

56 12080.118 -0.023513954 1.5614778 1.5379639 2.35158

57 12058.563 -0.020733492 1.5586915 1.5379581 2.4017057

58 12039.944 -0.018331594 1.5562849 1.5379533 2.4517486

59 12031.309 0 1.5551687 1.5551687 2.5017198

60 12031.309 0 1.5551687 1.5551687 2.551691

Loop time of 2.36701 on 8 procs for 60 steps with 2 atoms

Pair time (%) = 2.61366e-05 (0.00110421)

Neigh time (%) = 1.34408e-05 (0.000567841)

Comm time (%) = 0.0168602 (0.712302)

Outpt time (%) = 2.34915 (99.2456)

Other time (%) = 0.000955939 (0.040386)

Nlocal: 0.25 ave 1 max 0 min

Histogram: 6 0 0 0 0 0 0 0 0 2

Nghost: 1.75 ave 2 max 1 min

Histogram: 2 0 0 0 0 0 0 0 0 6

Neighs: 0.125 ave 1 max 0 min

Histogram: 7 0 0 0 0 0 0 0 0 1

Total # of neighbors = 1

Ave neighs/atom = 0.5

Neighbor list builds = 2

Dangerous builds = 0

Try shifting the potential to be 0.0 at the cutoff
via pair_modify shift.

Energy conservation is not a potential issue.
Any potential will conserve energy if it's energy
and force (gradient of the energy) are written
consistently. It's a numeric issue having to
do with time integrating the eqs of motion.
LAMMPS (and other MD codes) don't attempt
to do this extremely accurately, b/c it's not worth
the effort. Models are approximate and you can
use things like thermostats to control the system
over long timescales. Velocity verlet (what LAMMPS
uses) is 2nd order accurate in the timestep size.

Steve