# How to convert spline parameters into a funcfl format potential file ?

Dear Steve,

There was some problem when I tried to producing a EAM potential file written in funcfl format using the spline parameters provided in the paper " EAM potential for magnesium from quantum mechanical forces " ( Modelling Simul. Mater. Sci. Eng. 4 (1996) 293-303. ) . Though I am contacting with the author , still I am in great need of your assistance .

Sorry that I can’t afford you PDF version of that paper . Here are part of those parameters and their instruction :
The spline parameters for the pair potential function are in the form of a spline function which is calculated from
e(x)=y(i)+b(i)(r-r(i))+c(i)(r-r(i))**2+d(i)(r-r(i))**3
where r(i) is the spline knot position, y(i) is the function value at the knot, and c(i) and d(i) are the derivative coeffcients that construct the spline function . All of them are given in a table as follow ,
﻿r(i) y(i) b(i) c(i) d(i)
2.100000 3.072927 -8.860487 9.330483 -3.454020
2.280000 1.247677 -4.447802 6.429107 -3.893891
2.620000 0.325584 -1.426411 2.457338 -1.737102

6.580000 -0.001100 0.013000 0.015200 -0.385400
6.700000 0.00 0.00 0.00 0.00

So as the way Lammps read funcfl format I apprehend , I set them as follow :
Nr = 3000 , dr = 1.533 E-3 , cutoff = 6.7 ( here , cutoff - dr * Nr = 2.1 ang. )
But the system couldn’t even get equilibrium . That is , without analytic formula I can’t get datas when r < 2.1 angstroms if Lammps really need to know that .

Could you please give me some instructions to produce a EAM potential file only with optimized spline parameters starting around 2.1 angstroms just like mentioned above .
If this is impossible , please allow me to put forward another question :
Is it wrong to model a single-element metal using a setfl format alloy potential file with an " .eam.alloy " suffix which contians two or more elements , because the cutoff and " atomic density " would be different ?

Heartfelt thanks and best regards !
Sincerely
Xiaozhi Tang

Steve

Dear Steve,
There was some problem when I tried to producing a EAM potential file
written in funcfl format using the spline parameters provided in the paper
" EAM potential for magnesium from quantum mechanical forces " ( Modelling
Simul. Mater. Sci. Eng. 4 (1996) 293-303. ) . Though I am contacting with
the author , still I am in great need of your assistance .

Sorry that I can't afford you PDF version of that paper . Here are part of
those parameters and their instruction :
The spline parameters for the pair potential function are in the form of a
spline function which is calculated from
e(x)=y(i)+b(i)(r-r(i))+c(i)(r-r(i))**2+d(i)(r-r(i))**3
where r(i) is the spline knot position, y(i) is the function value at the
knot, and c(i) and d(i) are the derivative coeffcients that construct the
spline function . All of them are given in a table as follow ,
﻿r(i) y(i) b(i) c(i) d(i)
2.100000 3.072927 -8.860487 9.330483 -3.454020
2.280000 1.247677 -4.447802 6.429107 -3.893891
2.620000 0.325584 -1.426411 2.457338 -1.737102
...
6.580000 -0.001100 0.013000 0.015200 -0.385400
6.700000 0.00 0.00 0.00 0.00

Just to be clear. A funcfl file (or any of the EAM input
files) do not take spline parameters. They take a simple
table of some parameter as a function of another parameter.
E.g. for funcfl files there are 3 such tabulations as I remember.

The EAM code itself within LAMMPS uses those table
to fit splines to, and calculates its own spline coeffs.

So as the way Lammps read funcfl format I apprehend , I set them as follow :
Nr = 3000 , dr = 1.533 E-3 , cutoff = 6.7 ( here , cutoff - dr * Nr = 2.1
ang. )
But the system couldn't even get equilibrium . That is , without analytic
formula I can't get datas when r < 2.1 angstroms if Lammps really need to
know that .

Could you please give me some instructions to produce a EAM potential file
only with optimized spline parameters starting around 2.1 angstroms just
like mentioned above .

Again, what LAMMPS needs is a tabulation of values,
e.g. density as a function of distance, from 0 to the cutoff.

If the paper and formulas you have do not produce
those values for r < 2.1 then you still have to include
them in the funcfl file. If the atoms will never
get that close, the usual thing to do is exptrapolate
the values in a straight line all the way to r = 0.

If this is impossible , please allow me to put forward another question :
Is it wrong to model a single-element metal using a setfl format alloy
potential file with an " .eam.alloy " suffix which contians two or more
elements , because the cutoff and " atomic density " would be different ?

You can use setfl alloy files to simulate with a single element.
LAMMPS simply pulls out the info for the one element it
needs from the file.