alphagruneisenp.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:pyqha 作者: mauropalumbo75 项目源码 文件源码
def c_qv_python(T,omega):
    """
    This function calculates the mode contribution to the heat capacity at a given T
    and omega. A similar (faster) function should be available as C extension.
    """
    #print ("Python c_qv")
    if (T<1E-9 or omega<1E-9):
        return 0.0
    x = omega * KB1 / T 
    expx = math.exp(-x)   # exponential term
    x2 = math.pow(x,2)
    if expx>1E-3:           # compute normally
        return x2*K_BOLTZMANN_RY*expx/math.pow(expx-1.0,2)
    else:                   # Taylor series
        return K_BOLTZMANN_RY*expx* (x/math.pow(x-0.5*math.pow(x,2)+ 
        0.16666666666666667*math.pow(x,3)+0.04166666666666666667*math.pow(x,4),2))

################################################################################
# 
# If available use a c version of the function c_qv, else use the (slower)
# Python version
#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号