Page 1 of 1

dielectric constant for PME/Ewald

Posted: Fri Nov 20, 2015 7:09 am
by mikaellund
I am running CG models in implicit solvent and do not need the solvation terms from GBSA. Is there a way to specify the relative dielectric constant or Bjerrum length for the PME/Ewald methods? Scaling the charges by 1/sqrt(80.) in the xml file works, but seems somewhat cumbersome.

Re: dielectric constant for PME/Ewald

Posted: Fri Nov 20, 2015 11:10 am
by peastman
I'm not sure I quite followed that. You first said you're using implicit solvent, but then that you don't need the solvation terms from GBSA. What kind of implicit solvent are you using then?

Anyway, if all you want is to scale your charges, it's much simpler to do that by modifying the System directly, rather than by editing the XML file. Something like this should work:

Code: Select all

for force in system.getForces():
    if isinstance(force, NonbondedForce):
        for i in range(force.getNumParticles()):
            charge, sigma, epsilon = force.getParticleParameters(i)
            force.setParticleParameters(i, charge/sqrt(80.0), sigma, epsilon)
Peter

Re: dielectric constant for PME/Ewald

Posted: Fri Nov 20, 2015 4:06 pm
by mikaellund
Thanks for your help, that is indeed more convenient! I'm implementing the primitive model of electrolytes (albeit with soft spheres) where the pair potential is simply q1*q2/4*pi*eps_0*eps_r*r + LJ, where eps_r is the relative dielectric constant. See here for a jupyter notebook example where Ewald summation is used to reproduce the Debye-Huckel or linerarized Poisson-Boltzmann potential:

https://github.com/mlund/openmm-example ... nacl.ipynb

Control over the Bjerrum length/background dielectric is quite useful for many coarse grained potentials and while scaling the charges is of course equivalent, this has to be reverted before analysing molecular dipole moments, charge fluctuations etc.

Re: dielectric constant for PME/Ewald

Posted: Fri Nov 20, 2015 4:55 pm
by peastman
I forgot one piece: you'll also need to scale the exceptions.

Code: Select all

for  i in range(force.getNumExceptions()):
    p1, p2, chargeProd, sigma, epsilon = force.getExceptionParameters(i)
    force.setExceptionParameters(i, p1, p2, chargeProd/80.0, sigma, epsilon
Peter

Re: dielectric constant for PME/Ewald

Posted: Sat Nov 21, 2015 12:50 am
by mikaellund
Thanks, Peter / Mikael