Hi everybody,
I need to calculate the heat capacity of water in a series of cylindrical bins.
This calculation is supposed to give information on the local heat capacity, thus the thermodynamic variables should be calculated for each bin where I use equation 2.82 from Allen-Tildesley as follows:
C = (3/2) (N k_B) / ( 1 - ( <KE^2> - < KE >^2 )*2/(3 N k^2_B T^2) )
I read some of the previous threads and came up with an approach but I am not sure what I calculate is correct or not. Here is the way that I do binning:
compute dvd all chunk/atom bin/cylinder x lower 50 40 40 0.0 40.0 20 discard yes
variable np equal atoms # number of atoms
compute ke_peratom all ke/atom # KE per atom: ke_i, i=1, 2, …, N where N is the number of atoms
variable meanke atom c_ke_peratom/v_np # KE/N per atom: ke_i/N i=1, 2, …, N where N is the number of atoms
variable meanke2 atom v_meanke^2 # (KE/N)^2 per atom: (ke_i/N)^2 i=1, 2, …, N where N is the number of atoms
variable meank2e1 atom c_ke_peratom^2 # KE^2 per atom: ke^2_i, i=1, 2, …, N where N is the number of atoms
variable meank2e2 atom v_meank2e1/v_np # KE^2/N per atom: ke^2_i/N, i=1, 2, …, N where N is the number of atoms
variable kestd_v1 atom v_meank2e1^2/v_np-v_meanke2 # KE^2/N - (KE/N)^2 per atom: ke^2_i/N - (sum_i ke_i/N)^2
variable kb equal 0.00198722886 # kcal/mol/K
variable np1 atom density/mass
variable npc atom v_np1/mass
variable hc atom (1.5 * v_kb * v_npc)/(1-v_kestd_v1 * 2/(3 * v_kb^2 * temp^2 * v_npc))
fix heat_capacity_profile all ave/chunk 10 5 100 dvd v_hc file heat_capacity.profile # in kcal/mol/K
I think I do not calculate the number of atoms per bin correctly.
I appreciate it if anyone could take a look at this and give me some advice.