def func_calc_density(M,T,Tc,Pc,Vc,Tb):
    """
    Function to calculate density

    Parameters:
        Tc  :  Critical temperature (K)
        Pc  :  Critical pressure (bar)
        Vc  :  Critical molar volume (cm^3/mol)
        Tb  :  Normal boiling temperature (K)
        M   :  Molecular weight (g/mol)
        
    Return:
        Be extremely careful about the unit: 1 bar = 100000 Pa
        D   :  density (g/mL)
    """
    Tr = T / Tc
    Tbr = Tb / Tc
    beta = (-1.0 - pow(1-Tr,2/7)) / (1 + pow(1-Tbr, 2/7))
    tmp = pow(0.3445*Pc*pow(Vc,1.0135)/Tc/8.314/10, beta)
    D = M * Pc / 8.314 / Tc * tmp / 10
    return D