Kinetics (polykin.kinetics)¤
This module implements methods to create and visualize the types of kinetic coefficients most often used in polymer reactor models.
Arrhenius ¤
Arrhenius kinetic rate coefficient.
This class implements the following temperature dependence:
where \(T_0\) is a reference temperature, \(E_a\) is the activation energy, and \(k_0=k(T_0)\). In the limit \(T\rightarrow+\infty\), the usual form of the Arrhenius equation with \(k_0=A\) is recovered.
PARAMETER | DESCRIPTION |
---|---|
k0
|
Coefficient value at the reference temperature, \(k_0=k(T_0)\).
Unit =
TYPE:
|
EaR
|
Energy of activation, \(E_a/R\). Unit = K.
TYPE:
|
T0
|
Reference temperature, \(T_0\). Unit = K.
TYPE:
|
Tmin
|
Lower temperature bound. Unit = K.
TYPE:
|
Tmax
|
Upper temperature bound. Unit = K.
TYPE:
|
unit
|
Unit of coefficient.
TYPE:
|
symbol
|
Symbol of coefficient \(k\).
TYPE:
|
name
|
Name.
TYPE:
|
See also
Eyring
: alternative method.
Examples:
Define and evaluate the propagation rate coefficient of styrene.
>>> from polykin.kinetics import Arrhenius
>>> kp = Arrhenius(
... 10**7.63, # pre-exponential factor
... 32.5e3/8.314, # Ea/R, K
... Tmin=261., Tmax=366.,
... symbol='k_p',
... unit='L/mol/s',
... name='kp of styrene')
>>> kp(25.,'C')
86.28385101961442
Source code in src/polykin/kinetics/arrhenius.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 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 |
|
__call__ ¤
__call__(
T: Union[float, FloatArrayLike],
Tunit: Literal["C", "K"] = "K",
) -> Union[float, FloatArray]
Evaluate property equation at given temperature, including unit conversion and range check.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature.
Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Correlation value. |
Source code in src/polykin/properties/equations/base.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
__mul__ ¤
__mul__(other: Union[int, float, Arrhenius]) -> Arrhenius
Multipy Arrhenius coefficient(s).
Create a new Arrhenius coefficient from a product of two Arrhenius coefficients with identical shapes or a product of an Arrhenius coefficient and a numerical constant.
PARAMETER | DESCRIPTION |
---|---|
other
|
Another Arrhenius coefficient or number.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Arrhenius
|
Product coefficient. |
Source code in src/polykin/kinetics/arrhenius.py
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 |
|
__pow__ ¤
__pow__(other: Union[int, float]) -> Arrhenius
Power of an Arrhenius coefficient.
Create a new Arrhenius coefficient from the exponentiation of an Arrhenius coefficient.
PARAMETER | DESCRIPTION |
---|---|
other
|
Exponent.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Arrhenius
|
Power coefficient. |
Source code in src/polykin/kinetics/arrhenius.py
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 |
|
__truediv__ ¤
__truediv__(
other: Union[int, float, Arrhenius]
) -> Arrhenius
Divide Arrhenius coefficient(s).
Create a new Arrhenius coefficient from a division of two Arrhenius coefficients with identical shapes or a division involving an Arrhenius coefficient and a numerical constant.
PARAMETER | DESCRIPTION |
---|---|
other
|
Another Arrhenius coefficient or number.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Arrhenius
|
Quotient coefficient. |
Source code in src/polykin/kinetics/arrhenius.py
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 |
|
equation
staticmethod
¤
equation(
T: Union[float, FloatArray],
k0: Union[float, FloatArray],
EaR: Union[float, FloatArray],
T0: Union[float, FloatArray],
) -> Union[float, FloatArray]
Arrhenius equation.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
k0
|
Coefficient value at the reference temperature, \(k_0=k(T_0)\). Unit = Any.
TYPE:
|
EaR
|
Energy of activation, \(E_a/R\). Unit = K.
TYPE:
|
T0
|
Reference temperature, \(T_0\). Unit = K.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Coefficient value. Unit = [k0]. |
Source code in src/polykin/kinetics/arrhenius.py
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 |
|
fit ¤
fit(
T: FloatVectorLike,
Y: FloatVectorLike,
sigmaY: Optional[FloatVectorLike] = None,
fit_only: Optional[list[str]] = None,
logY: bool = False,
plot: bool = True,
) -> dict
Fit equation to data using non-linear regression.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
Y
|
Property to be fitted. Unit = Any.
TYPE:
|
sigmaY
|
Standard deviation of Y. Unit = [Y].
TYPE:
|
fit_only
|
List with name of parameters to be fitted.
TYPE:
|
logY
|
If
TYPE:
|
plot
|
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
A dictionary of results with the following keys: 'success', 'parameters', 'covariance', and 'plot'. |
Source code in src/polykin/properties/equations/base.py
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 |
|
plot ¤
plot(
kind: Literal[
"linear", "semilogy", "Arrhenius"
] = "linear",
Trange: Optional[tuple[float, float]] = None,
Tunit: Literal["C", "K"] = "K",
title: Optional[str] = None,
axes: Optional[Axes] = None,
return_objects: bool = False,
) -> Optional[tuple[Optional[Figure], Axes]]
Plot quantity as a function of temperature.
PARAMETER | DESCRIPTION |
---|---|
kind
|
Kind of plot to be generated.
TYPE:
|
Trange
|
Temperature range for x-axis. If
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/properties/equations/base.py
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 |
|
Eyring ¤
Eyring kinetic rate coefficient.
This class implements the following temperature dependence:
where \(\kappa\) is the transmission coefficient, \(\Delta S^\ddagger\) is the entropy of activation, and \(\Delta H^\ddagger\) is the enthalpy of activation. The unit of \(k\) is physically set to s\(^{-1}\).
PARAMETER | DESCRIPTION |
---|---|
DSa
|
Entropy of activation, \(\Delta S^\ddagger\). Unit = J/(mol·K).
TYPE:
|
DHa
|
Enthalpy of activation, \(\Delta H^\ddagger\). Unit = J/mol.
TYPE:
|
kappa
|
Transmission coefficient.
TYPE:
|
Tmin
|
Lower temperature bound. Unit = K.
TYPE:
|
Tmax
|
Upper temperature bound. Unit = K.
TYPE:
|
symbol
|
Symbol of coefficient \(k\).
TYPE:
|
name
|
Name.
TYPE:
|
See also
Arrhenius
: alternative method.
Examples:
Define and evaluate a rate coefficient from transition state properties.
>>> from polykin.kinetics import Eyring
>>> k = Eyring(
... DSa=20.,
... DHa=5e4,
... kappa=0.8,
... Tmin=273., Tmax=373.,
... symbol='k',
... name='A->B')
>>> k(25.,'C')
95808.36742009166
Source code in src/polykin/kinetics/eyring.py
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 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 |
|
__call__ ¤
__call__(
T: Union[float, FloatArrayLike],
Tunit: Literal["C", "K"] = "K",
) -> Union[float, FloatArray]
Evaluate property equation at given temperature, including unit conversion and range check.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature.
Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Correlation value. |
Source code in src/polykin/properties/equations/base.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
equation
staticmethod
¤
equation(
T: Union[float, FloatArray],
DSa: Union[float, FloatArray],
DHa: Union[float, FloatArray],
kappa: Union[float, FloatArray],
) -> Union[float, FloatArray]
Eyring equation.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
DSa
|
Entropy of activation, \(\Delta S^\ddagger\). Unit = J/(mol·K).
TYPE:
|
DHa
|
Enthalpy of activation, \(\Delta H^\ddagger\). Unit = J/mol.
TYPE:
|
kappa
|
Transmission coefficient.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Coefficient value. Unit = 1/s. |
Source code in src/polykin/kinetics/eyring.py
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 |
|
fit ¤
fit(
T: FloatVectorLike,
Y: FloatVectorLike,
sigmaY: Optional[FloatVectorLike] = None,
fit_only: Optional[list[str]] = None,
logY: bool = False,
plot: bool = True,
) -> dict
Fit equation to data using non-linear regression.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
Y
|
Property to be fitted. Unit = Any.
TYPE:
|
sigmaY
|
Standard deviation of Y. Unit = [Y].
TYPE:
|
fit_only
|
List with name of parameters to be fitted.
TYPE:
|
logY
|
If
TYPE:
|
plot
|
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
A dictionary of results with the following keys: 'success', 'parameters', 'covariance', and 'plot'. |
Source code in src/polykin/properties/equations/base.py
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 |
|
plot ¤
plot(
kind: Literal[
"linear", "semilogy", "Arrhenius"
] = "linear",
Trange: Optional[tuple[float, float]] = None,
Tunit: Literal["C", "K"] = "K",
title: Optional[str] = None,
axes: Optional[Axes] = None,
return_objects: bool = False,
) -> Optional[tuple[Optional[Figure], Axes]]
Plot quantity as a function of temperature.
PARAMETER | DESCRIPTION |
---|---|
kind
|
Kind of plot to be generated.
TYPE:
|
Trange
|
Temperature range for x-axis. If
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/properties/equations/base.py
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 |
|
PropagationHalfLength ¤
Half-length model for the decay of the propagation rate coefficient with chain length.
This model implements the chain-length dependence:
where \(k_p=k_p(\infty)\) is the long-chain value of the propagation rate coefficient, \(C\ge 1\) is the ratio \(k_p(1)/k_p\) and \((i_{1/2}+1)\) is the hypothetical chain-length at which the difference \(k_p(1) - k_p\) is halved.
References
- Smith, Gregory B., et al. "The effects of chain length dependent propagation and termination on the kinetics of free-radical polymerization at low chain lengths." European polymer journal 41.2 (2005): 225-230.
PARAMETER | DESCRIPTION |
---|---|
kp
|
Long-chain value of the propagation rate coefficient, \(k_p\). |
C
|
Ratio of the propagation coefficients of a monomeric radical and a long-chain radical, \(C\).
TYPE:
|
ihalf
|
Half-length, \(i_{1/2}\).
TYPE:
|
name
|
Name.
TYPE:
|
Examples:
>>> from polykin.kinetics import PropagationHalfLength, Arrhenius
>>> kp = Arrhenius(
... 10**7.63, 32.5e3/8.314, Tmin=261., Tmax=366.,
... symbol='k_p', unit='L/mol/s', name='kp of styrene')
>>> kpi = PropagationHalfLength(kp, C=10, ihalf=0.5,
... name='kp(T,i) of styrene')
>>> kpi
name: kp(T,i) of styrene
C: 10
ihalf: 0.5
kp:
name: kp of styrene
symbol: k_p
unit: L/mol/s
Trange [K]: (261.0, 366.0)
k0 [L/mol/s]: 42657951.88015926
EaR [K]: 3909.0690401732018
T0 [K]: inf
>>> kpi(T=50., i=3, Tunit='C')
371.75986615653215
Source code in src/polykin/kinetics/cldpropagation.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 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 |
|
__call__ ¤
__call__(
T: Union[float, FloatArrayLike],
i: Union[int, IntArrayLike],
Tunit: Literal["C", "K"] = "K",
) -> Union[float, FloatArray]
Evaluate kinetic coefficient at given conditions, including unit conversion and range check.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature.
Unit =
TYPE:
|
i
|
Chain length of radical.
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Coefficient value. |
Source code in src/polykin/kinetics/cldpropagation.py
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 |
|
equation
staticmethod
¤
equation(
i: Union[int, IntArray],
kp: Union[float, FloatArray],
C: float,
ihalf: float,
) -> Union[float, FloatArray]
Half-length model chain-length dependence equation.
PARAMETER | DESCRIPTION |
---|---|
i
|
Chain length of radical.
TYPE:
|
kp
|
Long-chain value of the propagation rate coefficient, \(k_p\).
TYPE:
|
C
|
Ratio of the propagation coefficients of a monomeric radical and a long-chain radical, \(C\).
TYPE:
|
ihalf
|
Half-length, \(i_{i/2}\).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Coefficient value. |
Source code in src/polykin/kinetics/cldpropagation.py
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 |
|
TerminationCompositeModel ¤
Composite model for the termination rate coefficient between two radicals.
This model implements the chain-length dependence:
with:
where \(k_t(1,1)\) is the temperature-dependent termination rate coefficient between two monomeric radicals, \(i_{crit}\) is the critical chain length, \(\alpha_S\) is the short-chain exponent, and \(\alpha_L\) is the long-chain exponent.
References
- Smith, Gregory B., Gregory T. Russell, and Johan PA Heuts. "Termination in dilute-solution free-radical polymerization: a composite model." Macromolecular theory and simulations 12.5 (2003): 299-314.
PARAMETER | DESCRIPTION |
---|---|
kt11
|
Temperature-dependent termination rate coefficient between two monomeric radicals, \(k_t(1,1)\). |
icrit
|
Critical chain length, \(i_{crit}\).
TYPE:
|
aS
|
Short-chain exponent, \(\alpha_S\).
TYPE:
|
aL
|
Long-chain exponent, \(\alpha_L\).
TYPE:
|
name
|
Name.
TYPE:
|
Examples:
>>> from polykin.kinetics import TerminationCompositeModel, Arrhenius
>>> kt11 = Arrhenius(1e9, 2e3, T0=298.,
... symbol='k_t(T,1,1)', unit='L/mol/s', name='kt11 of Y')
>>> ktij = TerminationCompositeModel(kt11, icrit=30, name='ktij of Y')
>>> ktij
name: ktij of Y
icrit: 30
aS: 0.5
aL: 0.2
kt11:
name: kt11 of Y
symbol: k_t(T,1,1)
unit: L/mol/s
Trange [K]: (0.0, inf)
k0 [L/mol/s]: 1000000000.0
EaR [K]: 2000.0
T0 [K]: 298.0
>>> ktij(T=25., i=150, j=200, Tunit='C')
129008375.03821689
Source code in src/polykin/kinetics/cldtermination.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 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 |
|
__call__ ¤
__call__(
T: Union[float, FloatArrayLike],
i: Union[int, IntArrayLike],
j: Union[int, IntArrayLike],
Tunit: Literal["C", "K"] = "K",
) -> Union[float, FloatArray]
Evaluate kinetic coefficient at given conditions, including unit conversion and range check.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature.
Unit =
TYPE:
|
i
|
Chain length of 1st radical.
TYPE:
|
j
|
Chain length of 2nd radical.
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Coefficient value. |
Source code in src/polykin/kinetics/cldtermination.py
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 |
|
equation
staticmethod
¤
equation(
i: Union[int, IntArray],
j: Union[int, IntArray],
kt11: Union[float, FloatArray],
icrit: int,
aS: float,
aL: float,
) -> Union[float, FloatArray]
Composite model chain-length dependence equation.
PARAMETER | DESCRIPTION |
---|---|
i
|
Chain length of 1st radical.
TYPE:
|
j
|
Chain length of 2nd radical.
TYPE:
|
kt11
|
Temperature-dependent termination rate coefficient between two monomeric radicals, \(k_t(1,1)\).
TYPE:
|
icrit
|
Critical chain length, \(i_{crit}\).
TYPE:
|
aS
|
Short-chain exponent, \(\alpha_S\).
TYPE:
|
aL
|
Long-chain exponent, \(\alpha_L\).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Coefficient value. |
Source code in src/polykin/kinetics/cldtermination.py
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 |
|