def compute_beta_splines(TT, minT, splinesoptions={}):
"""
This function computes the volumetric thermal expansion as a numerical
derivative of the volume as a function of temperature V(T) given in the
input array *minT*. This array can obtained
from the free energy minimization which should be done before.
This function uses splines for smoothing the derivative.
"""
betaT = np.zeros(len(TT))
x = np.array(TT)
y0 = np.array(minT)
if (splinesoptions == {}):
tck0 = interpolate.splrep(x, y0)
else:
tck0 = interpolate.splrep(x, y0, k=splinesoptions['k0'], s=splinesoptions['s0'])
ynew0 = interpolate.splev(x, tck0, der=0)
betaT = interpolate.splev(x, tck0, der=1)
return betaT/minT
评论列表
文章目录