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 heat-capacity.py results when changing the kB value #406

Closed
dmorone opened this issue Aug 26, 2020 · 3 comments
Closed

Different heat-capacity.py results when changing the kB value #406

dmorone opened this issue Aug 26, 2020 · 3 comments

Comments

@dmorone
Copy link

dmorone commented Aug 26, 2020

When appling the heat-capacity.py file to energies from a replica exchange simulation, if I change the kB value, the results are not only rescaled but I get a different Cv profile. Energies are in kcal/mol. If I set kB = 0.008315 and divide all energies by 4.184 I get a different Cv profile than when reading energies as is and setting kB= 0.001987

energies.txt

temperatures.txt

@dmorone dmorone closed this as completed Sep 3, 2020
@mrshirts
Copy link
Collaborator

mrshirts commented Sep 3, 2020

Sorry this slipped through the cracks - what was the resolution?

@dmorone
Copy link
Author

dmorone commented Sep 3, 2020

with high abs(energy) values there's a numerical error due to logsumexp function in the computation of expectation energies. That's why if I divide the energies I get more sensible plots (but wrong values). I was wrong in saying this is due to different kB, that's why I closed the issue. I will try in the next days to push a rewrite of the logsumexp function using mpmath. This should hopefully solve the issue

@mrshirts
Copy link
Collaborator

mrshirts commented Sep 3, 2020

I will try in the next days to push a rewrite of the logsumexp function using mpmath. This should hopefully solve the issue

We are in the middle of looking at more complete replacements to logsumexp (using JIT, etc). See branch We want to be careful with logsumexp, because it's about the largest expense of the entire program, so we need to make sure there isn't a big performance hit - perhaps have an alternate path only in cases that are likely to cause problems. Using additional modules is less likely to get accepted as a new PR if it can be avoided, unless there is a big overall upside.

See #340 for speedup efforts.

With regards to the original problem - yes, you need to make sure that kBT used in pymbar is consistent with the kBT used to generate the data, otherwise it will be garbage data.

push a rewrite of the logsumexp function using mpmath. This should hopefully solve the issue

Make sure you file an issue describing what's going on here so we understand better - perhaps there are better ways to deal with it.

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