dielectric constant for PME/Ewald

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Mikael Lund
Posts: 6
Joined: Sun Sep 07, 2008 3:45 am

dielectric constant for PME/Ewald

Post by Mikael Lund » Fri Nov 20, 2015 7:09 am

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.

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: dielectric constant for PME/Ewald

Post by Peter Eastman » Fri Nov 20, 2015 11:10 am

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

User avatar
Mikael Lund
Posts: 6
Joined: Sun Sep 07, 2008 3:45 am

Re: dielectric constant for PME/Ewald

Post by Mikael Lund » Fri Nov 20, 2015 4:06 pm

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.

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: dielectric constant for PME/Ewald

Post by Peter Eastman » Fri Nov 20, 2015 4:55 pm

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

User avatar
Mikael Lund
Posts: 6
Joined: Sun Sep 07, 2008 3:45 am

Re: dielectric constant for PME/Ewald

Post by Mikael Lund » Sat Nov 21, 2015 12:50 am

Thanks, Peter / Mikael

POST REPLY