LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] Issue with pressure control not giving the correct fluctuation properties with Lennard-Jones solids

# [lammps-users] Issue with pressure control not giving the correct fluctuation properties with Lennard-Jones solids

 From: Michael R Shirts Date: Wed, 19 Jul 2017 19:17:20 +0000

```Hi, all-

I’m using MD to simulate FCC Lennard-Jones.  I am not getting consistent values between compressibility determined by finite difference and by fluctuation formulas. I tried it in reduced units, was getting inconsistent results, and switched to real units to make it easier to compare numbers. I’ve also compared to GROMACS, where I get much better consistency.  This appears to be an underlying issue with LAMMPS not getting the proper Boltzmann distribution for the NPT ensemble.  I wonder if there is some subtle setting I’m getting wrong?

Some info:

Formula for finite difference used = - <Vhigh>-<Vhlow>/(((Phigh-Plow) (0.5(<Vhigh> + vlow>)))
Formula for finite difference by fluctuation: std(V)^2/kBT*<V>, kB = 0.1380 bar/nm^3 / K.

LAMMPS:
T     P        <V (A^3)>       dV/<V>
44 797 36833.043     0.002410
44 897 36751.109     0.002408
compressibility from finite difference = 2.2565e-05 atm^-1
compressibility from fluctuation (at 797 atm) = 3.5237e-05 atm^-1
compressibility from fluctuation (at 897 atm) = 3.5108e-05 atm^-1
compressibility from fluctuation (average) = 3.5173e-05 atm^-1

GROMACS:
T     P        <V (nm^3)>      dV/<V>
44 797     37.33091       0.002465
44 897     37.19381       0.002427
compressibility from finite difference = 3.6792e-05 bar^-1
compressibility from fluctuation (at 797 bar) = 3.7367e-05 bar^-1
compressibility from fluctuation (at 897 bar) = 3.6073e-05 bar^-1
compressibility from fluctuation (average) = 3.6720e-05 bar^-1

I expect the fantastic agreement of GROMACS to be somewhat a statistical fluke, but it is consistent.

I’ve also run ‘checkensemble’ (https://github.com/shirtsgroup/checkensemble) on the volume fluctuations.  In this case, I got for the maximum likelihood analysis of the slope of log P_1(V)/P_2(V):

GROMACS:
---------------------------------------------
Estimated slope       vs.   True slope
---------------------------------------------
-15.963630 +/-    0.345655  |   -17.006006
---------------------------------------------
(That's 3.02 quantiles from true slope=-17.006006)
---------------------------------------------
True dP = 100.000, Eff. dP =  93.871+/-2.033
---------------------------------------------

And for LAMMPS:
---------------------------------------------
Estimated slope       vs.   True slope
---------------------------------------------
-9.768420 +/-    0.462170  |   -17.006006
---------------------------------------------
(That's 15.66 quantiles from true slope=-17.006006)
---------------------------------------------
True dP = 100.000, Eff. dP =  57.441+/-2.718
---------------------------------------------

Which seems problematic (GROMACS is a bit off, but much less so).

I’ve attached the lammps input files.  To analyze them, I threw out the first 50000 steps for equilibration.  I’ve attached the GROMACS mdp files (though not the coordinates and topologies because of size.

There are a few differences between the inputs, though they shouldn't affect the comparison I’m doing.  I accidentally didn’t convert from bar to atm when going between GROMACS and LAMMPS runs, but did in the analysis.  I don’t expect the average volumes to be exactly the same between GROMACS and LAMMPS because of the way the cutoffs are handled, but they should be internally consistent within the program.  The dimensions of the box are not quite the same between the two programs for various reasons, but they are both roughly square, with 768 atoms.  There are some difference in tau_t and tau_p, though they are all differences that shouldn’t really matter.   Parameters should be the same – though again, it shouldn’t matter since we’re looking at internal consistency.  Here, GROMACS uses  Martyna-Tuckerman-Tobias-Klein equations, and did not use mtk yes with lammps, though I would think the 1/V term should be negligible here (though I will test it).

Any insight would be useful!

Best,
~~~~~~~~~~~~~~~~
Michael Shirts
Associate Professor
michael.shirts@...780...
Phone: (303) 735-7860
Office: JSCBB C123
Department of Chemical and Biological Engineering

```

Attachment: LJ_44_897.mdp
Description: LJ_44_897.mdp

Attachment: LJ_44_797.mdp
Description: LJ_44_797.mdp

Attachment: in.real.44_797.LJ
Description: in.real.44_797.LJ

Attachment: in.real.44_897.LJ
Description: in.real.44_897.LJ