Note
Go to the end to download the full example code.
Parallel (competing) first-order reactions#
For two competing channels \(A \xrightarrow{k_1} B\) and
\(A \xrightarrow{k_2} C\), the reactant decays with the sum
\(k_1 + k_2\), while the product ratio \([B]/[C] = k_1/k_2\) is
fixed at every instant – the kinetic basis of product selectivity.
Integrated with
parallel().
![Parallel channels: final [B]/[C] = 4.000 (k1/k2 = 4)](../../../../_images/sphx_glr_plot_05_parallel_reactions_001.png)
import matplotlib.pyplot as plt
import numpy as np
from chemistrykit.kinetics.systems.networks import StoichiometricNetwork
from chemistrykit.kinetics.visualizers.kinetics_plots import plot_concentration_vs_time
k1, k2 = 2.0, 0.5
net = StoichiometricNetwork.parallel(k1=k1, k2=k2, A0=1.0)
result = net.integrate((0.0, 4.0), dt=1e-3, method="rk4")
fig, ax = plt.subplots(figsize=(7, 5))
plot_concentration_vs_time(result, ax=ax)
ax.plot(result.t, np.exp(-(k1 + k2) * result.t), "k--", linewidth=0.8, label="exp(-(k1+k2)t)")
ax.legend()
ratio = result.concentration("B")[-1] / result.concentration("C")[-1]
ax.set_title(f"Parallel channels: final [B]/[C] = {ratio:.3f} (k1/k2 = {k1 / k2:g})")
fig.tight_layout()
plt.show()
Total running time of the script: (0 minutes 0.330 seconds)