Copolymerization (polykin.copolymerization)¤
This module implements methods and classes to model and analyze binary and multicomponent copolymerization systems.
CopoDataset_Ff
dataclass
¤
Dataclass for instantaneous copolymerization data of the form F(f).
Source code in src/polykin/copolymerization/copodataset.py
239 240 241 242 243 244 245 246 247 |
|
CopoDataset_Fx
dataclass
¤
Dataclass for drift copolymerization data of the form F1(x).
Source code in src/polykin/copolymerization/copodataset.py
262 263 264 265 266 267 268 269 270 271 |
|
CopoDataset_fx
dataclass
¤
Dataclass for drift copolymerization data of the form f1(x).
Source code in src/polykin/copolymerization/copodataset.py
250 251 252 253 254 255 256 257 258 259 |
|
CopoFitResult
dataclass
¤
Dataclass for copolymerization fit results.
ATTRIBUTE | DESCRIPTION |
---|---|
method |
Name of the fit method.
TYPE:
|
r1 |
Reactivity ratio of M1.
TYPE:
|
r2 |
Reactivity ratio of M2
TYPE:
|
alpha |
Significance level.
TYPE:
|
ci_r1 |
Confidence interval of r1.
TYPE:
|
ci_r2 |
Confidence interval of r2.
TYPE:
|
se_r1 |
Standard error of r1.
TYPE:
|
se_r2 |
Standard error of r2.
TYPE:
|
cov |
Scaled variance-covariance matrix.
TYPE:
|
plots |
Dictionary of plots.
TYPE:
|
M1 |
Name of M1.
TYPE:
|
M2 |
Name of M2.
TYPE:
|
Source code in src/polykin/copolymerization/fitting.py
35 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 |
|
DriftDataset ¤
Dataset of binary monomer drift copolymerization data.
Container for binary monomer drift copolymerization data, \(f_1\) vs \(x\).
PARAMETER | DESCRIPTION |
---|---|
M1
|
Name of M1.
TYPE:
|
M2
|
Name of M2.
TYPE:
|
x
|
Vector of total molar conversion, \(x\).
TYPE:
|
f1
|
Vector of monomer composition, \(f_1\).
TYPE:
|
sigma_x
|
Absolute standard deviation of \(x\).
TYPE:
|
sigma_f1
|
Absolute standard deviation of \(f_1\).
TYPE:
|
weight
|
Relative weight of dataset for fitting.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
name
|
Name of dataset.
TYPE:
|
source
|
Source of dataset.
TYPE:
|
Source code in src/polykin/copolymerization/copodataset.py
135 136 137 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 176 177 178 179 180 181 182 183 |
|
__init__ ¤
__init__(
M1: str,
M2: str,
x: FloatVectorLike,
f1: FloatVectorLike,
sigma_x: Union[float, FloatVectorLike] = 0.05,
sigma_f1: Union[float, FloatVectorLike] = 0.05,
weight: float = 1,
T: float = 298.0,
Tunit: Literal["C", "K"] = "K",
name: str = "",
source: str = "",
) -> None
Construct DriftDataset
with the given parameters.
Source code in src/polykin/copolymerization/copodataset.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
ImplicitPenultimateModel ¤
Implicit penultimate binary copolymerization model.
This model is a special case of the general (explicit) penultimate model, with a smaller number of independent parameters. As in the explicit version, the reactivity of a macroradical depends on the nature of the penultimate and terminal repeating units. A binary system is, thus, described by eight propagation reactions:
where \(k_{iii}\) are the homo-propagation rate coefficients and \(k_{ijk}\) are the cross-propagation coefficients. The six cross-propagation coefficients are specified via just four reactivity ratios, which are divided in two categories. There are two monomer reactivity ratios, which are defined as \(r_1=k_{111}/k_{112}=k_{211}/k_{212}\) and \(r_2=k_{222}/k_{221}=k_{122}/k_{121}\). Additionally, there are two radical reactivity ratios defined as \(s_1=k_{211}/k_{111}\) and \(s_2=k_{122}/k_{222}\). The latter influence the average propagation rate coefficient, but have no effect on the copolymer composition.
PARAMETER | DESCRIPTION |
---|---|
r1
|
Monomer reactivity ratio, \(r_1=k_{111}/k_{112}=k_{211}/k_{212}\).
TYPE:
|
r2
|
Monomer reactivity ratio, \(r_2=k_{222}/k_{221}=k_{122}/k_{121}\).
TYPE:
|
s1
|
Radical reactivity ratio, \(s_1=k_{211}/k_{111}\).
TYPE:
|
s2
|
Radical reactivity ratio, \(s_2=k_{122}/k_{222}\).
TYPE:
|
k1
|
Homopropagation rate coefficient of M1, \(k_1 \equiv k_{111}\).
TYPE:
|
k2
|
Homopropagation rate coefficient of M2, \(k_2 \equiv k_{222}\).
TYPE:
|
M1
|
Name of M1.
TYPE:
|
M2
|
Name of M2.
TYPE:
|
name
|
Name.
TYPE:
|
Source code in src/polykin/copolymerization/penultimate.py
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
F1 ¤
F1(
f1: Union[float, FloatArrayLike]
) -> Union[float, FloatArray]
Calculate the instantaneous copolymer composition, \(F_1\).
The calculation is handled by
inst_copolymer_binary
.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Instantaneous copolymer composition, \(F_1\). |
Source code in src/polykin/copolymerization/terminal.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
add_data ¤
add_data(
data: Union[CopoDataset, list[CopoDataset]]
) -> None
Add a copolymerization dataset for subsequent analysis.
PARAMETER | DESCRIPTION |
---|---|
data
|
Experimental dataset(s).
TYPE:
|
Source code in src/polykin/copolymerization/terminal.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
|
azeotrope
property
¤
azeotrope: Optional[float]
Calculate the azeotrope composition.
An azeotrope (i.e., a point where \(F_1=f_1\)) only exists if both reactivity ratios are smaller than unity. In that case, the azeotrope composition is given by:
where \(r_1\) and \(r_2\) are the reactivity ratios.
RETURNS | DESCRIPTION |
---|---|
float | None
|
If an azeotrope exists, it returns its composition in terms of \(f_1\). |
drift ¤
drift(
f10: Union[float, FloatVectorLike],
x: Union[float, FloatVectorLike],
) -> FloatArray
Calculate drift of comonomer composition in a closed system for a given total monomer conversion.
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
|
Value(s) of total monomer conversion values where the drift is to be evaluated.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatArray
|
Monomer fraction of M1 at a given conversion, \(f_1(x)\). |
Source code in src/polykin/copolymerization/terminal.py
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 |
|
from_Qe
classmethod
¤
from_Qe(
Qe1: tuple[float, float],
Qe2: tuple[float, float],
k1: Optional[Arrhenius] = None,
k2: Optional[Arrhenius] = None,
M1: str = "M1",
M2: str = "M2",
name: str = "",
) -> TerminalModel
Construct TerminalModel
from Q-e values.
Alternative constructor that takes the \(Q\)-\(e\) values of the monomers as primary input instead of the reactivity ratios.
The conversion from Q-e to r is handled by
convert_Qe_to_r
.
PARAMETER | DESCRIPTION |
---|---|
Qe1
|
Q-e values of M1.
TYPE:
|
Qe2
|
Q-e values of M2.
TYPE:
|
k1
|
Homopropagation rate coefficient of M1, \(k_1 \equiv k_{11}\).
TYPE:
|
k2
|
Homopropagation rate coefficient of M2, \(k_2 \equiv k_{22}\).
TYPE:
|
M1
|
Name of M1.
TYPE:
|
M2
|
Name of M2.
TYPE:
|
name
|
Name.
TYPE:
|
Source code in src/polykin/copolymerization/terminal.py
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
|
kii ¤
kii(
f1: Union[float, FloatArray],
T: float,
Tunit: Literal["C", "K"] = "K",
) -> tuple[
Union[float, FloatArray], Union[float, FloatArray]
]
Pseudo-homopropagation rate coefficients.
In the implicit penultimate model, the pseudohomopropagation rate coefficients depend on the instantaneous comonomer composition according to:
where \(r_i\) are the monomer reactivity ratios, \(s_i\) are the radical reactivity ratios, and \(k_{iii}\) are the homopropagation rate coefficients.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[float | FloatArray, float | FloatArray]
|
Tuple of pseudohomopropagation rate coefficients, (\(\bar{k}_{11}\), \(\bar{k}_{22}\)). |
Source code in src/polykin/copolymerization/penultimate.py
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
kp ¤
kp(
f1: Union[float, FloatArrayLike],
T: float,
Tunit: Literal["C", "K"] = "K",
) -> Union[float, FloatArray]
Calculate the average propagation rate coefficient, \(\bar{k}_p\).
The calculation is handled by
kp_average_binary
.
Note
This feature requires the attributes k11
and k22
to be defined.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Average propagation rate coefficient. Unit = L/(mol·s) |
Source code in src/polykin/copolymerization/terminal.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
plot ¤
plot(
kind: Literal["drift", "kp", "Mayo", "triads"],
show: Literal["auto", "all", "data", "model"] = "auto",
M: Literal[1, 2] = 1,
f0: Optional[Union[float, FloatVectorLike]] = None,
T: Optional[float] = None,
Tunit: Literal["C", "K"] = "K",
title: Optional[str] = None,
axes: Optional[Axes] = None,
return_objects: bool = False,
) -> Optional[tuple[Optional[Figure], Axes]]
Generate a plot of instantaneous copolymer composition, monomer composition drift, or average propagation rate coefficient.
PARAMETER | DESCRIPTION |
---|---|
kind
|
Kind of plot to be generated.
TYPE:
|
show
|
What informatation is to be plotted.
TYPE:
|
M
|
Index of the monomer to be used in input argument
TYPE:
|
f0
|
Initial monomer composition, \(f_i(0)\), as required for a monomer composition drift plot.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
title
|
Title of plot. If
TYPE:
|
axes
|
Matplotlib Axes object.
TYPE:
|
return_objects
|
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[Figure | None, Axes] | None
|
Figure and Axes objects if return_objects is |
Source code in src/polykin/copolymerization/terminal.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
|
ri ¤
ri(
_,
) -> tuple[
Union[float, FloatArray], Union[float, FloatArray]
]
Return the evaluated reactivity ratios at the given conditions.
Source code in src/polykin/copolymerization/terminal.py
585 586 587 588 |
|
sequence ¤
sequence(
f1: Union[float, FloatArrayLike],
k: Optional[Union[int, IntArrayLike]] = None,
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous sequence length probability or the number-average sequence length.
For a binary system, the probability of finding \(k\) consecutive units of monomer \(i\) in a chain is:
and the corresponding number-average sequence length is:
where \(P_{ii}\) is the transition probability \(i \rightarrow i\), which is a function of the monomer composition and the reactivity ratios.
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 177.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
k
|
Sequence length, i.e., number of consecutive units in a chain.
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
If |
Source code in src/polykin/copolymerization/terminal.py
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
|
transitions ¤
transitions(
f1: Union[float, FloatArrayLike]
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous transition probabilities.
For a binary system, the transition probabilities are given by:
where \(i,j=1,2, i \neq j\).
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 178.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
Transition probabilities, {'11': \(P_{11}\), '12': \(P_{12}\), ... }. |
Source code in src/polykin/copolymerization/terminal.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 |
|
triads ¤
triads(
f1: Union[float, FloatArrayLike]
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous triad fractions.
For a binary system, the triad fractions are given by:
where \(P_{ij}\) is the transition probability \(i \rightarrow j\) and \(F_i\) is the instantaneous copolymer composition.
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 179.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
Triad fractions, {'111': \(A_{111}\), '112': \(A_{112}\), '212': \(A_{212}\), ... }. |
Source code in src/polykin/copolymerization/terminal.py
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 |
|
MayoDataset ¤
Dataset of binary instantaneous copolymerization data.
Container for binary instantaneous copolymerization data, \(F_1\) vs \(f_1\), as usually obtained from low-conversion experiments.
PARAMETER | DESCRIPTION |
---|---|
M1
|
Name of M1.
TYPE:
|
M2
|
Name of M2.
TYPE:
|
f1
|
Vector of monomer composition, \(f_1\).
TYPE:
|
F1
|
Vector of instantaneous copolymer composition, \(F_1\).
TYPE:
|
sigma_f1
|
Absolute standard deviation of \(f_1\) (\(\sigma_{f_1} \equiv \sigma_{f_2}\)).
TYPE:
|
sigma_F1
|
Absolute standard deviation of \(F_1\) (\(\sigma_{F_1} \equiv \sigma_{F_2}\)).
TYPE:
|
weight
|
Relative weight of dataset for fitting.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
name
|
Name of dataset.
TYPE:
|
source
|
Source of dataset.
TYPE:
|
Source code in src/polykin/copolymerization/copodataset.py
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 132 |
|
__init__ ¤
__init__(
M1: str,
M2: str,
f1: FloatVectorLike,
F1: FloatVectorLike,
sigma_f1: Union[float, FloatVectorLike] = 0.01,
sigma_F1: Union[float, FloatVectorLike] = 0.05,
weight: float = 1,
T: float = 298.0,
Tunit: Literal["C", "K"] = "K",
name: str = "",
source: str = "",
) -> None
Construct MayoDataset
with the given parameters.
Source code in src/polykin/copolymerization/copodataset.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
PenultimateModel ¤
Penultimate binary copolymerization model.
According to this model, the reactivity of a macroradical depends on the nature of the penultimate and terminal repeating units. A binary system is, thus, described by eight propagation reactions:
where \(k_{iii}\) are the homo-propagation rate coefficients and \(k_{ijk}\) are the cross-propagation coefficients. The six cross-propagation coefficients are specified via an equal number of reactivity ratios, which are divided in two categories. There are four monomer reactivity ratios, defined as \(r_{11}=k_{111}/k_{112}\), \(r_{12}=k_{122}/k_{121}\), \(r_{21}=k_{211}/k_{212}\) and \(r_{22}=k_{222}/k_{221}\). Additionally, there are two radical reactivity ratios defined as \(s_1=k_{211}/k_{111}\) and \(s_2=k_{122}/k_{222}\). The latter influence the average propagation rate coefficient, but have no effect on the copolymer composition.
PARAMETER | DESCRIPTION |
---|---|
r11
|
Monomer reactivity ratio, \(r_{11}=k_{111}/k_{112}\).
TYPE:
|
r12
|
Monomer reactivity ratio, \(r_{12}=k_{122}/k_{121}\).
TYPE:
|
r21
|
Monomer reactivity ratio, \(r_{21}=k_{211}/k_{212}\).
TYPE:
|
r22
|
Monomer reactivity ratio, \(r_{22}=k_{222}/k_{221}\).
TYPE:
|
s1
|
Radical reactivity ratio, \(s_1=k_{211}/k_{111}\).
TYPE:
|
s2
|
Radical reactivity ratio, \(s_2=k_{122}/k_{222}\).
TYPE:
|
k1
|
Homopropagation rate coefficient of M1, \(k_1 \equiv k_{111}\).
TYPE:
|
k2
|
Homopropagation rate coefficient of M2, \(k_2 \equiv k_{222}\).
TYPE:
|
M1
|
Name of M1.
TYPE:
|
M2
|
Name of M2.
TYPE:
|
name
|
Name.
TYPE:
|
Source code in src/polykin/copolymerization/penultimate.py
26 27 28 29 30 31 32 33 34 35 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 132 133 134 135 136 137 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 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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
|
F1 ¤
F1(
f1: Union[float, FloatArrayLike]
) -> Union[float, FloatArray]
Calculate the instantaneous copolymer composition, \(F_1\).
The calculation is handled by
inst_copolymer_binary
.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Instantaneous copolymer composition, \(F_1\). |
Source code in src/polykin/copolymerization/terminal.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
add_data ¤
add_data(
data: Union[CopoDataset, list[CopoDataset]]
) -> None
Add a copolymerization dataset for subsequent analysis.
PARAMETER | DESCRIPTION |
---|---|
data
|
Experimental dataset(s).
TYPE:
|
Source code in src/polykin/copolymerization/terminal.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
|
azeotrope
property
¤
azeotrope: Optional[float]
Calculate the azeotrope composition.
RETURNS | DESCRIPTION |
---|---|
float | None
|
If an azeotrope exists, it returns its composition in terms of \(f_1\). |
drift ¤
drift(
f10: Union[float, FloatVectorLike],
x: Union[float, FloatVectorLike],
) -> FloatArray
Calculate drift of comonomer composition in a closed system for a given total monomer conversion.
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
|
Value(s) of total monomer conversion values where the drift is to be evaluated.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatArray
|
Monomer fraction of M1 at a given conversion, \(f_1(x)\). |
Source code in src/polykin/copolymerization/terminal.py
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 |
|
kii ¤
kii(
f1: Union[float, FloatArray],
T: float,
Tunit: Literal["C", "K"] = "K",
) -> tuple[
Union[float, FloatArray], Union[float, FloatArray]
]
Pseudohomopropagation rate coefficients.
In the penultimate model, the pseudohomopropagation rate coefficients depend on the instantaneous comonomer composition according to:
where \(r_{ij}\) are the monomer reactivity ratios, \(s_i\) are the radical reactivity ratios, and \(k_{iii}\) are the homopropagation rate coefficients.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[float | FloatArray, float | FloatArray]
|
Pseudohomopropagation rate coefficients, (\(\bar{k}_{11}\), \(\bar{k}_{22}\)). |
Source code in src/polykin/copolymerization/penultimate.py
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 |
|
kp ¤
kp(
f1: Union[float, FloatArrayLike],
T: float,
Tunit: Literal["C", "K"] = "K",
) -> Union[float, FloatArray]
Calculate the average propagation rate coefficient, \(\bar{k}_p\).
The calculation is handled by
kp_average_binary
.
Note
This feature requires the attributes k11
and k22
to be defined.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Average propagation rate coefficient. Unit = L/(mol·s) |
Source code in src/polykin/copolymerization/terminal.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
plot ¤
plot(
kind: Literal["drift", "kp", "Mayo", "triads"],
show: Literal["auto", "all", "data", "model"] = "auto",
M: Literal[1, 2] = 1,
f0: Optional[Union[float, FloatVectorLike]] = None,
T: Optional[float] = None,
Tunit: Literal["C", "K"] = "K",
title: Optional[str] = None,
axes: Optional[Axes] = None,
return_objects: bool = False,
) -> Optional[tuple[Optional[Figure], Axes]]
Generate a plot of instantaneous copolymer composition, monomer composition drift, or average propagation rate coefficient.
PARAMETER | DESCRIPTION |
---|---|
kind
|
Kind of plot to be generated.
TYPE:
|
show
|
What informatation is to be plotted.
TYPE:
|
M
|
Index of the monomer to be used in input argument
TYPE:
|
f0
|
Initial monomer composition, \(f_i(0)\), as required for a monomer composition drift plot.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
title
|
Title of plot. If
TYPE:
|
axes
|
Matplotlib Axes object.
TYPE:
|
return_objects
|
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[Figure | None, Axes] | None
|
Figure and Axes objects if return_objects is |
Source code in src/polykin/copolymerization/terminal.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
|
ri ¤
ri(
f1: Union[float, FloatArray]
) -> tuple[
Union[float, FloatArray], Union[float, FloatArray]
]
Pseudoreactivity ratios.
In the penultimate model, the pseudoreactivity ratios depend on the instantaneous comonomer composition according to:
where \(r_{ij}\) are the monomer reactivity ratios.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[FloatOrArray, FloatOrArray]
|
Pseudoreactivity ratios, (\(\bar{r}_1\), \(\bar{r}_2\)). |
Source code in src/polykin/copolymerization/penultimate.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
sequence ¤
sequence(
f1: Union[float, FloatArrayLike],
k: Optional[Union[int, IntArrayLike]] = None,
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous sequence length probability or the number-average sequence length.
For a binary system, the probability of finding \(k\) consecutive units of monomer \(i\) in a chain is:
and the corresponding number-average sequence length is:
where \(P_{ijk}\) is the transition probability \(i \rightarrow j \rightarrow k\), which is a function of the monomer composition and the reactivity ratios.
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 180.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
k
|
Sequence length, i.e., number of consecutive units in a chain.
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
If |
Source code in src/polykin/copolymerization/penultimate.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
|
transitions ¤
transitions(
f1: Union[float, FloatArrayLike]
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous transition probabilities.
For a binary system, the transition probabilities are given by:
where \(i,j=1,2, i \neq j\).
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 181.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
Transition probabilities, {'111': \(P_{111}\), '211': \(P_{211}\), '121': \(P_{121}\), ... }. |
Source code in src/polykin/copolymerization/penultimate.py
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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
triads ¤
triads(
f1: Union[float, FloatArrayLike]
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous triad fractions.
For a binary system, the triad fractions are given by:
where \(P_{ijk}\) is the transition probability \(i \rightarrow j \rightarrow k\), which is a function of the monomer composition and the reactivity ratios.
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 181.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
Triad fractions, {'111': \(F_{111}\), '112': \(F_{112}\), '212': \(F_{212}\), ... }. |
Source code in src/polykin/copolymerization/penultimate.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
TerminalModel ¤
Terminal binary copolymerization model.
According to this model, the reactivity of a macroradical depends uniquely on the nature of the terminal repeating unit. A binary system is, thus, described by four propagation reactions:
where \(k_{ii}\) are the homopropagation rate coefficients and \(k_{ij}\) are the cross-propagation coefficients. The two cross-propagation coefficients are specified via an equal number of reactivity ratios, defined as \(r_1=k_{11}/k_{12}\) and \(r_2=k_{22}/k_{21}\).
PARAMETER | DESCRIPTION |
---|---|
r1
|
Reactivity ratio of M1, \(r_1=k_{11}/k_{12}\).
TYPE:
|
r2
|
Reactivity ratio of M2, \(r_2=k_{22}/k_{21}\).
TYPE:
|
k1
|
Homopropagation rate coefficient of M1, \(k_1 \equiv k_{11}\).
TYPE:
|
k2
|
Homopropagation rate coefficient of M2, \(k_2 \equiv k_{22}\).
TYPE:
|
M1
|
Name of M1.
TYPE:
|
M2
|
Name of M2.
TYPE:
|
name
|
Name.
TYPE:
|
Source code in src/polykin/copolymerization/terminal.py
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
|
F1 ¤
F1(
f1: Union[float, FloatArrayLike]
) -> Union[float, FloatArray]
Calculate the instantaneous copolymer composition, \(F_1\).
The calculation is handled by
inst_copolymer_binary
.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Instantaneous copolymer composition, \(F_1\). |
Source code in src/polykin/copolymerization/terminal.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
add_data ¤
add_data(
data: Union[CopoDataset, list[CopoDataset]]
) -> None
Add a copolymerization dataset for subsequent analysis.
PARAMETER | DESCRIPTION |
---|---|
data
|
Experimental dataset(s).
TYPE:
|
Source code in src/polykin/copolymerization/terminal.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
|
azeotrope
property
¤
azeotrope: Optional[float]
Calculate the azeotrope composition.
An azeotrope (i.e., a point where \(F_1=f_1\)) only exists if both reactivity ratios are smaller than unity. In that case, the azeotrope composition is given by:
where \(r_1\) and \(r_2\) are the reactivity ratios.
RETURNS | DESCRIPTION |
---|---|
float | None
|
If an azeotrope exists, it returns its composition in terms of \(f_1\). |
drift ¤
drift(
f10: Union[float, FloatVectorLike],
x: Union[float, FloatVectorLike],
) -> FloatArray
Calculate drift of comonomer composition in a closed system for a given total monomer conversion.
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
|
Value(s) of total monomer conversion values where the drift is to be evaluated.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatArray
|
Monomer fraction of M1 at a given conversion, \(f_1(x)\). |
Source code in src/polykin/copolymerization/terminal.py
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 |
|
from_Qe
classmethod
¤
from_Qe(
Qe1: tuple[float, float],
Qe2: tuple[float, float],
k1: Optional[Arrhenius] = None,
k2: Optional[Arrhenius] = None,
M1: str = "M1",
M2: str = "M2",
name: str = "",
) -> TerminalModel
Construct TerminalModel
from Q-e values.
Alternative constructor that takes the \(Q\)-\(e\) values of the monomers as primary input instead of the reactivity ratios.
The conversion from Q-e to r is handled by
convert_Qe_to_r
.
PARAMETER | DESCRIPTION |
---|---|
Qe1
|
Q-e values of M1.
TYPE:
|
Qe2
|
Q-e values of M2.
TYPE:
|
k1
|
Homopropagation rate coefficient of M1, \(k_1 \equiv k_{11}\).
TYPE:
|
k2
|
Homopropagation rate coefficient of M2, \(k_2 \equiv k_{22}\).
TYPE:
|
M1
|
Name of M1.
TYPE:
|
M2
|
Name of M2.
TYPE:
|
name
|
Name.
TYPE:
|
Source code in src/polykin/copolymerization/terminal.py
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
|
kii ¤
kii(
_, T: float, Tunit: Literal["C", "K"] = "K"
) -> tuple[
Union[float, FloatArray], Union[float, FloatArray]
]
Return the evaluated homopropagation rate coefficients at the given conditions.
Source code in src/polykin/copolymerization/terminal.py
590 591 592 593 594 595 596 597 598 |
|
kp ¤
kp(
f1: Union[float, FloatArrayLike],
T: float,
Tunit: Literal["C", "K"] = "K",
) -> Union[float, FloatArray]
Calculate the average propagation rate coefficient, \(\bar{k}_p\).
The calculation is handled by
kp_average_binary
.
Note
This feature requires the attributes k11
and k22
to be defined.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Average propagation rate coefficient. Unit = L/(mol·s) |
Source code in src/polykin/copolymerization/terminal.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
plot ¤
plot(
kind: Literal["drift", "kp", "Mayo", "triads"],
show: Literal["auto", "all", "data", "model"] = "auto",
M: Literal[1, 2] = 1,
f0: Optional[Union[float, FloatVectorLike]] = None,
T: Optional[float] = None,
Tunit: Literal["C", "K"] = "K",
title: Optional[str] = None,
axes: Optional[Axes] = None,
return_objects: bool = False,
) -> Optional[tuple[Optional[Figure], Axes]]
Generate a plot of instantaneous copolymer composition, monomer composition drift, or average propagation rate coefficient.
PARAMETER | DESCRIPTION |
---|---|
kind
|
Kind of plot to be generated.
TYPE:
|
show
|
What informatation is to be plotted.
TYPE:
|
M
|
Index of the monomer to be used in input argument
TYPE:
|
f0
|
Initial monomer composition, \(f_i(0)\), as required for a monomer composition drift plot.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
title
|
Title of plot. If
TYPE:
|
axes
|
Matplotlib Axes object.
TYPE:
|
return_objects
|
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[Figure | None, Axes] | None
|
Figure and Axes objects if return_objects is |
Source code in src/polykin/copolymerization/terminal.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
|
ri ¤
ri(
_,
) -> tuple[
Union[float, FloatArray], Union[float, FloatArray]
]
Return the evaluated reactivity ratios at the given conditions.
Source code in src/polykin/copolymerization/terminal.py
585 586 587 588 |
|
sequence ¤
sequence(
f1: Union[float, FloatArrayLike],
k: Optional[Union[int, IntArrayLike]] = None,
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous sequence length probability or the number-average sequence length.
For a binary system, the probability of finding \(k\) consecutive units of monomer \(i\) in a chain is:
and the corresponding number-average sequence length is:
where \(P_{ii}\) is the transition probability \(i \rightarrow i\), which is a function of the monomer composition and the reactivity ratios.
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 177.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
k
|
Sequence length, i.e., number of consecutive units in a chain.
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
If |
Source code in src/polykin/copolymerization/terminal.py
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
|
transitions ¤
transitions(
f1: Union[float, FloatArrayLike]
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous transition probabilities.
For a binary system, the transition probabilities are given by:
where \(i,j=1,2, i \neq j\).
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 178.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
Transition probabilities, {'11': \(P_{11}\), '12': \(P_{12}\), ... }. |
Source code in src/polykin/copolymerization/terminal.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 |
|
triads ¤
triads(
f1: Union[float, FloatArrayLike]
) -> dict[str, Union[float, FloatArray]]
Calculate the instantaneous triad fractions.
For a binary system, the triad fractions are given by:
where \(P_{ij}\) is the transition probability \(i \rightarrow j\) and \(F_i\) is the instantaneous copolymer composition.
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 179.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, float | FloatArray]
|
Triad fractions, {'111': \(A_{111}\), '112': \(A_{112}\), '212': \(A_{212}\), ... }. |
Source code in src/polykin/copolymerization/terminal.py
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 |
|
convert_Qe_to_r ¤
convert_Qe_to_r(
Qe_values: list[tuple[float, float]]
) -> FloatSquareMatrix
Convert Q-e values to reactivity ratios.
According to the Q-e scheme proposed by Alfrey and Price, the reactivity ratios of the terminal model can be estimated using the relationship:
where \(Q_i\) and \(e_i\) are monomer-specific constants, and \(r_{ij}=k_{ii}/k_{ij}\) is the multicomponent reactivity ratio matrix.
References
- T Alfrey, CC Price. J. Polym. Sci., 1947, 2: 101-106.
PARAMETER | DESCRIPTION |
---|---|
Qe_values
|
List (N) of Q-e values.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatSquareMatrix(N, N)
|
Reactivity ratio matrix. |
Examples:
Estimate the reactivity ratio matrix for styrene (1), methyl methacrylate (2), and vinyl acetate(3) using Q-e values from the literature.
>>> from polykin.copolymerization import convert_Qe_to_r
>>>
>>> Qe1 = (1.0, -0.80) # Sty
>>> Qe2 = (0.78, 0.40) # MMA
>>> Qe3 = (0.026, -0.88) # VAc
>>>
>>> convert_Qe_to_r([Qe1, Qe2, Qe3])
array([[1.00000000e+00, 4.90888315e-01, 4.10035538e+01],
[4.82651046e-01, 1.00000000e+00, 1.79788736e+01],
[2.42325444e-02, 1.08066091e-02, 1.00000000e+00]])
Source code in src/polykin/copolymerization/multicomponent.py
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 |
|
fit_Finemann_Ross ¤
fit_Finemann_Ross(
f1: FloatVectorLike, F1: FloatVectorLike
) -> tuple[float, float]
Fit binary copolymer composition data using the Finemann-Ross method.
where \(x = f_1/(1 - f_1)\), \(y = F_1/(1 - F_1)\), \(r_i\) are the reactivity ratios, \(f_1\) is the monomer composition, and \(F_1\) is the instantaneous copolymer composition.
Reference
- Fineman, M.; Ross, S. D. J. Polymer Sci. 1950, 5, 259.
Note
The Finemann-Ross method relies on a linearization procedure that can lead to significant statistical bias. The method is provided for its historical significance, but should no longer be used for fitting reactivity ratios.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Vector of molar fraction of M1, \(f_1\).
TYPE:
|
F1
|
Vector of instantaneous copolymer composition of M1, \(F_1\).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[float, float]
|
Point estimates of the reactivity ratios \((r_1, r_2)\). |
See also
fit_copo_data
: alternative (recommended) method.
Examples:
>>> from polykin.copolymerization.fitting import fit_Finemann_Ross
>>>
>>> f1 = [0.186, 0.299, 0.527, 0.600, 0.700, 0.798]
>>> F1 = [0.196, 0.279, 0.415, 0.473, 0.542, 0.634]
>>>
>>> r1, r2 = fit_Finemann_Ross(f1, F1)
>>> print(f"r1={r1:.2f}, r2={r2:.2f}")
r1=0.27, r2=0.84
Source code in src/polykin/copolymerization/fitting.py
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 132 133 134 135 136 137 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 |
|
fit_copo_data ¤
fit_copo_data(
data_Ff: list[CopoDataset_Ff] = [],
data_fx: list[CopoDataset_fx] = [],
data_Fx: list[CopoDataset_Fx] = [],
r_guess: tuple[float, float] = (1.0, 1.0),
method: Literal["NLLS", "ODR"] = "NLLS",
alpha: float = 0.05,
plot_data: bool = True,
JCR_linear: bool = True,
JCR_exact: bool = False,
JCR_npoints: int = 200,
JCR_rtol: float = 0.01,
) -> CopoFitResult
Fit copolymer composition data and estimate reactivity ratios.
This function employs rigorous nonlinear algorithms to estimate the reactivity ratios from experimental copolymer composition data of type \(F(f)\), \(f(x;f_0)\), and \(F(x,f_0)\).
The fitting is performed using one of two methods: nonlinear least squares (NLLS) or orthogonal distance regression (ODR). NLLS considers only observational errors in the dependent variable, whereas ODR takes into account observational errors in both the dependent and independent variables. Although the ODR method is statistically more general, it is also more complex and can (at present) only be used for fitting \(F(f)\) data. Whenever composition drift data is provided, NLLS must be utilized.
The joint confidence region (JCR) of the reactivity ratios is generated using approximate (linear) and/or exact methods. In most cases, the linear method should be sufficiently accurate. Nonetheless, for these types of fits, the exact method is computationally inexpensive, making it perhaps a preferable choice.
Reference
- Van Herk, A.M. and Dröge, T. (1997), Nonlinear least squares fitting applied to copolymerization modeling. Macromol. Theory Simul., 6: 1263-1276.
- Boggs, Paul T., et al. "Algorithm 676: ODRPACK: software for weighted orthogonal distance regression." ACM Transactions on Mathematical Software (TOMS) 15.4 (1989): 348-364.
PARAMETER | DESCRIPTION |
---|---|
data_Ff
|
F(f) instantaneous composition datasets.
TYPE:
|
data_fx
|
f(x) composition drift datasets.
TYPE:
|
data_Fx
|
F(x) composition drift datasets
TYPE:
|
r_guess
|
Initial guess for the reactivity ratios.
TYPE:
|
method
|
Optimization method.
TYPE:
|
alpha
|
Significance level.
TYPE:
|
plot_data
|
If
TYPE:
|
JCR_linear
|
If
TYPE:
|
JCR_exact
|
If
TYPE:
|
JCR_npoints
|
Number of points where the JCR is evaluated. The computational effort
increases linearly with
TYPE:
|
JCR_rtol
|
Relative tolerance for the determination of the JCR. The default value (1e-2) should be adequate in most cases, as it implies a 1% accuracy in the JCR coordinates.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
CopoFitResult
|
Dataclass with all fit results. |
See also
confidence_ellipse
: linear method used to calculate the joint confidence region.confidence_region
: exact method used to calculate the joint confidence region.fit_Finemann_Ross
: alternative method.
Source code in src/polykin/copolymerization/fitting.py
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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
|
inst_copolymer_binary ¤
inst_copolymer_binary(
f1: Union[float, FloatArrayLike],
r1: Union[float, FloatArray],
r2: Union[float, FloatArray],
) -> Union[float, FloatArray]
Calculate the instantaneous copolymer composition using the Mayo-Lewis equation.
For a binary system, the instantaneous copolymer composition \(F_i\) is related to the comonomer composition \(f_i\) by:
where \(r_i\) are the reactivity ratios. Although the equation is written using terminal model notation, it is equally applicable in the frame of the penultimate model if \(r_i \rightarrow \bar{r}_i\).
References
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
r1
|
Reactivity ratio of M1, \(r_1\) or \(\bar{r}_1\).
TYPE:
|
r2
|
Reactivity ratio of M2, \(r_2\) or \(\bar{r}_2\).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Instantaneous copolymer composition, \(F_1\). |
See also
inst_copolymer_ternary
: specific method for terpolymer systems.inst_copolymer_multi
: generic method for multicomponent systems.
Examples:
>>> from polykin.copolymerization import inst_copolymer_binary
An example with f1 as scalar.
>>> F1 = inst_copolymer_binary(f1=0.5, r1=0.16, r2=0.70)
>>> print(f"F1 = {F1:.3f}")
F1 = 0.406
An example with f1 as list.
>>> F1 = inst_copolymer_binary(f1=[0.2, 0.6, 0.8], r1=0.16, r2=0.70)
>>> F1
array([0.21487603, 0.45812808, 0.58259325])
Source code in src/polykin/copolymerization/binary.py
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 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 |
|
inst_copolymer_multi ¤
inst_copolymer_multi(
f: Optional[FloatVectorLike],
r: Optional[FloatSquareMatrix],
P: Optional[FloatSquareMatrix] = None,
) -> FloatVector
Calculate the instantaneous copolymer composition for a multicomponent system.
In a multicomponent system, the instantaneous copolymer composition \(F_i\) can be determined by solving the following set of linear algebraic equations:
where \(P_{ij}\) are the transition probabilitites, which can be computed from the instantaneous monomer composition and the reactivity matrix.
References
- H. K. Frensdorff, R. Pariser; Copolymerization as a Markov Chain. J. Chem. Phys. 1 November 1963; 39 (9): 2303-2309.
PARAMETER | DESCRIPTION |
---|---|
f
|
Vector of instantaneous monomer compositions, \(f_i\).
TYPE:
|
r
|
Matrix of reactivity ratios, \(r_{ij}=k_{ii}/k_{ij}\).
TYPE:
|
P
|
Matrix of transition probabilities, \(P_{ij}\). If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatVector(N)
|
Vector of instantaneous copolymer compositions, \(F_i\). |
See also
inst_copolymer_binary
: specific method for binary systems.inst_copolymer_ternary
: specific method for terpolymer systems.monomer_drift_multi
: monomer composition drift.transitions_multi
: instantaneous transition probabilities.
Examples:
>>> from polykin.copolymerization import inst_copolymer_multi
>>> import numpy as np
Define the reactivity ratio matrix.
>>> r = np.ones((3, 3))
>>> r[0, 1] = 0.2
>>> r[1, 0] = 2.3
>>> r[0, 2] = 3.0
>>> r[2, 0] = 0.9
>>> r[1, 2] = 0.4
>>> r[2, 1] = 1.5
Evaluate the instantaneous copolymer composition at f1=0.5, f2=0.3, f3=0.2.
>>> f = [0.5, 0.3, 0.2]
>>> F = inst_copolymer_multi(f, r)
>>> F
array([0.32138111, 0.41041608, 0.26820282])
Source code in src/polykin/copolymerization/multicomponent.py
129 130 131 132 133 134 135 136 137 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 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 |
|
inst_copolymer_ternary ¤
inst_copolymer_ternary(
f1: Union[float, FloatArrayLike],
f2: Union[float, FloatArrayLike],
r12: float,
r21: float,
r13: float,
r31: float,
r23: float,
r32: float,
) -> tuple[
Union[float, FloatArray],
Union[float, FloatArray],
Union[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:
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:
|
f2
|
Molar fraction of M2.
TYPE:
|
r12
|
Reactivity ratio.
TYPE:
|
r21
|
Reactivity ratio.
TYPE:
|
r13
|
Reactivity ratio.
TYPE:
|
r31
|
Reactivity ratio.
TYPE:
|
r23
|
Reactivity ratio.
TYPE:
|
r32
|
Reactivity ratio.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[float | FloatArray, ...]
|
Instantaneous terpolymer composition, \((F_1, F_2, F_3)\). |
See also
inst_copolymer_binary
: specific method for binary systems.inst_copolymer_multi
: 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
Source code in src/polykin/copolymerization/multicomponent.py
29 30 31 32 33 34 35 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 |
|
kpDataset ¤
Dataset of average propagation rate coefficient data.
Container for average propagation rate coefficient as a function of monomer composition, \(k_p\) vs \(f_1\).
PARAMETER | DESCRIPTION |
---|---|
M1
|
Name of M1.
TYPE:
|
M2
|
Name of M2.
TYPE:
|
f1
|
Vector of monomer composition, \(f_1\).
TYPE:
|
kp
|
Vector of average propagation rate coefficient, \(\bar{k}_p\). Unit = L/(mol·s).
TYPE:
|
sigma_f1
|
Absolute standard deviation of \(f_1\).
TYPE:
|
sigma_kp
|
Absolute standard deviation of \(\bar{k}_p\). Unit = L/(mol·s).
TYPE:
|
weight
|
Relative weight of dataset for fitting.
TYPE:
|
T
|
Temperature. Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
name
|
Name of dataset.
TYPE:
|
source
|
Source of dataset.
TYPE:
|
Source code in src/polykin/copolymerization/copodataset.py
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 231 232 233 234 235 236 |
|
__init__ ¤
__init__(
M1: str,
M2: str,
f1: FloatVectorLike,
kp: FloatVectorLike,
sigma_f1: Union[float, FloatVectorLike] = 0.05,
sigma_kp: Union[float, FloatVectorLike] = 100.0,
weight: float = 1,
T: float = 298.0,
Tunit: Literal["C", "K"] = "K",
name: str = "",
source: str = "",
) -> None
Construct DriftDataset
with the given parameters.
Source code in src/polykin/copolymerization/copodataset.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
kp_average_binary ¤
kp_average_binary(
f1: Union[float, FloatArrayLike],
r1: Union[float, FloatArray],
r2: Union[float, FloatArray],
k11: Union[float, FloatArray],
k22: Union[float, FloatArray],
) -> Union[float, FloatArray]
Calculate the average propagation rate coefficient in a copolymerization.
For a binary system, the instantaneous average propagation rate coefficient is related to the instantaneous comonomer composition by:
where \(f_i\) is the instantaneous comonomer composition of monomer \(i\), \(r_i\) are the reactivity ratios, and \(k_{ii}\) are the homo-propagation rate coefficients. Although the equation is written using terminal model notation, it is equally applicable in the frame of the penultimate model if \(r_i \rightarrow \bar{r}_i\) and \(k_{ii} \rightarrow \bar{k}_{ii}\).
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
r1
|
Reactivity ratio of M1, \(r_1\) or \(\bar{r}_1\).
TYPE:
|
r2
|
Reactivity ratio of M2, \(r_2\) or \(\bar{r}_2\).
TYPE:
|
k11
|
Propagation rate coefficient of M1, \(k_{11}\) or \(\bar{k}_{11}\). Unit = L/(mol·s)
TYPE:
|
k22
|
Propagation rate coefficient of M2, \(k_{22}\) or \(\bar{k}_{22}\). Unit = L/(mol·s)
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Average propagation rate coefficient. Unit = L/(mol·s) |
Examples:
>>> from polykin.copolymerization import kp_average_binary
An example with f1 as scalar.
>>> kp = kp_average_binary(f1=0.5, r1=0.16, r2=0.70, k11=100., k22=1000.)
>>> print(f"{kp:.0f} L/(mol·s)")
622 L/(mol·s)
An example with f1 as list.
>>> f1 = [0.2, 0.6, 0.8]
>>> kp = kp_average_binary(f1=f1, r1=0.16, r2=0.70, k11=100., k22=1000.)
>>> kp
array([880. , 523.87096774, 317.18309859])
Source code in src/polykin/copolymerization/binary.py
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 132 133 134 135 136 137 138 139 140 141 142 143 |
|
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 |
|
monomer_drift_multi ¤
monomer_drift_multi(
f0: FloatVectorLike,
x: FloatVectorLike,
r: FloatSquareMatrix,
atol: float = 0.0001,
rtol: float = 0.0001,
) -> FloatMatrix
Compute the monomer composition drift for a multicomponent system.
In a closed system, the drift in monomer composition is given by the solution of the following system of differential equations:
with initial condition \(f_i(0)=f_{i,0}\), where \(f_i\) and \(F_i\) are, respectively, the instantaneous comonomer and copolymer composition of monomer \(i\), and \(x\) is the total molar monomer conversion.
PARAMETER | DESCRIPTION |
---|---|
f0
|
Vector of initial instantaneous comonomer compositions.
TYPE:
|
x
|
Vector of total monomer conversion values where the drift is to be evaluated.
TYPE:
|
r
|
Matrix of reactivity ratios, \(r_{ij}=k_{ii}/k_{ij}\).
TYPE:
|
atol
|
Absolute tolerance of the ODE solver.
TYPE:
|
rtol
|
Relative tolerance of the ODE solver.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatMatrix(M, N)
|
Matrix of monomer fraction of monomer \(i\) at the specified total monomer conversions, \(f_i(x_j)\). |
See also
inst_copolymer_multi
: instantaneous copolymer composition.monomer_drift_multi
: specific method for binary systems.
Examples:
>>> from polykin.copolymerization import monomer_drift_multi
>>> import numpy as np
Define reactivity ratio matrix.
>>> r = np.ones((3, 3))
>>> r[0, 1] = 0.2
>>> r[1, 0] = 2.3
>>> r[0, 2] = 3.0
>>> r[2, 0] = 0.9
>>> r[1, 2] = 0.4
>>> r[2, 1] = 1.5
Evaluate monomer drift.
>>> f0 = [0.5, 0.3, 0.2]
>>> x = [0.1, 0.5, 0.9, 0.99]
>>> f = monomer_drift_multi(f0, x, r)
>>> f
array([[5.19272893e-01, 2.87851432e-01, 1.92875675e-01],
[6.38613228e-01, 2.04334321e-01, 1.57052451e-01],
[8.31122266e-01, 5.58847454e-03, 1.63289259e-01],
[4.98294381e-01, 1.22646553e-07, 5.01705497e-01]])
Source code in src/polykin/copolymerization/multicomponent.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
|
radical_fractions_multi ¤
radical_fractions_multi(
f: FloatVectorLike, k: FloatSquareMatrix
) -> FloatVector
Calculate the radical fractions for a multicomponent system.
In a multicomponent system, the radical fractions \(p_i\) can be determined by solving the following set of linear algebraic equations:
where \(k_{ij}\) are the cross-propagation rate coefficients and \(f_i\) are the monomer compositions. Note that the homo-propagation rate coefficients \(k_{ii}\) do not appear in the equations. For this reason, radical fractions cannot be evaluated from reactivity ratios alone.
PARAMETER | DESCRIPTION |
---|---|
f
|
Vector of instantaneous monomer compositions, \(f_i\).
TYPE:
|
k
|
Matrix of cross-propagation rate coefficients. The diagonal elements \(k_{ii}\) are not used.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatVector(N)
|
Vector of radical fractions, \(p_i\). |
See also
radical_fractions_ternary
: specific method for terpolymer systems.
Examples:
>>> from polykin.copolymerization import radical_fractions_multi
>>> import numpy as np
Define the cross-propagation coefficient matrix.
>>> k = np.zeros((3, 3))
>>> k[0, 1] = 500.
>>> k[1, 0] = 50.
>>> k[0, 2] = 30.
>>> k[2, 0] = 200.
>>> k[1, 2] = 300.
>>> k[2, 1] = 40.
Evaluate the radical fractions at f1=0.5, f2=0.3, f3=0.2.
>>> f = [0.5, 0.3, 0.2]
>>> p = radical_fractions_multi(f, k)
>>> p
array([0.25012791, 0.47956341, 0.27030868])
Source code in src/polykin/copolymerization/multicomponent.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
radical_fractions_ternary ¤
radical_fractions_ternary(
f1: Union[float, FloatArrayLike],
f2: Union[float, FloatArrayLike],
k12: float,
k21: float,
k13: float,
k31: float,
k23: float,
k32: float,
) -> tuple[
Union[float, FloatArray],
Union[float, FloatArray],
Union[float, FloatArray],
]
Calculate the radical fractions for a ternary system.
In a ternary system, the radical fractions \(p_i\) are related to the monomer composition \(f_i\) by:
where \(k_{ij}\) are the cross-propagation rate coefficients. Note that the homo-propagation rate coefficients \(k_{ii}\) do not appear in the equations. For this reason, radical fractions cannot be evaluated from reactivity ratios alone.
References
- Hamielec, A.E., MacGregor, J.F. and Penlidis, A. (1987), Multicomponent free-radical polymerization in batch, semi- batch and continuous reactors. Makromolekulare Chemie. Macromolecular Symposia, 10-11: 521-570.
PARAMETER | DESCRIPTION |
---|---|
f1
|
Molar fraction of M1.
TYPE:
|
f2
|
Molar fraction of M2.
TYPE:
|
k12
|
Propagation rate coefficient.
TYPE:
|
k21
|
Propagation rate coefficient.
TYPE:
|
k13
|
Propagation rate coefficient.
TYPE:
|
k31
|
Propagation rate coefficient.
TYPE:
|
k23
|
Propagation rate coefficient.
TYPE:
|
k32
|
Propagation rate coefficient.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[float | FloatArray, ...]
|
Radical fractions, \((p_1, p_2, p_3)\). |
See also
radical_fractions_multi
: generic method for multicomponent systems.
Examples:
>>> from polykin.copolymerization import radical_fractions_ternary
>>> p1, p2, p3 = radical_fractions_ternary(
... f1=0.5, f2=0.3, k12=500., k21=50.,
... k13=30., k31=200., k23=300., k32=40.)
>>> print(f"p1 = {p1:.2f}; p2 = {p2:.2f}; p3 = {p3:.2f}")
p1 = 0.25; p2 = 0.48; p3 = 0.27
Source code in src/polykin/copolymerization/multicomponent.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
|
sequence_multi ¤
sequence_multi(
Pself: FloatVectorLike,
k: Optional[Union[int, IntArrayLike]] = None,
) -> FloatArray
Calculate the instantaneous sequence length probability or the number-average sequence length.
For a multicomponent system, the probability of finding \(k\) consecutive units of monomer \(i\) in a chain is:
and the corresponding number-average sequence length is:
where \(P_{ii}\) is the self-transition probability \(i \rightarrow i\), which is a function of the monomer composition and the reactivity ratios.
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 177.
PARAMETER | DESCRIPTION |
---|---|
Pself
|
Vector of self-transition probabilities, \(P_{ii}\), corresponding to the diagonal of the matrix of transition probabilities.
TYPE:
|
k
|
Sequence length, i.e., number of consecutive units in a chain.
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatArray(N, M)
|
If |
See also
transitions_multi
: instantaneous transition probabilities.tuples_multi
: instantaneous tuple fractions.
Examples:
>>> from polykin.copolymerization import sequence_multi
>>> from polykin.copolymerization import transitions_multi
>>> import numpy as np
Define reactivity ratio matrix.
>>> r = np.ones((3, 3))
>>> r[0, 1] = 0.2
>>> r[1, 0] = 2.3
>>> r[0, 2] = 3.0
>>> r[2, 0] = 0.9
>>> r[1, 2] = 0.4
>>> r[2, 1] = 1.5
Evaluate self-transition probabilities.
>>> f = [0.5, 0.3, 0.2]
>>> Pself = transitions_multi(f, r).diagonal()
>>> Pself
array([0.24193548, 0.29487179, 0.20930233])
Evaluate number-average sequence lengths for all monomers.
>>> S = sequence_multi(Pself)
>>> S
array([1.31914894, 1.41818182, 1.26470588])
Evaluate probabilities for certain sequence lengths.
>>> S = sequence_multi(Pself, k=[1, 5])
>>> S
array([[0.75806452, 0.00259719],
[0.70512821, 0.00533091],
[0.79069767, 0.00151742]])
Source code in src/polykin/copolymerization/multicomponent.py
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 |
|
transitions_multi ¤
transitions_multi(
f: FloatVectorLike, r: FloatSquareMatrix
) -> FloatSquareMatrix
Calculate the instantaneous transition probabilities for a multicomponent system.
For a multicomponent system, the transition probabilities are given by:
where \(f_i\) is the molar fraction of monomer \(i\) and \(r_{ij}=k_{ii}/k_{ij}\) is the multicomponent reactivity ratio matrix.
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 178.
PARAMETER | DESCRIPTION |
---|---|
f
|
Vector of instantaneous monomer compositions, \(f_i\).
TYPE:
|
r
|
Matrix of reactivity ratios, \(r_{ij}=k_{ii}/k_{ij}\).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatSquareMatrix(N, N)
|
Matrix of transition probabilities, \(P_{ij}\). |
See also
inst_copolymer_multi
: instantaneous copolymer composition.sequence_multi
: instantaneous sequence lengths.tuples_multi
: instantaneous tuple fractions.
Examples:
>>> from polykin.copolymerization import transitions_multi
>>> import numpy as np
Define reactivity ratio matrix.
>>> r = np.ones((3, 3))
>>> r[0, 1] = 0.2
>>> r[1, 0] = 2.3
>>> r[0, 2] = 3.0
>>> r[2, 0] = 0.9
>>> r[1, 2] = 0.4
>>> r[2, 1] = 1.5
Evaluate transition probabilities.
>>> f = [0.5, 0.3, 0.2]
>>> P = transitions_multi(f, r)
>>> P
array([[0.24193548, 0.72580645, 0.03225806],
[0.21367521, 0.29487179, 0.49145299],
[0.58139535, 0.20930233, 0.20930233]])
Source code in src/polykin/copolymerization/multicomponent.py
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 |
|
tuples_multi ¤
tuples_multi(
P: FloatSquareMatrix,
n: int,
F: Optional[FloatVectorLike] = None,
) -> dict[tuple[int, ...], float]
Calculate the instantaneous n-tuple fractions.
For a multicomponent system, the probability of finding a specific sequence \(ijk \cdots rs\) of repeating units is:
where \(F_i\) is the instantaneous copolymer composition, and \(P_{ij}\) is the transition probability \(i \rightarrow j\). Since the direction of chain growth does not play a role, symmetric sequences are combined under the sequence with lower index (e.g., \(A_{112} \leftarrow A_{112} + A_{211}\)).
References
- NA Dotson, R Galván, RL Laurence, and M Tirrel. Polymerization process modeling, Wiley, 1996, p. 179.
PARAMETER | DESCRIPTION |
---|---|
P
|
Matrix of transition probabilities, \(P_{ij}\).
TYPE:
|
n
|
Tuple length, e.g. monads (1), diads (2), triads (3), etc.
TYPE:
|
F
|
Vector of instantaneous copolymer composition, \(F_i\). If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[tuple[int, ...], float]
|
Tuple of molar fractions. |
See also
sequence_multi
: instantaneous sequence lengths.transitions_multi
: instantaneous transition probabilities.
Examples:
>>> from polykin.copolymerization import tuples_multi
>>> from polykin.copolymerization import transitions_multi
>>> import numpy as np
Define reactivity ratio matrix.
>>> r = np.ones((3, 3))
>>> r[0, 1] = 0.2
>>> r[1, 0] = 2.3
>>> r[0, 2] = 3.0
>>> r[2, 0] = 0.9
>>> r[1, 2] = 0.4
>>> r[2, 1] = 1.5
Evaluate transition probabilities.
>>> f = [0.5, 0.3, 0.2]
>>> P = transitions_multi(f, r)
Evaluate triad fractions.
>>> A = tuples_multi(P, 3)
>>> A[(0, 0, 0)]
0.018811329044450834
>>> A[(1, 0, 1)]
0.06365013630778116
Source code in src/polykin/copolymerization/multicomponent.py
657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
|