methods = []<EOL>if self.CASRN in CRC_inorg_s_const_data.index:<EOL><INDENT>methods.append(CRC_INORG_S)<EOL>self.CRC_INORG_S_Vm = float(CRC_inorg_s_const_data.at[self.CASRN, '<STR_LIT>'])<EOL>

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 == CRC_INORG_S:<EOL><INDENT>Vms = self.CRC_INORG_S_Vm<EOL>

r'''Method to calculate the molar volume of a solid at tempearture `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 molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vms : float
            Molar volume of the solid at T, [m^3/mol]


methods = [SIMPLE]     <EOL>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>Vms = [i(T, P) for i in self.VolumeSolids]<EOL>return mixing_simple(zs, Vms)<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>

r'''Method to calculate molar volume of a solid 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
        -------
        Vm : float
            Molar volume of the solid mixture at the given conditions,
            [m^3/mol]


def TWU_a_alpha_common(T, Tc, omega, a, full=True, quick=True, method='<STR_LIT>'):

Tr = T/Tc<EOL>if method == '<STR_LIT>':<EOL><INDENT>if Tr < <NUM_LIT:1>:<EOL><INDENT>L0, M0, N0 = <NUM_LIT>, <NUM_LIT>, <NUM_LIT><EOL>L1, M1, N1 = <NUM_LIT>, <NUM_LIT>, <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>L0, M0, N0 = <NUM_LIT>, <NUM_LIT>, -<NUM_LIT><EOL>L1, M1, N1 = <NUM_LIT>, <NUM_LIT>, -<NUM_LIT>  <EOL><DEDENT><DEDENT>elif method == '<STR_LIT>':<EOL><INDENT>if Tr < <NUM_LIT:1>:<EOL><INDENT>L0, M0, N0 = <NUM_LIT>, <NUM_LIT>, <NUM_LIT><EOL>L1, M1, N1 = <NUM_LIT>, <NUM_LIT>, <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>L0, M0, N0 = <NUM_LIT>, <NUM_LIT>, -<NUM_LIT><EOL>L1, M1, N1 = <NUM_LIT>,  <NUM_LIT>, -<NUM_LIT><EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>if not full:<EOL><INDENT>alpha0 = Tr**(N0*(M0-<NUM_LIT:1.>))*exp(L0*(<NUM_LIT:1.>-Tr**(N0*M0)))<EOL>alpha1 = Tr**(N1*(M1-<NUM_LIT:1.>))*exp(L1*(<NUM_LIT:1.>-Tr**(N1*M1)))<EOL>alpha = alpha0 + omega*(alpha1 - alpha0)<EOL>return a*alpha<EOL><DEDENT>else:<EOL><INDENT>if quick:<EOL><INDENT>x0 = T/Tc<EOL>x1 = M0 - <NUM_LIT:1><EOL>x2 = N0*x1<EOL>x3 = x0**x2<EOL>x4 = M0*N0<EOL>x5 = x0**x4<EOL>x6 = exp(-L0*(x5 - <NUM_LIT:1.>))<EOL>x7 = x3*x6<EOL>x8 = M1 - <NUM_LIT:1.><EOL>x9 = N1*x8<EOL>x10 = x0**x9<EOL>x11 = M1*N1<EOL>x12 = x0**x11<EOL>x13 = x2*x7<EOL>x14 = L0*M0*N0*x3*x5*x6<EOL>x15 = x13 - x14<EOL>x16 = exp(-L1*(x12 - <NUM_LIT:1>))<EOL>x17 = -L1*M1*N1*x10*x12*x16 + x10*x16*x9 - x13 + x14<EOL>x18 = N0*N0<EOL>x19 = x18*x3*x6<EOL>x20 = x1**<NUM_LIT:2>*x19<EOL>x21 = M0**<NUM_LIT:2><EOL>x22 = L0*x18*x3*x5*x6<EOL>x23 = x21*x22<EOL>x24 = <NUM_LIT:2>*M0*x1*x22<EOL>x25 = L0**<NUM_LIT:2>*x0**(<NUM_LIT:2>*x4)*x19*x21<EOL>x26 = N1**<NUM_LIT:2><EOL>x27 = x10*x16*x26<EOL>x28 = M1**<NUM_LIT:2><EOL>x29 = L1*x10*x12*x16*x26<EOL>a_alpha = a*(-omega*(-x10*exp(L1*(-x12 + <NUM_LIT:1>)) + x3*exp(L0*(-x5 + <NUM_LIT:1>))) + x7)<EOL>da_alpha_dT = a*(omega*x17 + x15)/T<EOL>d2a_alpha_dT2 = a*(-(omega*(-L1**<NUM_LIT:2>*x0**(<NUM_LIT>*x11)*x27*x28 + <NUM_LIT>*M1*x29*x8 + x17 + x20 - x23 - x24 + x25 - x27*x8**<NUM_LIT:2> + x28*x29) + x15 - x20 + x23 + x24 - x25)/T**<NUM_LIT:2>)<EOL><DEDENT>else:<EOL><INDENT>a_alpha = TWU_a_alpha_common(T=T, Tc=Tc, omega=omega, a=a, full=False, quick=quick, method=method)<EOL>da_alpha_dT = a*(-L0*M0*N0*(T/Tc)**(M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*exp(L0*(-(T/Tc)**(M0*N0) + <NUM_LIT:1>))/T + N0*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*(M0 - <NUM_LIT:1>)*exp(L0*(-(T/Tc)**(M0*N0) + <NUM_LIT:1>))/T + omega*(L0*M0*N0*(T/Tc)**(M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*exp(L0*(-(T/Tc)**(M0*N0) + <NUM_LIT:1>))/T - L1*M1*N1*(T/Tc)**(M1*N1)*(T/Tc)**(N1*(M1 - <NUM_LIT:1>))*exp(L1*(-(T/Tc)**(M1*N1) + <NUM_LIT:1>))/T - N0*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*(M0 - <NUM_LIT:1>)*exp(L0*(-(T/Tc)**(M0*N0) + <NUM_LIT:1>))/T + N1*(T/Tc)**(N1*(M1 - <NUM_LIT:1>))*(M1 - <NUM_LIT:1>)*exp(L1*(-(T/Tc)**(M1*N1) + <NUM_LIT:1>))/T))<EOL>d2a_alpha_dT2 = a*((L0**<NUM_LIT:2>*M0**<NUM_LIT:2>*N0**<NUM_LIT:2>*(T/Tc)**(<NUM_LIT:2>*M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - L0*M0**<NUM_LIT:2>*N0**<NUM_LIT:2>*(T/Tc)**(M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - <NUM_LIT:2>*L0*M0*N0**<NUM_LIT:2>*(T/Tc)**(M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*(M0 - <NUM_LIT:1>)*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) + L0*M0*N0*(T/Tc)**(M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) + N0**<NUM_LIT:2>*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*(M0 - <NUM_LIT:1>)**<NUM_LIT:2>*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - N0*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*(M0 - <NUM_LIT:1>)*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - omega*(L0**<NUM_LIT:2>*M0**<NUM_LIT:2>*N0**<NUM_LIT:2>*(T/Tc)**(<NUM_LIT:2>*M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - L0*M0**<NUM_LIT:2>*N0**<NUM_LIT:2>*(T/Tc)**(M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - <NUM_LIT:2>*L0*M0*N0**<NUM_LIT:2>*(T/Tc)**(M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*(M0 - <NUM_LIT:1>)*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) + L0*M0*N0*(T/Tc)**(M0*N0)*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - L1**<NUM_LIT:2>*M1**<NUM_LIT:2>*N1**<NUM_LIT:2>*(T/Tc)**(<NUM_LIT:2>*M1*N1)*(T/Tc)**(N1*(M1 - <NUM_LIT:1>))*exp(-L1*((T/Tc)**(M1*N1) - <NUM_LIT:1>)) + L1*M1**<NUM_LIT:2>*N1**<NUM_LIT:2>*(T/Tc)**(M1*N1)*(T/Tc)**(N1*(M1 - <NUM_LIT:1>))*exp(-L1*((T/Tc)**(M1*N1) - <NUM_LIT:1>)) + <NUM_LIT:2>*L1*M1*N1**<NUM_LIT:2>*(T/Tc)**(M1*N1)*(T/Tc)**(N1*(M1 - <NUM_LIT:1>))*(M1 - <NUM_LIT:1>)*exp(-L1*((T/Tc)**(M1*N1) - <NUM_LIT:1>)) - L1*M1*N1*(T/Tc)**(M1*N1)*(T/Tc)**(N1*(M1 - <NUM_LIT:1>))*exp(-L1*((T/Tc)**(M1*N1) - <NUM_LIT:1>)) + N0**<NUM_LIT:2>*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*(M0 - <NUM_LIT:1>)**<NUM_LIT:2>*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - N0*(T/Tc)**(N0*(M0 - <NUM_LIT:1>))*(M0 - <NUM_LIT:1>)*exp(-L0*((T/Tc)**(M0*N0) - <NUM_LIT:1>)) - N1**<NUM_LIT:2>*(T/Tc)**(N1*(M1 - <NUM_LIT:1>))*(M1 - <NUM_LIT:1>)**<NUM_LIT:2>*exp(-L1*((T/Tc)**(M1*N1) - <NUM_LIT:1>)) + N1*(T/Tc)**(N1*(M1 - <NUM_LIT:1>))*(M1 - <NUM_LIT:1>)*exp(-L1*((T/Tc)**(M1*N1) - <NUM_LIT:1>))))/T**<NUM_LIT:2>)<EOL><DEDENT>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Function to calculate `a_alpha` and optionally its first and second
    derivatives for the TWUPR or TWUSRK EOS. Returns 'a_alpha', and
    optionally 'da_alpha_dT' and 'd2a_alpha_dT2'.
    Used by `TWUPR` and `TWUSRK`; has little purpose on its own.
    See either class for the correct reference, and examples of using the EOS.

    Parameters
    ----------
    T : float
        Temperature, [K]
    Tc : float
        Critical temperature, [K]
    omega : float
        Acentric factor, [-]
    a : float
        Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
    full : float
        Whether or not to return its first and second derivatives
    quick : bool, optional
        Whether to use a SymPy cse-derived expression (3x faster) or
        individual formulas
    method : str
        Either 'PR' or 'SRK'

    Notes
    -----
    The derivatives are somewhat long and are not described here for
    brevity; they are obtainable from the following SymPy expression.

    >>> from sympy import *
    >>> T, Tc, omega, N1, N0, M1, M0, L1, L0 = symbols('T, Tc, omega, N1, N0, M1, M0, L1, L0')
    >>> Tr = T/Tc
    >>> alpha0 = Tr**(N0*(M0-1))*exp(L0*(1-Tr**(N0*M0)))
    >>> alpha1 = Tr**(N1*(M1-1))*exp(L1*(1-Tr**(N1*M1)))
    >>> alpha = alpha0 + omega*(alpha1-alpha0)
    >>> # diff(alpha, T)
    >>> # diff(alpha, T, T)


if not ((self.T and self.P) or (self.T and self.V) or (self.P and self.V)):<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>

Method to an exception if none of the pairs (T, P), (T, V), or
        (P, V) are given.


self.check_sufficient_inputs()<EOL>if self.V:<EOL><INDENT>if self.P:<EOL><INDENT>self.T = self.solve_T(self.P, self.V)<EOL>self.a_alpha, self.da_alpha_dT, self.d2a_alpha_dT2 = self.a_alpha_and_derivatives(self.T)<EOL><DEDENT>else:<EOL><INDENT>self.a_alpha, self.da_alpha_dT, self.d2a_alpha_dT2 = self.a_alpha_and_derivatives(self.T)<EOL>self.P = R*self.T/(self.V-self.b) - self.a_alpha/(self.V*self.V + self.delta*self.V + self.epsilon)<EOL><DEDENT>Vs = [self.V, <NUM_LIT>, <NUM_LIT>]<EOL><DEDENT>else:<EOL><INDENT>self.a_alpha, self.da_alpha_dT, self.d2a_alpha_dT2 = self.a_alpha_and_derivatives(self.T)<EOL>Vs = self.volume_solutions(self.T, self.P, self.b, self.delta, self.epsilon, self.a_alpha)<EOL><DEDENT>self.set_from_PT(Vs)<EOL>

First EOS-generic method; should be called by all specific EOSs.
        For solving for `T`, the EOS must provide the method `solve_T`.
        For all cases, the EOS must provide `a_alpha_and_derivatives`.
        Calls `set_from_PT` once done.


<EOL>good_roots = []<EOL>bad_roots = []<EOL>for i in Vs:<EOL><INDENT>j = i.real<EOL>if abs(i.imag) > <NUM_LIT> or j < <NUM_LIT:0>:<EOL><INDENT>bad_roots.append(i)<EOL><DEDENT>else:<EOL><INDENT>good_roots.append(j)<EOL><DEDENT><DEDENT>if len(bad_roots) == <NUM_LIT:2>: <EOL><INDENT>V = good_roots[<NUM_LIT:0>]<EOL>self.phase = self.set_properties_from_solution(self.T, self.P, V, self.b, self.delta, self.epsilon, self.a_alpha, self.da_alpha_dT, self.d2a_alpha_dT2)<EOL>if self.phase == '<STR_LIT:l>':<EOL><INDENT>self.V_l = V<EOL><DEDENT>else:<EOL><INDENT>self.V_g = V<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.V_l, self.V_g = min(good_roots), max(good_roots)<EOL>[self.set_properties_from_solution(self.T, self.P, V, self.b, self.delta, self.epsilon, self.a_alpha, self.da_alpha_dT, self.d2a_alpha_dT2) for V in [self.V_l, self.V_g]]<EOL>self.phase = '<STR_LIT>'<EOL><DEDENT>

Counts the number of real volumes in `Vs`, and determines what to do.
        If there is only one real volume, the method
        `set_properties_from_solution` is called with it. If there are
        two real volumes, `set_properties_from_solution` is called once with
        each volume. The phase is returned by `set_properties_from_solution`,
        and the volumes is set to either `V_l` or `V_g` as appropriate.

        Parameters
        ----------
        Vs : list[float]
            Three possible molar volumes, [m^3/mol]


def set_properties_from_solution(self, T, P, V, b, delta, epsilon, a_alpha, <EOL>da_alpha_dT, d2a_alpha_dT2, quick=True):

([dP_dT, dP_dV, dV_dT, dV_dP, dT_dV, dT_dP], <EOL>[d2P_dT2, d2P_dV2, d2V_dT2, d2V_dP2, d2T_dV2, d2T_dP2],<EOL>[d2V_dPdT, d2P_dTdV, d2T_dPdV],<EOL>[H_dep, S_dep, Cv_dep]) = self.derivatives_and_departures(T, P, V, b, delta, epsilon, a_alpha, da_alpha_dT, d2a_alpha_dT2, quick=quick)<EOL>beta = dV_dT/V <EOL>kappa = -dV_dP/V <EOL>Cp_m_Cv = -T*dP_dT*dP_dT/dP_dV <EOL>Cp_dep = Cp_m_Cv + Cv_dep - R<EOL>V_dep = (V - R*T/P)        <EOL>U_dep = H_dep - P*V_dep<EOL>G_dep = H_dep - T*S_dep<EOL>A_dep = U_dep - T*S_dep<EOL>fugacity = P*exp(G_dep/(R*T))<EOL>phi = fugacity/P<EOL>PIP = V*(d2P_dTdV/dP_dT - d2P_dV2/dP_dV) <EOL>phase = '<STR_LIT:l>' if PIP > <NUM_LIT:1> else '<STR_LIT:g>' <EOL>if phase == '<STR_LIT:l>':<EOL><INDENT>self.Z_l = self.P*V/(R*self.T)<EOL>self.beta_l, self.kappa_l = beta, kappa<EOL>self.PIP_l, self.Cp_minus_Cv_l = PIP, Cp_m_Cv<EOL>self.dP_dT_l, self.dP_dV_l, self.dV_dT_l = dP_dT, dP_dV, dV_dT<EOL>self.dV_dP_l, self.dT_dV_l, self.dT_dP_l = dV_dP, dT_dV, dT_dP<EOL>self.d2P_dT2_l, self.d2P_dV2_l = d2P_dT2, d2P_dV2<EOL>self.d2V_dT2_l, self.d2V_dP2_l = d2V_dT2, d2V_dP2<EOL>self.d2T_dV2_l, self.d2T_dP2_l = d2T_dV2, d2T_dP2<EOL>self.d2V_dPdT_l, self.d2P_dTdV_l, self.d2T_dPdV_l = d2V_dPdT, d2P_dTdV, d2T_dPdV<EOL>self.H_dep_l, self.S_dep_l, self.V_dep_l = H_dep, S_dep, V_dep, <EOL>self.U_dep_l, self.G_dep_l, self.A_dep_l = U_dep, G_dep, A_dep, <EOL>self.fugacity_l, self.phi_l = fugacity, phi<EOL>self.Cp_dep_l, self.Cv_dep_l = Cp_dep, Cv_dep<EOL><DEDENT>else:<EOL><INDENT>self.Z_g = self.P*V/(R*self.T)<EOL>self.beta_g, self.kappa_g = beta, kappa<EOL>self.PIP_g, self.Cp_minus_Cv_g = PIP, Cp_m_Cv<EOL>self.dP_dT_g, self.dP_dV_g, self.dV_dT_g = dP_dT, dP_dV, dV_dT<EOL>self.dV_dP_g, self.dT_dV_g, self.dT_dP_g = dV_dP, dT_dV, dT_dP<EOL>self.d2P_dT2_g, self.d2P_dV2_g = d2P_dT2, d2P_dV2<EOL>self.d2V_dT2_g, self.d2V_dP2_g = d2V_dT2, d2V_dP2<EOL>self.d2T_dV2_g, self.d2T_dP2_g = d2T_dV2, d2T_dP2<EOL>self.d2V_dPdT_g, self.d2P_dTdV_g, self.d2T_dPdV_g = d2V_dPdT, d2P_dTdV, d2T_dPdV<EOL>self.H_dep_g, self.S_dep_g, self.V_dep_g = H_dep, S_dep, V_dep, <EOL>self.U_dep_g, self.G_dep_g, self.A_dep_g = U_dep, G_dep, A_dep, <EOL>self.fugacity_g, self.phi_g = fugacity, phi<EOL>self.Cp_dep_g, self.Cv_dep_g = Cp_dep, Cv_dep<EOL><DEDENT>return phase<EOL>

r'''Sets all interesting properties which can be calculated from an
        EOS alone. Determines which phase the fluid is on its own; for details,
        see `phase_identification_parameter`.

        The list of properties set is as follows, with all properties suffixed
        with '_l' or '_g'.

        dP_dT, dP_dV, dV_dT, dV_dP, dT_dV, dT_dP, d2P_dT2, d2P_dV2, d2V_dT2,
        d2V_dP2, d2T_dV2, d2T_dP2, d2V_dPdT, d2P_dTdV, d2T_dPdV, H_dep, S_dep,
        beta, kappa, Cp_minus_Cv, V_dep, U_dep, G_dep, A_dep, fugacity, phi,
        and PIP.

        Parameters
        ----------
        T : float
            Temperature, [K]
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        b : float
            Coefficient calculated by EOS-specific method, [m^3/mol]
        delta : float
            Coefficient calculated by EOS-specific method, [m^3/mol]
        epsilon : float
            Coefficient calculated by EOS-specific method, [m^6/mol^2]
        a_alpha : float
            Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
        da_alpha_dT : float
            Temperature derivative of coefficient calculated by EOS-specific
            method, [J^2/mol^2/Pa/K]
        d2a_alpha_dT2 : float
            Second temperature derivative of coefficient calculated by
            EOS-specific method, [J^2/mol^2/Pa/K**2]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (3x faster) or
            individual formulas

        Returns
        -------
        phase : str
            Either 'l' or 'g'

        Notes
        -----
        The individual formulas for the derivatives and excess properties are
        as follows. For definitions of `beta`, see `isobaric_expansion`;
        for `kappa`, see isothermal_compressibility; for `Cp_minus_Cv`, see
        `Cp_minus_Cv`; for `phase_identification_parameter`, see
        `phase_identification_parameter`.

        First derivatives; in part using the Triple Product Rule [2]_, [3]_:

        .. math::
            \left(\frac{\partial P}{\partial T}\right)_V = \frac{R}{V - b}
            - \frac{a \frac{d \alpha{\left (T \right )}}{d T}}{V^{2} + V \delta
            + \epsilon}

            \left(\frac{\partial P}{\partial V}\right)_T = - \frac{R T}{\left(
            V - b\right)^{2}} - \frac{a \left(- 2 V - \delta\right) \alpha{
            \left (T \right )}}{\left(V^{2} + V \delta + \epsilon\right)^{2}}

            \left(\frac{\partial V}{\partial T}\right)_P =-\frac{
            \left(\frac{\partial P}{\partial T}\right)_V}{
            \left(\frac{\partial P}{\partial V}\right)_T}

            \left(\frac{\partial V}{\partial P}\right)_T =-\frac{
            \left(\frac{\partial V}{\partial T}\right)_P}{
            \left(\frac{\partial P}{\partial T}\right)_V}

            \left(\frac{\partial T}{\partial V}\right)_P = \frac{1}
            {\left(\frac{\partial V}{\partial T}\right)_P}

            \left(\frac{\partial T}{\partial P}\right)_V = \frac{1}
            {\left(\frac{\partial P}{\partial T}\right)_V}

        Second derivatives with respect to one variable; those of `T` and `V`
        use identities shown in [1]_ and verified numerically:

        .. math::
            \left(\frac{\partial^2  P}{\partial T^2}\right)_V =  - \frac{a
            \frac{d^{2} \alpha{\left (T \right )}}{d T^{2}}}{V^{2} + V \delta
            + \epsilon}

            \left(\frac{\partial^2  P}{\partial V^2}\right)_T = 2 \left(\frac{
            R T}{\left(V - b\right)^{3}} - \frac{a \left(2 V + \delta\right)^{
            2} \alpha{\left (T \right )}}{\left(V^{2} + V \delta + \epsilon
            \right)^{3}} + \frac{a \alpha{\left (T \right )}}{\left(V^{2} + V
            \delta + \epsilon\right)^{2}}\right)

            \left(\frac{\partial^2 T}{\partial P^2}\right)_V = -\left(\frac{
            \partial^2 P}{\partial T^2}\right)_V \left(\frac{\partial P}{
            \partial T}\right)^{-3}_V

            \left(\frac{\partial^2 V}{\partial P^2}\right)_T = -\left(\frac{
            \partial^2 P}{\partial V^2}\right)_T \left(\frac{\partial P}{
            \partial V}\right)^{-3}_T

            \left(\frac{\partial^2 T}{\partial V^2}\right)_P = -\left[
            \left(\frac{\partial^2 P}{\partial V^2}\right)_T
            \left(\frac{\partial P}{\partial T}\right)_V
            - \left(\frac{\partial P}{\partial V}\right)_T
            \left(\frac{\partial^2 P}{\partial T \partial V}\right) \right]
            \left(\frac{\partial P}{\partial T}\right)^{-2}_V
            + \left[\left(\frac{\partial^2 P}{\partial T\partial V}\right)
            \left(\frac{\partial P}{\partial T}\right)_V
            - \left(\frac{\partial P}{\partial V}\right)_T
            \left(\frac{\partial^2 P}{\partial T^2}\right)_V\right]
            \left(\frac{\partial P}{\partial T}\right)_V^{-3}
            \left(\frac{\partial P}{\partial V}\right)_T

            \left(\frac{\partial^2 V}{\partial T^2}\right)_P = -\left[
            \left(\frac{\partial^2 P}{\partial T^2}\right)_V
            \left(\frac{\partial P}{\partial V}\right)_T
            - \left(\frac{\partial P}{\partial T}\right)_V
            \left(\frac{\partial^2 P}{\partial T \partial V}\right) \right]
            \left(\frac{\partial P}{\partial V}\right)^{-2}_T
            + \left[\left(\frac{\partial^2 P}{\partial T\partial V}\right)
            \left(\frac{\partial P}{\partial V}\right)_T
            - \left(\frac{\partial P}{\partial T}\right)_V
            \left(\frac{\partial^2 P}{\partial V^2}\right)_T\right]
            \left(\frac{\partial P}{\partial V}\right)_T^{-3}
            \left(\frac{\partial P}{\partial T}\right)_V

        Second derivatives with respect to the other two variables; those of
        `T` and `V` use identities shown in [1]_ and verified numerically:

        .. math::
            \left(\frac{\partial^2 P}{\partial T \partial V}\right) = - \frac{
            R}{\left(V - b\right)^{2}} + \frac{a \left(2 V + \delta\right)
            \frac{d \alpha{\left (T \right )}}{d T}}{\left(V^{2} + V \delta
            + \epsilon\right)^{2}}

           \left(\frac{\partial^2 T}{\partial P\partial V}\right) =
            - \left[\left(\frac{\partial^2 P}{\partial T \partial V}\right)
            \left(\frac{\partial P}{\partial T}\right)_V
            - \left(\frac{\partial P}{\partial V}\right)_T
            \left(\frac{\partial^2 P}{\partial T^2}\right)_V
            \right]\left(\frac{\partial P}{\partial T}\right)_V^{-3}

            \left(\frac{\partial^2 V}{\partial T\partial P}\right) =
            - \left[\left(\frac{\partial^2 P}{\partial T \partial V}\right)
            \left(\frac{\partial P}{\partial V}\right)_T
            - \left(\frac{\partial P}{\partial T}\right)_V
            \left(\frac{\partial^2 P}{\partial V^2}\right)_T
            \right]\left(\frac{\partial P}{\partial V}\right)_T^{-3}

        Excess properties

        .. math::
            H_{dep} = \int_{\infty}^V \left[T\frac{\partial P}{\partial T}_V
            - P\right]dV + PV - RT= P V - R T + \frac{2}{\sqrt{
            \delta^{2} - 4 \epsilon}} \left(T a \frac{d \alpha{\left (T \right
            )}}{d T}  - a \alpha{\left (T \right )}\right) \operatorname{atanh}
            {\left (\frac{2 V + \delta}{\sqrt{\delta^{2} - 4 \epsilon}}
            \right)}

            S_{dep} = \int_{\infty}^V\left[\frac{\partial P}{\partial T}
            - \frac{R}{V}\right] dV + R\log\frac{PV}{RT} = - R \log{\left (V
            \right )} + R \log{\left (\frac{P V}{R T} \right )} + R \log{\left
            (V - b \right )} + \frac{2 a \frac{d\alpha{\left (T \right )}}{d T}
            }{\sqrt{\delta^{2} - 4 \epsilon}} \operatorname{atanh}{\left (\frac
            {2 V + \delta}{\sqrt{\delta^{2} - 4 \epsilon}} \right )}

            V_{dep} = V - \frac{RT}{P}

            U_{dep} = H_{dep} - P V_{dep}

            G_{dep} = H_{dep} - T S_{dep}

            A_{dep} = U_{dep} - T S_{dep}

            \text{fugacity} = P\exp\left(\frac{G_{dep}}{RT}\right)

            \phi = \frac{\text{fugacity}}{P}

            C_{v, dep} = T\int_\infty^V \left(\frac{\partial^2 P}{\partial
            T^2}\right) dV = - T a \left(\sqrt{\frac{1}{\delta^{2} - 4
            \epsilon}} \log{\left (V - \frac{\delta^{2}}{2} \sqrt{\frac{1}{
            \delta^{2} - 4 \epsilon}} + \frac{\delta}{2} + 2 \epsilon \sqrt{
            \frac{1}{\delta^{2} - 4 \epsilon}} \right )} - \sqrt{\frac{1}{
            \delta^{2} - 4 \epsilon}} \log{\left (V + \frac{\delta^{2}}{2}
            \sqrt{\frac{1}{\delta^{2} - 4 \epsilon}} + \frac{\delta}{2}
            - 2 \epsilon \sqrt{\frac{1}{\delta^{2} - 4 \epsilon}} \right )}
            \right) \frac{d^{2} \alpha{\left (T \right )} }{d T^{2}}

            C_{p, dep} = (C_p-C_v)_{\text{from EOS}} + C_{v, dep} - R

        References
        ----------
        .. [1] Thorade, Matthis, and Ali Saadat. "Partial Derivatives of
           Thermodynamic State Properties for Dynamic Simulation."
           Environmental Earth Sciences 70, no. 8 (April 10, 2013): 3497-3503.
           doi:10.1007/s12665-013-2394-z.
        .. [2] Poling, Bruce E. The Properties of Gases and Liquids. 5th
           edition. New York: McGraw-Hill Professional, 2000.
        .. [3] Walas, Stanley M. Phase Equilibria in Chemical Engineering.
           Butterworth-Heinemann, 1985.


def a_alpha_and_derivatives(self, T, full=True, quick=True):

raise NotImplemented('<STR_LIT>')<EOL>

Dummy method to calculate `a_alpha` and its first and second
        derivatives. Should be implemented with the same function signature in
        each EOS variant; this only raises a NotImplemented Exception.
        Should return 'a_alpha', 'da_alpha_dT', and 'd2a_alpha_dT2'.

        For use in `solve_T`, returns only `a_alpha` if `full` is False.

        Parameters
        ----------
        T : float
            Temperature, [K]
        full : bool, optional
            If False, calculates and returns only `a_alpha`
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (3x faster) or
            individual formulas

        Returns
        -------
        a_alpha : float
            Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
        da_alpha_dT : float
            Temperature derivative of coefficient calculated by EOS-specific
            method, [J^2/mol^2/Pa/K]
        d2a_alpha_dT2 : float
            Second temperature derivative of coefficient calculated by
            EOS-specific method, [J^2/mol^2/Pa/K**2]


def to_solve(T):<EOL><INDENT>a_alpha = self.a_alpha_and_derivatives(T, full=False)<EOL>P_calc = R*T/(V-self.b) - a_alpha/(V*V + self.delta*V + self.epsilon)<EOL>return P_calc - P<EOL><DEDENT>return newton(to_solve, self.Tc*<NUM_LIT:0.5>)<EOL>

Generic method to calculate `T` from a specified `P` and `V`.
        Provides SciPy's `newton` solver, and iterates to solve the general
        equation for `P`, recalculating `a_alpha` as a function of temperature
        using `a_alpha_and_derivatives` each iteration.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (3x faster) or
            individual formulas - not applicable where a numerical solver is
            used.

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


@staticmethod<EOL><INDENT>def volume_solutions(T, P, b, delta, epsilon, a_alpha, quick=True):<DEDENT>

if quick:<EOL><INDENT>x0 = <NUM_LIT:1.>/P<EOL>x1 = P*b<EOL>x2 = R*T<EOL>x3 = P*delta<EOL>x4 = x1 + x2 - x3<EOL>x5 = x0*x4<EOL>x6 = a_alpha*b<EOL>x7 = epsilon*x1<EOL>x8 = epsilon*x2<EOL>x9 = x0*x0<EOL>x10 = P*epsilon<EOL>x11 = delta*x1<EOL>x12 = delta*x2<EOL>x13 = <NUM_LIT>*a_alpha<EOL>x14 = <NUM_LIT>*x10<EOL>x15 = <NUM_LIT>*x11<EOL>x16 = <NUM_LIT>*x12<EOL>x17 = -x1 - x2 + x3<EOL>x18 = x0*x17*x17<EOL>x19 = ((-<NUM_LIT>*x0*(x6 + x7 + x8) - <NUM_LIT>*x4*x9*(-a_alpha - x10 + x11 + x12) + ((x9*(-<NUM_LIT>*x0*(-x13 - x14 + x15 + x16 + x18)**<NUM_LIT:3> + (-<NUM_LIT>*x0*x17*(a_alpha + x10 - x11 - x12) + <NUM_LIT>*x17*x17*x17*x9 - <NUM_LIT>*(x6 + x7 + x8))**<NUM_LIT:2>))+<NUM_LIT>)**<NUM_LIT:0.5>*<NUM_LIT:0.5> - x4**<NUM_LIT:3>*x9*x0)+<NUM_LIT>)**(<NUM_LIT:1.>/<NUM_LIT>)<EOL>x20 = x13 + x14 - x15 - x16 - x18<EOL>x22 = <NUM_LIT>*x5<EOL>x24 = <NUM_LIT> + <NUM_LIT:1.><EOL>x25 = <NUM_LIT>*x0*x20/x19<EOL>x26 = -<NUM_LIT> + <NUM_LIT:1.><EOL>return [(x0*x20/x19 - x19 + x5)/<NUM_LIT>,<EOL>(x19*x24 + x22 - x25/x24)/<NUM_LIT>,<EOL>(x19*x26 + x22 - x25/x26)/<NUM_LIT>]<EOL><DEDENT>else:<EOL><INDENT>return [-(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)/(<NUM_LIT:3>*(sqrt(-<NUM_LIT:4>*(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)**<NUM_LIT:3> + (<NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/P - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P**<NUM_LIT:2> + <NUM_LIT:2>*(-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**<NUM_LIT:2>)/<NUM_LIT:2> + <NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/(<NUM_LIT:2>*P) - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/(<NUM_LIT:2>*P**<NUM_LIT:2>) + (-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**(<NUM_LIT:1>/<NUM_LIT:3>)) - (sqrt(-<NUM_LIT:4>*(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)**<NUM_LIT:3> + (<NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/P - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P**<NUM_LIT:2> + <NUM_LIT:2>*(-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**<NUM_LIT:2>)/<NUM_LIT:2> + <NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/(<NUM_LIT:2>*P) - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/(<NUM_LIT:2>*P**<NUM_LIT:2>) + (-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**(<NUM_LIT:1>/<NUM_LIT:3>)/<NUM_LIT:3> - (-P*b + P*delta - R*T)/(<NUM_LIT:3>*P),<EOL>-(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)/(<NUM_LIT:3>*(-<NUM_LIT:1>/<NUM_LIT:2> - sqrt(<NUM_LIT:3>)*<NUM_LIT>/<NUM_LIT:2>)*(sqrt(-<NUM_LIT:4>*(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)**<NUM_LIT:3> + (<NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/P - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P**<NUM_LIT:2> + <NUM_LIT:2>*(-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**<NUM_LIT:2>)/<NUM_LIT:2> + <NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/(<NUM_LIT:2>*P) - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/(<NUM_LIT:2>*P**<NUM_LIT:2>) + (-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**(<NUM_LIT:1>/<NUM_LIT:3>)) - (-<NUM_LIT:1>/<NUM_LIT:2> - sqrt(<NUM_LIT:3>)*<NUM_LIT>/<NUM_LIT:2>)*(sqrt(-<NUM_LIT:4>*(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)**<NUM_LIT:3> + (<NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/P - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P**<NUM_LIT:2> + <NUM_LIT:2>*(-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**<NUM_LIT:2>)/<NUM_LIT:2> + <NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/(<NUM_LIT:2>*P) - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/(<NUM_LIT:2>*P**<NUM_LIT:2>) + (-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**(<NUM_LIT:1>/<NUM_LIT:3>)/<NUM_LIT:3> - (-P*b + P*delta - R*T)/(<NUM_LIT:3>*P),<EOL>-(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)/(<NUM_LIT:3>*(-<NUM_LIT:1>/<NUM_LIT:2> + sqrt(<NUM_LIT:3>)*<NUM_LIT>/<NUM_LIT:2>)*(sqrt(-<NUM_LIT:4>*(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)**<NUM_LIT:3> + (<NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/P - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P**<NUM_LIT:2> + <NUM_LIT:2>*(-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**<NUM_LIT:2>)/<NUM_LIT:2> + <NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/(<NUM_LIT:2>*P) - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/(<NUM_LIT:2>*P**<NUM_LIT:2>) + (-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**(<NUM_LIT:1>/<NUM_LIT:3>)) - (-<NUM_LIT:1>/<NUM_LIT:2> + sqrt(<NUM_LIT:3>)*<NUM_LIT>/<NUM_LIT:2>)*(sqrt(-<NUM_LIT:4>*(-<NUM_LIT:3>*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P + (-P*b + P*delta - R*T)**<NUM_LIT:2>/P**<NUM_LIT:2>)**<NUM_LIT:3> + (<NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/P - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/P**<NUM_LIT:2> + <NUM_LIT:2>*(-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**<NUM_LIT:2>)/<NUM_LIT:2> + <NUM_LIT>*(-P*b*epsilon - R*T*epsilon - a_alpha*b)/(<NUM_LIT:2>*P) - <NUM_LIT:9>*(-P*b + P*delta - R*T)*(-P*b*delta + P*epsilon - R*T*delta + a_alpha)/(<NUM_LIT:2>*P**<NUM_LIT:2>) + (-P*b + P*delta - R*T)**<NUM_LIT:3>/P**<NUM_LIT:3>)**(<NUM_LIT:1>/<NUM_LIT:3>)/<NUM_LIT:3> - (-P*b + P*delta - R*T)/(<NUM_LIT:3>*P)]<EOL><DEDENT>

r'''Solution of this form of the cubic EOS in terms of volumes. Returns
        three values, all with some complex part.

        Parameters
        ----------
        T : float
            Temperature, [K]
        P : float
            Pressure, [Pa]
        b : float
            Coefficient calculated by EOS-specific method, [m^3/mol]
        delta : float
            Coefficient calculated by EOS-specific method, [m^3/mol]
        epsilon : float
            Coefficient calculated by EOS-specific method, [m^6/mol^2]
        a_alpha : float
            Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (3x faster) or
            individual formulas

        Returns
        -------
        Vs : list[float]
            Three possible molar volumes, [m^3/mol]

        Notes
        -----
        Using explicit formulas, as can be derived in the following example,
        is faster than most numeric root finding techniques, and
        finds all values explicitly. It takes several seconds.

        >>> from sympy import *
        >>> P, T, V, R, b, a, delta, epsilon, alpha = symbols('P, T, V, R, b, a, delta, epsilon, alpha')
        >>> Tc, Pc, omega = symbols('Tc, Pc, omega')
        >>> CUBIC = R*T/(V-b) - a*alpha/(V*V + delta*V + epsilon) - P
        >>> #solve(CUBIC, V)


alpha = self.a_alpha_and_derivatives(T, full=False)/self.a<EOL>Tr = T/self.Tc<EOL>x = alpha/Tr - <NUM_LIT:1.><EOL>c = self.Psat_coeffs_limiting if Tr < <NUM_LIT> else self.Psat_coeffs<EOL>y = horner(c, x)<EOL>try:<EOL><INDENT>Psat = exp(y)*Tr*self.Pc<EOL><DEDENT>except OverflowError:<EOL><INDENT>polish = False<EOL>Psat = <NUM_LIT:0><EOL><DEDENT>if polish:<EOL><INDENT>def to_solve(P):<EOL><INDENT>e = self.__class__(Tc=self.Tc, Pc=self.Pc, omega=self.omega, T=T, P=P)<EOL>err = e.fugacity_l - e.fugacity_g<EOL>return err<EOL><DEDENT>Psat = newton(to_solve, Psat)<EOL><DEDENT>return Psat<EOL>

r'''Generic method to calculate vapor pressure for a specified `T`.

        From Tc to 0.32Tc, uses a 10th order polynomial of the following form:

        .. math::
            \ln\frac{P_r}{T_r} = \sum_{k=0}^{10} C_k\left(\frac{\alpha}{T_r}
            -1\right)^{k}

        If `polish` is True, SciPy's `newton` solver is launched with the
        calculated vapor pressure as an initial guess in an attempt to get more
        accuracy. This may not converge however.

        Results above the critical temperature are meaningless. A first-order
        polynomial is used to extrapolate under 0.32 Tc; however, there is
        normally not a volume solution to the EOS which can produce that
        low of a pressure.

        Parameters
        ----------
        T : float
            Temperature, [K]
        polish : bool, optional
            Whether to attempt to use a numerical solver to make the solution
            more precise or not

        Returns
        -------
        Psat : float
            Vapor pressure, [Pa]

        Notes
        -----
        EOSs sharing the same `b`, `delta`, and `epsilon` have the same
        coefficient sets.

        All coefficients were derived with numpy's polyfit. The intersection
        between the polynomials is continuous, but there is a step change
        in its derivative.

        Form for the regression is inspired from [1]_.

        References
        ----------
        .. [1] Soave, G. "Direct Calculation of Pure-Compound Vapour Pressures
           through Cubic Equations of State." Fluid Phase Equilibria 31, no. 2
           (January 1, 1986): 203-7. doi:10.1016/0378-3812(86)90013-0.


a_alphas = self.a_alpha_and_derivatives(T)<EOL>alpha, d_alpha_dT = a_alphas[<NUM_LIT:0>]/self.a, a_alphas[<NUM_LIT:1>]/self.a<EOL>Tr = T/self.Tc<EOL>if Tr >= <NUM_LIT>:<EOL><INDENT>c = self.Psat_coeffs<EOL>x0 = alpha/T<EOL>x1 = -self.Tc*x0 + <NUM_LIT:1><EOL>x2 = c[<NUM_LIT:0>]*x1<EOL>x3 = c[<NUM_LIT:2>] - x1*(c[<NUM_LIT:1>] - x2)<EOL>x4 = c[<NUM_LIT:3>] - x1*x3<EOL>x5 = c[<NUM_LIT:4>] - x1*x4<EOL>x6 = c[<NUM_LIT:5>] - x1*x5<EOL>x7 = c[<NUM_LIT:6>] - x1*x6<EOL>x8 = c[<NUM_LIT:7>] - x1*x7<EOL>x9 = c[<NUM_LIT:8>] - x1*x8<EOL>return self.Pc*(-(d_alpha_dT - x0)*(-c[<NUM_LIT:9>] + x1*x9 + x1*(-x1*(-x1*(-x1*(-x1*(-x1*(-x1*(-x1*(c[<NUM_LIT:1>] - <NUM_LIT:2>*x2) + x3) + x4) + x5) + x6) + x7) + x8) + x9)) + <NUM_LIT:1.>/self.Tc)*exp(c[<NUM_LIT:10>] - x1*(c[<NUM_LIT:9>] - x1*(c[<NUM_LIT:8>] - x1*(c[<NUM_LIT:7>] - x1*(c[<NUM_LIT:6>] - x1*(c[<NUM_LIT:5>] - x1*(c[<NUM_LIT:4>] - x1*(c[<NUM_LIT:3>] - x1*(c[<NUM_LIT:2>] + x1*(-c[<NUM_LIT:1>] + x2))))))))))    <EOL><DEDENT>else:<EOL><INDENT>c = self.Psat_coeffs_limiting<EOL>return self.Pc*T*c[<NUM_LIT:0>]*(self.Tc*d_alpha_dT/T - self.Tc*alpha/(T*T))*exp(c[<NUM_LIT:0>]*(-<NUM_LIT:1.> + self.Tc*alpha/T) + c[<NUM_LIT:1>])/self.Tc + self.Pc*exp(c[<NUM_LIT:0>]*(-<NUM_LIT:1.> + self.Tc*alpha/T) + c[<NUM_LIT:1>])/self.Tc<EOL><DEDENT>

r'''Generic method to calculate the temperature derivative of vapor
        pressure for a specified `T`. Implements the analytical derivative
        of the two polynomials described in `Psat`.

        As with `Psat`, results above the critical temperature are meaningless.
        The first-order polynomial which is used to calculate it under 0.32 Tc
        may not be physicall meaningful, due to there normally not being a
        volume solution to the EOS which can produce that low of a pressure.

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

        Returns
        -------
        dPsat_dT : float
            Derivative of vapor pressure with respect to temperature, [Pa/K]

        Notes
        -----
        There is a small step change at 0.32 Tc for all EOS due to the two
        switch between polynomials at that point.

        Useful for calculating enthalpy of vaporization with the Clausius
        Clapeyron Equation. Derived with SymPy's diff and cse.


Psat = self.Psat(T)<EOL>a_alpha = self.a_alpha_and_derivatives(T, full=False)<EOL>Vs = self.volume_solutions(T, Psat, self.b, self.delta, self.epsilon, a_alpha)<EOL>return min([i.real for i in Vs])<EOL>

r'''Method to calculate molar volume of the liquid phase along the
        saturation line.

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

        Returns
        -------
        V_l_sat : float
            Liquid molar volume along the saturation line, [m^3/mol]

        Notes
        -----
        Computers `Psat`, and then uses `volume_solutions` to obtain the three
        possible molar volumes. The lowest value is returned.


Psat = self.Psat(T)<EOL>a_alpha = self.a_alpha_and_derivatives(T, full=False)<EOL>Vs = self.volume_solutions(T, Psat, self.b, self.delta, self.epsilon, a_alpha)<EOL>return max([i.real for i in Vs])<EOL>

r'''Method to calculate molar volume of the vapor phase along the
        saturation line.

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

        Returns
        -------
        V_g_sat : float
            Gas molar volume along the saturation line, [m^3/mol]

        Notes
        -----
        Computers `Psat`, and then uses `volume_solutions` to obtain the three
        possible molar volumes. The highest value is returned.


Psat = self.Psat(T)<EOL>dPsat_dT = self.dPsat_dT(T)<EOL>a_alpha = self.a_alpha_and_derivatives(T, full=False)<EOL>Vs = self.volume_solutions(T, Psat, self.b, self.delta, self.epsilon, a_alpha)<EOL>Vs = [i.real for i in Vs]<EOL>V_l, V_g = min(Vs), max(Vs)<EOL>return dPsat_dT*T*(V_g-V_l)<EOL>

r'''Method to calculate enthalpy of vaporization for a pure fluid from
        an equation of state, without iteration.

        .. math::
            \frac{dP^{sat}}{dT}=\frac{\Delta H_{vap}}{T(V_g - V_l)}

        Results above the critical temperature are meaningless. A first-order
        polynomial is used to extrapolate under 0.32 Tc; however, there is
        normally not a volume solution to the EOS which can produce that
        low of a pressure.

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

        Returns
        -------
        Hvap : float
            Increase in enthalpy needed for vaporization of liquid phase along
            the saturation line, [J/mol]

        Notes
        -----
        Calculates vapor pressure and its derivative with `Psat` and `dPsat_dT`
        as well as molar volumes of the saturation liquid and vapor phase in
        the process.

        Very near the critical point this provides unrealistic results due to
        `Psat`'s polynomials being insufficiently accurate.

        References
        ----------
        .. [1] Walas, Stanley M. Phase Equilibria in Chemical Engineering.
           Butterworth-Heinemann, 1985.


@staticmethod<EOL><INDENT>def Soave_1972(self, T, full=True, quick=True):<DEDENT>

c1 = self.alpha_function_coeffs[<NUM_LIT:0>]<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(c1*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)**<NUM_LIT:2><EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = -a*c1*sqrt(T/Tc)*(c1*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)/T<EOL>d2a_alpha_dT2 = a*c1*(c1/Tc - sqrt(T/Tc)*(c1*(sqrt(T/Tc) - <NUM_LIT:1>) - <NUM_LIT:1>)/T)/(<NUM_LIT:2>*T)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Soave (1972) [1]_. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Same as `SRK.a_alpha_and_derivatives` but slower and
        requiring `alpha_function_coeffs` to be set. One coefficient needed.

        .. math::
            \alpha = \left(c_{1} \left(- \sqrt{\frac{T}{Tc}} + 1\right)
            + 1\right)^{2}

        References
        ----------
        .. [1] Soave, Giorgio. "Equilibrium Constants from a Modified Redlich-
           Kwong Equation of State." Chemical Engineering Science 27, no. 6
           (June 1972): 1197-1203. doi:10.1016/0009-2509(72)80096-4.


@staticmethod<EOL><INDENT>def Heyen(self, T, full=True, quick=True):<DEDENT>

c1, c2 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*exp(c1*(<NUM_LIT:1> -(T/Tc)**c2))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = -a*c1*c2*(T/Tc)**c2*exp(c1*(-(T/Tc)**c2 + <NUM_LIT:1>))/T<EOL>d2a_alpha_dT2 = a*c1*c2*(T/Tc)**c2*(c1*c2*(T/Tc)**c2 - c2 + <NUM_LIT:1>)*exp(-c1*((T/Tc)**c2 - <NUM_LIT:1>))/T**<NUM_LIT:2><EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Heyen (1980) [1]_. Returns `a_alpha`, `da_alpha_dT`,
        and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Two coefficients needed.

        .. math::
            \alpha = e^{c_{1} \left(- \left(\frac{T}{Tc}\right)^{c_{2}}
            + 1\right)}

        References
        ----------
        .. [1] Heyen, G. Liquid and Vapor Properties from a Cubic Equation of
           State. In "Proceedings of the 2nd International Conference on Phase
           Equilibria and Fluid Properties in the Chemical Industry". DECHEMA:
           Frankfurt, 1980; p 9-13.


@staticmethod<EOL><INDENT>def Harmens_Knapp(self, T, full=True, quick=True):<DEDENT>

c1, c2 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(c1*(-sqrt(T/Tc) + <NUM_LIT:1>) - c2*(<NUM_LIT:1> - Tc/T) + <NUM_LIT:1>)**<NUM_LIT:2><EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(-c1*sqrt(T/Tc)/T - <NUM_LIT:2>*Tc*c2/T**<NUM_LIT:2>)*(c1*(-sqrt(T/Tc) + <NUM_LIT:1>) - c2*(<NUM_LIT:1> - Tc/T) + <NUM_LIT:1>)<EOL>d2a_alpha_dT2 = a*((c1*sqrt(T/Tc) + <NUM_LIT:2>*Tc*c2/T)**<NUM_LIT:2> - (c1*sqrt(T/Tc) + <NUM_LIT:8>*Tc*c2/T)*(c1*(sqrt(T/Tc) - <NUM_LIT:1>) + c2*(<NUM_LIT:1> - Tc/T) - <NUM_LIT:1>))/(<NUM_LIT:2>*T**<NUM_LIT:2>)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Harmens and Knapp (1980) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Two coefficients needed.

        .. math::
            \alpha = \left(c_{1} \left(- \sqrt{\frac{T}{Tc}} + 1\right)
            - c_{2} \left(1 - \frac{Tc}{T}\right) + 1\right)^{2}

        References
        ----------
        .. [1] Harmens, A., and H. Knapp. "Three-Parameter Cubic Equation of
           State for Normal Substances." Industrial & Engineering Chemistry
           Fundamentals 19, no. 3 (August 1, 1980): 291-94.
           doi:10.1021/i160075a010.


@staticmethod<EOL><INDENT>def Mathias(self, T, full=True, quick=True):<DEDENT>

c1, c2 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(<NUM_LIT:1> + c1*(<NUM_LIT:1>-sqrt(Tr)) -c2*(<NUM_LIT:1>-Tr)*(<NUM_LIT>-Tr))**<NUM_LIT:2><EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(c1*(-sqrt(T/Tc) + <NUM_LIT:1>) - c2*(-T/Tc + <NUM_LIT>)*(-T/Tc + <NUM_LIT:1>) + <NUM_LIT:1>)*(<NUM_LIT:2>*c2*(-T/Tc + <NUM_LIT>)/Tc + <NUM_LIT:2>*c2*(-T/Tc + <NUM_LIT:1>)/Tc - c1*sqrt(T/Tc)/T)<EOL>d2a_alpha_dT2 = a*((<NUM_LIT:8>*c2/Tc**<NUM_LIT:2> - c1*sqrt(T/Tc)/T**<NUM_LIT:2>)*(c1*(sqrt(T/Tc) - <NUM_LIT:1>) + c2*(T/Tc - <NUM_LIT:1>)*(T/Tc - <NUM_LIT>) - <NUM_LIT:1>) + (<NUM_LIT:2>*c2*(T/Tc - <NUM_LIT:1>)/Tc + <NUM_LIT:2>*c2*(T/Tc - <NUM_LIT>)/Tc + c1*sqrt(T/Tc)/T)**<NUM_LIT:2>)/<NUM_LIT:2><EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Mathias (1983) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Two coefficients needed.

        .. math::
            \alpha = \left(c_{1} \left(- \sqrt{\frac{T}{Tc}} + 1\right)
            - c_{2} \left(- \frac{T}{Tc} + 0.7\right) \left(- \frac{T}{Tc}
            + 1\right) + 1\right)^{2}

        References
        ----------
        .. [1] Mathias, Paul M. "A Versatile Phase Equilibrium Equation of
           State." Industrial & Engineering Chemistry Process Design and
           Development 22, no. 3 (July 1, 1983): 385-91.
           doi:10.1021/i200022a008.


@staticmethod<EOL><INDENT>def Mathias_Copeman(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(c1*(-sqrt(T/Tc) + <NUM_LIT:1>) + c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2> + c3*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)**<NUM_LIT:2><EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(-c1*sqrt(T/Tc)/T - <NUM_LIT:2>*c2*sqrt(T/Tc)*(-sqrt(T/Tc) + <NUM_LIT:1>)/T - <NUM_LIT:3>*c3*sqrt(T/Tc)*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2>/T)*(c1*(-sqrt(T/Tc) + <NUM_LIT:1>) + c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2> + c3*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)<EOL>d2a_alpha_dT2 = a*(T*(c1 - <NUM_LIT:2>*c2*(sqrt(T/Tc) - <NUM_LIT:1>) + <NUM_LIT:3>*c3*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2>)**<NUM_LIT:2> - (<NUM_LIT:2>*T*(c2 - <NUM_LIT:3>*c3*(sqrt(T/Tc) - <NUM_LIT:1>)) + Tc*sqrt(T/Tc)*(c1 - <NUM_LIT:2>*c2*(sqrt(T/Tc) - <NUM_LIT:1>) + <NUM_LIT:3>*c3*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2>))*(c1*(sqrt(T/Tc) - <NUM_LIT:1>) - c2*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2> + c3*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:3> - <NUM_LIT:1>))/(<NUM_LIT:2>*T**<NUM_LIT:2>*Tc)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Mathias and Copeman (1983) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Three coefficients needed.

        .. math::
            \alpha = \left(c_{1} \left(- \sqrt{\frac{T}{Tc}} + 1\right)
            + c_{2} \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{2} + c_{3} \left(
            - \sqrt{\frac{T}{Tc}} + 1\right)^{3} + 1\right)^{2}

        References
        ----------
        .. [1] Mathias, Paul M., and Thomas W. Copeman. "Extension of the
           Peng-Robinson Equation of State to Complex Mixtures: Evaluation of
           the Various Forms of the Local Composition Concept." Fluid Phase
           Equilibria 13 (January 1, 1983): 91-108.
           doi:10.1016/0378-3812(83)80084-3.


@staticmethod<EOL><INDENT>def Gibbons_Laughton(self, T, full=True, quick=True):<DEDENT>

c1, c2 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(c1*(T/Tc - <NUM_LIT:1>) + c2*(sqrt(T/Tc) - <NUM_LIT:1>) + <NUM_LIT:1>)<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(c1/Tc + c2*sqrt(T/Tc)/(<NUM_LIT:2>*T))<EOL>d2a_alpha_dT2 = a*(-c2*sqrt(T/Tc)/(<NUM_LIT:4>*T**<NUM_LIT:2>))<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Gibbons and Laughton (1984) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Two coefficients needed.

        .. math::
            \alpha = c_{1} \left(\frac{T}{Tc} - 1\right) + c_{2}
            \left(\sqrt{\frac{T}{Tc}} - 1\right) + 1

        References
        ----------
        .. [1] Gibbons, Richard M., and Andrew P. Laughton. "An Equation of
           State for Polar and Non-Polar Substances and Mixtures" 80, no. 9
           (January 1, 1984): 1019-38. doi:10.1039/F29848001019.


@staticmethod<EOL><INDENT>def Soave_1984(self, T, full=True, quick=True):<DEDENT>

c1, c2 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(c1*(-T/Tc + <NUM_LIT:1>) + c2*(-<NUM_LIT:1> + Tc/T) + <NUM_LIT:1>)<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(-c1/Tc - Tc*c2/T**<NUM_LIT:2>)<EOL>d2a_alpha_dT2 = a*(<NUM_LIT:2>*Tc*c2/T**<NUM_LIT:3>)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Soave (1984) [1]_. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Two coefficients needed.

        .. math::
            \alpha = c_{1} \left(- \frac{T}{Tc} + 1\right) + c_{2} \left(-1
            + \frac{Tc}{T}\right) + 1

        References
        ----------
        .. [1] Soave, G. "Improvement of the Van Der Waals Equation of State."
           Chemical Engineering Science 39, no. 2 (January 1, 1984): 357-69.
           doi:10.1016/0009-2509(84)80034-2.


@staticmethod<EOL><INDENT>def Yu_Lu(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3, c4 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*<NUM_LIT:10>**(c4*(-T/Tc + <NUM_LIT:1>)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(<NUM_LIT:10>**(c4*(-T/Tc + <NUM_LIT:1>)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1))*(c4*(-T/Tc + <NUM_LIT:1>)*(<NUM_LIT:2>*T*c3/Tc**<NUM_LIT:2> + c2/Tc) - c4*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1)/Tc)*log(<NUM_LIT:10>))<EOL>d2a_alpha_dT2 = a*(<NUM_LIT:10>**(-c4*(T/Tc - <NUM_LIT:1>)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1))*c4*(-<NUM_LIT:4>*T*c3/Tc - <NUM_LIT:2>*c2 - <NUM_LIT:2>*c3*(T/Tc - <NUM_LIT:1>) + c4*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1 + (T/Tc - <NUM_LIT:1>)*(<NUM_LIT:2>*T*c3/Tc + c2))**<NUM_LIT:2>*log(<NUM_LIT:10>))*log(<NUM_LIT:10>)/Tc**<NUM_LIT:2>)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Yu and Lu (1987) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Four coefficients needed.

        .. math::
            \alpha = 10^{c_{4} \left(- \frac{T}{Tc} + 1\right) \left(
            \frac{T^{2} c_{3}}{Tc^{2}} + \frac{T c_{2}}{Tc} + c_{1}\right)}

        References
        ----------
        .. [1] Yu, Jin-Min, and Benjamin C. -Y. Lu. "A Three-Parameter Cubic
           Equation of State for Asymmetric Mixture Density Calculations."
           Fluid Phase Equilibria 34, no. 1 (January 1, 1987): 1-19.
           doi:10.1016/0378-3812(87)85047-1.


@staticmethod<EOL><INDENT>def Trebble_Bishnoi(self, T, full=True, quick=True):<DEDENT>

c1 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*exp(c1*(-T/Tc + <NUM_LIT:1>))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*-c1*exp(c1*(-T/Tc + <NUM_LIT:1>))/Tc<EOL>d2a_alpha_dT2 = a*c1**<NUM_LIT:2>*exp(-c1*(T/Tc - <NUM_LIT:1>))/Tc**<NUM_LIT:2><EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Trebble and Bishnoi (1987) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. One coefficient needed.

        .. math::
            \alpha = e^{c_{1} \left(- \frac{T}{Tc} + 1\right)}

        References
        ----------
        .. [1] Trebble, M. A., and P. R. Bishnoi. "Development of a New Four-
           Parameter Cubic Equation of State." Fluid Phase Equilibria 35, no. 1
           (September 1, 1987): 1-18. doi:10.1016/0378-3812(87)80001-8.


@staticmethod<EOL><INDENT>def Melhem(self, T, full=True, quick=True):<DEDENT>

c1, c2 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*exp(c1*(-T/Tc + <NUM_LIT:1>) + c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2>)<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*((-c1/Tc - c2*sqrt(T/Tc)*(-sqrt(T/Tc) + <NUM_LIT:1>)/T)*exp(c1*(-T/Tc + <NUM_LIT:1>) + c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2>))<EOL>d2a_alpha_dT2 = a*(((c1/Tc - c2*sqrt(T/Tc)*(sqrt(T/Tc) - <NUM_LIT:1>)/T)**<NUM_LIT:2> + c2*(<NUM_LIT:1>/Tc - sqrt(T/Tc)*(sqrt(T/Tc) - <NUM_LIT:1>)/T)/(<NUM_LIT:2>*T))*exp(-c1*(T/Tc - <NUM_LIT:1>) + c2*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2>))<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Melhem et al. (1989) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Two coefficients needed.

        .. math::
            \alpha = e^{c_{1} \left(- \frac{T}{Tc} + 1\right) + c_{2}
            \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{2}}

        References
        ----------
        .. [1] Melhem, Georges A., Riju Saini, and Bernard M. Goodwin. "A
           Modified Peng-Robinson Equation of State." Fluid Phase Equilibria
           47, no. 2 (August 1, 1989): 189-237.
           doi:10.1016/0378-3812(89)80176-1.


@staticmethod<EOL><INDENT>def Androulakis(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(c1*(-(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) + <NUM_LIT:1>) + c2*(-(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) + <NUM_LIT:1>)**<NUM_LIT:2> + c3*(-(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) + <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(-<NUM_LIT:2>*c1*(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>)/(<NUM_LIT:3>*T) - <NUM_LIT:4>*c2*(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>)*(-(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) + <NUM_LIT:1>)/(<NUM_LIT:3>*T) - <NUM_LIT:2>*c3*(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>)*(-(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) + <NUM_LIT:1>)**<NUM_LIT:2>/T)<EOL>d2a_alpha_dT2 = a*(<NUM_LIT:2>*(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>)*(c1 + <NUM_LIT:4>*c2*(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) - <NUM_LIT:2>*c2*((T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) - <NUM_LIT:1>) - <NUM_LIT:12>*c3*(T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>)*((T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) - <NUM_LIT:1>) + <NUM_LIT:3>*c3*((T/Tc)**(<NUM_LIT:2>/<NUM_LIT:3>) - <NUM_LIT:1>)**<NUM_LIT:2>)/(<NUM_LIT:9>*T**<NUM_LIT:2>))<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Androulakis et al. (1989) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Three coefficients needed.

        .. math::
            \alpha = c_{1} \left(- \left(\frac{T}{Tc}\right)^{\frac{2}{3}}
            + 1\right) + c_{2} \left(- \left(\frac{T}{Tc}\right)^{\frac{2}{3}}
            + 1\right)^{2} + c_{3} \left(- \left(\frac{T}{Tc}\right)^{
            \frac{2}{3}} + 1\right)^{3} + 1

        References
        ----------
        .. [1] Androulakis, I. P., N. S. Kalospiros, and D. P. Tassios.
           "Thermophysical Properties of Pure Polar and Nonpolar Compounds with
           a Modified VdW-711 Equation of State." Fluid Phase Equilibria 45,
           no. 2 (April 1, 1989): 135-63. doi:10.1016/0378-3812(89)80254-7.


@staticmethod<EOL><INDENT>def Schwartzentruber(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*((c4*(-sqrt(T/Tc) + <NUM_LIT:1>) - (-sqrt(T/Tc) + <NUM_LIT:1>)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1) + <NUM_LIT:1>)**<NUM_LIT:2>)<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*((c4*(-sqrt(T/Tc) + <NUM_LIT:1>) - (-sqrt(T/Tc) + <NUM_LIT:1>)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1) + <NUM_LIT:1>)*(-<NUM_LIT:2>*(-sqrt(T/Tc) + <NUM_LIT:1>)*(<NUM_LIT:2>*T*c3/Tc**<NUM_LIT:2> + c2/Tc) - c4*sqrt(T/Tc)/T + sqrt(T/Tc)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1)/T))<EOL>d2a_alpha_dT2 = a*(((-c4*(sqrt(T/Tc) - <NUM_LIT:1>) + (sqrt(T/Tc) - <NUM_LIT:1>)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1) + <NUM_LIT:1>)*(<NUM_LIT:8>*c3*(sqrt(T/Tc) - <NUM_LIT:1>)/Tc**<NUM_LIT:2> + <NUM_LIT:4>*sqrt(T/Tc)*(<NUM_LIT:2>*T*c3/Tc + c2)/(T*Tc) + c4*sqrt(T/Tc)/T**<NUM_LIT:2> - sqrt(T/Tc)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1)/T**<NUM_LIT:2>) + (<NUM_LIT:2>*(sqrt(T/Tc) - <NUM_LIT:1>)*(<NUM_LIT:2>*T*c3/Tc + c2)/Tc - c4*sqrt(T/Tc)/T + sqrt(T/Tc)*(T**<NUM_LIT:2>*c3/Tc**<NUM_LIT:2> + T*c2/Tc + c1)/T)**<NUM_LIT:2>)/<NUM_LIT:2>)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Schwartzentruber et al. (1990) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Three coefficients needed.

        .. math::
            \alpha = \left(c_{4} \left(- \sqrt{\frac{T}{Tc}} + 1\right)
            - \left(- \sqrt{\frac{T}{Tc}} + 1\right) \left(\frac{T^{2} c_{3}}
            {Tc^{2}} + \frac{T c_{2}}{Tc} + c_{1}\right) + 1\right)^{2}

        References
        ----------
        .. [1] J. Schwartzentruber, H. Renon, and S. Watanasiri, "K-values for
           Non-Ideal Systems:An Easier Way," Chem. Eng., March 1990, 118-124.


@staticmethod<EOL><INDENT>def Almeida(self, T, full=True, quick=True):<DEDENT>

<EOL>c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*exp(c1*(-T/Tc + <NUM_LIT:1>)*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:1>) + c3*(-<NUM_LIT:1> + Tc/T))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*((c1*(c2 - <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:1>)*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:1>)*copysign(<NUM_LIT:1>, T/Tc - <NUM_LIT:1>)/(Tc*Abs(T/Tc - <NUM_LIT:1>)) - c1*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:1>)/Tc - Tc*c3/T**<NUM_LIT:2>)*exp(c1*(-T/Tc + <NUM_LIT:1>)*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:1>) + c3*(-<NUM_LIT:1> + Tc/T)))<EOL>d2a_alpha_dT2 = a*exp(c3*(Tc/T - <NUM_LIT:1>) - c1*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:1>)*(T/Tc - <NUM_LIT:1>))*((c1*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:1>))/Tc + (Tc*c3)/T**<NUM_LIT:2> + (c1*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:2>)*copysign(<NUM_LIT:1>, T/Tc - <NUM_LIT:1>)*(c2 - <NUM_LIT:1>)*(T/Tc - <NUM_LIT:1>))/Tc)**<NUM_LIT:2> - exp(c3*(Tc/T - <NUM_LIT:1>) - c1*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:1>)*(T/Tc - <NUM_LIT:1>))*((<NUM_LIT:2>*c1*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:2>)*copysign(<NUM_LIT:1>, T/Tc - <NUM_LIT:1>)*(c2 - <NUM_LIT:1>))/Tc**<NUM_LIT:2> - (<NUM_LIT:2>*Tc*c3)/T**<NUM_LIT:3> + (c1*abs(T/Tc - <NUM_LIT:1>)**(c2 - <NUM_LIT:3>)*copysign(<NUM_LIT:1>, T/Tc - <NUM_LIT:1>)**<NUM_LIT:2>*(c2 - <NUM_LIT:1>)*(c2 - <NUM_LIT:2>)*(T/Tc - <NUM_LIT:1>))/Tc**<NUM_LIT:2>)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Almeida et al. (1991) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Three coefficients needed.

        .. math::
            \alpha = e^{c_{1} \left(- \frac{T}{Tc} + 1\right) \left|{
            \frac{T}{Tc} - 1}\right|^{c_{2} - 1} + c_{3} \left(-1
            + \frac{Tc}{T}\right)}

        References
        ----------
        .. [1] Almeida, G. S., M. Aznar, and A. S. Telles. "Uma Nova Forma de
           Dependência Com a Temperatura Do Termo Atrativo de Equações de
           Estado Cúbicas." RBE, Rev. Bras. Eng., Cad. Eng. Quim 8 (1991): 95.


@staticmethod<EOL><INDENT>def Twu(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*((T/Tc)**(c3*(c2 - <NUM_LIT:1>))*exp(c1*(-(T/Tc)**(c2*c3) + <NUM_LIT:1>)))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(-c1*c2*c3*(T/Tc)**(c2*c3)*(T/Tc)**(c3*(c2 - <NUM_LIT:1>))*exp(c1*(-(T/Tc)**(c2*c3) + <NUM_LIT:1>))/T + c3*(T/Tc)**(c3*(c2 - <NUM_LIT:1>))*(c2 - <NUM_LIT:1>)*exp(c1*(-(T/Tc)**(c2*c3) + <NUM_LIT:1>))/T)<EOL>d2a_alpha_dT2 = a*(c3*(T/Tc)**(c3*(c2 - <NUM_LIT:1>))*(c1**<NUM_LIT:2>*c2**<NUM_LIT:2>*c3*(T/Tc)**(<NUM_LIT:2>*c2*c3) - c1*c2**<NUM_LIT:2>*c3*(T/Tc)**(c2*c3) - <NUM_LIT:2>*c1*c2*c3*(T/Tc)**(c2*c3)*(c2 - <NUM_LIT:1>) + c1*c2*(T/Tc)**(c2*c3) - c2 + c3*(c2 - <NUM_LIT:1>)**<NUM_LIT:2> + <NUM_LIT:1>)*exp(-c1*((T/Tc)**(c2*c3) - <NUM_LIT:1>))/T**<NUM_LIT:2>)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Twu et al. (1991) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Three coefficients needed.

        .. math::
            \alpha = \left(\frac{T}{Tc}\right)^{c_{3} \left(c_{2}
            - 1\right)} e^{c_{1} \left(- \left(\frac{T}{Tc}
            \right)^{c_{2} c_{3}} + 1\right)}

        References
        ----------
        .. [1] Twu, Chorng H., David Bluck, John R. Cunningham, and John E.
           Coon. "A Cubic Equation of State with a New Alpha Function and a
           New Mixing Rule." Fluid Phase Equilibria 69 (December 10, 1991):
           33-50. doi:10.1016/0378-3812(91)90024-2.


@staticmethod<EOL><INDENT>def Soave_1993(self, T, full=True, quick=True):<DEDENT>

c1, c2 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(c1*(-T/Tc + <NUM_LIT:1>) + c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2> + <NUM_LIT:1>)<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(-c1/Tc - c2*sqrt(T/Tc)*(-sqrt(T/Tc) + <NUM_LIT:1>)/T)<EOL>d2a_alpha_dT2 = a*(c2*(<NUM_LIT:1>/Tc - sqrt(T/Tc)*(sqrt(T/Tc) - <NUM_LIT:1>)/T)/(<NUM_LIT:2>*T))<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Soave (1983) [1]_. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Two coefficient needed.

        .. math::
            \alpha = c_{1} \left(- \frac{T}{Tc} + 1\right) + c_{2}
            \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{2} + 1

        References
        ----------
        .. [1] Soave, G. "Improving the Treatment of Heavy Hydrocarbons by the
           SRK EOS." Fluid Phase Equilibria 84 (April 1, 1993): 339-42.
           doi:10.1016/0378-3812(93)85131-5.


@staticmethod<EOL><INDENT>def Gasem(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(exp((-(T/Tc)**c3 + <NUM_LIT:1>)*(T*c2/Tc + c1)))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*((c2*(-(T/Tc)**c3 + <NUM_LIT:1>)/Tc - c3*(T/Tc)**c3*(T*c2/Tc + c1)/T)*exp((-(T/Tc)**c3 + <NUM_LIT:1>)*(T*c2/Tc + c1)))<EOL>d2a_alpha_dT2 = a*(((c2*((T/Tc)**c3 - <NUM_LIT:1>)/Tc + c3*(T/Tc)**c3*(T*c2/Tc + c1)/T)**<NUM_LIT:2> - c3*(T/Tc)**c3*(<NUM_LIT:2>*c2/Tc + c3*(T*c2/Tc + c1)/T - (T*c2/Tc + c1)/T)/T)*exp(-((T/Tc)**c3 - <NUM_LIT:1>)*(T*c2/Tc + c1)))<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Gasem (2001) [1]_. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Three coefficients needed.

        .. math::
            \alpha = e^{\left(- \left(\frac{T}{Tc}\right)^{c_{3}} + 1\right)
            \left(\frac{T c_{2}}{Tc} + c_{1}\right)}

        References
        ----------
        .. [1] Gasem, K. A. M, W Gao, Z Pan, and R. L Robinson Jr. "A Modified
           Temperature Dependence for the Peng-Robinson Equation of State."
           Fluid Phase Equilibria 181, no. 1–2 (May 25, 2001): 113-25.
           doi:10.1016/S0378-3812(01)00488-5.


@staticmethod<EOL><INDENT>def Coquelet(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(exp(c1*(-T/Tc + <NUM_LIT:1>)*(c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2> + c3*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)**<NUM_LIT:2>))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*((c1*(-T/Tc + <NUM_LIT:1>)*(-<NUM_LIT:2>*c2*sqrt(T/Tc)*(-sqrt(T/Tc) + <NUM_LIT:1>)/T - <NUM_LIT:3>*c3*sqrt(T/Tc)*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2>/T)*(c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2> + c3*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>) - c1*(c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2> + c3*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)**<NUM_LIT:2>/Tc)*exp(c1*(-T/Tc + <NUM_LIT:1>)*(c2*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:2> + c3*(-sqrt(T/Tc) + <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)**<NUM_LIT:2>))<EOL>d2a_alpha_dT2 = a*(c1*(c1*(-(c2*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2> - c3*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)/Tc + sqrt(T/Tc)*(-<NUM_LIT:2>*c2 + <NUM_LIT:3>*c3*(sqrt(T/Tc) - <NUM_LIT:1>))*(sqrt(T/Tc) - <NUM_LIT:1>)*(T/Tc - <NUM_LIT:1>)/T)**<NUM_LIT:2>*(c2*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2> - c3*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)**<NUM_LIT:2> - ((T/Tc - <NUM_LIT:1>)*(c2*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2> - c3*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)*(<NUM_LIT:2>*c2/Tc - <NUM_LIT:6>*c3*(sqrt(T/Tc) - <NUM_LIT:1>)/Tc - <NUM_LIT:2>*c2*sqrt(T/Tc)*(sqrt(T/Tc) - <NUM_LIT:1>)/T + <NUM_LIT:3>*c3*sqrt(T/Tc)*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2>/T) + <NUM_LIT:4>*sqrt(T/Tc)*(<NUM_LIT:2>*c2 - <NUM_LIT:3>*c3*(sqrt(T/Tc) - <NUM_LIT:1>))*(sqrt(T/Tc) - <NUM_LIT:1>)*(c2*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2> - c3*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)/Tc + (<NUM_LIT:2>*c2 - <NUM_LIT:3>*c3*(sqrt(T/Tc) - <NUM_LIT:1>))**<NUM_LIT:2>*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2>*(T/Tc - <NUM_LIT:1>)/Tc)/(<NUM_LIT:2>*T))*exp(-c1*(T/Tc - <NUM_LIT:1>)*(c2*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:2> - c3*(sqrt(T/Tc) - <NUM_LIT:1>)**<NUM_LIT:3> + <NUM_LIT:1>)**<NUM_LIT:2>))<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Coquelet et al. (2004) [1]_. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Three coefficients needed.

        .. math::
            \alpha = e^{c_{1} \left(- \frac{T}{Tc} + 1\right) \left(c_{2}
            \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{2} + c_{3}
            \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{3} + 1\right)^{2}}

        References
        ----------
        .. [1] Coquelet, C., A. Chapoy, and D. Richon. "Development of a New
           Alpha Function for the Peng–Robinson Equation of State: Comparative
           Study of Alpha Function Models for Pure Gases (Natural Gas
           Components) and Water-Gas Systems." International Journal of
           Thermophysics 25, no. 1 (January 1, 2004): 133-58.
           doi:10.1023/B:IJOT.0000022331.46865.2f.


@staticmethod<EOL><INDENT>def Haghtalab(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*exp((-c3**log(T/Tc) + <NUM_LIT:1>)*(-T*c2/Tc + c1))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*((-c2*(-c3**log(T/Tc) + <NUM_LIT:1>)/Tc - c3**log(T/Tc)*(-T*c2/Tc + c1)*log(c3)/T)*exp((-c3**log(T/Tc) + <NUM_LIT:1>)*(-T*c2/Tc + c1)))<EOL>d2a_alpha_dT2 = a*(((c2*(c3**log(T/Tc) - <NUM_LIT:1>)/Tc + c3**log(T/Tc)*(T*c2/Tc - c1)*log(c3)/T)**<NUM_LIT:2> + c3**log(T/Tc)*(<NUM_LIT:2>*c2/Tc + (T*c2/Tc - c1)*log(c3)/T - (T*c2/Tc - c1)/T)*log(c3)/T)*exp((c3**log(T/Tc) - <NUM_LIT:1>)*(T*c2/Tc - c1)))<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Haghtalab et al. (2010) [1]_. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Three coefficients needed.

        .. math::
            \alpha = e^{\left(- c_{3}^{\log{\left (\frac{T}{Tc} \right )}}
            + 1\right) \left(- \frac{T c_{2}}{Tc} + c_{1}\right)}

        References
        ----------
        .. [1] Haghtalab, A., M. J. Kamali, S. H. Mazloumi, and P. Mahmoodi.
           "A New Three-Parameter Cubic Equation of State for Calculation
           Physical Properties and Vapor-liquid Equilibria." Fluid Phase
           Equilibria 293, no. 2 (June 25, 2010): 209-18.
           doi:10.1016/j.fluid.2010.03.029.


@staticmethod<EOL><INDENT>def Saffari(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*(exp(T*c1/Tc + c2*log(T/Tc) + c3*(-sqrt(T/Tc) + <NUM_LIT:1>)))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*((c1/Tc + c2/T - c3*sqrt(T/Tc)/(<NUM_LIT:2>*T))*exp(T*c1/Tc + c2*log(T/Tc) + c3*(-sqrt(T/Tc) + <NUM_LIT:1>)))<EOL>d2a_alpha_dT2 = a*(((<NUM_LIT:2>*c1/Tc + <NUM_LIT:2>*c2/T - c3*sqrt(T/Tc)/T)**<NUM_LIT:2> - (<NUM_LIT:4>*c2 - c3*sqrt(T/Tc))/T**<NUM_LIT:2>)*exp(T*c1/Tc + c2*log(T/Tc) - c3*(sqrt(T/Tc) - <NUM_LIT:1>))/<NUM_LIT:4>)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Saffari and Zahedi (2013) [1]_. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Three coefficients needed.

        .. math::
            \alpha = e^{\frac{T c_{1}}{Tc} + c_{2} \log{\left (\frac{T}{Tc}
            \right )} + c_{3} \left(- \sqrt{\frac{T}{Tc}} + 1\right)}

        References
        ----------
        .. [1] Saffari, Hamid, and Alireza Zahedi. "A New Alpha-Function for
           the Peng-Robinson Equation of State: Application to Natural Gas."
           Chinese Journal of Chemical Engineering 21, no. 10 (October 1,
           2013): 1155-61. doi:10.1016/S1004-9541(13)60581-9.


@staticmethod<EOL><INDENT>def Chen_Yang(self, T, full=True, quick=True):<DEDENT>

c1, c2, c3, c4, c5, c6, c7 = self.alpha_function_coeffs<EOL>T, Tc, a = self.T, self.Tc, self.a<EOL>a_alpha = a*exp(c4*log((-sqrt(T/Tc) + <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) + <NUM_LIT:1>)**<NUM_LIT:2> + (-T/Tc + <NUM_LIT:1>)*(c1 + c2*omega + c3*omega**<NUM_LIT:2>))<EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = a*(-(c1 + c2*omega + c3*omega**<NUM_LIT:2>)/Tc - c4*sqrt(T/Tc)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>)*log((-sqrt(T/Tc) + <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) + <NUM_LIT:1>)/(T*((-sqrt(T/Tc) + <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) + <NUM_LIT:1>)))*exp(c4*log((-sqrt(T/Tc) + <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) + <NUM_LIT:1>)**<NUM_LIT:2> + (-T/Tc + <NUM_LIT:1>)*(c1 + c2*omega + c3*omega**<NUM_LIT:2>))<EOL>d2a_alpha_dT2 = a*(((c1 + c2*omega + c3*omega**<NUM_LIT:2>)/Tc - c4*sqrt(T/Tc)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>)*log(-(sqrt(T/Tc) - <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) + <NUM_LIT:1>)/(T*((sqrt(T/Tc) - <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) - <NUM_LIT:1>)))**<NUM_LIT:2> - c4*(c5 + c6*omega + c7*omega**<NUM_LIT:2>)*((c5 + c6*omega + c7*omega**<NUM_LIT:2>)*log(-(sqrt(T/Tc) - <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) + <NUM_LIT:1>)/(Tc*((sqrt(T/Tc) - <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) - <NUM_LIT:1>)) - (c5 + c6*omega + c7*omega**<NUM_LIT:2>)/(Tc*((sqrt(T/Tc) - <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) - <NUM_LIT:1>)) + sqrt(T/Tc)*log(-(sqrt(T/Tc) - <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) + <NUM_LIT:1>)/T)/(<NUM_LIT:2>*T*((sqrt(T/Tc) - <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) - <NUM_LIT:1>)))*exp(c4*log(-(sqrt(T/Tc) - <NUM_LIT:1>)*(c5 + c6*omega + c7*omega**<NUM_LIT:2>) + <NUM_LIT:1>)**<NUM_LIT:2> - (T/Tc - <NUM_LIT:1>)*(c1 + c2*omega + c3*omega**<NUM_LIT:2>))<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives according to Hamid and Yang (2017) [1]_. Returns `a_alpha`,
        `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives`
        for more documentation. Seven coefficients needed.

        .. math::
            \alpha = e^{\left(- c_{3}^{\log{\left (\frac{T}{Tc} \right )}}
            + 1\right) \left(- \frac{T c_{2}}{Tc} + c_{1}\right)}

        References
        ----------
        .. [1] Chen, Zehua, and Daoyong Yang. "Optimization of the Reduced
           Temperature Associated with Peng–Robinson Equation of State and
           Soave-Redlich-Kwong Equation of State To Improve Vapor Pressure
           Prediction for Heavy Hydrocarbon Compounds." Journal of Chemical &
           Engineering Data, August 31, 2017. doi:10.1021/acs.jced.7b00496.


def a_alpha_and_derivatives(self, T, full=True, quick=True):

if not full:<EOL><INDENT>return self.a*(<NUM_LIT:1> + self.kappa*(<NUM_LIT:1>-(T/self.Tc)**<NUM_LIT:0.5>))**<NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>if quick:<EOL><INDENT>Tc, kappa = self.Tc, self.kappa<EOL>x0 = T**<NUM_LIT:0.5><EOL>x1 = Tc**-<NUM_LIT:0.5><EOL>x2 = kappa*(x0*x1 - <NUM_LIT:1.>) - <NUM_LIT:1.><EOL>x3 = self.a*kappa<EOL>a_alpha = self.a*x2*x2<EOL>da_alpha_dT = x1*x2*x3/x0<EOL>d2a_alpha_dT2 = x3*(-<NUM_LIT:0.5>*T**-<NUM_LIT>*x1*x2 + <NUM_LIT:0.5>/(T*Tc)*kappa)<EOL><DEDENT>else:<EOL><INDENT>a_alpha = self.a*(<NUM_LIT:1> + self.kappa*(<NUM_LIT:1>-(T/self.Tc)**<NUM_LIT:0.5>))**<NUM_LIT:2><EOL>da_alpha_dT = -self.a*self.kappa*sqrt(T/self.Tc)*(self.kappa*(-sqrt(T/self.Tc) + <NUM_LIT:1.>) + <NUM_LIT:1.>)/T<EOL>d2a_alpha_dT2 = self.a*self.kappa*(self.kappa/self.Tc - sqrt(T/self.Tc)*(self.kappa*(sqrt(T/self.Tc) - <NUM_LIT:1.>) - <NUM_LIT:1.>)/T)/(<NUM_LIT>*T)<EOL><DEDENT>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Uses the set values of `Tc`, `kappa`, and `a`.

        For use in `solve_T`, returns only `a_alpha` if full is False.

        .. math::
            a\alpha = a \left(\kappa \left(- \frac{T^{0.5}}{Tc^{0.5}}
            + 1\right) + 1\right)^{2}

            \frac{d a\alpha}{dT} = - \frac{1.0 a \kappa}{T^{0.5} Tc^{0.5}}
            \left(\kappa \left(- \frac{T^{0.5}}{Tc^{0.5}} + 1\right) + 1\right)

            \frac{d^2 a\alpha}{dT^2} = 0.5 a \kappa \left(- \frac{1}{T^{1.5}
            Tc^{0.5}} \left(\kappa \left(\frac{T^{0.5}}{Tc^{0.5}} - 1\right)
            - 1\right) + \frac{\kappa}{T^{1.0} Tc^{1.0}}\right)


Tc, a, b, kappa = self.Tc, self.a, self.b, self.kappa<EOL>if quick:<EOL><INDENT>x0 = V*V<EOL>x1 = R*Tc<EOL>x2 = x0*x1<EOL>x3 = kappa*kappa<EOL>x4 = a*x3<EOL>x5 = b*x4<EOL>x6 = <NUM_LIT>*V*b<EOL>x7 = x1*x6<EOL>x8 = b*b<EOL>x9 = x1*x8<EOL>x10 = V*x4<EOL>x11 = (-x10 + x2 + x5 + x7 - x9)**<NUM_LIT:2><EOL>x12 = x0*x0<EOL>x13 = R*R<EOL>x14 = Tc*Tc<EOL>x15 = x13*x14<EOL>x16 = x8*x8<EOL>x17 = a*a<EOL>x18 = x3*x3<EOL>x19 = x17*x18<EOL>x20 = x0*V<EOL>x21 = <NUM_LIT>*R*Tc*a*x3<EOL>x22 = x8*b<EOL>x23 = <NUM_LIT>*V*x22<EOL>x24 = <NUM_LIT>*b*x20<EOL>x25 = a*x1<EOL>x26 = x25*x8<EOL>x27 = x26*x3<EOL>x28 = x0*x25<EOL>x29 = x28*x3<EOL>x30 = <NUM_LIT>*x8<EOL>x31 = <NUM_LIT>*V*x27 - <NUM_LIT>*b*x29 + x0*x13*x14*x30 + x0*x19 + x12*x15 + x15*x16 - x15*x23 + x15*x24 - x19*x6 + x19*x8 - x20*x21 - x21*x22<EOL>x32 = V - b<EOL>x33 = <NUM_LIT>*(R*Tc*a*kappa)<EOL>x34 = P*x2<EOL>x35 = P*x5<EOL>x36 = x25*x3<EOL>x37 = P*x10<EOL>x38 = P*R*Tc<EOL>x39 = V*x17<EOL>x40 = <NUM_LIT>*kappa*x3<EOL>x41 = b*x17<EOL>x42 = P*a*x3<EOL>return -Tc*(<NUM_LIT>*a*kappa*x11*sqrt(x32**<NUM_LIT:3>*(x0 + x6 - x8)*(P*x7 - P*x9 + x25 + x33 + x34 + x35 + x36 - x37))*(kappa + <NUM_LIT:1.>) - x31*x32*((<NUM_LIT>*V)*(R*Tc*a*b*kappa) + x0*x33 - x0*x35 + x12*x38 + x16*x38 + x18*x39 - x18*x41 - x20*x42 - x22*x42 - x23*x38 + x24*x38 + x25*x6 - x26 - x27 + x28 + x29 + x3*x39 - x3*x41 + x30*x34 - x33*x8 + x36*x6 + <NUM_LIT:3>*x37*x8 + x39*x40 - x40*x41))/(x11*x31)<EOL><DEDENT>else:<EOL><INDENT>return Tc*(-<NUM_LIT:2>*a*kappa*sqrt((V - b)**<NUM_LIT:3>*(V**<NUM_LIT:2> + <NUM_LIT:2>*V*b - b**<NUM_LIT:2>)*(P*R*Tc*V**<NUM_LIT:2> + <NUM_LIT:2>*P*R*Tc*V*b - P*R*Tc*b**<NUM_LIT:2> - P*V*a*kappa**<NUM_LIT:2> + P*a*b*kappa**<NUM_LIT:2> + R*Tc*a*kappa**<NUM_LIT:2> + <NUM_LIT:2>*R*Tc*a*kappa + R*Tc*a))*(kappa + <NUM_LIT:1>)*(R*Tc*V**<NUM_LIT:2> + <NUM_LIT:2>*R*Tc*V*b - R*Tc*b**<NUM_LIT:2> - V*a*kappa**<NUM_LIT:2> + a*b*kappa**<NUM_LIT:2>)**<NUM_LIT:2> + (V - b)*(R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*V**<NUM_LIT:4> + <NUM_LIT:4>*R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*V**<NUM_LIT:3>*b + <NUM_LIT:2>*R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*V**<NUM_LIT:2>*b**<NUM_LIT:2> - <NUM_LIT:4>*R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*V*b**<NUM_LIT:3> + R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*b**<NUM_LIT:4> - <NUM_LIT:2>*R*Tc*V**<NUM_LIT:3>*a*kappa**<NUM_LIT:2> - <NUM_LIT:2>*R*Tc*V**<NUM_LIT:2>*a*b*kappa**<NUM_LIT:2> + <NUM_LIT:6>*R*Tc*V*a*b**<NUM_LIT:2>*kappa**<NUM_LIT:2> - <NUM_LIT:2>*R*Tc*a*b**<NUM_LIT:3>*kappa**<NUM_LIT:2> + V**<NUM_LIT:2>*a**<NUM_LIT:2>*kappa**<NUM_LIT:4> - <NUM_LIT:2>*V*a**<NUM_LIT:2>*b*kappa**<NUM_LIT:4> + a**<NUM_LIT:2>*b**<NUM_LIT:2>*kappa**<NUM_LIT:4>)*(P*R*Tc*V**<NUM_LIT:4> + <NUM_LIT:4>*P*R*Tc*V**<NUM_LIT:3>*b + <NUM_LIT:2>*P*R*Tc*V**<NUM_LIT:2>*b**<NUM_LIT:2> - <NUM_LIT:4>*P*R*Tc*V*b**<NUM_LIT:3> + P*R*Tc*b**<NUM_LIT:4> - P*V**<NUM_LIT:3>*a*kappa**<NUM_LIT:2> - P*V**<NUM_LIT:2>*a*b*kappa**<NUM_LIT:2> + <NUM_LIT:3>*P*V*a*b**<NUM_LIT:2>*kappa**<NUM_LIT:2> - P*a*b**<NUM_LIT:3>*kappa**<NUM_LIT:2> + R*Tc*V**<NUM_LIT:2>*a*kappa**<NUM_LIT:2> + <NUM_LIT:2>*R*Tc*V**<NUM_LIT:2>*a*kappa + R*Tc*V**<NUM_LIT:2>*a + <NUM_LIT:2>*R*Tc*V*a*b*kappa**<NUM_LIT:2> + <NUM_LIT:4>*R*Tc*V*a*b*kappa + <NUM_LIT:2>*R*Tc*V*a*b - R*Tc*a*b**<NUM_LIT:2>*kappa**<NUM_LIT:2> - <NUM_LIT:2>*R*Tc*a*b**<NUM_LIT:2>*kappa - R*Tc*a*b**<NUM_LIT:2> + V*a**<NUM_LIT:2>*kappa**<NUM_LIT:4> + <NUM_LIT:2>*V*a**<NUM_LIT:2>*kappa**<NUM_LIT:3> + V*a**<NUM_LIT:2>*kappa**<NUM_LIT:2> - a**<NUM_LIT:2>*b*kappa**<NUM_LIT:4> - <NUM_LIT:2>*a**<NUM_LIT:2>*b*kappa**<NUM_LIT:3> - a**<NUM_LIT:2>*b*kappa**<NUM_LIT:2>))/((R*Tc*V**<NUM_LIT:2> + <NUM_LIT:2>*R*Tc*V*b - R*Tc*b**<NUM_LIT:2> - V*a*kappa**<NUM_LIT:2> + a*b*kappa**<NUM_LIT:2>)**<NUM_LIT:2>*(R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*V**<NUM_LIT:4> + <NUM_LIT:4>*R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*V**<NUM_LIT:3>*b + <NUM_LIT:2>*R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*V**<NUM_LIT:2>*b**<NUM_LIT:2> - <NUM_LIT:4>*R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*V*b**<NUM_LIT:3> + R**<NUM_LIT:2>*Tc**<NUM_LIT:2>*b**<NUM_LIT:4> - <NUM_LIT:2>*R*Tc*V**<NUM_LIT:3>*a*kappa**<NUM_LIT:2> - <NUM_LIT:2>*R*Tc*V**<NUM_LIT:2>*a*b*kappa**<NUM_LIT:2> + <NUM_LIT:6>*R*Tc*V*a*b**<NUM_LIT:2>*kappa**<NUM_LIT:2> - <NUM_LIT:2>*R*Tc*a*b**<NUM_LIT:3>*kappa**<NUM_LIT:2> + V**<NUM_LIT:2>*a**<NUM_LIT:2>*kappa**<NUM_LIT:4> - <NUM_LIT:2>*V*a**<NUM_LIT:2>*b*kappa**<NUM_LIT:4> + a**<NUM_LIT:2>*b**<NUM_LIT:2>*kappa**<NUM_LIT:4>))<EOL><DEDENT>

r'''Method to calculate `T` from a specified `P` and `V` for the PR
        EOS. Uses `Tc`, `a`, `b`, and `kappa` as well, obtained from the
        class's namespace.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (3x faster) or
            individual formulas

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

        Notes
        -----
        The exact solution can be derived as follows, and is excluded for
        breviety.

        >>> from sympy import *
        >>> P, T, V = symbols('P, T, V')
        >>> Tc, Pc, omega = symbols('Tc, Pc, omega')
        >>> R, a, b, kappa = symbols('R, a, b, kappa')

        >>> a_alpha = a*(1 + kappa*(1-sqrt(T/Tc)))**2
        >>> PR_formula = R*T/(V-b) - a_alpha/(V*(V+b)+b*(V-b)) - P
        >>> #solve(PR_formula, T)


Tc, a, b, kappa0, kappa1 = self.Tc, self.a, self.b, self.kappa0, self.kappa1<EOL>if quick:<EOL><INDENT>x0 = V - b<EOL>R_x0 = R/x0<EOL>x3 = (<NUM_LIT>*(V*(V + b) + b*x0))<EOL>x4 = <NUM_LIT>*kappa0<EOL>kappa110 = kappa1*<NUM_LIT><EOL>kappa17 = kappa1*<NUM_LIT><EOL>def to_solve(T):<EOL><INDENT>x1 = T/Tc<EOL>x2 = x1**<NUM_LIT:0.5><EOL>return (T*R_x0 - a*((x4 - (kappa110*x1 - kappa17)*(x2 + <NUM_LIT:1.>))*(x2 - <NUM_LIT:1.>) - <NUM_LIT>)**<NUM_LIT:2>/x3) - P<EOL><DEDENT><DEDENT>else:<EOL><INDENT>def to_solve(T):<EOL><INDENT>P_calc = R*T/(V - b) - a*((kappa0 + kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>))*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)**<NUM_LIT:2>/(V*(V + b) + b*(V - b))<EOL>return P_calc - P<EOL><DEDENT><DEDENT>return newton(to_solve, Tc*<NUM_LIT:0.5>)<EOL>

r'''Method to calculate `T` from a specified `P` and `V` for the PRSV
        EOS. Uses `Tc`, `a`, `b`, `kappa0`  and `kappa` as well, obtained from
        the class's namespace.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (somewhat faster) or
            individual formulas.

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

        Notes
        -----
        Not guaranteed to produce a solution. There are actually two solution,
        one much higher than normally desired; it is possible the solver could
        converge on this.


Tc, a, kappa0, kappa1 = self.Tc, self.a, self.kappa0, self.kappa1<EOL>if not full:<EOL><INDENT>return a*((kappa0 + kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT>))*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)**<NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>if quick:<EOL><INDENT>x1 = T/Tc<EOL>x2 = x1**<NUM_LIT:0.5><EOL>x3 = x2 - <NUM_LIT:1.><EOL>x4 = <NUM_LIT>*x1 - <NUM_LIT><EOL>x5 = x2 + <NUM_LIT:1.><EOL>x6 = <NUM_LIT>*kappa0 - kappa1*x4*x5<EOL>x7 = x3*x6<EOL>x8 = x7*<NUM_LIT:0.1> - <NUM_LIT:1.><EOL>x10 = x6/T<EOL>x11 = kappa1*x3<EOL>x12 = x4/T<EOL>x13 = <NUM_LIT>/Tc*x5 + x12*x2<EOL>x14 = -x10*x2 + x11*x13<EOL>a_alpha = a*x8*x8<EOL>da_alpha_dT = -a*x14*x8*<NUM_LIT:0.1><EOL>d2a_alpha_dT2 = a*(x14*x14 - x2/T*(x7 - <NUM_LIT>)*(<NUM_LIT>*kappa1*x13 + x10 + x11*(<NUM_LIT>/Tc - x12)))/<NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>a_alpha = a*((kappa0 + kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT>))*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)**<NUM_LIT:2><EOL>da_alpha_dT = a*((kappa0 + kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT>))*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)*(<NUM_LIT:2>*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)/Tc + kappa1*sqrt(T/Tc)*(-T/Tc + <NUM_LIT>)/(<NUM_LIT:2>*T)) - sqrt(T/Tc)*(kappa0 + kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT>))/T)<EOL>d2a_alpha_dT2 = a*((kappa1*(sqrt(T/Tc) - <NUM_LIT:1>)*(<NUM_LIT:20>*(sqrt(T/Tc) + <NUM_LIT:1>)/Tc + sqrt(T/Tc)*(<NUM_LIT:10>*T/Tc - <NUM_LIT:7>)/T) - sqrt(T/Tc)*(<NUM_LIT:10>*kappa0 - kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)*(<NUM_LIT:10>*T/Tc - <NUM_LIT:7>))/T)**<NUM_LIT:2> - sqrt(T/Tc)*((<NUM_LIT:10>*kappa0 - kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)*(<NUM_LIT:10>*T/Tc - <NUM_LIT:7>))*(sqrt(T/Tc) - <NUM_LIT:1>) - <NUM_LIT:10>)*(kappa1*(<NUM_LIT>/Tc - (<NUM_LIT:10>*T/Tc - <NUM_LIT:7>)/T)*(sqrt(T/Tc) - <NUM_LIT:1>) + <NUM_LIT:2>*kappa1*(<NUM_LIT:20>*(sqrt(T/Tc) + <NUM_LIT:1>)/Tc + sqrt(T/Tc)*(<NUM_LIT:10>*T/Tc - <NUM_LIT:7>)/T) + (<NUM_LIT:10>*kappa0 - kappa1*(sqrt(T/Tc) + <NUM_LIT:1>)*(<NUM_LIT:10>*T/Tc - <NUM_LIT:7>))/T)/T)/<NUM_LIT:200><EOL><DEDENT>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Uses the set values of `Tc`, `kappa0`, `kappa1`, and
        `a`.

        For use in root-finding, returns only `a_alpha` if full is False.

        The `a_alpha` function is shown below; its first and second derivatives
        are long available through the SymPy expression under it.

        .. math::
            a\alpha = a \left(\left(\kappa_{0} + \kappa_{1} \left(\sqrt{\frac{
            T}{Tc}} + 1\right) \left(- \frac{T}{Tc} + \frac{7}{10}\right)
            \right) \left(- \sqrt{\frac{T}{Tc}} + 1\right) + 1\right)^{2}

        >>> from sympy import *
        >>> P, T, V = symbols('P, T, V')
        >>> Tc, Pc, omega = symbols('Tc, Pc, omega')
        >>> R, a, b, kappa0, kappa1 = symbols('R, a, b, kappa0, kappa1')
        >>> kappa = kappa0 + kappa1*(1 + sqrt(T/Tc))*(Rational(7, 10)-T/Tc)
        >>> a_alpha = a*(1 + kappa*(1-sqrt(T/Tc)))**2
        >>> # diff(a_alpha, T)
        >>> # diff(a_alpha, T, 2)


<EOL><INDENT>return super(PR, self).solve_T(P, V, quick=quick) <EOL><DEDENT>Tc, a, b, kappa0, kappa1, kappa2, kappa3 = self.Tc, self.a, self.b, self.kappa0, self.kappa1, self.kappa2, self.kappa3<EOL>if quick:<EOL><INDENT>x0 = V - b<EOL>R_x0 = R/x0<EOL>x5 = (<NUM_LIT>*(V*(V + b) + b*x0))<EOL>x4 = <NUM_LIT>*kappa0<EOL>def to_solve(T):<EOL><INDENT>x1 = T/Tc<EOL>x2 = x1**<NUM_LIT:0.5><EOL>x3 = x2 - <NUM_LIT:1.><EOL>return (R_x0*T - a*(x3*(x4 - (kappa1 + kappa2*x3*(-kappa3 + x1))*(<NUM_LIT>*x1 - <NUM_LIT>)*(x2 + <NUM_LIT:1.>)) - <NUM_LIT>)**<NUM_LIT:2>/x5) - P<EOL><DEDENT><DEDENT>else:<EOL><INDENT>def to_solve(T):<EOL><INDENT>P_calc = R*T/(V - b) - a*((kappa0 + (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>))*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)**<NUM_LIT:2>/(V*(V + b) + b*(V - b))<EOL>return P_calc - P<EOL><DEDENT><DEDENT>return newton(to_solve, Tc*<NUM_LIT:0.5>)<EOL>

r'''Method to calculate `T` from a specified `P` and `V` for the PRSV2
        EOS. Uses `Tc`, `a`, `b`, `kappa0`, `kappa1`, `kappa2`, and `kappa3`
        as well, obtained from the class's namespace.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (somewhat faster) or
            individual formulas.

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

        Notes
        -----
        Not guaranteed to produce a solution. There are actually 8 solutions,
        six with an imaginary component at a tested point. The two temperature
        solutions are quite far apart, with one much higher than the other;
        it is possible the solver could converge on the higher solution, so use
        `T` inputs with care. This extra solution is a perfectly valid one
        however.


Tc, a, kappa0, kappa1, kappa2, kappa3 = self.Tc, self.a, self.kappa0, self.kappa1, self.kappa2, self.kappa3<EOL>if not full:<EOL><INDENT>Tr = T/Tc<EOL>kappa = kappa0 + ((kappa1 + kappa2*(kappa3 - Tr)*(<NUM_LIT:1> - Tr**<NUM_LIT:0.5>))*(<NUM_LIT:1> + Tr**<NUM_LIT:0.5>)*(<NUM_LIT> - Tr))<EOL>return a*(<NUM_LIT:1> + kappa*(<NUM_LIT:1>-sqrt(T/Tc)))**<NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>if quick:<EOL><INDENT>x1 = T/Tc<EOL>x2 = sqrt(x1)<EOL>x3 = x2 - <NUM_LIT:1.><EOL>x4 = x2 + <NUM_LIT:1.><EOL>x5 = <NUM_LIT>*x1 - <NUM_LIT><EOL>x6 = -kappa3 + x1<EOL>x7 = kappa1 + kappa2*x3*x6<EOL>x8 = x5*x7<EOL>x9 = <NUM_LIT>*kappa0 - x4*x8<EOL>x10 = x3*x9<EOL>x11 = x10*<NUM_LIT:0.1> - <NUM_LIT:1.><EOL>x13 = x2/T<EOL>x14 = x7/Tc<EOL>x15 = kappa2*x4*x5<EOL>x16 = <NUM_LIT>*(-x2 + <NUM_LIT:1.>)/Tc + x13*(kappa3 - x1)<EOL>x17 = -x13*x8 - x14*(<NUM_LIT>*x2 + <NUM_LIT>) + x15*x16<EOL>x18 = x13*x9 + x17*x3<EOL>x19 = x2/(T*T)<EOL>x20 = <NUM_LIT>*x2/T<EOL>a_alpha = a*x11*x11<EOL>da_alpha_dT = a*x11*x18*<NUM_LIT:0.1><EOL>d2a_alpha_dT2 = a*(x18*x18 + (x10 - <NUM_LIT>)*(x17*x20 - x19*x9 + x3*(<NUM_LIT>*kappa2/Tc*x16*x4 + kappa2*x16*x20*x5 - <NUM_LIT>/T*x14*x2 - x15/T*x2*(<NUM_LIT>/Tc - x6/T) + x19*x8)))/<NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>a_alpha = a*(<NUM_LIT:1> + self.kappa*(<NUM_LIT:1>-sqrt(T/Tc)))**<NUM_LIT:2><EOL>da_alpha_dT = a*((kappa0 + (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>))*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)*(<NUM_LIT:2>*(-sqrt(T/Tc) + <NUM_LIT:1>)*((sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)*(-kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)/Tc - kappa2*sqrt(T/Tc)*(-T/Tc + kappa3)/(<NUM_LIT:2>*T)) - (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)/Tc + sqrt(T/Tc)*(kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)/(<NUM_LIT:2>*T)) - sqrt(T/Tc)*(kappa0 + (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>))/T)<EOL>d2a_alpha_dT2 = a*((kappa0 + (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>))*(-sqrt(T/Tc) + <NUM_LIT:1>) + <NUM_LIT:1>)*(<NUM_LIT:2>*(-sqrt(T/Tc) + <NUM_LIT:1>)*((sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)*(kappa2*sqrt(T/Tc)/(T*Tc) + kappa2*sqrt(T/Tc)*(-T/Tc + kappa3)/(<NUM_LIT:4>*T**<NUM_LIT:2>)) - <NUM_LIT:2>*(sqrt(T/Tc) + <NUM_LIT:1>)*(-kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)/Tc - kappa2*sqrt(T/Tc)*(-T/Tc + kappa3)/(<NUM_LIT:2>*T))/Tc + sqrt(T/Tc)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)*(-kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)/Tc - kappa2*sqrt(T/Tc)*(-T/Tc + kappa3)/(<NUM_LIT:2>*T))/T - sqrt(T/Tc)*(kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))/(T*Tc) - sqrt(T/Tc)*(kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)/(<NUM_LIT:4>*T**<NUM_LIT:2>)) - <NUM_LIT:2>*sqrt(T/Tc)*((sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)*(-kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)/Tc - kappa2*sqrt(T/Tc)*(-T/Tc + kappa3)/(<NUM_LIT:2>*T)) - (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)/Tc + sqrt(T/Tc)*(kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)/(<NUM_LIT:2>*T))/T + sqrt(T/Tc)*(kappa0 + (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>))/(<NUM_LIT:2>*T**<NUM_LIT:2>)) + a*((-sqrt(T/Tc) + <NUM_LIT:1>)*((sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)*(-kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)/Tc - kappa2*sqrt(T/Tc)*(-T/Tc + kappa3)/(<NUM_LIT:2>*T)) - (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)/Tc + sqrt(T/Tc)*(kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)/(<NUM_LIT:2>*T)) - sqrt(T/Tc)*(kappa0 + (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>))/(<NUM_LIT:2>*T))*(<NUM_LIT:2>*(-sqrt(T/Tc) + <NUM_LIT:1>)*((sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)*(-kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)/Tc - kappa2*sqrt(T/Tc)*(-T/Tc + kappa3)/(<NUM_LIT:2>*T)) - (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)/Tc + sqrt(T/Tc)*(kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>)/(<NUM_LIT:2>*T)) - sqrt(T/Tc)*(kappa0 + (kappa1 + kappa2*(-sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + kappa3))*(sqrt(T/Tc) + <NUM_LIT:1>)*(-T/Tc + <NUM_LIT:7>/<NUM_LIT:10>))/T)<EOL><DEDENT>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Uses the set values of `Tc`, `kappa0`, `kappa1`,
        `kappa2`, `kappa3`, and `a`.

        For use in `solve_T`, returns only `a_alpha` if full is False.

        The first and second derivatives of `a_alpha` are available through the
        following SymPy expression.

        >>> from sympy import *
        >>> P, T, V = symbols('P, T, V')
        >>> Tc, Pc, omega = symbols('Tc, Pc, omega')
        >>> R, a, b, kappa0, kappa1, kappa2, kappa3 = symbols('R, a, b, kappa0, kappa1, kappa2, kappa3')
        >>> Tr = T/Tc
        >>> kappa = kappa0 + (kappa1 + kappa2*(kappa3-Tr)*(1-sqrt(Tr)))*(1+sqrt(Tr))*(Rational('0.7')-Tr)
        >>> a_alpha = a*(1 + kappa*(1-sqrt(T/Tc)))**2
        >>> # diff(a_alpha, T)
        >>> # diff(a_alpha, T, 2)


if not full:<EOL><INDENT>return self.a<EOL><DEDENT>else:<EOL><INDENT>a_alpha = self.a<EOL>da_alpha_dT = <NUM_LIT:0.0><EOL>d2a_alpha_dT2 = <NUM_LIT:0.0><EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Uses the set values of `a`.

        .. math::
            a\alpha = a

            \frac{d a\alpha}{dT} = 0

            \frac{d^2 a\alpha}{dT^2} = 0


return (P*V**<NUM_LIT:2>*(V - self.b) + V*self.a - self.a*self.b)/(R*V**<NUM_LIT:2>)<EOL>

r'''Method to calculate `T` from a specified `P` and `V` for the VDW
        EOS. Uses `a`, and `b`, obtained from the class's namespace.

        .. math::
            T =  \frac{1}{R V^{2}} \left(P V^{2} \left(V - b\right)
            + V a - a b\right)

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]

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


@staticmethod<EOL><INDENT>def main_derivatives_and_departures(T, P, V, b, delta, epsilon, a_alpha,<EOL>da_alpha_dT, d2a_alpha_dT2, quick=True):<DEDENT>

dP_dT = R/(V - b)<EOL>dP_dV = -R*T/(V - b)**<NUM_LIT:2> + <NUM_LIT:2>*a_alpha/V**<NUM_LIT:3><EOL>d2P_dT2 = <NUM_LIT:0><EOL>d2P_dV2 = <NUM_LIT:2>*(R*T/(V - b)**<NUM_LIT:3> - <NUM_LIT:3>*a_alpha/V**<NUM_LIT:4>)<EOL>d2P_dTdV = -R/(V - b)**<NUM_LIT:2><EOL>H_dep = P*V - R*T - a_alpha/V<EOL>S_dep = R*(-log(V) + log(V - b)) + R*log(P*V/(R*T))<EOL>Cv_dep = <NUM_LIT:0><EOL>return [dP_dT, dP_dV, d2P_dT2, d2P_dV2, d2P_dTdV, H_dep, S_dep, Cv_dep]<EOL>

Re-implementation of derivatives and excess property calculations,
        as ZeroDivisionError errors occur with the general solution. The
        following derivation is the source of these formulas.

        >>> from sympy import *
        >>> P, T, V, R, b, a = symbols('P, T, V, R, b, a')
        >>> P_vdw = R*T/(V-b) - a/(V*V)
        >>> vdw = P_vdw - P
        >>>
        >>> dP_dT = diff(vdw, T)
        >>> dP_dV = diff(vdw, V)
        >>> d2P_dT2 = diff(vdw, T, 2)
        >>> d2P_dV2 = diff(vdw, V, 2)
        >>> d2P_dTdV = diff(vdw, T, V)
        >>> H_dep = integrate(T*dP_dT - P_vdw, (V, oo, V))
        >>> H_dep += P*V - R*T
        >>> S_dep = integrate(dP_dT - R/V, (V,oo,V))
        >>> S_dep += R*log(P*V/(R*T))
        >>> Cv_dep = T*integrate(d2P_dT2, (V,oo,V))
        >>>
        >>> dP_dT, dP_dV, d2P_dT2, d2P_dV2, d2P_dTdV, H_dep, S_dep, Cv_dep
        (R/(V - b), -R*T/(V - b)**2 + 2*a/V**3, 0, 2*(R*T/(V - b)**3 - 3*a/V**4), -R/(V - b)**2, P*V - R*T - a/V, R*(-log(V) + log(V - b)) + R*log(P*V/(R*T)), 0)


a_alpha = self.a*T**-<NUM_LIT:0.5><EOL>if not full:<EOL><INDENT>return a_alpha<EOL><DEDENT>else:<EOL><INDENT>da_alpha_dT = -<NUM_LIT:0.5>*self.a*T**(-<NUM_LIT>)<EOL>d2a_alpha_dT2 = <NUM_LIT>*self.a*T**(-<NUM_LIT>)<EOL>return a_alpha, da_alpha_dT, d2a_alpha_dT2<EOL><DEDENT>

r'''Method to calculate `a_alpha` and its first and second
        derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Uses the set values of `a`.

        .. math::
            a\alpha = \frac{a}{\sqrt{T}}

            \frac{d a\alpha}{dT} = - \frac{a}{2 T^{\frac{3}{2}}}

            \frac{d^2 a\alpha}{dT^2} = \frac{3 a}{4 T^{\frac{5}{2}}}