Kinetic Models & Rate Matrices#

The Bilinear Model#

Every model in PyRATE-TA produces a concentration matrix \(\mathbf{C}\) of shape \(N_{\text{delays}} \times N_{\text{components}}\). The data matrix is then bilinear:

\[\mathbf{D} \;\approx\; \mathbf{C}\,\mathbf{S}^{\mathsf{T}}\]

with \(\mathbf{S}\) of shape \(N_{\text{pixels}} \times N_{\text{components}}\) holding the component spectra. The kinetics enter only through \(\mathbf{C}\), and the spectra only through \(\mathbf{S}\); this separation is what makes global analysis tractable via Variable Projection (Global, Target & Lifetime Density Analysis (LDA)).

Model Families#

Model Families and the Meaning of the Resulting Spectra#

ModelType

Scheme

Spectra Obtained

Parallel

Independent exponential decays

DAS (Decay-Associated Spectra)

Sequential

Unbranched chain \(A \to B \to C \to \cdots\)

EAS (Evolution-Associated Spectra)

Target

General \(\mathbf{K}\) with branching / equilibria

SAS (Species-Associated Spectra)

The distinction is fundamental:

  • A parallel model makes no claim about connectivity, and its DAS are linear combinations of the true species spectra.

  • A sequential model assumes a single irreversible chain, and its EAS are the spectra of the successive evolving states.

  • Only a target model with an explicitly justified rate matrix \(\mathbf{K}\) yields the true SAS of actual chemical species.

Parallel and Sequential Models#

For a parallel model with lifetimes \(\tau_i\):

\[C_{ni} = \exp\!\left(-t_n / \tau_i\right)\]

For a sequential model, the concentration profiles follow the analytic solution of the unbranched chain (a sum of exponentials weighted by \(\prod_{j \ne i}(\tau_i^{-1} - \tau_j^{-1})^{-1}\)). Both are special cases of the general rate-matrix propagator below.

Rate Matrices (\(\mathbf{K}\)) & Degeneracy Handling#

A target model is defined by its rate matrix \(\mathbf{K}\), with off-diagonal element \(K_{ij}\) the rate from compartment \(j\) to compartment \(i\) and the diagonal the negative sum of all rates leaving that compartment. The populations obey:

\[\frac{\mathrm{d}\mathbf{c}(t)}{\mathrm{d}t} = \mathbf{K}\,\mathbf{c}(t), \qquad \mathbf{c}(0) = \mathbf{c}_0 \quad\Longrightarrow\quad \mathbf{c}(t) = \exp(\mathbf{K} t)\,\mathbf{c}_0\]

\(\mathbf{K}\) is built explicitly and \(\mathbf{C}\) is obtained by eigendecomposition where \(\mathbf{K}\) is diagonalisable, and by a matrix-exponential propagator otherwise.

  • Exactly degenerate lifetimes: When two rates coincide, \(\mathbf{K}\) is defective and the eigenvector matrix is singular, even though the kinetics are smooth (e.g. \(c_B = k t e^{-kt}\) for \(A \to B \to\) with equal rates). PyRATE-TA splits exact degeneracy via an antisymmetric diagonal perturbation of relative size \(10^{-6}\) so an optimiser can pass smoothly through equal lifetimes without aborting.

  • Near-degenerate lifetimes: When two fitted lifetimes approach within degeneracy_warn_ratio (default 1.2), the eigenvector matrix becomes ill-conditioned (manifesting as compensating component spectra of opposite sign). PyRATE-TA logs an explicit warning when this threshold is crossed.

Predefined Schemes & Writing Reaction Schemes in Text#

Branched schemes are kept in pyrate_ta.models.TARGET_SCHEMES (including equilibria A_eq_B, chains with equilibria A_eq_B_to_C / A_eq_B_eq_C, branchings branch_to_common_D, and parallel chains two_chains_decaying_ends):

import pyrate_ta as pr

model = pr.make_model("Target", scheme="A_eq_B_to_C")
C = model.concentrations(t, taus=[2.0, 5.0, 20.0, 200.0], irf_fwhm=0.15)

Custom target models are written directly as chemical reactions using scheme_from_text():

A  ->  B   : k1          # irreversible step
B <->  C   : k2, k3      # equilibrium (forward, backward)
C  ->      : k4          # decay to ground state
init A = 1               # optional initial populations

Every reaction contributes \(-k\) to the reactant’s diagonal and \(+k\) to the product’s row, guaranteeing mass conservation:

  • Species are named: S1, ICT, T1 appear on the compartment diagram, in the lifetime table, and in the fit result.

  • Rates are named and shareable: Reusing the same rate symbol on two arrows constrains both channels to share a single fitted rate parameter.

  • Arbitrary topology: Chains, branches, equilibria, cycles, disconnected pools, and non-decaying photoproducts are supported, and scheme_to_text() round-trips the scheme back to text.

Scheme Diagrams#

pyrate_ta.plot_scheme() draws the horizontal compartment diagram of any model, scheme, or fit result: one node per compartment, one arrow per rate, the ground state positioned below, and equilibria drawn as opposed arrows labelled with rate symbols (\(k_1, k_2, \dots\)) or fitted lifetimes (rate_labels="value").

Instrument Response Function (IRF)#

The instrument response is convolved into \(\mathbf{C}\), not into the data. For exponential models convolved with a Gaussian IRF of width \(\sigma\) centred at \(t_0\), PyRATE-TA evaluates the analytical Exponentially Modified Gaussian (EMG):

\[\left(g \ast e^{-t/\tau}\right)(t) = \tfrac{1}{2}\exp\!\left(\frac{\sigma^{2}}{2\tau^{2}} - \frac{t-t_0}{\tau}\right) \operatorname{erfc}\!\left(\frac{1}{\sqrt{2}}\left(\frac{\sigma}{\tau} - \frac{t-t_0}{\sigma}\right)\right)\]

The three IRF handling modes are None (no IRF), Gaussian (analytical EMG), and Clip (drop delays below t_min).