Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add entropy and enthalpy #406
Add entropy and enthalpy #406
Changes from all commits
8b5820b
37d6a17
f8668ee
f8de2d8
ec3d7d8
214bbfe
ffd7080
5574c3b
5e1a393
bef7d06
74b8341
eb2fa34
f312b6d
d8850fd
d4dbeb0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is enthalpy dimensionless? Should it be having energy unit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiki-tempula Do you want me to change the docstring? I put this since the existing documentation for free energy is:
and I'm treating enthalpy and entropy the same as free energy... it seems I should change entropy appropriately though. See the new commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then I think this is fine. I will change this in a later PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy for this value to be
s*T
. Is the mbar outputs
ors*T
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the mbar output is reduced entropy, so S/k or sT/(kT) so it's consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that the unit is the same but I worried about the magnitude.
The G=H-sT so if the
Delta_s
is s then theDelta_f
should be the same asDelta_u
-Delta_s
*T
. If Delta_s is sT, thenDelta_f
should beDelta_u
-Delta_s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree, so I'm changing the variable names to make that clear. I'll do whatever the maintainers agree on, maybe @mrshirts or @orbeckst have an opinion?
Summary: Entropy has different units and which need to be handled properly. While the units of enthalpy and free energy are
attr['energy_units'] = 'kT', 'kcal/mol' or 'kJ/mol'
, the equivalent for entropy would then be'k', 'kcal/mol/K' or 'kJ/mol/K'
. The downside of this difference in units would require either having copies of the units.py functions for entropy specifically or add a series of if statements to the functions in units.py to detect and handle entropy units. Also, it's awkward to say that dimensionless entropy has units of'k'
Alternative: By having the entropy matrix represent S*T (denoted with the variable name
delta_sT_
) the object can retain the same units as enthalpy and free energy and use the same unit conversion functions, making everything cleaner internally, and avoid the awkward unit "definition" of'k'
for S.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'm merging this PR. I have checked the numerical values and can verify that Delta_s is not s but rather s*T. So it is in the unit of kT, kJ/mol and kcal/mol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you do add the units back.