def compute_Cv(T,Vmin,V,Cvib):
"""
This function computes the isocoric heat capacity as a function of temperature.
From *Cvib*, which is a matrix with *Cvib(T,V)* as from the harmonic calculations
determines the *Cv* at each temperature by linear interpolation between the values
at the two volumes closest to Vmin(T). Vmin(T) is from the minimization of F(V,T)
and *V* is the array of volumes used for it.
Returns *Cv(T)*.
Work in progress... for now it uses all volumes in the interpolation.
"""
Cv = np.zeros(len(T))
for iT in range(0,len(T)):
Cv_interpolated = np.interp(Vmin[iT], V, Cvib[iT,:])
Cv[iT] = Cv_interpolated
return Cv
评论列表
文章目录