Pair-Table Problem

Dear Lammps users,

I met one question when using Pair_style:“table” and “pair_write” commands. in this simulation, I am trying to give potential energy and force as a function of distance. we had the correct potentials from previous simulations and calculated force from cubic spline fit of MATLAB at each R. then, when I submitted the input file for table style and asked for the energy and force values at specific distances in the output file from Pair_write, the values of force in pair_write output file were surprisingly different from the ones in input file.

here are the input file for Pair_ style: table and output file from Pair_write respectively:

pair_style table linear 6251

input file for Pair_style table looks like:

#Pair potential for linear-polymer Melt
entry1
N 6251 RSQ 0.000000000001 625.0

1 1.0000000E-06 1.690000 -1.0514040E-03
2 0.3162293 1.657552 0.2030731
3 0.4472147 1.625750 0.2818211
4 0.5477235 1.594545 0.3385073
5 0.6324564 1.563940 0.3834179
6 0.7071075 1.533921 0.4203998
7 0.7745973 1.504482 0.4516596
8 0.8366606 1.475607 0.4785343

.
.
.

6244 24.98600 5.0875130E-03 0.0000000E+00
6245 24.98800 5.0875130E-03 0.0000000E+00
6246 24.99000 5.0875130E-03 0.0000000E+00
6247 24.99200 5.0875130E-03 0.0000000E+00
6248 24.99400 5.0875130E-03 0.0000000E+00
6249 24.99600 5.0875130E-03 0.0000000E+00
6250 24.99800 5.0875130E-03 0.0000000E+00
6251 25.00000 5.0875130E-03 0.0000000E+00

and the output file from pair_write command called table.txt is:

pair_write * * 6251 r 0.000001 25.0 table.txt entry1

Pair potential table for atom types 1 1: i,r,energy,force

entry1
N 6251 R 1e-06 25

1 1e-06 1.69 -1051.4
2 0.004001 1.69 -4.20599e+06
3 0.008001 1.69 -8.4069e+06
4 0.012001 1.69 -1.25997e+07
5 0.016001 1.69 -1.67804e+07
6 0.020001 1.69 -2.0945e+07
7 0.024001 1.69 -2.50894e+07
8 0.028001 1.69 -2.92095e+07
9 0.032001 1.69 -3.33014e+07
10 0.036001 1.69 -3.7361e+07
11 0.040001 1.69 -4.13843e+07
12 0.044001 1.69 -4.53671e+07
13 0.048001 1.69001 -4.93056e+07

I chose Ntable = Nfile and RSQ being evenly spaced between rlorlo and rhirhi to avoid preliminary spline interpolation,i.e., interpolated table matches exactly the tabulated file. apparently, this approach does not help.

can anyone help me with this problem?

Thanks,
Mouge

Dear Lammps users,

I met one question when using Pair_style:"table" and "pair_write" commands.
in this simulation, I am trying to give potential energy and force as a
function of distance. we had the correct potentials from previous
simulations and calculated force from cubic spline fit of MATLAB at each R.
then, when I submitted the input file for table style and asked for the
energy and force values at specific distances in the output file from
Pair_write, the values of force in pair_write output file were surprisingly
different from the ones in input file.

here are the input file for Pair_ style: table and output file from
Pair_write respectively:

pair_style table linear 6251

input file for Pair_style table looks like:

#Pair potential for linear-polymer Melt
entry1
N 6251 RSQ 0.000000000001 625.0

           1 1.0000000E-06 1.690000 -1.0514040E-03
           2 0.3162293 1.657552 0.2030731
           3 0.4472147 1.625750 0.2818211
           4 0.5477235 1.594545 0.3385073
           5 0.6324564 1.563940 0.3834179
           6 0.7071075 1.533921 0.4203998
           7 0.7745973 1.504482 0.4516596
           8 0.8366606 1.475607 0.4785343
                      .
                      .
                      .
        6244 24.98600 5.0875130E-03 0.0000000E+00
        6245 24.98800 5.0875130E-03 0.0000000E+00
        6246 24.99000 5.0875130E-03 0.0000000E+00
        6247 24.99200 5.0875130E-03 0.0000000E+00
        6248 24.99400 5.0875130E-03 0.0000000E+00
        6249 24.99600 5.0875130E-03 0.0000000E+00
        6250 24.99800 5.0875130E-03 0.0000000E+00
        6251 25.00000 5.0875130E-03 0.0000000E+00

and the output file from pair_write command called table.txt is:

pair_write * * 6251 r 0.000001 25.0 table.txt entry1

# Pair potential table for atom types 1 1: i,r,energy,force
entry1
N 6251 R 1e-06 25

1 1e-06 1.69 -1051.4
2 0.004001 1.69 -4.20599e+06
3 0.008001 1.69 -8.4069e+06
4 0.012001 1.69 -1.25997e+07
5 0.016001 1.69 -1.67804e+07
6 0.020001 1.69 -2.0945e+07
7 0.024001 1.69 -2.50894e+07
8 0.028001 1.69 -2.92095e+07
9 0.032001 1.69 -3.33014e+07
10 0.036001 1.69 -3.7361e+07
11 0.040001 1.69 -4.13843e+07
12 0.044001 1.69 -4.53671e+07
13 0.048001 1.69001 -4.93056e+07

I chose Ntable = Nfile and RSQ being evenly spaced between rlo*rlo and
rhi*rhi to avoid preliminary spline interpolation,i.e., interpolated table
matches exactly the tabulated file. apparently, this approach does not help.

can anyone help me with this problem?

you get what you ask for, where is the problem?
since you ask to write out a linear spaced R style table from an RSQ
table, you enforce that the potential is being resplined, and since
your potential is strongly curved at the low r end, you cannot avoid
that the spline function is behaving the way it does.

axel.