dielectric constant for PME/Ewald
- Mikael Lund
- Posts: 6
- Joined: Sun Sep 07, 2008 3:45 am
dielectric constant for PME/Ewald
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.
- Peter Eastman
- Posts: 2593
- Joined: Thu Aug 09, 2007 1:25 pm
Re: dielectric constant for PME/Ewald
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:
Peter
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)
- Mikael Lund
- Posts: 6
- Joined: Sun Sep 07, 2008 3:45 am
Re: dielectric constant for PME/Ewald
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.
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.
- Peter Eastman
- Posts: 2593
- Joined: Thu Aug 09, 2007 1:25 pm
Re: dielectric constant for PME/Ewald
I forgot one piece: you'll also need to scale the exceptions.
Peter
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
- Mikael Lund
- Posts: 6
- Joined: Sun Sep 07, 2008 3:45 am
Re: dielectric constant for PME/Ewald
Thanks, Peter / Mikael