methods = []<EOL>Tmins, Tmaxs = [], []<EOL>if self.CASRN in Mulero_Cachadina_data.index:<EOL><INDENT>methods.append(STREFPROP)<EOL>_, sigma0, n0, sigma1, n1, sigma2, n2, Tc, self.STREFPROP_Tmin, self.STREFPROP_Tmax = _Mulero_Cachadina_data_values[Mulero_Cachadina_data.index.get_loc(self.CASRN)].tolist()<EOL>self.STREFPROP_coeffs = [sigma0, n0, sigma1, n1, sigma2, n2, Tc]<EOL>Tmins.append(self.STREFPROP_Tmin); Tmaxs.append(self.STREFPROP_Tmax)<EOL><DEDENT>if self.CASRN in Somayajulu_data_2.index:<EOL><INDENT>methods.append(SOMAYAJULU2)<EOL>_, self.SOMAYAJULU2_Tt, self.SOMAYAJULU2_Tc, A, B, C = _Somayajulu_data_2_values[Somayajulu_data_2.index.get_loc(self.CASRN)].tolist()<EOL>self.SOMAYAJULU2_coeffs = [A, B, C]<EOL>Tmins.append(self.SOMAYAJULU2_Tt); Tmaxs.append(self.SOMAYAJULU2_Tc)<EOL><DEDENT>if self.CASRN in Somayajulu_data.index:<EOL><INDENT>methods.append(SOMAYAJULU)<EOL>_, self.SOMAYAJULU_Tt, self.SOMAYAJULU_Tc, A, B, C = _Somayajulu_data_values[Somayajulu_data.index.get_loc(self.CASRN)].tolist()<EOL>self.SOMAYAJULU_coeffs = [A, B, C]<EOL>Tmins.append(self.SOMAYAJULU_Tt); Tmaxs.append(self.SOMAYAJULU_Tc)<EOL><DEDENT>if self.CASRN in _VDISaturationDict:<EOL><INDENT>methods.append(VDI_TABULAR)<EOL>Ts, props = VDI_tabular_data(self.CASRN, '<STR_LIT>')<EOL>self.VDI_Tmin = Ts[<NUM_LIT:0>]<EOL>self.VDI_Tmax = Ts[-<NUM_LIT:1>]<EOL>self.tabular_data[VDI_TABULAR] = (Ts, props)<EOL>Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)<EOL><DEDENT>if self.CASRN in Jasper_Lange_data.index:<EOL><INDENT>methods.append(JASPER)<EOL>_, a, b, self.JASPER_Tmin, self.JASPER_Tmax= _Jasper_Lange_data_values[Jasper_Lange_data.index.get_loc(self.CASRN)].tolist()<EOL>self.JASPER_coeffs = [a, b]<EOL>Tmins.append(self.JASPER_Tmin); Tmaxs.append(self.JASPER_Tmax)<EOL><DEDENT>if all((self.Tc, self.Vc, self.omega)):<EOL><INDENT>methods.append(MIQUEU)<EOL>Tmins.append(<NUM_LIT:0.0>); Tmaxs.append(self.Tc)<EOL><DEDENT>if all((self.Tb, self.Tc, self.Pc)):<EOL><INDENT>methods.append(BROCK_BIRD)<EOL>methods.append(SASTRI_RAO)<EOL>Tmins.append(<NUM_LIT:0.0>); Tmaxs.append(self.Tc)<EOL><DEDENT>if all((self.Tc, self.Pc, self.omega)):<EOL><INDENT>methods.append(PITZER)<EOL>methods.append(ZUO_STENBY)<EOL>Tmins.append(<NUM_LIT:0.0>); Tmaxs.append(self.Tc)<EOL><DEDENT>if self.CASRN in VDI_PPDS_11.index:<EOL><INDENT>_,  Tm, Tc, A, B, C, D, E = _VDI_PPDS_11_values[VDI_PPDS_11.index.get_loc(self.CASRN)].tolist()<EOL>self.VDI_PPDS_coeffs = [A, B, C, D, E]<EOL>self.VDI_PPDS_Tc = Tc<EOL>self.VDI_PPDS_Tm = Tm<EOL>methods.append(VDI_PPDS)<EOL>Tmins.append(self.VDI_PPDS_Tm) ; Tmaxs.append(self.VDI_PPDS_Tc); <EOL><DEDENT>if all((self.Tb, self.Hvap_Tb, self.MW)):<EOL><INDENT>self.Cpl_Tb = self.Cpl(self.Tb) if hasattr(self.Cpl, '<STR_LIT>') else self.Cpl<EOL>if self.Cpl_Tb:<EOL><INDENT>methods.append(ALEEM)<EOL>Tmax_possible = self.Tb + self.Hvap_Tb/self.Cpl_Tb<EOL>if self.Tc:<EOL><INDENT>Tmax_possible = min(self.Tc, Tmax_possible)<EOL><DEDENT>Tmins.append(<NUM_LIT:0.0>); Tmaxs.append(Tmax_possible)<EOL><DEDENT><DEDENT>self.all_methods = set(methods)<EOL>if Tmins and Tmaxs:<EOL><INDENT>self.Tmin = min(Tmins)<EOL>self.Tmax = max(Tmaxs)<EOL><DEDENT>

r'''Method which picks out coefficients for the specified chemical
        from the various dictionaries and DataFrames storing it. All data is
        stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`,
        and :obj:`all_methods` as a set of methods for which the data exists for.

        Called on initialization only. See the source code for the variables at
        which the coefficients are stored. The coefficients can safely be
        altered once the class is initialized. This method can be called again
        to reset the parameters.


if method == STREFPROP:<EOL><INDENT>sigma0, n0, sigma1, n1, sigma2, n2, Tc = self.STREFPROP_coeffs<EOL>sigma = REFPROP(T, Tc=Tc, sigma0=sigma0, n0=n0, sigma1=sigma1, n1=n1,<EOL>sigma2=sigma2, n2=n2)<EOL><DEDENT>elif method == VDI_PPDS:<EOL><INDENT>sigma = EQ106(T, self.VDI_PPDS_Tc, *self.VDI_PPDS_coeffs)<EOL><DEDENT>elif method == SOMAYAJULU2:<EOL><INDENT>A, B, C = self.SOMAYAJULU2_coeffs<EOL>sigma = Somayajulu(T, Tc=self.SOMAYAJULU2_Tc, A=A, B=B, C=C)<EOL><DEDENT>elif method == SOMAYAJULU:<EOL><INDENT>A, B, C = self.SOMAYAJULU_coeffs<EOL>sigma = Somayajulu(T, Tc=self.SOMAYAJULU_Tc, A=A, B=B, C=C)<EOL><DEDENT>elif method == JASPER:<EOL><INDENT>sigma = Jasper(T, a=self.JASPER_coeffs[<NUM_LIT:0>], b=self.JASPER_coeffs[<NUM_LIT:1>])<EOL><DEDENT>elif method == BROCK_BIRD:<EOL><INDENT>sigma = Brock_Bird(T, self.Tb, self.Tc, self.Pc)<EOL><DEDENT>elif method == SASTRI_RAO:<EOL><INDENT>sigma = Sastri_Rao(T, self.Tb, self.Tc, self.Pc)<EOL><DEDENT>elif method == PITZER:<EOL><INDENT>sigma = Pitzer(T, self.Tc, self.Pc, self.omega)<EOL><DEDENT>elif method == ZUO_STENBY:<EOL><INDENT>sigma = Zuo_Stenby(T, self.Tc, self.Pc, self.omega)<EOL><DEDENT>elif method == MIQUEU:<EOL><INDENT>sigma = Miqueu(T, self.Tc, self.Vc, self.omega)<EOL><DEDENT>elif method == ALEEM:<EOL><INDENT>Cpl = self.Cpl(T) if hasattr(self.Cpl, '<STR_LIT>') else self.Cpl<EOL>Vml = self.Vml(T) if hasattr(self.Vml, '<STR_LIT>') else self.Vml<EOL>rhol = Vm_to_rho(Vml, self.MW)<EOL>sigma = Aleem(T=T, MW=self.MW, Tb=self.Tb, rhol=rhol, Hvap_Tb=self.Hvap_Tb, Cpl=Cpl)<EOL><DEDENT>elif method in self.tabular_data:<EOL><INDENT>sigma = self.interpolate(T, method)<EOL><DEDENT>return sigma<EOL>

r'''Method to calculate surface tension of a liquid at temperature `T`
        with a given method.

        This method has no exception handling; see `T_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate surface tension, [K]
        method : str
            Name of the method to use

        Returns
        -------
        sigma : float
            Surface tension of the liquid at T, [N/m]


methods = []        <EOL>methods.append(SIMPLE) <EOL>methods.append(WINTERFELDSCRIVENDAVIS) <EOL>if none_and_length_check((self.Tbs, self.Tcs)):<EOL><INDENT>self.sigmas_Tb = [i(Tb) for i, Tb in zip(self.SurfaceTensions, self.Tbs)]<EOL>if none_and_length_check([self.sigmas_Tb]):<EOL><INDENT>methods.append(DIGUILIOTEJA)<EOL><DEDENT><DEDENT>self.all_methods = set(methods)<EOL>

r'''Method to initialize the object by precomputing any values which
        may be used repeatedly and by retrieving mixture-specific variables.
        All data are stored as attributes. This method also sets :obj:`Tmin`,
        :obj:`Tmax`, and :obj:`all_methods` as a set of methods which should
        work to calculate the property.

        Called on initialization only. See the source code for the variables at
        which the coefficients are stored. The coefficients can safely be
        altered once the class is initialized. This method can be called again
        to reset the parameters.


def calculate(self, T, P, zs, ws, method):

if method == SIMPLE:<EOL><INDENT>sigmas = [i(T) for i in self.SurfaceTensions]<EOL>return mixing_simple(zs, sigmas)<EOL><DEDENT>elif method == DIGUILIOTEJA:<EOL><INDENT>return Diguilio_Teja(T=T, xs=zs, sigmas_Tb=self.sigmas_Tb, <EOL>Tbs=self.Tbs, Tcs=self.Tcs)<EOL><DEDENT>elif method == WINTERFELDSCRIVENDAVIS:<EOL><INDENT>sigmas = [i(T) for i in self.SurfaceTensions]<EOL>rhoms = [<NUM_LIT:1.>/i(T, P) for i in self.VolumeLiquids]<EOL>return Winterfeld_Scriven_Davis(zs, sigmas, rhoms)<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>

r'''Method to calculate surface tension of a liquid mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see `mixture_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate the property, [K]
        P : float
            Pressure at which to calculate the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        sigma : float
            Surface tension of the liquid at given conditions, [N/m]


def EQ100(T, A=<NUM_LIT:0>, B=<NUM_LIT:0>, C=<NUM_LIT:0>, D=<NUM_LIT:0>, E=<NUM_LIT:0>, F=<NUM_LIT:0>, G=<NUM_LIT:0>, order=<NUM_LIT:0>):

if order == <NUM_LIT:0>:<EOL><INDENT>return A + T*(B + T*(C + T*(D + T*(E + T*(F + G*T)))))<EOL><DEDENT>elif order == <NUM_LIT:1>:<EOL><INDENT>return B + T*(<NUM_LIT:2>*C + T*(<NUM_LIT:3>*D + T*(<NUM_LIT:4>*E + T*(<NUM_LIT:5>*F + <NUM_LIT:6>*G*T))))<EOL><DEDENT>elif order == -<NUM_LIT:1>:<EOL><INDENT>return T*(A + T*(B/<NUM_LIT:2> + T*(C/<NUM_LIT:3> + T*(D/<NUM_LIT:4> + T*(E/<NUM_LIT:5> + T*(F/<NUM_LIT:6> + G*T/<NUM_LIT:7>))))))<EOL><DEDENT>elif order == -<NUM_LIT>:<EOL><INDENT>return A*log(T) + T*(B + T*(C/<NUM_LIT:2> + T*(D/<NUM_LIT:3> + T*(E/<NUM_LIT:4> + T*(F/<NUM_LIT:5> + G*T/<NUM_LIT:6>)))))<EOL><DEDENT>else:<EOL><INDENT>raise Exception(order_not_found_msg)<EOL><DEDENT>

r'''DIPPR Equation # 100. Used in calculating the molar heat capacities
    of liquids and solids, liquid thermal conductivity, and solid density.
    All parameters default to zero. As this is a straightforward polynomial,
    no restrictions on parameters apply. Note that high-order polynomials like
    this may need large numbers of decimal places to avoid unnecessary error.

    .. math::
        Y = A + BT + CT^2 + DT^3 + ET^4 + FT^5 + GT^6

    Parameters
    ----------
    T : float
        Temperature, [K]
    A-G : float
        Parameter for the equation; chemical and property specific [-]
    order : int, optional
        Order of the calculation. 0 for the calculation of the result itself;
        for 1, the first derivative of the property is returned, for
        -1, the indefinite integral of the property with respect to temperature
        is returned; and for -1j, the indefinite integral of the property
        divided by temperature with respect to temperature is returned. No
        other integrals or derivatives are implemented, and an exception will
        be raised if any other order is given.

    Returns
    -------
    Y : float
        Property [constant-specific; if order == 1, property/K; if order == -1,
                  property*K; if order == -1j, unchanged from default]

    Notes
    -----
    The derivative with respect to T, integral with respect to T, and integral
    over T with respect to T are computed as follows. All derivatives and
    integrals are easily computed with SymPy.

    .. math::
        \frac{d Y}{dT} = B + 2 C T + 3 D T^{2} + 4 E T^{3} + 5 F T^{4}
        + 6 G T^{5}

    .. math::
        \int Y dT = A T + \frac{B T^{2}}{2} + \frac{C T^{3}}{3} + \frac{D
        T^{4}}{4} + \frac{E T^{5}}{5} + \frac{F T^{6}}{6} + \frac{G T^{7}}{7}

    .. math::
        \int \frac{Y}{T} dT = A \log{\left (T \right )} + B T + \frac{C T^{2}}
        {2} + \frac{D T^{3}}{3} + \frac{E T^{4}}{4} + \frac{F T^{5}}{5}
        + \frac{G T^{6}}{6}

    Examples
    --------
    Water liquid heat capacity; DIPPR coefficients normally listed in J/kmol/K.

    >>> EQ100(300, 276370., -2090.1, 8.125, -0.014116, 0.0000093701)
    75355.81000000003

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


return exp(A + B/T + C*log(T) + D*T**E)<EOL>

r'''DIPPR Equation # 101. Used in calculating vapor pressure, sublimation
    pressure, and liquid viscosity.
    All 5 parameters are required. E is often an integer. As the model is
    exponential, a sufficiently high temperature will cause an OverflowError.
    A negative temperature (or just low, if fit poorly) may cause a math domain
    error.

    .. math::
        Y = \exp\left(A + \frac{B}{T} + C\cdot \ln T + D \cdot T^E\right)

    Parameters
    ----------
    T : float
        Temperature, [K]
    A-E : float
        Parameter for the equation; chemical and property specific [-]

    Returns
    -------
    Y : float
        Property [constant-specific]

    Notes
    -----
    This function is not integrable for either dT or Y/T dT.

    Examples
    --------
    Water vapor pressure; DIPPR coefficients normally listed in Pa.

    >>> EQ101(300, 73.649, -7258.2, -7.3037, 4.1653E-6, 2)
    3537.44834545549

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


def EQ102(T, A, B, C, D, order=<NUM_LIT:0>):

if order == <NUM_LIT:0>:<EOL><INDENT>return A*T**B/(<NUM_LIT:1.> + C/T + D/(T*T))<EOL><DEDENT>elif order == <NUM_LIT:1>:<EOL><INDENT>return (A*B*T**B/(T*(C/T + D/T**<NUM_LIT:2> + <NUM_LIT:1>)) <EOL>+ A*T**B*(C/T**<NUM_LIT:2> + <NUM_LIT:2>*D/T**<NUM_LIT:3>)/(C/T + D/T**<NUM_LIT:2> + <NUM_LIT:1>)**<NUM_LIT:2>)<EOL><DEDENT>elif order == -<NUM_LIT:1>:<EOL><INDENT>return (<NUM_LIT:2>*A*T**(<NUM_LIT:3>+B)*hyp2f1(<NUM_LIT:1>, <NUM_LIT:3>+B, <NUM_LIT:4>+B, -<NUM_LIT:2>*T/(C - csqrt(C*C <EOL>- <NUM_LIT:4>*D)))/((<NUM_LIT:3>+B)*(C - csqrt(C*C-<NUM_LIT:4>*D))*csqrt(C*C-<NUM_LIT:4>*D))<EOL>-<NUM_LIT:2>*A*T**(<NUM_LIT:3>+B)*hyp2f1(<NUM_LIT:1>, <NUM_LIT:3>+B, <NUM_LIT:4>+B, -<NUM_LIT:2>*T/(C + csqrt(C*C - <NUM_LIT:4>*D)))/(<EOL>(<NUM_LIT:3>+B)*(C + csqrt(C*C-<NUM_LIT:4>*D))*csqrt(C*C-<NUM_LIT:4>*D))).real<EOL><DEDENT>elif order == -<NUM_LIT>:<EOL><INDENT>return (<NUM_LIT:2>*A*T**(<NUM_LIT:2>+B)*hyp2f1(<NUM_LIT:1>, <NUM_LIT:2>+B, <NUM_LIT:3>+B, -<NUM_LIT:2>*T/(C - csqrt(C*C - <NUM_LIT:4>*D)))/(<EOL>(<NUM_LIT:2>+B)*(C - csqrt(C*C-<NUM_LIT:4>*D))*csqrt(C*C-<NUM_LIT:4>*D)) -<NUM_LIT:2>*A*T**(<NUM_LIT:2>+B)*hyp2f1(<EOL><NUM_LIT:1>, <NUM_LIT:2>+B, <NUM_LIT:3>+B, -<NUM_LIT:2>*T/(C + csqrt(C*C - <NUM_LIT:4>*D)))/((<NUM_LIT:2>+B)*(C + csqrt(<EOL>C*C-<NUM_LIT:4>*D))*csqrt(C*C-<NUM_LIT:4>*D))).real<EOL><DEDENT>else:<EOL><INDENT>raise Exception(order_not_found_msg)<EOL><DEDENT>

r'''DIPPR Equation # 102. Used in calculating vapor viscosity, vapor
    thermal conductivity, and sometimes solid heat capacity. High values of B
    raise an OverflowError.
    All 4 parameters are required. C and D are often 0.

    .. math::
        Y = \frac{A\cdot T^B}{1 + \frac{C}{T} + \frac{D}{T^2}}

    Parameters
    ----------
    T : float
        Temperature, [K]
    A-D : float
        Parameter for the equation; chemical and property specific [-]
    order : int, optional
        Order of the calculation. 0 for the calculation of the result itself;
        for 1, the first derivative of the property is returned, for
        -1, the indefinite integral of the property with respect to temperature
        is returned; and for -1j, the indefinite integral of the property
        divided by temperature with respect to temperature is returned. No
        other integrals or derivatives are implemented, and an exception will
        be raised if any other order is given.

    Returns
    -------
    Y : float
        Property [constant-specific; if order == 1, property/K; if order == -1,
                  property*K; if order == -1j, unchanged from default]

    Notes
    -----
    The derivative with respect to T, integral with respect to T, and integral
    over T with respect to T are computed as follows. The first derivative is
    easily computed; the two integrals required Rubi to perform the integration.

    .. math::
        \frac{d Y}{dT} = \frac{A B T^{B}}{T \left(\frac{C}{T} + \frac{D}{T^{2}}
        + 1\right)} + \frac{A T^{B} \left(\frac{C}{T^{2}} + \frac{2 D}{T^{3}}
        \right)}{\left(\frac{C}{T} + \frac{D}{T^{2}} + 1\right)^{2}}

    .. math::
        \int Y dT = - \frac{2 A T^{B + 3} \operatorname{hyp2f1}{\left (1,B + 3,
        B + 4,- \frac{2 T}{C - \sqrt{C^{2} - 4 D}} \right )}}{\left(B + 3\right)
        \left(C + \sqrt{C^{2} - 4 D}\right) \sqrt{C^{2} - 4 D}} + \frac{2 A
        T^{B + 3} \operatorname{hyp2f1}{\left (1,B + 3,B + 4,- \frac{2 T}{C
        + \sqrt{C^{2} - 4 D}} \right )}}{\left(B + 3\right) \left(C
        - \sqrt{C^{2} - 4 D}\right) \sqrt{C^{2} - 4 D}}

    .. math::
        \int \frac{Y}{T} dT = - \frac{2 A T^{B + 2} \operatorname{hyp2f1}{\left
        (1,B + 2,B + 3,- \frac{2 T}{C + \sqrt{C^{2} - 4 D}} \right )}}{\left(B
        + 2\right) \left(C + \sqrt{C^{2} - 4 D}\right) \sqrt{C^{2} - 4 D}}
        + \frac{2 A T^{B + 2} \operatorname{hyp2f1}{\left (1,B + 2,B + 3,
        - \frac{2 T}{C - \sqrt{C^{2} - 4 D}} \right )}}{\left(B + 2\right)
        \left(C - \sqrt{C^{2} - 4 D}\right) \sqrt{C^{2} - 4 D}}

    Examples
    --------
    Water vapor viscosity; DIPPR coefficients normally listed in Pa*s.

    >>> EQ102(300, 1.7096E-8, 1.1146, 0, 0)
    9.860384711890639e-06

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


def EQ104(T, A, B, C, D, E, order=<NUM_LIT:0>):

if order == <NUM_LIT:0>:<EOL><INDENT>T2 = T*T<EOL>return A + (B + (C + (D + E/T)/(T2*T2*T))/T2)/T<EOL><DEDENT>elif order == <NUM_LIT:1>:<EOL><INDENT>T2 = T*T<EOL>T4 = T2*T2<EOL>return (-B + (-<NUM_LIT:3>*C + (-<NUM_LIT:8>*D - <NUM_LIT:9>*E/T)/(T4*T))/T2)/T2<EOL><DEDENT>elif order == -<NUM_LIT:1>:<EOL><INDENT>return A*T + B*log(T) - (<NUM_LIT>*C*T**<NUM_LIT:6> + <NUM_LIT:8>*D*T + <NUM_LIT:7>*E)/(<NUM_LIT>*T**<NUM_LIT:8>)<EOL><DEDENT>elif order == -<NUM_LIT>:<EOL><INDENT>return A*log(T) - (<NUM_LIT>*B*T**<NUM_LIT:8> + <NUM_LIT>*C*T**<NUM_LIT:6> + <NUM_LIT:9>*D*T + <NUM_LIT:8>*E)/(<NUM_LIT>*T**<NUM_LIT:9>)<EOL><DEDENT>else:<EOL><INDENT>raise Exception(order_not_found_msg)<EOL><DEDENT>

r'''DIPPR Equation #104. Often used in calculating second virial
    coefficients of gases. All 5 parameters are required.
    C, D, and E are normally large values.

    .. math::
        Y = A + \frac{B}{T} + \frac{C}{T^3} + \frac{D}{T^8} + \frac{E}{T^9}

    Parameters
    ----------
    T : float
        Temperature, [K]
    A-E : float
        Parameter for the equation; chemical and property specific [-]
    order : int, optional
        Order of the calculation. 0 for the calculation of the result itself;
        for 1, the first derivative of the property is returned, for
        -1, the indefinite integral of the property with respect to temperature
        is returned; and for -1j, the indefinite integral of the property
        divided by temperature with respect to temperature is returned. No
        other integrals or derivatives are implemented, and an exception will
        be raised if any other order is given.

    Returns
    -------
    Y : float
        Property [constant-specific; if order == 1, property/K; if order == -1,
                  property*K; if order == -1j, unchanged from default]

    Notes
    -----
    The derivative with respect to T, integral with respect to T, and integral
    over T with respect to T are computed as follows. All expressions can be
    obtained with SymPy readily.

    .. math::
        \frac{d Y}{dT} = - \frac{B}{T^{2}} - \frac{3 C}{T^{4}}
        - \frac{8 D}{T^{9}} - \frac{9 E}{T^{10}}

    .. math::
        \int Y dT = A T + B \log{\left (T \right )} - \frac{1}{56 T^{8}}
        \left(28 C T^{6} + 8 D T + 7 E\right)

    .. math::
        \int \frac{Y}{T} dT = A \log{\left (T \right )} - \frac{1}{72 T^{9}}
        \left(72 B T^{8} + 24 C T^{6} + 9 D T + 8 E\right)

    Examples
    --------
    Water second virial coefficient; DIPPR coefficients normally dimensionless.

    >>> EQ104(300, 0.02222, -26.38, -16750000, -3.894E19, 3.133E21)
    -1.1204179007265156

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


return A/B**(<NUM_LIT:1.> + (<NUM_LIT:1.> - T/C)**D)<EOL>

r'''DIPPR Equation #105. Often used in calculating liquid molar density.
    All 4 parameters are required. C is sometimes the fluid's critical
    temperature.

    .. math::
        Y = \frac{A}{B^{1 + (1-\frac{T}{C})^D}}

    Parameters
    ----------
    T : float
        Temperature, [K]
    A-D : float
        Parameter for the equation; chemical and property specific [-]

    Returns
    -------
    Y : float
        Property [constant-specific]

    Notes
    -----
    This expression can be integrated in terms of the incomplete gamma function
    for dT, but for Y/T dT no integral could be found.

    Examples
    --------
    Hexane molar density; DIPPR coefficients normally in kmol/m^3.

    >>> EQ105(300., 0.70824, 0.26411, 507.6, 0.27537)
    7.593170096339236

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


def EQ106(T, Tc, A, B, C=<NUM_LIT:0>, D=<NUM_LIT:0>, E=<NUM_LIT:0>):

Tr = T/Tc<EOL>return A*(<NUM_LIT:1.> - Tr)**(B + Tr*(C + Tr*(D + E*Tr)))<EOL>

r'''DIPPR Equation #106. Often used in calculating liquid surface tension,
    and heat of vaporization.
    Only parameters A and B parameters are required; many fits include no
    further parameters. Critical temperature is also required.

    .. math::
        Y = A(1-T_r)^{B + C T_r + D T_r^2 + E T_r^3}

        Tr = \frac{T}{Tc}

    Parameters
    ----------
    T : float
        Temperature, [K]
    Tc : float
        Critical temperature, [K]
    A-D : float
        Parameter for the equation; chemical and property specific [-]

    Returns
    -------
    Y : float
        Property [constant-specific]

    Notes
    -----
    The integral could not be found, but the integral over T actually could,
    again in terms of hypergeometric functions.

    Examples
    --------
    Water surface tension; DIPPR coefficients normally in Pa*s.

    >>> EQ106(300, 647.096, 0.17766, 2.567, -3.3377, 1.9699)
    0.07231499373541

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


def EQ107(T, A=<NUM_LIT:0>, B=<NUM_LIT:0>, C=<NUM_LIT:0>, D=<NUM_LIT:0>, E=<NUM_LIT:0>, order=<NUM_LIT:0>):

if order == <NUM_LIT:0>:<EOL><INDENT>return A + B*((C/T)/sinh(C/T))**<NUM_LIT:2> + D*((E/T)/cosh(E/T))**<NUM_LIT:2><EOL><DEDENT>elif order == <NUM_LIT:1>:<EOL><INDENT>return (<NUM_LIT:2>*B*C**<NUM_LIT:3>*cosh(C/T)/(T**<NUM_LIT:4>*sinh(C/T)**<NUM_LIT:3>) <EOL>- <NUM_LIT:2>*B*C**<NUM_LIT:2>/(T**<NUM_LIT:3>*sinh(C/T)**<NUM_LIT:2>) <EOL>+ <NUM_LIT:2>*D*E**<NUM_LIT:3>*sinh(E/T)/(T**<NUM_LIT:4>*cosh(E/T)**<NUM_LIT:3>)<EOL>- <NUM_LIT:2>*D*E**<NUM_LIT:2>/(T**<NUM_LIT:3>*cosh(E/T)**<NUM_LIT:2>))<EOL><DEDENT>elif order == -<NUM_LIT:1>:<EOL><INDENT>return A*T + B*C/tanh(C/T) - D*E*tanh(E/T)<EOL><DEDENT>elif order == -<NUM_LIT>:<EOL><INDENT>return (A*log(T) + B*C/tanh(C/T)/T - B*log(sinh(C/T)) <EOL>- D*E*tanh(E/T)/T + D*log(cosh(E/T)))<EOL><DEDENT>else:<EOL><INDENT>raise Exception(order_not_found_msg)<EOL><DEDENT>

r'''DIPPR Equation #107. Often used in calculating ideal-gas heat capacity.
    All 5 parameters are required.
    Also called the Aly-Lee equation.

    .. math::
        Y = A + B\left[\frac{C/T}{\sinh(C/T)}\right]^2 + D\left[\frac{E/T}{
        \cosh(E/T)}\right]^2

    Parameters
    ----------
    T : float
        Temperature, [K]
    A-E : float
        Parameter for the equation; chemical and property specific [-]
    order : int, optional
        Order of the calculation. 0 for the calculation of the result itself;
        for 1, the first derivative of the property is returned, for
        -1, the indefinite integral of the property with respect to temperature
        is returned; and for -1j, the indefinite integral of the property
        divided by temperature with respect to temperature is returned. No
        other integrals or derivatives are implemented, and an exception will
        be raised if any other order is given.

    Returns
    -------
    Y : float
        Property [constant-specific; if order == 1, property/K; if order == -1,
                  property*K; if order == -1j, unchanged from default]

    Notes
    -----
    The derivative with respect to T, integral with respect to T, and integral
    over T with respect to T are computed as follows. The derivative is
    obtained via SymPy; the integrals from Wolfram Alpha.

    .. math::
        \frac{d Y}{dT} = \frac{2 B C^{3} \cosh{\left (\frac{C}{T} \right )}}
        {T^{4} \sinh^{3}{\left (\frac{C}{T} \right )}} - \frac{2 B C^{2}}{T^{3}
        \sinh^{2}{\left (\frac{C}{T} \right )}} + \frac{2 D E^{3} \sinh{\left
        (\frac{E}{T} \right )}}{T^{4} \cosh^{3}{\left (\frac{E}{T} \right )}}
        - \frac{2 D E^{2}}{T^{3} \cosh^{2}{\left (\frac{E}{T} \right )}}

    .. math::
        \int Y dT = A T + \frac{B C}{\tanh{\left (\frac{C}{T} \right )}}
        - D E \tanh{\left (\frac{E}{T} \right )}

    .. math::
        \int \frac{Y}{T} dT = A \log{\left (T \right )} + \frac{B C}{T \tanh{
        \left (\frac{C}{T} \right )}} - B \log{\left (\sinh{\left (\frac{C}{T}
        \right )} \right )} - \frac{D E}{T} \tanh{\left (\frac{E}{T} \right )}
        + D \log{\left (\cosh{\left (\frac{E}{T} \right )} \right )}

    Examples
    --------
    Water ideal gas molar heat capacity; DIPPR coefficients normally in
    J/kmol/K

    >>> EQ107(300., 33363., 26790., 2610.5, 8896., 1169.)
    33585.90452768923

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE
    .. [2] Aly, Fouad A., and Lloyd L. Lee. "Self-Consistent Equations for
       Calculating the Ideal Gas Heat Capacity, Enthalpy, and Entropy." Fluid
       Phase Equilibria 6, no. 3 (January 1, 1981): 169-79.
       doi:10.1016/0378-3812(81)85002-9.


def EQ114(T, Tc, A, B, C, D, order=<NUM_LIT:0>):

if order == <NUM_LIT:0>:<EOL><INDENT>t = <NUM_LIT:1.>-T/Tc<EOL>return (A**<NUM_LIT>/t + B - <NUM_LIT>*A*C*t - A*D*t**<NUM_LIT> - C**<NUM_LIT>*t**<NUM_LIT>/<NUM_LIT> <EOL>- C*D*t**<NUM_LIT>/<NUM_LIT> - D**<NUM_LIT:2>*t**<NUM_LIT>/<NUM_LIT>)<EOL><DEDENT>elif order == <NUM_LIT:1>:<EOL><INDENT>return (A**<NUM_LIT:2>/(Tc*(-T/Tc + <NUM_LIT:1>)**<NUM_LIT:2>) + <NUM_LIT:2>*A*C/Tc + <NUM_LIT:2>*A*D*(-T/Tc + <NUM_LIT:1>)/Tc <EOL>+ C**<NUM_LIT:2>*(-T/Tc + <NUM_LIT:1>)**<NUM_LIT:2>/Tc + <NUM_LIT:2>*C*D*(-T/Tc + <NUM_LIT:1>)**<NUM_LIT:3>/Tc <EOL>+ D**<NUM_LIT:2>*(-T/Tc + <NUM_LIT:1>)**<NUM_LIT:4>/Tc)<EOL><DEDENT>elif order == -<NUM_LIT:1>:<EOL><INDENT>return (-A**<NUM_LIT:2>*Tc*clog(T - Tc).real + D**<NUM_LIT:2>*T**<NUM_LIT:6>/(<NUM_LIT:30>*Tc**<NUM_LIT:5>) <EOL>- T**<NUM_LIT:5>*(C*D + <NUM_LIT:2>*D**<NUM_LIT:2>)/(<NUM_LIT:10>*Tc**<NUM_LIT:4>) <EOL>+ T**<NUM_LIT:4>*(C**<NUM_LIT:2> + <NUM_LIT:6>*C*D + <NUM_LIT:6>*D**<NUM_LIT:2>)/(<NUM_LIT:12>*Tc**<NUM_LIT:3>) - T**<NUM_LIT:3>*(A*D + C**<NUM_LIT:2> <EOL>+ <NUM_LIT:3>*C*D + <NUM_LIT:2>*D**<NUM_LIT:2>)/(<NUM_LIT:3>*Tc**<NUM_LIT:2>) + T**<NUM_LIT:2>*(<NUM_LIT:2>*A*C + <NUM_LIT:2>*A*D + C**<NUM_LIT:2> + <NUM_LIT:2>*C*D <EOL>+ D**<NUM_LIT:2>)/(<NUM_LIT:2>*Tc) + T*(-<NUM_LIT:2>*A*C - A*D + B - C**<NUM_LIT:2>/<NUM_LIT:3> - C*D/<NUM_LIT:2> - D**<NUM_LIT:2>/<NUM_LIT:5>))<EOL><DEDENT>elif order == -<NUM_LIT>:<EOL><INDENT>return (-A**<NUM_LIT:2>*clog(T + (-<NUM_LIT>*A**<NUM_LIT:2>*Tc + <NUM_LIT>*A*C*Tc + <NUM_LIT:30>*A*D*Tc - <NUM_LIT:30>*B*Tc <EOL>+ <NUM_LIT:10>*C**<NUM_LIT:2>*Tc + <NUM_LIT:15>*C*D*Tc + <NUM_LIT:6>*D**<NUM_LIT:2>*Tc)/(<NUM_LIT>*A**<NUM_LIT:2> - <NUM_LIT>*A*C <EOL>- <NUM_LIT:30>*A*D + <NUM_LIT:30>*B - <NUM_LIT:10>*C**<NUM_LIT:2> - <NUM_LIT:15>*C*D - <NUM_LIT:6>*D**<NUM_LIT:2>)).real <EOL>+ D**<NUM_LIT:2>*T**<NUM_LIT:5>/(<NUM_LIT>*Tc**<NUM_LIT:5>) - T**<NUM_LIT:4>*(C*D + <NUM_LIT:2>*D**<NUM_LIT:2>)/(<NUM_LIT:8>*Tc**<NUM_LIT:4>) <EOL>+ T**<NUM_LIT:3>*(C**<NUM_LIT:2> + <NUM_LIT:6>*C*D + <NUM_LIT:6>*D**<NUM_LIT:2>)/(<NUM_LIT:9>*Tc**<NUM_LIT:3>) - T**<NUM_LIT:2>*(A*D + C**<NUM_LIT:2><EOL>+ <NUM_LIT:3>*C*D + <NUM_LIT:2>*D**<NUM_LIT:2>)/(<NUM_LIT:2>*Tc**<NUM_LIT:2>) + T*(<NUM_LIT:2>*A*C + <NUM_LIT:2>*A*D + C**<NUM_LIT:2> + <NUM_LIT:2>*C*D<EOL>+ D**<NUM_LIT:2>)/Tc + (<NUM_LIT:30>*A**<NUM_LIT:2> - <NUM_LIT>*A*C - <NUM_LIT:30>*A*D + <NUM_LIT:30>*B - <NUM_LIT:10>*C**<NUM_LIT:2><EOL>- <NUM_LIT:15>*C*D - <NUM_LIT:6>*D**<NUM_LIT:2>)*clog(T + (-<NUM_LIT:30>*A**<NUM_LIT:2>*Tc + <NUM_LIT>*A*C*Tc <EOL>+ <NUM_LIT:30>*A*D*Tc - <NUM_LIT:30>*B*Tc + <NUM_LIT:10>*C**<NUM_LIT:2>*Tc + <NUM_LIT:15>*C*D*Tc + <NUM_LIT:6>*D**<NUM_LIT:2>*Tc <EOL>+ Tc*(<NUM_LIT:30>*A**<NUM_LIT:2> - <NUM_LIT>*A*C - <NUM_LIT:30>*A*D + <NUM_LIT:30>*B - <NUM_LIT:10>*C**<NUM_LIT:2> - <NUM_LIT:15>*C*D <EOL>- <NUM_LIT:6>*D**<NUM_LIT:2>))/(<NUM_LIT>*A**<NUM_LIT:2> - <NUM_LIT>*A*C - <NUM_LIT:30>*A*D + <NUM_LIT:30>*B - <NUM_LIT:10>*C**<NUM_LIT:2> <EOL>- <NUM_LIT:15>*C*D - <NUM_LIT:6>*D**<NUM_LIT:2>)).real/<NUM_LIT:30>)<EOL><DEDENT>else:<EOL><INDENT>raise Exception(order_not_found_msg)<EOL><DEDENT>

r'''DIPPR Equation #114. Rarely used, normally as an alternate liquid
    heat capacity expression. All 4 parameters are required, as well as
    critical temperature.

    .. math::
        Y = \frac{A^2}{\tau} + B - 2AC\tau - AD\tau^2 - \frac{1}{3}C^2\tau^3
        - \frac{1}{2}CD\tau^4 - \frac{1}{5}D^2\tau^5

        \tau = 1 - \frac{T}{Tc}

    Parameters
    ----------
    T : float
        Temperature, [K]
    Tc : float
        Critical temperature, [K]
    A-D : float
        Parameter for the equation; chemical and property specific [-]
    order : int, optional
        Order of the calculation. 0 for the calculation of the result itself;
        for 1, the first derivative of the property is returned, for
        -1, the indefinite integral of the property with respect to temperature
        is returned; and for -1j, the indefinite integral of the property
        divided by temperature with respect to temperature is returned. No
        other integrals or derivatives are implemented, and an exception will
        be raised if any other order is given.

    Returns
    -------
    Y : float
        Property [constant-specific; if order == 1, property/K; if order == -1,
                  property*K; if order == -1j, unchanged from default]

    Notes
    -----
    The derivative with respect to T, integral with respect to T, and integral
    over T with respect to T are computed as follows. All expressions can be
    obtained with SymPy readily.

    .. math::
        \frac{d Y}{dT} = \frac{A^{2}}{T_{c} \left(- \frac{T}{T_{c}}
        + 1\right)^{2}} + \frac{2 A}{T_{c}} C + \frac{2 A}{T_{c}} D \left(
        - \frac{T}{T_{c}} + 1\right) + \frac{C^{2}}{T_{c}} \left(
        - \frac{T}{T_{c}} + 1\right)^{2} + \frac{2 C}{T_{c}} D \left(
        - \frac{T}{T_{c}} + 1\right)^{3} + \frac{D^{2}}{T_{c}} \left(
        - \frac{T}{T_{c}} + 1\right)^{4}

    .. math::
        \int Y dT = - A^{2} T_{c} \log{\left (T - T_{c} \right )} + \frac{D^{2}
        T^{6}}{30 T_{c}^{5}} - \frac{T^{5}}{10 T_{c}^{4}} \left(C D + 2 D^{2}
        \right) + \frac{T^{4}}{12 T_{c}^{3}} \left(C^{2} + 6 C D + 6 D^{2}
        \right) - \frac{T^{3}}{3 T_{c}^{2}} \left(A D + C^{2} + 3 C D
        + 2 D^{2}\right) + \frac{T^{2}}{2 T_{c}} \left(2 A C + 2 A D + C^{2}
        + 2 C D + D^{2}\right) + T \left(- 2 A C - A D + B - \frac{C^{2}}{3}
        - \frac{C D}{2} - \frac{D^{2}}{5}\right)

    .. math::
        \int \frac{Y}{T} dT = - A^{2} \log{\left (T + \frac{- 60 A^{2} T_{c}
        + 60 A C T_{c} + 30 A D T_{c} - 30 B T_{c} + 10 C^{2} T_{c}
        + 15 C D T_{c} + 6 D^{2} T_{c}}{60 A^{2} - 60 A C - 30 A D + 30 B
        - 10 C^{2} - 15 C D - 6 D^{2}} \right )} + \frac{D^{2} T^{5}}
        {25 T_{c}^{5}} - \frac{T^{4}}{8 T_{c}^{4}} \left(C D + 2 D^{2}
        \right) + \frac{T^{3}}{9 T_{c}^{3}} \left(C^{2} + 6 C D + 6 D^{2}
        \right) - \frac{T^{2}}{2 T_{c}^{2}} \left(A D + C^{2} + 3 C D
        + 2 D^{2}\right) + \frac{T}{T_{c}} \left(2 A C + 2 A D + C^{2}
        + 2 C D + D^{2}\right) + \frac{1}{30} \left(30 A^{2} - 60 A C
        - 30 A D + 30 B - 10 C^{2} - 15 C D - 6 D^{2}\right) \log{\left
        (T + \frac{1}{60 A^{2} - 60 A C - 30 A D + 30 B - 10 C^{2} - 15 C D
        - 6 D^{2}} \left(- 30 A^{2} T_{c} + 60 A C T_{c} + 30 A D T_{c}
        - 30 B T_{c} + 10 C^{2} T_{c} + 15 C D T_{c} + 6 D^{2} T_{c}
        + T_{c} \left(30 A^{2} - 60 A C - 30 A D + 30 B - 10 C^{2} - 15 C D
        - 6 D^{2}\right)\right) \right )}

    Strictly speaking, the integral over T has an imaginary component, but
    only the real component is relevant and the complex part discarded.

    Examples
    --------
    Hydrogen liquid heat capacity; DIPPR coefficients normally in J/kmol/K.

    >>> EQ114(20, 33.19, 66.653, 6765.9, -123.63, 478.27)
    19423.948911676463

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


def EQ115(T, A, B, C=<NUM_LIT:0>, D=<NUM_LIT:0>, E=<NUM_LIT:0>):

return exp(A+B/T+C*log(T)+D*T**<NUM_LIT:2> + E/T**<NUM_LIT:2>)<EOL>

r'''DIPPR Equation #115. No major uses; has been used as an alternate
    liquid viscosity expression, and as a model for vapor pressure.
    Only parameters A and B are required.

    .. math::
        Y = \exp\left(A + \frac{B}{T} + C\log T + D T^2 + \frac{E}{T^2}\right)

    Parameters
    ----------
    T : float
        Temperature, [K]
    A-E : float
        Parameter for the equation; chemical and property specific [-]

    Returns
    -------
    Y : float
        Property [constant-specific]

    Notes
    -----
    No coefficients found for this expression.
    This function is not integrable for either dT or Y/T dT.

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


def EQ116(T, Tc, A, B, C, D, E, order=<NUM_LIT:0>):

if order == <NUM_LIT:0>:<EOL><INDENT>tau = <NUM_LIT:1>-T/Tc<EOL>return A + B*tau**<NUM_LIT> + C*tau**(<NUM_LIT:2>/<NUM_LIT>) + D*tau + E*tau**(<NUM_LIT:4>/<NUM_LIT>)<EOL><DEDENT>elif order == <NUM_LIT:1>:<EOL><INDENT>return (-<NUM_LIT:7>*B/(<NUM_LIT:20>*Tc*(-T/Tc + <NUM_LIT:1>)**(<NUM_LIT>/<NUM_LIT:20>)) <EOL>- <NUM_LIT:2>*C/(<NUM_LIT:3>*Tc*(-T/Tc + <NUM_LIT:1>)**(<NUM_LIT:1>/<NUM_LIT:3>)) <EOL>- D/Tc - <NUM_LIT:4>*E*(-T/Tc + <NUM_LIT:1>)**(<NUM_LIT:1>/<NUM_LIT:3>)/(<NUM_LIT:3>*Tc))<EOL><DEDENT>elif order == -<NUM_LIT:1>:<EOL><INDENT>return (A*T - <NUM_LIT:20>*B*Tc*(-T/Tc + <NUM_LIT:1>)**(<NUM_LIT>/<NUM_LIT:20>)/<NUM_LIT> <EOL>- <NUM_LIT:3>*C*Tc*(-T/Tc + <NUM_LIT:1>)**(<NUM_LIT:5>/<NUM_LIT:3>)/<NUM_LIT:5> + D*(-T**<NUM_LIT:2>/(<NUM_LIT:2>*Tc) + T)<EOL>- <NUM_LIT:3>*E*Tc*(-T/Tc + <NUM_LIT:1>)**(<NUM_LIT:7>/<NUM_LIT:3>)/<NUM_LIT:7>)<EOL><DEDENT>elif order == -<NUM_LIT>:<EOL><INDENT>x0 = log(T)<EOL>x1 = <NUM_LIT:0.5>*x0<EOL>x2 = <NUM_LIT:1>/Tc<EOL>x3 = T*x2<EOL>x4 = -x3 + <NUM_LIT:1><EOL>x5 = <NUM_LIT>*C<EOL>x6 = x4**<NUM_LIT><EOL>x7 = <NUM_LIT:2>*B<EOL>x8 = x4**<NUM_LIT><EOL>x9 = log(-x6 + <NUM_LIT:1>)<EOL>x10 = sqrt(<NUM_LIT:3>)<EOL>x11 = x10*atan(x10*(<NUM_LIT:2>*x6 + <NUM_LIT:1>)/<NUM_LIT:3>)<EOL>x12 = sqrt(<NUM_LIT:5>)<EOL>x13 = <NUM_LIT:0.5>*x12<EOL>x14 = x13 + <NUM_LIT:0.5><EOL>x15 = B*x14<EOL>x16 = sqrt(x13 + <NUM_LIT>)<EOL>x17 = <NUM_LIT:2>*x8<EOL>x18 = -x17<EOL>x19 = -x13<EOL>x20 = x19 + <NUM_LIT:0.5><EOL>x21 = B*x20<EOL>x22 = sqrt(x19 + <NUM_LIT>)<EOL>x23 = B*x16<EOL>x24 = <NUM_LIT:0.5>*sqrt(<NUM_LIT:0.1>*x12 + <NUM_LIT:0.5>)<EOL>x25 = x12 + <NUM_LIT:1><EOL>x26 = <NUM_LIT:4>*x8<EOL>x27 = -x26<EOL>x28 = sqrt(<NUM_LIT:10>)*B/sqrt(x12 + <NUM_LIT:5>)<EOL>x29 = <NUM_LIT:2>*x12<EOL>x30 = sqrt(x29 + <NUM_LIT:10>)<EOL>x31 = <NUM_LIT:1>/x30<EOL>x32 = -x12 + <NUM_LIT:1><EOL>x33 = <NUM_LIT:0.5>*B*x22<EOL>x34 = -x2*(T - Tc)<EOL>x35 = <NUM_LIT:2>*x34**<NUM_LIT:0.1><EOL>x36 = x35 + <NUM_LIT:2><EOL>x37 = x34**<NUM_LIT><EOL>x38 = x30*x37<EOL>x39 = <NUM_LIT:0.5>*B*x16<EOL>x40 = x37*sqrt(-x29 + <NUM_LIT:10>)<EOL>x41 = <NUM_LIT>*x12<EOL>x42 = B*(-x41 + <NUM_LIT>)<EOL>x43 = x12*x37<EOL>x44 = x35 + x37 + <NUM_LIT:2><EOL>x45 = B*(x41 + <NUM_LIT>)<EOL>x46 = -x43<EOL>x47 = x35 - x37 + <NUM_LIT:2><EOL>return A*x0 + <NUM_LIT>*B*x4**<NUM_LIT> - C*x1 + C*x11 + D*x0 - D*x3 - E*x1 - E*x11 + <NUM_LIT>*E*x4**<NUM_LIT> + <NUM_LIT:3>*E*x6 + <NUM_LIT>*E*x9 - x15*atan(x14*(x16 + x17)) + x15*atan(x14*(x16 + x18)) - x21*atan(x20*(x17 + x22)) + x21*atan(x20*(x18 + x22)) + x23*atan(x24*(x25 + x26)) - x23*atan(x24*(x25 + x27)) - x28*atan(x31*(x26 + x32)) + x28*atan(x31*(x27 + x32)) - x33*log(x36 - x38) + x33*log(x36 + x38) + x39*log(x36 - x40) - x39*log(x36 + x40) + x4**<NUM_LIT>*x5 - x42*log(x43 + x44) + x42*log(x46 + x47) + x45*log(x43 + x47) - x45*log(x44 + x46) + x5*x9 + x7*atan(x8) - x7*atanh(x8)<EOL><DEDENT>else:<EOL><INDENT>raise Exception(order_not_found_msg)<EOL><DEDENT>

r'''DIPPR Equation #116. Used to describe the molar density of water fairly
    precisely; no other uses listed. All 5 parameters are needed, as well as
    the critical temperature.

    .. math::
        Y = A + B\tau^{0.35} + C\tau^{2/3} + D\tau + E\tau^{4/3}

        \tau = 1 - \frac{T}{T_c}

    Parameters
    ----------
    T : float
        Temperature, [K]
    Tc : float
        Critical temperature, [K]
    A-E : float
        Parameter for the equation; chemical and property specific [-]
    order : int, optional
        Order of the calculation. 0 for the calculation of the result itself;
        for 1, the first derivative of the property is returned, for
        -1, the indefinite integral of the property with respect to temperature
        is returned; and for -1j, the indefinite integral of the property
        divided by temperature with respect to temperature is returned. No
        other integrals or derivatives are implemented, and an exception will
        be raised if any other order is given.

    Returns
    -------
    Y : float
        Property [constant-specific; if order == 1, property/K; if order == -1,
                  property*K; if order == -1j, unchanged from default]

    Notes
    -----
    The derivative with respect to T and integral with respect to T are
    computed as follows. The integral divided by T with respect to T has an
    extremely complicated (but still elementary) integral which can be read
    from the source. It was computed with Rubi; the other expressions can
    readily be obtained with SymPy.

    .. math::
        \frac{d Y}{dT} = - \frac{7 B}{20 T_c \left(- \frac{T}{T_c} + 1\right)^{
        \frac{13}{20}}} - \frac{2 C}{3 T_c \sqrt[3]{- \frac{T}{T_c} + 1}}
        - \frac{D}{T_c} - \frac{4 E}{3 T_c} \sqrt[3]{- \frac{T}{T_c} + 1}

    .. math::
        \int Y dT = A T - \frac{20 B}{27} T_c \left(- \frac{T}{T_c} + 1\right)^{
        \frac{27}{20}} - \frac{3 C}{5} T_c \left(- \frac{T}{T_c} + 1\right)^{
        \frac{5}{3}} + D \left(- \frac{T^{2}}{2 T_c} + T\right) - \frac{3 E}{7}
        T_c \left(- \frac{T}{T_c} + 1\right)^{\frac{7}{3}}

    Examples
    --------
    Water liquid molar density; DIPPR coefficients normally in kmol/m^3.

    >>> EQ116(300., 647.096, 17.863, 58.606, -95.396, 213.89, -141.26)
    55.17615446406527

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


def EQ127(T, A, B, C, D, E, F, G, order=<NUM_LIT:0>):

if order == <NUM_LIT:0>:<EOL><INDENT>return (A+B*((C/T)**<NUM_LIT:2>*exp(C/T)/(exp(C/T) - <NUM_LIT:1>)**<NUM_LIT:2>) + <EOL>D*((E/T)**<NUM_LIT:2>*exp(E/T)/(exp(E/T)-<NUM_LIT:1>)**<NUM_LIT:2>) + <EOL>F*((G/T)**<NUM_LIT:2>*exp(G/T)/(exp(G/T)-<NUM_LIT:1>)**<NUM_LIT:2>))<EOL><DEDENT>elif order == <NUM_LIT:1>:<EOL><INDENT>return (-B*C**<NUM_LIT:3>*exp(C/T)/(T**<NUM_LIT:4>*(exp(C/T) - <NUM_LIT:1>)**<NUM_LIT:2>) <EOL>+ <NUM_LIT:2>*B*C**<NUM_LIT:3>*exp(<NUM_LIT:2>*C/T)/(T**<NUM_LIT:4>*(exp(C/T) - <NUM_LIT:1>)**<NUM_LIT:3>) <EOL>- <NUM_LIT:2>*B*C**<NUM_LIT:2>*exp(C/T)/(T**<NUM_LIT:3>*(exp(C/T) - <NUM_LIT:1>)**<NUM_LIT:2>) <EOL>- D*E**<NUM_LIT:3>*exp(E/T)/(T**<NUM_LIT:4>*(exp(E/T) - <NUM_LIT:1>)**<NUM_LIT:2>) <EOL>+ <NUM_LIT:2>*D*E**<NUM_LIT:3>*exp(<NUM_LIT:2>*E/T)/(T**<NUM_LIT:4>*(exp(E/T) - <NUM_LIT:1>)**<NUM_LIT:3>) <EOL>- <NUM_LIT:2>*D*E**<NUM_LIT:2>*exp(E/T)/(T**<NUM_LIT:3>*(exp(E/T) - <NUM_LIT:1>)**<NUM_LIT:2>) <EOL>- F*G**<NUM_LIT:3>*exp(G/T)/(T**<NUM_LIT:4>*(exp(G/T) - <NUM_LIT:1>)**<NUM_LIT:2>)<EOL>+ <NUM_LIT:2>*F*G**<NUM_LIT:3>*exp(<NUM_LIT:2>*G/T)/(T**<NUM_LIT:4>*(exp(G/T) - <NUM_LIT:1>)**<NUM_LIT:3>) <EOL>- <NUM_LIT:2>*F*G**<NUM_LIT:2>*exp(G/T)/(T**<NUM_LIT:3>*(exp(G/T) - <NUM_LIT:1>)**<NUM_LIT:2>))<EOL><DEDENT>elif order == -<NUM_LIT:1>:<EOL><INDENT>return (A*T + B*C**<NUM_LIT:2>/(C*exp(C/T) - C) + D*E**<NUM_LIT:2>/(E*exp(E/T) - E)<EOL>+ F*G**<NUM_LIT:2>/(G*exp(G/T) - G))<EOL><DEDENT>elif order == -<NUM_LIT>:<EOL><INDENT>return (A*log(T) + B*C**<NUM_LIT:2>*(<NUM_LIT:1>/(C*T*exp(C/T) - C*T) + <NUM_LIT:1>/(C*T)<EOL>- log(exp(C/T) - <NUM_LIT:1>)/C**<NUM_LIT:2>) + D*E**<NUM_LIT:2>*(<NUM_LIT:1>/(E*T*exp(E/T) - E*T) <EOL>+ <NUM_LIT:1>/(E*T) - log(exp(E/T) - <NUM_LIT:1>)/E**<NUM_LIT:2>)<EOL>+ F*G**<NUM_LIT:2>*(<NUM_LIT:1>/(G*T*exp(G/T) - G*T) + <NUM_LIT:1>/(G*T) - log(exp(G/T) <EOL>- <NUM_LIT:1>)/G**<NUM_LIT:2>))<EOL><DEDENT>else:<EOL><INDENT>raise Exception(order_not_found_msg)<EOL><DEDENT>

r'''DIPPR Equation #127. Rarely used, and then only in calculating
    ideal-gas heat capacity. All 7 parameters are required.

    .. math::
        Y = A+B\left[\frac{\left(\frac{C}{T}\right)^2\exp\left(\frac{C}{T}
        \right)}{\left(\exp\frac{C}{T}-1 \right)^2}\right]
        +D\left[\frac{\left(\frac{E}{T}\right)^2\exp\left(\frac{E}{T}\right)}
        {\left(\exp\frac{E}{T}-1 \right)^2}\right]
        +F\left[\frac{\left(\frac{G}{T}\right)^2\exp\left(\frac{G}{T}\right)}
        {\left(\exp\frac{G}{T}-1 \right)^2}\right]

    Parameters
    ----------
    T : float
        Temperature, [K]
    A-G : float
        Parameter for the equation; chemical and property specific [-]
    order : int, optional
        Order of the calculation. 0 for the calculation of the result itself;
        for 1, the first derivative of the property is returned, for
        -1, the indefinite integral of the property with respect to temperature
        is returned; and for -1j, the indefinite integral of the property
        divided by temperature with respect to temperature is returned. No
        other integrals or derivatives are implemented, and an exception will
        be raised if any other order is given.

    Returns
    -------
    Y : float
        Property [constant-specific; if order == 1, property/K; if order == -1,
                  property*K; if order == -1j, unchanged from default]

    Notes
    -----
    The derivative with respect to T, integral with respect to T, and integral
    over T with respect to T are computed as follows. All expressions can be
    obtained with SymPy readily.

    .. math::
        \frac{d Y}{dT} = - \frac{B C^{3} e^{\frac{C}{T}}}{T^{4}
        \left(e^{\frac{C}{T}} - 1\right)^{2}} + \frac{2 B C^{3}
        e^{\frac{2 C}{T}}}{T^{4} \left(e^{\frac{C}{T}} - 1\right)^{3}}
        - \frac{2 B C^{2} e^{\frac{C}{T}}}{T^{3} \left(e^{\frac{C}{T}}
        - 1\right)^{2}} - \frac{D E^{3} e^{\frac{E}{T}}}{T^{4}
        \left(e^{\frac{E}{T}} - 1\right)^{2}} + \frac{2 D E^{3}
        e^{\frac{2 E}{T}}}{T^{4} \left(e^{\frac{E}{T}} - 1\right)^{3}}
        - \frac{2 D E^{2} e^{\frac{E}{T}}}{T^{3} \left(e^{\frac{E}{T}}
        - 1\right)^{2}} - \frac{F G^{3} e^{\frac{G}{T}}}{T^{4}
        \left(e^{\frac{G}{T}} - 1\right)^{2}} + \frac{2 F G^{3}
        e^{\frac{2 G}{T}}}{T^{4} \left(e^{\frac{G}{T}} - 1\right)^{3}}
        - \frac{2 F G^{2} e^{\frac{G}{T}}}{T^{3} \left(e^{\frac{G}{T}}
        - 1\right)^{2}}

    .. math::
        \int Y dT = A T + \frac{B C^{2}}{C e^{\frac{C}{T}} - C}
        + \frac{D E^{2}}{E e^{\frac{E}{T}} - E}
        + \frac{F G^{2}}{G e^{\frac{G}{T}} - G}

    .. math::
        \int \frac{Y}{T} dT = A \log{\left (T \right )} + B C^{2} \left(
        \frac{1}{C T e^{\frac{C}{T}} - C T} + \frac{1}{C T} - \frac{1}{C^{2}}
        \log{\left (e^{\frac{C}{T}} - 1 \right )}\right) + D E^{2} \left(
        \frac{1}{E T e^{\frac{E}{T}} - E T} + \frac{1}{E T} - \frac{1}{E^{2}}
        \log{\left (e^{\frac{E}{T}} - 1 \right )}\right) + F G^{2} \left(
        \frac{1}{G T e^{\frac{G}{T}} - G T} + \frac{1}{G T} - \frac{1}{G^{2}}
        \log{\left (e^{\frac{G}{T}} - 1 \right )}\right)

    Examples
    --------
    Ideal gas heat capacity of methanol; DIPPR coefficients normally in
    J/kmol/K

    >>> EQ127(20., 3.3258E4, 3.6199E4, 1.2057E3, 1.5373E7, 3.2122E3, -1.5318E7, 3.2122E3)
    33258.0

    References
    ----------
    .. [1] Design Institute for Physical Properties, 1996. DIPPR Project 801
       DIPPR/AIChE


def smarts_fragment(catalog, rdkitmol=None, smi=None):

if not hasRDKit: <EOL><INDENT>raise Exception(rdkit_missing)<EOL><DEDENT>if rdkitmol is None and smi is None:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>if smi is not None:<EOL><INDENT>rdkitmol = Chem.MolFromSmiles(smi)<EOL>if rdkitmol is None:<EOL><INDENT>status = '<STR_LIT>'<EOL>success = False<EOL>return {}, success, status<EOL><DEDENT><DEDENT>atom_count = len(rdkitmol.GetAtoms())    <EOL>status = '<STR_LIT:OK>'<EOL>success = True<EOL>counts = {}<EOL>all_matches = {}<EOL>for key, smart in catalog.items():<EOL><INDENT>patt = Chem.MolFromSmarts(smart)<EOL>hits = rdkitmol.GetSubstructMatches(patt)<EOL>if hits:<EOL><INDENT>all_matches[smart] = hits<EOL>counts[key] = len(hits)<EOL><DEDENT><DEDENT>matched_atoms = set()<EOL>for i in all_matches.values():<EOL><INDENT>for j in i:<EOL><INDENT>matched_atoms.update(j)<EOL><DEDENT><DEDENT>if len(matched_atoms) != atom_count:<EOL><INDENT>status = '<STR_LIT>'<EOL>success = False<EOL><DEDENT>if success:<EOL><INDENT>matched_atoms = []<EOL>for i in all_matches.values():<EOL><INDENT>for j in i:<EOL><INDENT>matched_atoms.extend(j)<EOL><DEDENT><DEDENT>if len(matched_atoms) < atom_count:<EOL><INDENT>status = '<STR_LIT>' %(len(matched_atoms), atom_count)<EOL>success = False<EOL><DEDENT>elif len(matched_atoms) > atom_count:<EOL><INDENT>status = '<STR_LIT>' %( [i for i, c in Counter(matched_atoms).items() if c > <NUM_LIT:1>])<EOL>success = False<EOL><DEDENT><DEDENT>return counts, success, status<EOL>

r'''Fragments a molecule into a set of unique groups and counts as
    specified by the `catalog`. The molecule can either be an rdkit
    molecule object, or a smiles string which will be parsed by rdkit.
    Returns a dictionary of groups and their counts according to the
    indexes of the catalog provided.

    Parameters
    ----------
    catalog : dict
        Dictionary indexed by keys pointing to smarts strings, [-]
    rdkitmol : mol, optional
        Molecule as rdkit object, [-]
    smi : str, optional
        Smiles string representing a chemical, [-]

    Returns
    -------
    counts : dict
        Dictionaty of integer counts of the found groups only, indexed by
        the same keys used by the catalog [-]
    success : bool
        Whether or not molecule was fully and uniquely fragmented, [-]
    status : str
        A string holding an explanation of why the molecule failed to be
        fragmented, if it fails; 'OK' if it suceeds.

    Notes
    -----
    Raises an exception if rdkit is not installed, or `smi` or `rdkitmol` is
    not defined.

    Examples
    --------
    Acetone:

    >>> smarts_fragment(catalog=J_BIGGS_JOBACK_SMARTS_id_dict, smi='CC(=O)C')
    ({24: 1, 1: 2}, True, 'OK')

    Sodium sulfate, (Na2O4S):

    >>> smarts_fragment(catalog=J_BIGGS_JOBACK_SMARTS_id_dict, smi='[O-]S(=O)(=O)[O-].[Na+].[Na+]')
    ({29: 4}, False, 'Did not match all atoms present')

    Propionic anhydride (C6H10O3):

    >>> smarts_fragment(catalog=J_BIGGS_JOBACK_SMARTS_id_dict, smi='CCC(=O)OC(=O)CC')
    ({1: 2, 2: 2, 28: 2}, False, 'Matched some atoms repeatedly: [4]')


<EOL>self.mul(<NUM_LIT>)<EOL>self.Cpig(<NUM_LIT>) <EOL>estimates = {'<STR_LIT>': self.Tb(self.counts),<EOL>'<STR_LIT>': self.Tm(self.counts),<EOL>'<STR_LIT>': self.Tc(self.counts, self.Tb_estimated),<EOL>'<STR_LIT>': self.Pc(self.counts, self.atom_count),<EOL>'<STR_LIT>': self.Vc(self.counts),<EOL>'<STR_LIT>': self.Hf(self.counts),<EOL>'<STR_LIT>': self.Gf(self.counts),<EOL>'<STR_LIT>': self.Hfus(self.counts),<EOL>'<STR_LIT>': self.Hvap(self.counts),<EOL>'<STR_LIT>': self.mul,<EOL>'<STR_LIT>': self.calculated_mul_coeffs,<EOL>'<STR_LIT>': self.Cpig,<EOL>'<STR_LIT>': self.calculated_Cpig_coeffs}<EOL>return estimates<EOL>

Method to compute all available properties with the Joback method;
        returns their results as a dict. For the tempearture dependent values
        Cpig and mul, both the coefficients and objects to perform calculations
        are returned.


tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Tb*count<EOL><DEDENT>Tb = <NUM_LIT> + tot<EOL>return Tb<EOL>

r'''Estimates the normal boiling temperature of an organic compound
        using the Joback method as a function of chemical structure only.

        .. math::
            T_b = 198.2 + \sum_i {T_{b,i}}

        For 438 compounds tested by Joback, the absolute average error was
        12.91 K  and standard deviation was 17.85 K; the average relative error
        was 3.6%.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        Tb : float
            Estimated normal boiling temperature, [K]

        Examples
        --------
        >>> Joback.Tb({1: 2, 24: 1})
        322.11


tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Tm*count<EOL><DEDENT>Tm = <NUM_LIT> + tot<EOL>return Tm<EOL>

r'''Estimates the melting temperature of an organic compound using the
        Joback method as a function of chemical structure only.

        .. math::
            T_m = 122.5 + \sum_i {T_{m,i}}

        For 388 compounds tested by Joback, the absolute average error was
        22.6 K  and standard deviation was 24.68 K; the average relative error
        was 11.2%.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        Tm : float
            Estimated melting temperature, [K]

        Examples
        --------
        >>> Joback.Tm({1: 2, 24: 1})
        173.5


if Tb is None:<EOL><INDENT>Tb = Joback.Tb(counts)<EOL><DEDENT>tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Tc*count<EOL><DEDENT>Tc = Tb/(<NUM_LIT> + <NUM_LIT>*tot - tot*tot)<EOL>return Tc<EOL>

r'''Estimates the critcal temperature of an organic compound using the
        Joback method as a function of chemical structure only, or optionally
        improved by using an experimental boiling point. If the experimental
        boiling point is not provided it will be estimated with the Joback
        method as well.

        .. math::
            T_c = T_b \left[0.584 + 0.965 \sum_i {T_{c,i}}
            - \left(\sum_i {T_{c,i}}\right)^2 \right]^{-1}

        For 409 compounds tested by Joback, the absolute average error was
        4.76 K  and standard deviation was 6.94 K; the average relative error
        was 0.81%.

        Appendix BI of Joback's work lists 409 estimated critical temperatures.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]
        Tb : float, optional
            Experimental normal boiling temperature, [K]

        Returns
        -------
        Tc : float
            Estimated critical temperature, [K]

        Examples
        --------
        >>> Joback.Tc({1: 2, 24: 1}, Tb=322.11)
        500.5590049525365


tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Pc*count<EOL><DEDENT>Pc = (<NUM_LIT> + <NUM_LIT>*atom_count - tot)**-<NUM_LIT:2><EOL>return Pc*<NUM_LIT><EOL>

r'''Estimates the critcal pressure of an organic compound using the
        Joback method as a function of chemical structure only. This
        correlation was developed using the actual number of atoms forming
        the molecule as well.

        .. math::
            P_c = \left [0.113 + 0.0032N_A - \sum_i {P_{c,i}}\right ]^{-2}

        In the above equation, critical pressure is calculated in bar; it is
        converted to Pa here.

        392 compounds were used by Joback in this determination, with an
        absolute average error of 2.06 bar, standard devaition 3.2 bar, and
        AARE of 5.2%.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]
        atom_count : int
            Total number of atoms (including hydrogens) in the molecule, [-]

        Returns
        -------
        Pc : float
            Estimated critical pressure, [Pa]

        Examples
        --------
        >>> Joback.Pc({1: 2, 24: 1}, 10)
        4802499.604994407


tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Vc*count<EOL><DEDENT>Vc = <NUM_LIT> + tot<EOL>return Vc*<NUM_LIT><EOL>

r'''Estimates the critcal volume of an organic compound using the
        Joback method as a function of chemical structure only.

        .. math::
            V_c = 17.5 + \sum_i {V_{c,i}}

        In the above equation, critical volume is calculated in cm^3/mol; it
        is converted to m^3/mol here.

        310 compounds were used by Joback in this determination, with an
        absolute average error of 7.54 cm^3/mol, standard devaition 13.16
        cm^3/mol, and AARE of 2.27%.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        Vc : float
            Estimated critical volume, [m^3/mol]

        Examples
        --------
        >>> Joback.Vc({1: 2, 24: 1})
        0.0002095


tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Hform*count<EOL><DEDENT>Hf = <NUM_LIT> + tot<EOL>return Hf*<NUM_LIT:1000><EOL>

r'''Estimates the ideal-gas enthalpy of formation at 298.15 K of an
        organic compound using the Joback method as a function of chemical
        structure only.

        .. math::
            H_{formation} = 68.29 + \sum_i {H_{f,i}}

        In the above equation, enthalpy of formation is calculated in kJ/mol;
        it is converted to J/mol here.

        370 compounds were used by Joback in this determination, with an
        absolute average error of 2.2 kcal/mol, standard devaition 2.0
        kcal/mol, and AARE of 15.2%.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        Hf : float
            Estimated ideal-gas enthalpy of formation at 298.15 K, [J/mol]

        Examples
        --------
        >>> Joback.Hf({1: 2, 24: 1})
        -217829.99999999997


tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Gform*count<EOL><DEDENT>Gf = <NUM_LIT> + tot<EOL>return Gf*<NUM_LIT:1000><EOL>

r'''Estimates the ideal-gas Gibbs energy of formation at 298.15 K of an
        organic compound using the Joback method as a function of chemical
        structure only.

        .. math::
            G_{formation} = 53.88 + \sum {G_{f,i}}

        In the above equation, Gibbs energy of formation is calculated in
        kJ/mol; it is converted to J/mol here.

        328 compounds were used by Joback in this determination, with an
        absolute average error of 2.0 kcal/mol, standard devaition 4.37
        kcal/mol, and AARE of 15.7%.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        Gf : float
            Estimated ideal-gas Gibbs energy of formation at 298.15 K, [J/mol]

        Examples
        --------
        >>> Joback.Gf({1: 2, 24: 1})
        -154540.00000000003


tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Hfus*count<EOL><DEDENT>Hfus = -<NUM_LIT> + tot<EOL>return Hfus*<NUM_LIT:1000><EOL>

r'''Estimates the enthalpy of fusion of an organic compound at its
        melting point using the Joback method as a function of chemical
        structure only.

        .. math::
            \Delta H_{fus} = -0.88 + \sum_i H_{fus,i}

        In the above equation, enthalpy of fusion is calculated in
        kJ/mol; it is converted to J/mol here.

        For 155 compounds tested by Joback, the absolute average error was
        485.2 cal/mol  and standard deviation was 661.4 cal/mol; the average
        relative error was 38.7%.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        Hfus : float
            Estimated enthalpy of fusion of the compound at its melting point,
            [J/mol]

        Examples
        --------
        >>> Joback.Hfus({1: 2, 24: 1})
        5125.0


tot = <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>tot += joback_groups_id_dict[group].Hvap*count<EOL><DEDENT>Hvap = <NUM_LIT> + tot<EOL>return Hvap*<NUM_LIT:1000><EOL>

r'''Estimates the enthalpy of vaporization of an organic compound at
        its normal boiling point using the Joback method as a function of
        chemical structure only.

        .. math::
            \Delta H_{vap} = 15.30 + \sum_i H_{vap,i}

        In the above equation, enthalpy of fusion is calculated in
        kJ/mol; it is converted to J/mol here.

        For 368 compounds tested by Joback, the absolute average error was
        303.5 cal/mol  and standard deviation was 429 cal/mol; the average
        relative error was 3.88%.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        Hvap : float
            Estimated enthalpy of vaporization of the compound at its normal
            boiling point, [J/mol]

        Examples
        --------
        >>> Joback.Hvap({1: 2, 24: 1})
        29018.0


a, b, c, d = <NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>a += joback_groups_id_dict[group].Cpa*count<EOL>b += joback_groups_id_dict[group].Cpb*count<EOL>c += joback_groups_id_dict[group].Cpc*count<EOL>d += joback_groups_id_dict[group].Cpd*count<EOL><DEDENT>a -= <NUM_LIT><EOL>b += <NUM_LIT><EOL>c -= <NUM_LIT><EOL>d += <NUM_LIT><EOL>return [a, b, c, d]<EOL>

r'''Computes the ideal-gas polynomial heat capacity coefficients
        of an organic compound using the Joback method as a function of
        chemical structure only.

        .. math::
            C_p^{ig} = \sum_i a_i - 37.93 + \left[ \sum_i b_i + 0.210 \right] T
            + \left[ \sum_i c_i - 3.91 \cdot 10^{-4} \right] T^2
            + \left[\sum_i d_i + 2.06 \cdot 10^{-7}\right] T^3

        288 compounds were used by Joback in this determination. No overall
        error was reported.

        The ideal gas heat capacity values used in developing the heat
        capacity polynomials used 9 data points between 298 K and 1000 K.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        coefficients : list[float]
            Coefficients which will result in a calculated heat capacity in
            in units of J/mol/K, [-]

        Examples
        --------
        >>> c = Joback.Cpig_coeffs({1: 2, 24: 1})
        >>> c
        [7.520000000000003, 0.26084, -0.0001207, 1.545999999999998e-08]
        >>> Cp = lambda T : c[0] + c[1]*T + c[2]*T**2 + c[3]*T**3
        >>> Cp(300)
        75.32642000000001


a, b = <NUM_LIT:0.0>, <NUM_LIT:0.0><EOL>for group, count in counts.items():<EOL><INDENT>a += joback_groups_id_dict[group].mua*count<EOL>b += joback_groups_id_dict[group].mub*count<EOL><DEDENT>a -= <NUM_LIT><EOL>b -= <NUM_LIT><EOL>return [a, b]<EOL>

r'''Computes the liquid phase viscosity Joback coefficients
        of an organic compound using the Joback method as a function of
        chemical structure only.

        .. math::
            \mu_{liq} = \text{MW} \exp\left( \frac{ \sum_i \mu_a - 597.82}{T}
            + \sum_i \mu_b - 11.202 \right)

        288 compounds were used by Joback in this determination. No overall
        error was reported.

        The liquid viscosity data used was specified to be at "several
        temperatures for each compound" only. A small and unspecified number
        of compounds were used in this estimation.

        Parameters
        ----------
        counts : dict
            Dictionary of Joback groups present (numerically indexed) and their
            counts, [-]

        Returns
        -------
        coefficients : list[float]
            Coefficients which will result in a liquid viscosity in
            in units of Pa*s, [-]

        Examples
        --------
        >>> mu_ab = Joback.mul_coeffs({1: 2, 24: 1})
        >>> mu_ab
        [839.1099999999998, -14.99]
        >>> MW = 58.041864812
        >>> mul = lambda T : MW*exp(mu_ab[0]/T + mu_ab[1])
        >>> mul(300)
        0.0002940378347162687


if self.calculated_Cpig_coeffs is None:<EOL><INDENT>self.calculated_Cpig_coeffs = Joback.Cpig_coeffs(self.counts)<EOL><DEDENT>return horner(reversed(self.calculated_Cpig_coeffs), T)<EOL>

r'''Computes ideal-gas heat capacity at a specified temperature
        of an organic compound using the Joback method as a function of
        chemical structure only.

        .. math::
            C_p^{ig} = \sum_i a_i - 37.93 + \left[ \sum_i b_i + 0.210 \right] T
            + \left[ \sum_i c_i - 3.91 \cdot 10^{-4} \right] T^2
            + \left[\sum_i d_i + 2.06 \cdot 10^{-7}\right] T^3

        Parameters
        ----------
        T : float
            Temperature, [K]

        Returns
        -------
        Cpig : float
            Ideal-gas heat capacity, [J/mol/K]

        Examples
        --------
        >>> J = Joback('CC(=O)C')
        >>> J.Cpig(300)
        75.32642000000001


if self.calculated_mul_coeffs is None:<EOL><INDENT>self.calculated_mul_coeffs = Joback.mul_coeffs(self.counts)<EOL><DEDENT>a, b = self.calculated_mul_coeffs<EOL>return self.MW*exp(a/T + b)<EOL>

r'''Computes liquid viscosity at a specified temperature
        of an organic compound using the Joback method as a function of
        chemical structure only.

        .. math::
            \mu_{liq} = \text{MW} \exp\left( \frac{ \sum_i \mu_a - 597.82}{T}
            + \sum_i \mu_b - 11.202 \right)

        Parameters
        ----------
        T : float
            Temperature, [K]

        Returns
        -------
        mul : float
            Liquid viscosity, [Pa*s]

        Examples
        --------
        >>> J = Joback('CC(=O)C')
        >>> J.mul(300)
        0.0002940378347162687


<EOL>if DDBST_UNIFAC_assignments:<EOL><INDENT>return None<EOL><DEDENT>with open(os.path.join(folder, '<STR_LIT>')) as f:<EOL><INDENT>_group_assignments = [DDBST_UNIFAC_assignments, DDBST_MODIFIED_UNIFAC_assignments, DDBST_PSRK_assignments]<EOL>for line in f.readlines():<EOL><INDENT>key, valids, original, modified, PSRK = line.split('<STR_LIT:\t>')<EOL>valids = [True if i == '<STR_LIT:1>' else False for i in valids.split('<STR_LIT:U+0020>')]<EOL>for groups, storage, valid in zip([original, modified, PSRK], _group_assignments, valids):<EOL><INDENT>if valid:<EOL><INDENT>groups = groups.rstrip().split('<STR_LIT:U+0020>')<EOL>d_data = {}<EOL>for i in range(int(len(groups)/<NUM_LIT:2>)):<EOL><INDENT>d_data[int(groups[i*<NUM_LIT:2>])] = int(groups[i*<NUM_LIT:2>+<NUM_LIT:1>])<EOL><DEDENT>storage[key] = d_data<EOL><DEDENT><DEDENT><DEDENT><DEDENT>

Data is stored in the format
    InChI key\tbool bool bool \tsubgroup count ...\tsubgroup count \tsubgroup count...
    where the bools refer to whether or not the original UNIFAC, modified
    UNIFAC, and PSRK group assignments were completed correctly.
    The subgroups and their count have an indefinite length.


if subgroup_data is not None:<EOL><INDENT>subgroups = subgroup_data<EOL><DEDENT>else:<EOL><INDENT>subgroups = UFSG<EOL><DEDENT>ri = <NUM_LIT:0.><EOL>qi = <NUM_LIT:0.><EOL>for group, count in groups.items():<EOL><INDENT>ri += subgroups[group].R*count<EOL>qi += subgroups[group].Q*count<EOL><DEDENT>return ri, qi<EOL>

r'''Calculates UNIFAC parameters R and Q for a chemical, given a dictionary
    of its groups, as shown in [1]_. Most UNIFAC methods use the same subgroup
    values; however, a dictionary of `UNIFAC_subgroup` instances may be
    specified as an optional second parameter.

    .. math::
        r_i = \sum_{k=1}^{n} \nu_k R_k

        q_i = \sum_{k=1}^{n}\nu_k Q_k

    Parameters
    ----------
    groups : dict[count]
        Dictionary of numeric subgroup IDs : their counts
    subgroup_data : None or dict[UNIFAC_subgroup]
        Optional replacement for standard subgroups; leave as None to use the
        original UNIFAC subgroup r and q values.

    Returns
    -------
    R : float
        R UNIFAC parameter (normalized Van der Waals Volume)  [-]
    Q : float
        Q UNIFAC parameter (normalized Van der Waals Area)  [-]

    Notes
    -----
    These parameters have some predictive value for other chemical properties.

    Examples
    --------
    Hexane

    >>> UNIFAC_RQ({1:2, 2:4})
    (4.4998000000000005, 3.856)

    References
    ----------
    .. [1] Gmehling, Jurgen. Chemical Thermodynamics: For Process Simulation.
       Weinheim, Germany: Wiley-VCH, 2012.


return R*<NUM_LIT><EOL>

r'''Calculates a species Van der Waals molar volume with the UNIFAC method,
    given a species's R parameter.

    .. math::
        V_{wk} = 15.17R_k

    Parameters
    ----------
    R : float
        R UNIFAC parameter (normalized Van der Waals Volume)  [-]

    Returns
    -------
    V_vdw : float
        Unnormalized Van der Waals volume, [m^3/mol]

    Notes
    -----
    The volume was originally given in cm^3/mol, but is converted to SI here.

    Examples
    --------
    >>> Van_der_Waals_volume(4.4998)
    6.826196599999999e-05

    References
    ----------
    .. [1] Wei, James, Morton M. Denn, John H. Seinfeld, Arup Chakraborty,
       Jackie Ying, Nicholas Peppas, and George Stephanopoulos. Molecular
       Modeling and Theory in Chemical Engineering. Academic Press, 2001.


return Q*<NUM_LIT><EOL>

r'''Calculates a species Van der Waals molar surface area with the UNIFAC
    method, given a species's Q parameter.

    .. math::
        A_{wk} = 2.5\times 10^9 Q_k

    Parameters
    ----------
    Q : float
        Q UNIFAC parameter (normalized Van der Waals Area)  [-]

    Returns
    -------
    A_vdw : float
        Unnormalized Van der Waals surface area, [m^2/mol]

    Notes
    -----
    The volume was originally given in cm^2/mol, but is converted to SI here.

    Examples
    --------
    >>> Van_der_Waals_area(3.856)
    964000.0

    References
    ----------
    .. [1] Wei, James, Morton M. Denn, John H. Seinfeld, Arup Chakraborty,
       Jackie Ying, Nicholas Peppas, and George Stephanopoulos. Molecular
       Modeling and Theory in Chemical Engineering. Academic Press, 2001.


def UNIFAC_psi(T, subgroup1, subgroup2, subgroup_data, interaction_data, <EOL>modified=False):

main1 = subgroup_data[subgroup1].main_group_id<EOL>main2 = subgroup_data[subgroup2].main_group_id<EOL>if modified:<EOL><INDENT>try:<EOL><INDENT>a, b, c = interaction_data[main1][main2]<EOL><DEDENT>except:<EOL><INDENT>return <NUM_LIT:1.><EOL><DEDENT>return exp((-a/T -b - c*T))<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>return exp(-interaction_data[main1][main2]/T)<EOL><DEDENT>except:<EOL><INDENT>return <NUM_LIT:1.><EOL><DEDENT><DEDENT>

r'''Calculates the interaction parameter psi(m, n) for two UNIFAC
    subgroups, given the system temperature, the UNIFAC subgroups considered
    for the variant of UNIFAC used, the interaction parameters for the
    variant of UNIFAC used, and whether or not the temperature dependence is
    modified from the original form, as shown below.

    Original temperature dependence:

    .. math::
        \Psi_{mn} = \exp\left(\frac{-a_{mn}}{T}\right)

    Modified temperature dependence:

    .. math::
        \Psi_{mn} = \exp\left(\frac{-a_{mn} - b_{mn}T - c_{mn}T^2}{T}\right)

    Parameters
    ----------
    T : float
        Temperature of the system, [K]
    subgroup1 : int
        First UNIFAC subgroup for identifier, [-]
    subgroup2 : int
        Second UNIFAC subgroup for identifier, [-]
    subgroup_data : dict[UNIFAC_subgroup]
        Normally provided as inputs to `UNIFAC`.
    interaction_data : dict[dict[tuple(a_mn, b_mn, c_mn)]]
        Normally provided as inputs to `UNIFAC`.
    modified : bool
        True if the modified temperature dependence is used by the interaction
        parameters, otherwise False

    Returns
    -------
    psi : float
        UNIFAC interaction parameter term, [-]

    Notes
    -----
    UNIFAC interaction parameters are asymmetric. No warning is raised if an
    interaction parameter is missing.

    Examples
    --------
    >>> from thermo.unifac import UFSG, UFIP, DOUFSG, DOUFIP2006

    >>> UNIFAC_psi(307, 18, 1, UFSG, UFIP)
    0.9165248264184787

    >>> UNIFAC_psi(373.15, 9, 78, DOUFSG, DOUFIP2006, modified=True)
    1.3703140538273264

    References
    ----------
    .. [1] Gmehling, Jurgen. Chemical Thermodynamics: For Process Simulation.
       Weinheim, Germany: Wiley-VCH, 2012.
    .. [2] Fredenslund, Aage, Russell L. Jones, and John M. Prausnitz. "Group
       Contribution Estimation of Activity Coefficients in Nonideal Liquid
       Mixtures." AIChE Journal 21, no. 6 (November 1, 1975): 1086-99.
       doi:10.1002/aic.690210607.


def UNIFAC(T, xs, chemgroups, cached=None, subgroup_data=None, <EOL>interaction_data=None, modified=False):

cmps = range(len(xs))<EOL>if subgroup_data is None:<EOL><INDENT>subgroups = UFSG<EOL><DEDENT>else:<EOL><INDENT>subgroups = subgroup_data<EOL><DEDENT>if interaction_data is None:<EOL><INDENT>interactions = UFIP<EOL><DEDENT>else:<EOL><INDENT>interactions = interaction_data<EOL><DEDENT>if not cached:<EOL><INDENT>rs = []<EOL>qs = []<EOL>for groups in chemgroups:<EOL><INDENT>ri = <NUM_LIT:0.><EOL>qi = <NUM_LIT:0.><EOL>for group, count in groups.items():<EOL><INDENT>ri += subgroups[group].R*count<EOL>qi += subgroups[group].Q*count<EOL><DEDENT>rs.append(ri)<EOL>qs.append(qi)<EOL><DEDENT>group_counts = {}<EOL>for groups in chemgroups:<EOL><INDENT>for group, count in groups.items():<EOL><INDENT>if group in group_counts:<EOL><INDENT>group_counts[group] += count<EOL><DEDENT>else:<EOL><INDENT>group_counts[group] = count<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>rs, qs, group_counts = cached<EOL><DEDENT>group_sum = sum(count*xs[i] for i in cmps for count in chemgroups[i].values())<EOL>group_count_xs = {}<EOL>for group in group_counts:<EOL><INDENT>tot_numerator = sum(chemgroups[i][group]*xs[i] for i in cmps if group in chemgroups[i])        <EOL>group_count_xs[group] = tot_numerator/group_sum<EOL><DEDENT>rsxs = sum([rs[i]*xs[i] for i in cmps])<EOL>Vis = [rs[i]/rsxs for i in cmps]<EOL>qsxs = sum([qs[i]*xs[i] for i in cmps])<EOL>Fis = [qs[i]/qsxs for i in cmps]<EOL>if modified:<EOL><INDENT>rsxs2 = sum([rs[i]**<NUM_LIT>*xs[i] for i in cmps])<EOL>Vis2 = [rs[i]**<NUM_LIT>/rsxs2 for i in cmps]<EOL>loggammacs = [<NUM_LIT:1.> - Vis2[i] + log(Vis2[i]) - <NUM_LIT>*qs[i]*(<NUM_LIT:1.> - Vis[i]/Fis[i]<EOL>+ log(Vis[i]/Fis[i])) for i in cmps]<EOL><DEDENT>else:<EOL><INDENT>loggammacs = [<NUM_LIT:1.> - Vis[i] + log(Vis[i]) - <NUM_LIT>*qs[i]*(<NUM_LIT:1.> - Vis[i]/Fis[i]<EOL>+ log(Vis[i]/Fis[i])) for i in cmps]<EOL><DEDENT>Q_sum_term = sum([subgroups[group].Q*group_count_xs[group] for group in group_counts])<EOL>area_fractions = {group: subgroups[group].Q*group_count_xs[group]/Q_sum_term<EOL>for group in group_counts.keys()}<EOL>UNIFAC_psis = {k: {m:(UNIFAC_psi(T, m, k, subgroups, interactions, modified=modified))<EOL>for m in group_counts} for k in group_counts}<EOL>loggamma_groups = {}<EOL>for k in group_counts:<EOL><INDENT>sum1, sum2 = <NUM_LIT:0.>, <NUM_LIT:0.><EOL>for m in group_counts:<EOL><INDENT>sum1 += area_fractions[m]*UNIFAC_psis[k][m]<EOL>sum3 = sum(area_fractions[n]*UNIFAC_psis[m][n] for n in group_counts)<EOL>sum2 -= area_fractions[m]*UNIFAC_psis[m][k]/sum3<EOL><DEDENT>loggamma_groups[k] = subgroups[k].Q*(<NUM_LIT:1.> - log(sum1) + sum2)<EOL><DEDENT>loggammars = []<EOL>for groups in chemgroups:<EOL><INDENT>chem_loggamma_groups = {}<EOL>chem_group_sum = sum(groups.values())<EOL>chem_group_count_xs = {group: count/chem_group_sum for group, count in groups.items()}<EOL>Q_sum_term = sum([subgroups[group].Q*chem_group_count_xs[group] for group in groups])<EOL>chem_area_fractions = {group: subgroups[group].Q*chem_group_count_xs[group]/Q_sum_term<EOL>for group in groups.keys()}<EOL>for k in groups:<EOL><INDENT>sum1, sum2 = <NUM_LIT:0.>, <NUM_LIT:0.><EOL>for m in groups:<EOL><INDENT>sum1 += chem_area_fractions[m]*UNIFAC_psis[k][m]<EOL>sum3 = sum(chem_area_fractions[n]*UNIFAC_psis[m][n] for n in groups)<EOL>sum2 -= chem_area_fractions[m]*UNIFAC_psis[m][k]/sum3<EOL><DEDENT>chem_loggamma_groups[k] = subgroups[k].Q*(<NUM_LIT:1.> - log(sum1) + sum2)<EOL><DEDENT>tot = sum([count*(loggamma_groups[group] - chem_loggamma_groups[group])<EOL>for group, count in groups.items()])<EOL>loggammars.append(tot)<EOL><DEDENT>return [exp(loggammacs[i]+loggammars[i]) for i in cmps]<EOL>

r'''Calculates activity coefficients using the UNIFAC model (optionally
    modified), given a mixture's temperature, liquid mole fractions,
    and optionally the subgroup data and interaction parameter data of your
    choice. The default is to use the original UNIFAC model, with the latest
    parameters published by DDBST. The model supports modified forms (Dortmund,
    NIST) when the `modified` parameter is True.

    Parameters
    ----------
    T : float
        Temperature of the system, [K]
    xs : list[float]
        Mole fractions of all species in the system in the liquid phase, [-]
    chemgroups : list[dict]
        List of dictionaries of subgroup IDs and their counts for all species
        in the mixture, [-]
    subgroup_data : dict[UNIFAC_subgroup]
        UNIFAC subgroup data; available dictionaries in this module are UFSG
        (original), DOUFSG (Dortmund), or NISTUFSG ([4]_).
    interaction_data : dict[dict[tuple(a_mn, b_mn, c_mn)]]
        UNIFAC interaction parameter data; available dictionaries in this
        module are UFIP (original), DOUFIP2006 (Dortmund parameters as
        published by 2006), DOUFIP2016 (Dortmund parameters as published by
        2016), and NISTUFIP ([4]_).
    modified : bool
        True if using the modified form and temperature dependence, otherwise
        False.

    Returns
    -------
    gammas : list[float]
        Activity coefficients of all species in the mixture, [-]

    Notes
    -----
    The actual implementation of UNIFAC is formulated slightly different than
    the formulas above for computational efficiency. DDBST switched to using
    the more efficient forms in their publication, but the numerical results
    are identical.

    The model is as follows:

    .. math::
        \ln \gamma_i =  \ln \gamma_i^c + \ln \gamma_i^r

    **Combinatorial component**

    .. math::
        \ln \gamma_i^c = \ln \frac{\phi_i}{x_i} + \frac{z}{2} q_i
        \ln\frac{\theta_i}{\phi_i} + L_i - \frac{\phi_i}{x_i}
        \sum_{j=1}^{n} x_j L_j

        \theta_i = \frac{x_i q_i}{\sum_{j=1}^{n} x_j q_j}

         \phi_i = \frac{x_i r_i}{\sum_{j=1}^{n} x_j r_j}

          L_i = 5(r_i - q_i)-(r_i-1)

    **Residual component**

    .. math::
        \ln \gamma_i^r = \sum_{k}^n \nu_k^{(i)} \left[ \ln \Gamma_k
        - \ln \Gamma_k^{(i)} \right]

        \ln \Gamma_k = Q_k \left[1 - \ln \sum_m \Theta_m \Psi_{mk} - \sum_m
        \frac{\Theta_m \Psi_{km}}{\sum_n \Theta_n \Psi_{nm}}\right]

        \Theta_m = \frac{Q_m X_m}{\sum_{n} Q_n X_n}

        X_m = \frac{ \sum_j \nu^j_m x_j}{\sum_j \sum_n \nu_n^j x_j}

    **R and Q**

    .. math::
        r_i = \sum_{k=1}^{n} \nu_k R_k

        q_i = \sum_{k=1}^{n}\nu_k Q_k

    The newer forms of UNIFAC (Dortmund, NIST) calculate the combinatorial
    part slightly differently:

    .. math::
        \ln \gamma_i^c = 1 - {V'}_i + \ln({V'}_i) - 5q_i \left(1
        - \frac{V_i}{F_i}+ \ln\left(\frac{V_i}{F_i}\right)\right)

        V'_i = \frac{r_i^{3/4}}{\sum_j r_j^{3/4}x_j}

    This is more clear when looking at the full rearranged form as in [3]_.

    Examples
    --------
    >>> UNIFAC(T=333.15, xs=[0.5, 0.5], chemgroups=[{1:2, 2:4}, {1:1, 2:1, 18:1}])
    [1.4276025835624173, 1.3646545010104225]

    >>> UNIFAC(373.15, [0.2, 0.3, 0.2, 0.2],
    ... [{9:6}, {78:6}, {1:1, 18:1}, {1:1, 2:1, 14:1}],
    ... subgroup_data=DOUFSG, interaction_data=DOUFIP2006, modified=True)
    [1.186431113706829, 1.440280133911197, 1.204479833499608, 1.9720706090299824]

    References
    ----------
    .. [1] Gmehling, Jurgen. Chemical Thermodynamics: For Process Simulation.
       Weinheim, Germany: Wiley-VCH, 2012.
    .. [2] Fredenslund, Aage, Russell L. Jones, and John M. Prausnitz. "Group
       Contribution Estimation of Activity Coefficients in Nonideal Liquid
       Mixtures." AIChE Journal 21, no. 6 (November 1, 1975): 1086-99.
       doi:10.1002/aic.690210607.
    .. [3] Jakob, Antje, Hans Grensemann, Jürgen Lohmann, and Jürgen Gmehling.
       "Further Development of Modified UNIFAC (Dortmund):  Revision and
       Extension 5." Industrial & Engineering Chemistry Research 45, no. 23
       (November 1, 2006): 7924-33. doi:10.1021/ie060355c.
    .. [4] Kang, Jeong Won, Vladimir Diky, and Michael Frenkel. "New Modified
       UNIFAC Parameters Using Critically Evaluated Phase Equilibrium Data."
       Fluid Phase Equilibria 388 (February 25, 2015): 128-41.
       doi:10.1016/j.fluid.2014.12.042.


return self.eos_in_a_box[<NUM_LIT:0>]<EOL>

r'''Equation of state object held by the mixture. See :
        obj:`thermo.eos_mix` for a full listing.

        Examples
        --------


if (T is None or T == self.T) and (P is None or P == self.P):<EOL><INDENT>Vmls = self.Vmls<EOL><DEDENT>else:<EOL><INDENT>if T is None: T = self.T<EOL>if P is None: P = self.P<EOL>Vmls = [i(T, P) for i in self.VolumeLiquids]<EOL><DEDENT>if none_and_length_check([Vmls]):<EOL><INDENT>return zs_to_Vfs(self.zs, Vmls)<EOL><DEDENT>return None<EOL>

r'''Volume fractions of all species in a hypothetical pure-liquid phase
        at the current or specified temperature and pressure. If temperature
        or pressure are specified, the non-specified property is assumed to be
        that of the mixture. Note this is a method, not a property. Volume
        fractions are calculated based on **pure species volumes only**.

        Examples
        --------
        >>> Mixture(['hexane', 'pentane'], zs=[.5, .5], T=315).Vfls()
        [0.5299671144566751, 0.47003288554332484]

        >>> S = Mixture(['hexane', 'decane'], zs=[0.25, 0.75])
        >>> S.Vfls(298.16, 101326)
        [0.18301434895886864, 0.8169856510411313]


if (T is None or T == self.T) and (P is None or P == self.P):<EOL><INDENT>Vmgs = self.Vmgs<EOL><DEDENT>else:<EOL><INDENT>if T is None: T = self.T<EOL>if P is None: P = self.P<EOL>Vmgs = [i(T, P) for i in self.VolumeGases]<EOL><DEDENT>if none_and_length_check([Vmgs]):<EOL><INDENT>return zs_to_Vfs(self.zs, Vmgs)<EOL><DEDENT>return None<EOL>

r'''Volume fractions of all species in a hypothetical pure-gas phase
        at the current or specified temperature and pressure. If temperature
        or pressure are specified, the non-specified property is assumed to be
        that of the mixture. Note this is a method, not a property. Volume
        fractions are calculated based on **pure species volumes only**.

        Examples
        --------
        >>> Mixture(['sulfur hexafluoride', 'methane'], zs=[.2, .9], T=315).Vfgs()
        [0.18062059238682632, 0.8193794076131737]

        >>> S = Mixture(['sulfur hexafluoride', 'methane'], zs=[.1, .9])
        >>> S.Vfgs(P=1E2)
        [0.0999987466608421, 0.9000012533391578]


return [i.PubChem for i in self.Chemicals]<EOL>

r'''PubChem Component ID numbers for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5]).PubChems
        [241, 1140]


return [i.formula for i in self.Chemicals]<EOL>

r'''Chemical formulas for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['ethanol', 'trichloroethylene', 'furfuryl alcohol'],
        ... ws=[0.5, 0.2, 0.3]).formulas
        ['C2H6O', 'C2HCl3', 'C5H6O2']


return [i.smiles for i in self.Chemicals]<EOL>

r'''SMILES strings for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['methane', 'ethane', 'propane', 'butane'],
        ... zs=[0.25, 0.25, 0.25, 0.25]).smiless
        ['C', 'CC', 'CCC', 'CCCC']


return [i.InChI for i in self.Chemicals]<EOL>


return [i.InChI_Key for i in self.Chemicals]<EOL>

r'''InChI keys for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['1-nonene'], zs=[1]).InChI_Keys
        ['JRZJOMJEPLMPRA-UHFFFAOYSA-N']


return [i.IUPAC_name for i in self.Chemicals]<EOL>

r'''IUPAC names for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['1-hexene', '1-nonene'], zs=[.7, .3]).IUPAC_names
        ['hex-1-ene', 'non-1-ene']


return [i.synonyms for i in self.Chemicals]<EOL>

r'''Lists of synonyms for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['Tetradecene', 'Pentadecene'], zs=[.1, .9]).synonymss
        [['tetradec-2-ene', 'tetradecene', '2-tetradecene', 'tetradec-2-ene', '26952-13-6', '35953-53-8', '1652-97-7'], ['pentadec-1-ene', '1-pentadecene', 'pentadecene,1-', 'pentadec-1-ene', '13360-61-7', 'pentadecene']]


return [i.charge for i in self.Chemicals]<EOL>

r'''Charges for all chemicals in the mixture, [faraday].

        Examples
        --------
        >>> Mixture(['water', 'sodium ion', 'chloride ion'], zs=[.9, .05, .05]).charges
        [0, 1, -1]


return [i.similarity_variable for i in self.Chemicals]<EOL>

r'''Similarity variables for all chemicals in the mixture, see
        :obj:`thermo.elements.similarity_variable` for the definition, [mol/g]

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5]).similarity_variables
        [0.15362587797189262, 0.16279853724428964]


return [i.atoms for i in self.Chemicals]<EOL>

r'''List of dictionaries of atom counts for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['nitrogen', 'oxygen'], zs=[.01, .99]).atomss
        [{'N': 2}, {'O': 2}]


return [i.rings for i in self.Chemicals]<EOL>

r'''List of ring counts for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['Docetaxel', 'Paclitaxel'], zs=[.5, .5]).ringss
        [6, 7]


return [i.atom_fractions for i in self.Chemicals]<EOL>

r'''List of dictionaries of atomic fractions for all chemicals in the
        mixture.

        Examples
        --------
        >>> Mixture(['oxygen', 'nitrogen'], zs=[.5, .5]).atom_fractionss
        [{'O': 1.0}, {'N': 1.0}]


things = dict()<EOL>for zi, atoms in zip(self.zs, self.atomss):<EOL><INDENT>for atom, count in atoms.iteritems():<EOL><INDENT>if atom in things:<EOL><INDENT>things[atom] += zi*count<EOL><DEDENT>else:<EOL><INDENT>things[atom] = zi*count<EOL><DEDENT><DEDENT><DEDENT>tot = sum(things.values())<EOL>return {atom : value/tot for atom, value in things.iteritems()}<EOL>

r'''Dictionary of atomic fractions for each atom in the mixture.

        Examples
        --------
        >>> Mixture(['CO2', 'O2'], zs=[0.5, 0.5]).atom_fractions
        {'C': 0.2, 'O': 0.8}


return [i.mass_fractions for i in self.Chemicals]<EOL>

r'''List of dictionaries of mass fractions for all chemicals in the mixture.

        Examples
        --------
        >>> Mixture(['oxygen', 'nitrogen'], zs=[.5, .5]).mass_fractionss
        [{'O': 1.0}, {'N': 1.0}]


things = dict()<EOL>for zi, atoms in zip(self.zs, self.atomss):<EOL><INDENT>for atom, count in atoms.iteritems():<EOL><INDENT>if atom in things:<EOL><INDENT>things[atom] += zi*count<EOL><DEDENT>else:<EOL><INDENT>things[atom] = zi*count<EOL><DEDENT><DEDENT><DEDENT>return mass_fractions(things)<EOL>


return [i.legal_status for i in self.Chemicals]<EOL>

r'''List of dictionaries of the legal status for all chemicals in the
        mixture.

        Examples
        --------
        >>> pprint(Mixture(['oxygen', 'nitrogen'], zs=[.5, .5]).legal_statuses)
        [{'DSL': 'LISTED',
          'EINECS': 'LISTED',
          'NLP': 'UNLISTED',
          'SPIN': 'LISTED',
          'TSCA': 'LISTED'},
         {'DSL': 'LISTED',
          'EINECS': 'LISTED',
          'NLP': 'UNLISTED',
          'SPIN': 'LISTED',
          'TSCA': 'LISTED'}]


return [i.economic_status for i in self.Chemicals]<EOL>

r'''List of dictionaries of the economic status for all chemicals in
        the mixture.

        Examples
        --------
        >>> pprint(Mixture(['o-xylene', 'm-xylene'], zs=[.5, .5]).economic_statuses)
        [["US public: {'Manufactured': 0.0, 'Imported': 0.0, 'Exported': 0.0}",
          u'100,000 - 1,000,000 tonnes per annum',
          'OECD HPV Chemicals'],
         ["US public: {'Manufactured': 39.805, 'Imported': 0.0, 'Exported': 0.0}",
          u'100,000 - 1,000,000 tonnes per annum',
          'OECD HPV Chemicals']]


return [i.UNIFAC_groups for i in self.Chemicals]<EOL>

r'''List of dictionaries of UNIFAC subgroup: count groups for each chemical in the mixture. Uses the original
        UNIFAC subgroups, as determined by `DDBST's online service <http://www.ddbst.com/unifacga.html>`_.

        Examples
        --------
        >>> pprint(Mixture(['1-pentanol', 'decane'], ws=[0.5, 0.5]).UNIFAC_groups)
        [{1: 1, 2: 4, 14: 1}, {1: 2, 2: 8}]


return [i.UNIFAC_Dortmund_groups for i in self.Chemicals]<EOL>

r'''List of dictionaries of Dortmund UNIFAC subgroup: count groups for each chemcial in the mixture. Uses the
        Dortmund UNIFAC subgroups, as determined by `DDBST's online service <http://www.ddbst.com/unifacga.html>`_.

        Examples
        --------
        >>> pprint(Mixture(['1-pentanol', 'decane'], ws=[0.5, 0.5]).UNIFAC_Dortmund_groups)
        [{1: 1, 2: 4, 14: 1}, {1: 2, 2: 8}]


return [i.PSRK_groups for i in self.Chemicals]<EOL>

r'''List of dictionaries of PSRK subgroup: count groups for each chemical in the mixture. Uses the PSRK subgroups,
        as determined by `DDBST's online service <http://www.ddbst.com/unifacga.html>`_.

        Examples
        --------
        >>> pprint(Mixture(['1-pentanol', 'decane'], ws=[0.5, 0.5]).PSRK_groups)
        [{1: 1, 2: 4, 14: 1}, {1: 2, 2: 8}]


return property_molar_to_mass(R, self.MW)<EOL>

r'''Specific gas constant of the mixture, in units of [J/kg/K].

        Examples
        --------
        >>> Mixture(['N2', 'O2'], zs=[0.79, .21]).R_specific
        288.1928437986195


return sum([zi*ci for zi, ci in zip(self.zs, self.charges)])<EOL>

r'''Charge imbalance of the mixture, in units of [faraday].
        Mixtures meeting the electroneutrality condition will have an imbalance
        of 0.

        Examples
        --------
        >>> Mixture(['Na+', 'Cl-', 'water'], zs=[.01, .01, .98]).charge_balance
        0.0


return [i.Psat for i in self.Chemicals]<EOL>

r'''Pure component vapor pressures of the chemicals in the mixture at
        its current temperature, in units of [Pa].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Psats
        [32029.25774454549, 10724.419010511821]


return [i.Hvapm for i in self.Chemicals]<EOL>

r'''Pure component enthalpies of vaporization of the chemicals in the
        mixture at its current temperature, in units of [J/mol].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Hvapms
        [32639.806783391632, 36851.7902195611]


return [i.Hvap for i in self.Chemicals]<EOL>

r'''Enthalpy of vaporization of the chemicals in the mixture at its
        current temperature, in units of [J/kg].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Hvaps
        [417859.9144942896, 399961.16950519773]


return [i.Cpsm for i in self.Chemicals]<EOL>

r'''Solid-phase pure component heat capacity of the chemicals in the
        mixture at its current temperature, in units of [J/mol/K].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Cpsms
        [109.77384365511931, 135.22614707678474]


return [i.Cplm for i in self.Chemicals]<EOL>

r'''Liquid-phase pure component heat capacity of the chemicals in the
        mixture at its current temperature, in units of [J/mol/K].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Cplms
        [140.9113971170526, 163.62584810669068]


return [i.Cpgm for i in self.Chemicals]<EOL>

r'''Gas-phase ideal gas heat capacity of the chemicals at its current
        temperature, in units of [J/mol/K].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Cpgms
        [89.55804092586159, 111.70390334788907]


return [i.Cps for i in self.Chemicals]<EOL>

r'''Solid-phase pure component heat capacity of the chemicals in the
        mixture at its current temperature, in units of [J/kg/K].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Cpss
        [1405.341925822248, 1467.6412627521154]


return [i.Cpl for i in self.Chemicals]<EOL>

r'''Liquid-phase pure component heat capacity of the chemicals in the
        mixture at its  current temperature, in units of [J/kg/K].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Cpls
        [1803.9697581961016, 1775.869915141704]


return [i.Cpg for i in self.Chemicals]<EOL>

r'''Gas-phase pure component heat capacity of the chemicals in the
        mixture at its current temperature, in units of [J/kg/K].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Cpgs
        [1146.5360555565146, 1212.3488046342566]


return [i.Cvgm for i in self.Chemicals]<EOL>

r'''Gas-phase pure component ideal-gas contant-volume heat capacities
        of the chemicals in the mixture at its current temperature, in units
        of [J/mol/K].  Subtracts R from the ideal-gas heat capacities; does not
        include pressure-compensation from an equation of state.

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Cvgms
        [81.2435811258616, 103.38944354788907]


return [i.Cvg for i in self.Chemicals]<EOL>

r'''Gas-phase pure component ideal-gas contant-volume heat capacities
        of the chemicals in the mixture at its current temperature, in units of
        [J/kg/K]. Subtracts R from the ideal-gas heat capacity; does not include
        pressure-compensation from an equation of state.

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Cvgs
        [1040.093040003431, 1122.1100117398266]


return [i.isentropic_exponent for i in self.Chemicals]<EOL>

r'''Gas-phase pure component ideal-gas isentropic exponent of the
        chemicals in the  mixture at its current temperature, [dimensionless].
         Does not include pressure-compensation from an equation of state.

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).isentropic_exponents
        [1.1023398979313739, 1.080418846592871]


return [i.Vms for i in self.Chemicals]<EOL>

r'''Pure component solid-phase molar volumes of the chemicals in the
        mixture at its current temperature, in units of [m^3/mol].

        Examples
        --------
        >>> Mixture(['iron'], ws=[1], T=320).Vmss
        [7.09593392630242e-06]


return [i.Vml for i in self.Chemicals]<EOL>

r'''Pure component liquid-phase molar volumes of the chemicals in the
        mixture at its current temperature and pressure, in units of [m^3/mol].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Vmls
        [9.188896727673715e-05, 0.00010946199496993461]


return [i.Vmg for i in self.Chemicals]<EOL>

r'''Pure component gas-phase molar volumes of the chemicals in the
        mixture at its current temperature and pressure, in units of [m^3/mol].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Vmgs
        [0.024929001982294974, 0.024150186467130488]


return [i.rhos for i in self.Chemicals]<EOL>

r'''Pure component solid-phase mass density of the chemicals in the
        mixture at its  current temperature, in units of [kg/m^3].

        Examples
        --------
        >>> Mixture(['iron'], ws=[1], T=320).rhoss
        [7869.999999999994]


return [i.rhol for i in self.Chemicals]<EOL>

r'''Pure-component liquid-phase mass density of the chemicals in the
        mixture at its current temperature and pressure, in units of [kg/m^3].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).rhols
        [850.0676666084917, 841.7389069631628]


return [i.rhog for i in self.Chemicals]<EOL>

r'''Pure-component gas-phase mass densities of the chemicals in the
        mixture at its current temperature and pressure, in units of [kg/m^3].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).rhogs
        [3.1333721283939258, 3.8152260283954584]


return [i.rhosm for i in self.Chemicals]<EOL>

r'''Pure component molar densities of the chemicals in the solid phase
        at the current temperature and pressure, in units of [mol/m^3].

        Examples
        --------
        >>> Mixture(['iron'], ws=[1], T=320).rhosms
        [140925.7767033753]


return [i.rholm for i in self.Chemicals]<EOL>

r'''Pure component molar densities of the chemicals in the mixture in
        the liquid phase at the current temperature and pressure, in units of
        [mol/m^3].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).rholms
        [10882.699301520635, 9135.590853014008]


return [i.rhogm for i in self.Chemicals]<EOL>

r'''Pure component molar densities of the chemicals in the gas phase at
        the current temperature and pressure, in units of [mol/m^3].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).rhogms
        [40.11392035309789, 41.407547778608084]


return [i.Zs for i in self.Chemicals]<EOL>

r'''Pure component compressibility factors of the chemicals in the
        mixture in the solid phase at the current temperature and pressure,
        [dimensionless].

        Examples
        --------
        >>> Mixture(['palladium'], ws=[1]).Zss
        [0.00036248477437931853]


return [i.Zl for i in self.Chemicals]<EOL>

r'''Pure component compressibility factors of the chemicals in the
        liquid phase at the current temperature and pressure, [dimensionless].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Zls
        [0.0034994191720201235, 0.004168655010037687]


return [i.Zg for i in self.Chemicals]<EOL>

r'''Pure component compressibility factors of the chemicals in the
        mixture in the gas phase at the current temperature and pressure,
        [dimensionless].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).Zgs
        [0.9493743379816593, 0.9197146081359057]


rhos = self.rhos<EOL>if rhos is not None:<EOL><INDENT>return SG(rhos)<EOL><DEDENT>return None<EOL>

r'''Specific gravity of a hypothetical solid phase of the mixture at the
        specified temperature and pressure, [dimensionless].
        The reference condition is water at 4 °C and 1 atm
        (rho=999.017 kg/m^3). The SG varries with temperature and pressure
        but only very slightly.


rhol = self.rhol<EOL>if rhol is not None:<EOL><INDENT>return SG(rhol)<EOL><DEDENT>return None<EOL>

r'''Specific gravity of a hypothetical liquid phase of the mixture at
        the specified temperature and pressure, [dimensionless].
        The reference condition is water at 4 °C and 1 atm
        (rho=999.017 kg/m^3). For liquids, SG is defined that the reference
        chemical's T and P are fixed, but the chemical itself varies with
        the specified T and P.

        Examples
        --------
        >>> Mixture('water', ws=[1], T=365).SGl
        0.9650065522428539


return [i.isobaric_expansion_l for i in self.Chemicals]<EOL>

r'''Pure component isobaric (constant-pressure) expansions of the
        chemicals in the mixture in the liquid phase at its current temperature
        and pressure, in units of [1/K].

        .. math::
            \beta = \frac{1}{V}\left(\frac{\partial V}{\partial T} \right)_P

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).isobaric_expansion_ls
        [0.0012736035771253886, 0.0011234157437069571]


return [i.isobaric_expansion_g for i in self.Chemicals]<EOL>

r'''Pure component isobaric (constant-pressure) expansions of the
        chemicals in the mixture in the gas phase at its current temperature
        and pressure, in units of [1/K].

        .. math::
            \beta = \frac{1}{V}\left(\frac{\partial V}{\partial T} \right)_P

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).isobaric_expansion_gs
        [0.0038091518363900499, 0.0043556759306508453]


return [i.mul for i in self.Chemicals]<EOL>

r'''Pure component viscosities of the chemicals in the mixture in the
        liquid phase at its current temperature and pressure, in units of
        [Pa*s].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).muls
        [0.00045545522798131764, 0.00043274394349114754]


return [i.mug for i in self.Chemicals]<EOL>

r'''Pure component viscosities of the chemicals in the mixture in the
        gas phase at its current temperature and pressure, in units of [Pa*s].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).mugs
        [8.082880451060605e-06, 7.442602145854158e-06]


return [i.kl for i in self.Chemicals]<EOL>

r'''Pure component thermal conductivities of the chemicals in the
        mixture in the liquid phase at its current temperature and pressure, in
        units of [W/m/K].

        Examples
        --------
        >>> Mixture(['benzene', 'toluene'], ws=[0.5, 0.5], T=320).kls
        [0.13391538485205587, 0.12429339088930591]