cg_openmm icon indicating copy to clipboard operation
cg_openmm copied to clipboard

How to do enthalpy/entropy of configurational states

Open mrshirts opened this issue 4 years ago • 1 comments

OK there are two difference scenarios:

  • Calculating the entropy and enthalpy as a function of T (or as a function of parameters).

    This is straightforward, as there is already a function in pymbar that computes entropy, enthalpy and free energies (compute_entropy_and_enthalpy) for a standard set of energy input to MBAR

  • Calculate the entropy and enthalpy differences between two states as a function of T (or parameters).

    The average as a function of states is more complicated. Thinking out loud, the first instinct would be to calculate the expectation the function (indicator function of which state the configuration is in)*(enthalpy of the configuration).
    So this would be \sum W_j E_j, where W_j is multiplied by zero when the configuration j is inconsistent with state j. This average alone would be too low, since it's averaging together a bunch of zeros (for the other states) along with the average of the probability of each configuration. But maybe we can manipulate this a bit to get what we want.

The average of the energy over all configurational states is <E> = \sum_i W_1 E_1 + \sum W_2 E_2 + \sum W_3 E_3, where the W_i are the weights from MBAR corresponding to each configuration in the overall Hamiltonian, where \sum W_j = exp(-f_j) (up to a constant) for j=1,2,3 are the configurations.

So I THINK the average energy/enthalpy of each state is \sum W_j E_j / \sum W_j, with the difference in enthalpy between two states, say 1 and 2, is equal to:

\sum W_1 E_1 / \sum W_1 - \sum W_2 E_2/ \sum W_2

i.e. the weighted average of the configurations consistent with that state, normalized by the probability of the state.

The the entropy difference (at a single T) should be obtainable by (dH - dG)/T = dS.

I could potentially figure out the error propagation, but calculating it by bootstrap is probably better.

This probably should be checked by finite difference of the free energy for each state, since I'm not entirely certain about this derivation!

mrshirts avatar Sep 01 '20 19:09 mrshirts

Or could do a numerical fit to \Delta F, and differentiate to get \Delta S, then compute \Delta H by \Delta F + T \Delta S

mrshirts avatar Sep 22 '20 20:09 mrshirts