Add explanation for translation entropy constants
Worked out the constants following the expressions for translation entropy given (among other places) here
Would fix also https://github.com/grimme-lab/xtb/issues/649 and https://github.com/grimme-lab/xtb/issues/1052.
So I rewrote the translation entropy equation and it gives approximately the same result (free energy differs by ~10^-5 kcal/mol)
If I work out the equivalent of magic4 and magic5, they come out to:
- magic4 = 2.2879 (previously 2.2869)
- magic5 = 2.3149 (previously 2.3135)
As best I can tell, these must have been originally been worked out with slightly different definitions of the constants. Not all the constants used in xTB correspond to their exact current value. For example in thermo, these values are defined:
real(wp),parameter :: R = 1.98726D0 ! GAS CONSTANT IN CALORIES/(MOLE*K) (should be 1.9872*04*)
@marcelmbn Not sure if this is an acceptable difference and tests should be updated or this is too large a change and we just stick with the current magic constants, just providing some documentation on how they were likely calculated.
Thanks for the correct implementation of the constant!
- Currently, the tests fail due to a ~10-5 value mismatch in the
thermounit tests, which is not very surprising. - I've checked your point regarding the gas constant and came to the same result. The right way to do it would probably be to update all necessary constants (if necessary) to their most recent SotA value and then update the reference unit test results with the updated values. IMHO, there's no reason to stick with old fixed numbers based on slightly wrong fundamental constants. EDIT: Regarding the SotA fundamental constants: If we update them anyway, it is probably a good idea to give a reference for the value (paper, reference data collection, ...).
- Finally, we should move all constants from
thermo.f90intomctc/mctc_constants.f90and justusethem at the beginning ofthermodyn. Moreover, I'd also delete the old code, i.e.magic4,magic5,s_tr_old, ... as people could still look it up in thegithistory and we don't need it in the active code base.
Thank you in advance for your work on this project!
@TyBalduf Just wanted to ping you again on this topic. We'd be very grateful if you find the time to update the related points in the code to the SotA standard you suggested, including the correct ab initio constants, so that we can integrate everything into the main branch. 😊
If you are no longer working on it, a short note would also be nice.
I've been a little preoccupied of late and won't have a chance to work on this too soon. I can probably get to it eventually, its mainly a matter of updating tests. But I'm not actively working on it so if someone else wanted to take this on, there wouldn't be conflicting work.
I updated the necessary constants from CODATA 2018 to be consistent with mctc-lib and calculated all necessary quantities directly from the fundamental constants. The resulting corrections change by about 10e-5 but the new values are just more accurate. Therefore, I adapted the tests to the new values. Should now be ready.