[lammps-users] Is the table interpolation correct?


I tried to use tabulated potential with lammps.
To test the actual data used in lammps, I followed what is suggested in the
First I built a table containing 276 data points of energy and forces
calculated from a Lennard-Jones 12-6 analytic function, called pot.lj.table
(sigma=5.2 eps=1.0, r->[2.5, 30.0])

Then I use the following commands in my input script:


This is a fairly common question. Take a look at some of the previous discussions on this topic in the archives:


Also, you might want to take another look at the documentation:


Make sure you use a large N in the table that you feed to LAMMPS (around 10000 should be good). Your 276 data points seems small to me. You're having LAMMPS do a cubic spline of the data you're feeding it, then a linear interpolation of the cubic spline data --- that's why it is non-linear.

As far as I know, the FPRIME keyword is not obsolete. It should work if formatted properly. Please make sure you're following the format procedures exactly as outlined in the documentation.