# harmonic bond with exponential decay

Dear LAMMPS users,

I will go straight to the point. I want to employ an angle_style similar to the harmonic one, but with the difference that it is multiplied by an exponential that depends on the bond-lengths (the so called harmonic with exponential decay):

E_ijk = K*(angle_ijk-angle_0)^2*exp(-a*r_ij)*exp(-a*r_jk),

where angle_ijk is the angle between the atoms i,j,k, r_ij and r_ jk are the distances between the i,j and j,k atoms respectively. I have been thinking a simple way to do so, but i haven’t found any. Do you know if there is a simple way to do it?

Dr. Jon Zubeltzu

Dear LAMMPS users,

I will go straight to the point. I want to employ an angle_style similar to the harmonic one, but with the difference that it is multiplied by an exponential that depends on the bond-lengths (the so called harmonic with exponential decay):

E_ijk = K*(angle_ijk-angle_0)^2exp(-ar_ij)exp(-ar_jk),

where angle_ijk is the angle between the atoms i,j,k, r_ij and r_ jk are the distances between the i,j and j,k atoms respectively. I have been thinking a simple way to do so, but i haven’t found any. Do you know if there is a simple way to do it?

​the simplest way i can imagine would be to add a new custom angle style, that is created as an extension to angle/harmonic; i.e. you make a copy of the .h and .cpp files under a new name, change the name of the style and the class and then add handling for the additional parameter and add the necessary changes to the compute() method. http://lammps.sandia.gov/doc/Section_modify.html

axel.

Thank you for the suggestion, it is indeed quite simple and it worked!

Jon

Thank you for the suggestion, it is indeed quite simple and it worked!

good to hear. ​please consider​ submitting your new angle style for inclusion to LAMMPS, best through a pull request on github (a tutorial for the process is given in the manual).

axel.