polykin.copolymerization¤
monomer_drift_binary ¤
monomer_drift_binary(
f10: Union[float, FloatVectorLike],
x: FloatVectorLike,
r1: float,
r2: float,
atol: float = 0.0001,
rtol: float = 0.0001,
method: Literal["LSODA", "RK45"] = "LSODA",
) -> FloatMatrix
Compute the monomer composition drift for a binary system.
In a closed binary system, the drift in monomer composition is given by the solution of the following differential equation:
with initial condition \(f_1(0)=f_{1,0}\), where \(f_1\) and \(F_1\) are, respectively, the instantaneous comonomer and copolymer composition of M1, and \(x\) is the total molar monomer conversion.
PARAMETER | DESCRIPTION |
---|---|
f10
|
Initial molar fraction of M1, \(f_{1,0}=f_1(0)\).
TYPE:
|
x
|
Total monomer conversion values where the drift is to be evaluated.
TYPE:
|
r1
|
Reactivity ratio of M1.
TYPE:
|
r2
|
Reactivity ratio of M2.
TYPE:
|
atol
|
Absolute tolerance of ODE solver.
TYPE:
|
rtol
|
Relative tolerance of ODE solver.
TYPE:
|
method
|
ODE solver.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatMatrix(M, N)
|
Monomer fraction of M1 at a given conversion, \(f_1(x)\). |
See also
monomer_drift_multi
: generic method for multicomponent systems.
Examples:
>>> from polykin.copolymerization import monomer_drift_binary
An example with f10 as scalar.
>>> f1 = monomer_drift_binary(f10=0.5, x=[0.1, 0.5, 0.9], r1=0.16, r2=0.70)
>>> f1
array([0.51026241, 0.57810678, 0.87768138])
An example with f10 as list.
>>> f1 = monomer_drift_binary(f10=[0.2, 0.8], x=[0.1, 0.5, 0.9],
... r1=0.16, r2=0.70)
>>> f1
array([[0.19841009, 0.18898084, 0.15854395],
[0.82315475, 0.94379024, 0.99996457]])
Source code in src/polykin/copolymerization/binary.py
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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|