Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different energy after constant hard-coding in custom force #4490

Open
lslumass opened this issue Mar 31, 2024 · 3 comments
Open

different energy after constant hard-coding in custom force #4490

lslumass opened this issue Mar 31, 2024 · 3 comments

Comments

@lslumass
Copy link

lslumass commented Mar 31, 2024

Hi,

I'm running simulation starting form CHARMM-style force field, and trying to add an custom nonbonded force which is

f1 = f"""(ke/er*charge1*charge2)/r*exp(-r*kf)"""
or
f2 = f"""(ke/20*charge1*charge2)/r*exp(-r*kf)"""

, a coulomb interaction (er is 20.0 as the relative dielectric constant). For both f1 and f2, I got the same initial potential energy (1434.24 kj/mol). But after minimization I got -273.9 kj/mol for f1 and -243.3 kj/mol for f2. I'm confused why they are different. any suggestions?

BTW, starting from CHARMM force field, if NBFIX was set, I found that all the epsilon in default nonbonded force was set as 0. Instead, all the interactions were defined in a new CustomNonbondedForce. Is that correct?

Thank you.

@peastman
Copy link
Member

peastman commented Apr 1, 2024

The energy minimizer is not deterministic. It finds a local minimum, but it doesn't guarantee which one it will find. If you call it several time from the same starting conformation, it may find different minima.

I found that all the epsilon in default nonbonded force was set as 0. Instead, all the interactions were defined in a new CustomNonbondedForce. Is that correct?

Correct. NonbondedForce doesn't support NBFIX, so it uses a CustomNonbondedForce to calculate the LJ interactions.

@lslumass
Copy link
Author

lslumass commented Apr 1, 2024

Agree, it should be. That's why I was confused. My test system was so simple that I got identical energies after minimization for several times. I hve repeated the minimization five times, and every time I got -273.9 kj/mol and -243.3 kj/mol for f1 and f2, respectively.

@peastman
Copy link
Member

peastman commented Apr 1, 2024

Try taking the two different ending conformations and evaluate their energies with the two versions of the force. Do they agree?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants