Skip to content

polykin.thermo.acm¤

Wilson_gamma ¤

Wilson_gamma(
    x: FloatVector, Lambda: FloatSquareMatrix
) -> FloatVector

Calculate the activity coefficients of a multicomponent mixture according to the Wilson model.

\[ \ln{\gamma_i} = -\ln{\left(\displaystyle\sum_{j}{x_{j}\Lambda_{ij}}\right)} + 1 - \sum_{k}{\frac{x_{k}\Lambda_{ki}} {\displaystyle\sum_{j}{x_{j}\Lambda_{kj}}}} \]

where \(x_i\) are the mole fractions and \(\Lambda_{ij}\) are the interaction parameters.

References

  • G.M. Wilson, J. Am. Chem. Soc., 1964, 86, 127.
PARAMETER DESCRIPTION
x

Mole fractions of all components. Unit = mol/mol.

TYPE: FloatVector(N)

Lambda

Interaction parameters, \(\Lambda_{ij}\). It is expected (but not checked) that \(\Lambda_{ii}=1\).

TYPE: FloatSquareMatrix(N, N)

RETURNS DESCRIPTION
FloatVector(N)

Activity coefficients of all components.

See also
Source code in src/polykin/thermo/acm/wilson.py
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
def Wilson_gamma(x: FloatVector,
                 Lambda: FloatSquareMatrix
                 ) -> FloatVector:
    r"""Calculate the activity coefficients of a multicomponent mixture
    according to the Wilson model.

    $$ \ln{\gamma_i} = 
    -\ln{\left(\displaystyle\sum_{j}{x_{j}\Lambda_{ij}}\right)} + 1 -
    \sum_{k}{\frac{x_{k}\Lambda_{ki}}
    {\displaystyle\sum_{j}{x_{j}\Lambda_{kj}}}} $$

    where $x_i$ are the mole fractions and $\Lambda_{ij}$ are the interaction
    parameters.

    **References**

    *   G.M. Wilson, J. Am. Chem. Soc., 1964, 86, 127.

    Parameters
    ----------
    x : FloatVector (N)
        Mole fractions of all components. Unit = mol/mol.
    Lambda : FloatSquareMatrix (N,N)
        Interaction parameters, $\Lambda_{ij}$. It is expected (but not
        checked) that $\Lambda_{ii}=1$.

    Returns
    -------
    FloatVector (N)
        Activity coefficients of all components.

    See also
    --------
    * [`Wilson`](Wilson.md): related class.

    """
    A = dot(Lambda, x)
    return exp(1. - dot(x/A, Lambda))/A