# [gmx-users] C6-C12 table potential

Alex alexanderwien2k at gmail.com
Wed May 16 22:56:37 CEST 2018

Hi,
Thanks.

On Wed, May 16, 2018 at 3:09 PM, Mark Abraham <mark.j.abraham at gmail.com>
wrote:

> Hi,
>
> I would assume not, because it's more useful to be able to let a user
> specify a table for an energy group and for that to contain different atom
> types.
>
I'm afraid I did get your point!
What I know is that the potential V(r) = 1/r + C12/(r^12) - C6/(r^6) and
then force F(r) = -dV/dr = 1/(r2) + 12*C12/(r^13) - 6*C6/(r^7) which all
together would make the table_A_B.xvg with 7 columns.
In Gromacs the unit of \sigma and \epsilon in C12 = 4*\epsilon*\sigma^12
and C6 = 4*\epsilon*\sigma^6 are nm and kj/mol, do you know if the C12 and
C6 reported in the Martini FF are using the same unit?

>
> But your best friend is to test both your understanding and the code by
> e.g. making a structure file with two such atoms 1nm apart and observing
> what force you get from a suitable mdrun -rerun with various tables.
>
With various tables, do you mean playing around with the C6 and C12? How
much I should differ the C6 and C12 respect to the above numerical
parameters.

BTW, I am going to use this table as the initial guess for in a IBI
coarse-grained parametrisation.

Thank you and regards,
Alex

>
> Mark
>
> On Wed, May 16, 2018 at 8:59 PM Alex <alexanderwien2k at gmail.com> wrote:
>
> > Hi,
> > Suppose that the C6 and C12 for the nonbonded interaction between two
> > of P4 and SNa in the Martini force fields are as following:
> >                                     C6                   C12
> > P4    SNda    1       0.17246E-00     0.18590E-02 ; semi attractive
> >
> > Now, I was wondering how I can generate a table potential
> > (table_P4_SNda.xvg) using the above C6 and C12 parameters?
> >
> > I guess the general below C code provided in the gromacs tabulated
> > potential does the job, but I am not sure if the columns of -1/r6(-1/r7)
> > and 1/r12(1/r13) should be multiplied by the above C6 and C12
> parameters!?
> >
> > #include <stdio.h>
> > #include <math.h>
> >
> > main()
> > {
> >     FILE    *fout;
> >     double  r;
> >
> >     fout = fopen("table_example.xvg", "w");
> >     fprintf(fout, "#\n# Example LJ 6-12 Potential\n#\n");
> >
> >     for (r=0; r<=2.4; r+=0.002) {
> >
> >         double f = 1/r;
> >         double fprime = 1/(pow(r,2));
> >
> >         double g = -1/(pow(r,6));
> > /*   *C6   ? */
> >         double gprime = -6/(pow(r,7));                                /*
> > *C6   ? */
> >
> >         double h = 1/(pow(r,12));
> > /*   *C12   ? */
> >         double hprime = 12/(pow(r,13));                             /*
> > *C12   ? */
> >
> >         /* print output */
> >         if (r<0.001) {
> >             fprintf(fout, "%12.10e   %12.10e %12.10e   %12.10e %12.10e
> > %12.10e %12.10e\n", r,0.0,0.0,0.0,0.0,0.0,0.0);
> >         } else {
> >             fprintf(fout, "%12.10e   %12.10e %12.10e   %12.10e %12.10e
> > %12.10e %12.10e\n", r,f,fprime,g,gprime,h,hprime);
> >         }
> >     }
> >
> >     fclose(fout);
> >     return(0);
> > }
> >
> > Regards,
> > Alex
> > --
> > Gromacs Users mailing list
> >
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > posting!
> >
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >
> > * For (un)subscribe requests visit
> > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> > send a mail to gmx-users-request at gromacs.org.
> >
> --
> Gromacs Users mailing list
>
> * Please search the archive at http://www.gromacs.org/
> Support/Mailing_Lists/GMX-Users_List before posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.
>