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

Gromacs XVG parser - Calculation of the reduced potential goes badly wrong #59

Closed
harlor opened this issue Oct 15, 2018 · 3 comments
Closed

Comments

@harlor
Copy link
Contributor

harlor commented Oct 15, 2018

Assuming to find values of U and pV in the second and last column can go badly wrong if they are not given.

# not entirely sure if we need to get potentials relative to
# the state actually sampled, but perhaps needed to stack
# samples from all states?
U = df[df.columns[1]]
# gromacs also gives us pV directly; need this for reduced potential
pV = df[df.columns[-1]]
u_k = dict()
cols= list()
for col in dH:
u_col = eval(col.split('to')[1])
u_k[u_col] = beta * (dH[col].values + U.values + pV.values)

What do you think: Should we print a warning when these columns are not given and continue with what is given or directly throw an exception?

Btw: Is it really necessary to add pV if the simulations are in NVT? Why do we add U?

@mrshirts
Copy link

If the simulations are carried out at 2 different temperatures, we need U, as the ratio of Boltzmann factors involved the total energy, not just the difference.

Certainly, if they are not given, this should be caught well before.

For NVT, one shouldn't need PV. I'll need to check to see how this was handled in alchemical-analysis.

@dotsdl
Copy link
Member

dotsdl commented Oct 19, 2018

Hi @harlor, welcome to alchemlyb! We're always looking for ways to improve the existing components of the library. Do you have an example dataset using NVT? It would be worthwhile to generate one, perhaps with a single molecule such as benzene, but in NVT instead of NPT. @ianmkenney, do you have a way to do this by chance?

@harlor
Copy link
Contributor Author

harlor commented Oct 19, 2018

I have NPT and NVT datasets available but all without U.

If I understand the alchemical-analysis parser correctly it ads pV if its available and does not add U.

Maybe if nothing else is specified one could add pV if its available and add U if its available?

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

No branches or pull requests

4 participants