Usage Hints

Catalyst

TikhonovFenichelReductions.jl can use reaction networks defined with Catalyst.jl as input as of version v0.2.7. Note, that this is implemented as an extension and is therefore only supported by Julia 1.9+ (this prevents unnecessary precompilation when Catalyst.jl is not loaded).

Here is an example:

using Catalyst
using TikhonovFenichelReductions

# define enzyme kinetics as reaction network
rn = @reaction_network begin
  @parameters e₀ k₁ k₋₁ k₂
  @species S(t) C(t)
  k₁*e₀, S --> C
  k₁, S+C --> 2S
  k₋₁, C --> S
  k₂, C --> 0
end

# Make `ReductionProblem`
problem_catalyst = ReductionProblem(rn, 1)
ReductionProblem for dimension s = 1
 x = [S, C]
 p = [e₀, k₁, k₋₁, k₂]
 ODE system:
  dS/dt = -e₀*k₁*S + k₁*S*C + k₋₁*C
  dC/dt = e₀*k₁*S - k₁*S*C - k₋₁*C - k₂*C

LaTeX

All of the print_... functions can be used with the keyword latex=true to produce LaTeX code (this relies on Latexify.jl internally). The output strings can also be written to arbitrary IO streams, which allows to write directly to a file (e.g. to include the ODE definition from a main.tex).

print_system(problem_catalyst; latex=true)
\[
\begin{aligned}
\frac{dS}{dt} &=  - e_0 k_1 S + k_1 S C + k_{- 1} C\\
\frac{dC}{dt} &= e_0 k_1 S - k_1 S C - k_{- 1} C - k_2 C\\
\end{aligned}
\]