[lammps-users] modification of dihedral form

Hi all lammps-users,
I have a question about modification of dihedral form,I want to add a
extra item a6*cos(theta)^6 to the dihedral type dihedral_multi_harmonic.In
the dihedral_multi_harmonic.cpp file except the corresponding input and
output control statements I only find the following lines .

// force & energy
// p = sum (i=1,5) a_i * c**(i-1)
// pd = dp/dc
p = a1[type] + c*(a2[type] + c*(a3[type] + c*(a4[type] + ca5[type])));
pd = a2[type] + c
(2.0a3[type] + c(3.0a4[type] + c4.0a5[type]));
and I rewrite it.
p = a1[type] + c
(a2[type] + c*(a3[type] + c*(a4[type] + c*(a5[type]+ca6[type])));
pd = a2[type] + c
(2.0a3[type] + c(3.0a4[type] + c(4.0a5[type]+c5.0*a6[type]));
Centainly the corresponding input and output control statements are
modified too.And then I compiled it.No error occured.
But the simulation result is nearly no change compared to the result of
original lammps.Are there any other files or lines needed to modify?
Thanks very much!

Hi all lammps-users,
  I have a question about modification of dihedral form,I want to add
a
extra item a6*cos(theta)^6 to the dihedral type
dihedral_multi_harmonic.In
the dihedral_multi_harmonic.cpp file except the corresponding input
and
output control statements I only find the following lines .

// force & energy
    // p = sum (i=1,5) a_i * c**(i-1)
    // pd = dp/dc
    p = a1[type] + c*(a2[type] + c*(a3[type] + c*(a4[type] +
c*a5[type])));
    pd = a2[type] + c*(2.0*a3[type] + c*(3.0*a4[type] +
c*4.0*a5[type]));
and I rewrite it.
p = a1[type] + c*(a2[type] + c*(a3[type] + c*(a4[type] + c*
(a5[type]+c*a6[type])));
    pd = a2[type] + c*(2.0*a3[type] + c*(3.0*a4[type] +
c*(4.0*a5[type]+c*5.0*a6[type]));

Centainly the corresponding input and output control statements are
modified too.And then I compiled it.No error occured.

writing sources that compile are a prerequisite for correct
programming, but no indication for the absolute correctness
of the implementation.

have you tried some simple explicit examples, where you can
make control calculations by hand?

But the simulation result is nearly no change compared to the result
of original lammps.Are there any other files or lines needed to
modify?

perhaps, the higher order term does have little impact
in your case. that would not surprise me. but this kind
of guesstimate i no way of proving the correctness of
your implementation. the only way to make sure is to compare
to explicit force and energy values for a selection of
given dihedrals, for which you can compute the force and
energy contributions manually.

cheers,
    axel.