Skip to content

polykin.copolymerization¤

inst_copolymer_ternary ¤

inst_copolymer_ternary(
    f1: float | FloatArrayLike,
    f2: float | FloatArrayLike,
    r12: float,
    r21: float,
    r13: float,
    r31: float,
    r23: float,
    r32: float,
) -> tuple[
    float | FloatArray,
    float | FloatArray,
    float | FloatArray,
]

Calculate the instantaneous copolymer composition for a ternary system.

In a ternary system, the instantaneous copolymer composition \(F_i\) is related to the monomer composition \(f_i\) by:

\[\begin{aligned} a &= \frac{f_1}{r_{21} r_{31}} + \frac{f_2}{r_{21} r_{32}} + \frac{f_3}{r_{31} r_{23}} \\ b &= f_1 + \frac{f_2}{r_{12}} + \frac{f_3}{r_{13}} \\ c &= \frac{f_1}{r_{12} r_{31}} + \frac{f_2}{r_{12} r_{32}} + \frac{f_3}{r_{13} r_{32}} \\ d &= f_2 + \frac{f_1}{r_{21}} + \frac{f_3}{r_{23}} \\ e &= \frac{f_1}{r_{13} r_{21}} + \frac{f_2}{r_{23} r_{12}} + \frac{f_3}{r_{13} r_{23}} \\ g &= f_3 + \frac{f_1}{r_{31}} + \frac{f_2}{r_{32}} \\ F_1 &= \frac{a b f_1}{a b f_1 + c d f_2 + e g f_3} \\ F_2 &= \frac{c d f_2}{a b f_1 + c d f_2 + e g f_3} \\ F_3 &= \frac{e g f_3}{a b f_1 + c d f_2 + e g f_3} \end{aligned}\]

where \(r_{ij}=k_{ii}/k_{ij}\) are the multicomponent reactivity ratios.

References

  • Kazemi, N., Duever, T.A. and Penlidis, A. (2014), Demystifying the estimation of reactivity ratios for terpolymerization systems. AIChE J., 60: 1752-1766.
PARAMETER DESCRIPTION
f1

Molar fraction of M1.

TYPE: float | FloatArrayLike

f2

Molar fraction of M2.

TYPE: float | FloatArrayLike

r12

Reactivity ratio.

TYPE: float

r21

Reactivity ratio.

TYPE: float

r13

Reactivity ratio.

TYPE: float

r31

Reactivity ratio.

TYPE: float

r23

Reactivity ratio.

TYPE: float

r32

Reactivity ratio.

TYPE: float

RETURNS DESCRIPTION
tuple[float | FloatArray, ...]

Instantaneous terpolymer composition, \((F_1, F_2, F_3)\).

See Also

Examples:

>>> from polykin.copolymerization import inst_copolymer_ternary
>>> F1, F2, F3 = inst_copolymer_ternary(f1=0.5, f2=0.3, r12=0.2, r21=2.3,
...                                     r13=3.0, r31=0.9, r23=0.4, r32=1.5)
>>> print(f"F1 = {F1:.2f}; F2 = {F2:.2f}; F3 = {F3:.2f}")
F1 = 0.32; F2 = 0.41; F3 = 0.27
Source code in src/polykin/copolymerization/multicomponent.py
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
def inst_copolymer_ternary(
    f1: float | FloatArrayLike,
    f2: float | FloatArrayLike,
    r12: float,
    r21: float,
    r13: float,
    r31: float,
    r23: float,
    r32: float,
) -> tuple[float | FloatArray, float | FloatArray, float | FloatArray]:
    r"""Calculate the instantaneous copolymer composition for a ternary system.

    In a ternary system, the instantaneous copolymer composition $F_i$ is
    related to the monomer composition $f_i$ by:

    \begin{aligned}
        a &= \frac{f_1}{r_{21} r_{31}} + \frac{f_2}{r_{21} r_{32}} +
             \frac{f_3}{r_{31} r_{23}} \\
        b &= f_1 + \frac{f_2}{r_{12}} + \frac{f_3}{r_{13}} \\
        c &= \frac{f_1}{r_{12} r_{31}} + \frac{f_2}{r_{12} r_{32}} +
             \frac{f_3}{r_{13} r_{32}} \\
        d &= f_2 + \frac{f_1}{r_{21}} + \frac{f_3}{r_{23}} \\
        e &= \frac{f_1}{r_{13} r_{21}} + \frac{f_2}{r_{23} r_{12}} +
             \frac{f_3}{r_{13} r_{23}} \\
        g &= f_3 + \frac{f_1}{r_{31}} + \frac{f_2}{r_{32}} \\
        F_1 &= \frac{a b f_1}{a b f_1 + c d f_2 + e g f_3} \\
        F_2 &= \frac{c d f_2}{a b f_1 + c d f_2 + e g f_3} \\
        F_3 &= \frac{e g f_3}{a b f_1 + c d f_2 + e g f_3}
    \end{aligned}

    where $r_{ij}=k_{ii}/k_{ij}$ are the multicomponent reactivity ratios.

    **References**

    *   Kazemi, N., Duever, T.A. and Penlidis, A. (2014), Demystifying the
    estimation of reactivity ratios for terpolymerization systems. AIChE J.,
    60: 1752-1766.

    Parameters
    ----------
    f1 : float | FloatArrayLike
        Molar fraction of M1.
    f2 : float | FloatArrayLike
        Molar fraction of M2.
    r12 : float
        Reactivity ratio.
    r21 : float
        Reactivity ratio.
    r13 : float
        Reactivity ratio.
    r31 : float
        Reactivity ratio.
    r23 : float
        Reactivity ratio.
    r32 : float
        Reactivity ratio.

    Returns
    -------
    tuple[float | FloatArray, ...]
        Instantaneous terpolymer composition, $(F_1, F_2, F_3)$.

    See Also
    --------
    * [`inst_copolymer_binary`](inst_copolymer_binary.md):
      specific method for binary systems.
    * [`inst_copolymer_multi`](inst_copolymer_multi.md):
      generic method for multicomponent systems.

    Examples
    --------
    >>> from polykin.copolymerization import inst_copolymer_ternary
    >>> F1, F2, F3 = inst_copolymer_ternary(f1=0.5, f2=0.3, r12=0.2, r21=2.3,
    ...                                     r13=3.0, r31=0.9, r23=0.4, r32=1.5)
    >>> print(f"F1 = {F1:.2f}; F2 = {F2:.2f}; F3 = {F3:.2f}")
    F1 = 0.32; F2 = 0.41; F3 = 0.27
    """
    f1 = np.asarray(f1, dtype=np.float64)
    f2 = np.asarray(f2, dtype=np.float64)

    f3 = 1.0 - (f1 + f2)

    a = f1 / (r21 * r31) + f2 / (r21 * r32) + f3 / (r31 * r23)
    b = f1 + f2 / r12 + f3 / r13
    c = f1 / (r12 * r31) + f2 / (r12 * r32) + f3 / (r13 * r32)
    d = f2 + f1 / r21 + f3 / r23
    e = f1 / (r13 * r21) + f2 / (r23 * r12) + f3 / (r13 * r23)
    g = f3 + f1 / r31 + f2 / r32

    denominator = f1 * a * b + f2 * c * d + f3 * e * g

    F1 = f1 * a * b / denominator
    F2 = f2 * c * d / denominator
    F3 = 1.0 - (F1 + F2)

    return (F1, F2, F3)