Debian Codegraph @

examples/heat-capacity/README.md

raw
1 # Heat capacity
2
3 ## Usage
4
5 For calling with MBAR error estimates:
6
7 ```
8 python heat-capacity.py -r 0 > heat-capacity.py.sample_out_no_bootstrap
9 ```
10
11 For calling with bootstrap error estimates using 200 bootstraps
12
13 ```
14 python heat-capacity.py -b 200 -r 0 > heat-capacity.py.sample_out_bootstrap
15 ```
16
17 Other options:
18
19 * `-t temperature` or `-t beta`: controls whether temperate or beta
20 derivatives are used in calculating finite differences
21
22 * `-s` spacing controls the number of intermediates used compute finite
23 differences (default is 200)
24
25 ## Description
26
27 This script takes the total energies of a simplified protein model that
28 are collected at 16 temperatures, and computes the heat capacity at a
29 finer grain in temperature. The graph exhibits a strong maximum at
30 the folding transition.
31
32 The heat capacity is computed three ways:
33
34 1) Using the fluctuations using the formula `(<E^2>-<E>^2)
35 /(R*T^2)`. The uncertainty in the heat capacity is computed from
36 propagation of the error, though it requires a (not very good)
37 estimate of the number of effective samples. CV is proportional to
38 the variance of the energy, and the uncertainty in the variance is
39 simply 2*variance divided by the same proportionality constant.
40
41 2) We also compute the heat capacity by numerical differentiation of
42 the heat capacity. This can be done either with temperature (`C_v =
43 d<E>/dT`) or beta (`C_V - kB beta^2 d<E>/dbeta`) differences. Which
44 one is used can be controlled using the `-t` flag, with `-t` temperature
45 being the default.
46
47 3) Finally, we compute the heat capacity in terms of the second derivative of
48 the free energy. This can be done either with temperature or beta
49 differences. In the case of temperature differences, we have: `C_V =
50 2*T*df/dT + T^2*d^2f/dT^2`, where `f` is the reduced free energy `-kB*ln
51 Q`. In the case of beta differences, we have: `C_V = -k_b beta^2
52 df^2/d^2beta`. The error can be computed by propagation of error, but
53 is not currently implemented correctly. Because of complications in
54 central difference computation of 2nd derivatives at the endpoints, we
55 omit these points.
56
57 We can check the analytical uncertainty estimate by comparing to the
58 bootstrap error estimate, as seen in the two sample output files. We
59 see that the first derivative numerical difference error estimate is
60 off by no more than about 10%, though the variance-derived heat
61 capacity error estimate is off by significantly more (usually 50% or
62 more), and the second derivative variance is completely wrong and
63 needs to be rederived.
64
65 Thanks to Tommy Knotts and Jacob Lewis (BYU) for the data set and the
66 first draft of the script!
67