Skip to content

polykin.properties.pvt¤

quadratic_mixing ¤

quadratic_mixing(
    y: FloatVector, Q: FloatSquareMatrix
) -> float

Calculate a mixture parameter using a quadratic mixing rule.

\[ Q_m = \sum_i \sum_j y_i y_j Q_{ij} \]

Note

For the sake of generality, no assumptions are made regarding the symmetry of \(Q_{ij}\). The full matrix must be supplied and will be used as given.

References

  • RC Reid, JM Prausniz, and BE Poling. The properties of gases & liquids 4th edition, 1986, p. 75.
PARAMETER DESCRIPTION
y

Composition, usually molar or mass fractions.

TYPE: FloatVector

Q

Matrix of pure component and interaction parameters.

TYPE: FloatSquareMatrix

RETURNS DESCRIPTION
float

Mixture parameter, \(Q_m\). Unit = [Q].

Source code in src/polykin/properties/pvt/mixing_rules.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
def quadratic_mixing(y: FloatVector,
                     Q: FloatSquareMatrix
                     ) -> float:
    r"""Calculate a mixture parameter using a quadratic mixing rule.

    $$ Q_m = \sum_i \sum_j y_i y_j Q_{ij} $$

    !!! note

        For the sake of generality, no assumptions are made regarding the
        symmetry of $Q_{ij}$. The _full_ matrix must be supplied and will be
        used as given.

    **References**

    *   RC Reid, JM Prausniz, and BE Poling. The properties of gases & liquids
        4th edition, 1986, p. 75.

    Parameters
    ----------
    y : FloatVector
        Composition, usually molar or mass fractions.
    Q : FloatSquareMatrix
        Matrix of pure component and interaction parameters.

    Returns
    -------
    float
        Mixture parameter, $Q_m$. Unit = [Q].
    """
    return dot(y, dot(y, Q))