Catalyst.jl
Chemical reaction network and systems biology interface for scientific machine learning (SciML). High performance, GPU-parallelized, and O(1) solvers in open source software.
Install / Use
/learn @SciML/Catalyst.jlREADME
Catalyst.jl
<!--[-blue.svg)](https://docs.sciml.ai/Catalyst/stable/api/) [-blue.svg)](https://docs.sciml.ai/Catalyst/dev/api/) [](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged)--> <!--[](https://codecov.io/gh/SciML/Catalyst.jl)-->Catalyst.jl is a symbolic modeling package for analysis and high-performance simulation of chemical reaction networks and related dynamical systems. Models can be specified using an intuitive domain-specific language (DSL) or constructed programmatically. Catalyst supports ODE, steady-state ODE, SDE, stochastic chemical kinetics (jump), and hybrid simulations, including models that couple reactions with differential equations, events, and external noise (via Brownian Motions and/or Poisson Processes).
Built on ModelingToolkitBase.jl and Symbolics.jl, Catalyst leverages symbolic computation for sparsity exploitation, Jacobian construction, dependency graph analysis, and parallelism. Generated models integrate with the broader Julia and SciML ecosystems for sensitivity analysis, parameter estimation, bifurcation analysis, and more.
Installation
Catalyst can be installed as follows.
using Pkg
# (optional but recommended) create new environment in which to install Catalyst
Pkg.activate("catalyst_environment")
# install latest Catalyst release
Pkg.add("Catalyst")
What's new in v16
Version 16 is a breaking release. Most breaking changes primarily affect libraries built on top of Catalyst. Please see HISTORY.md for the full list of breaking changes and migration guide.
Highlights:
- ModelingToolkitBase foundation — Without any reduction in core functionality, Catalyst now depends on ModelingToolkitBase instead of ModelingToolkit, to avoid adding new, non-MIT licensed dependencies.
- ModelingToolkit compatible - Catalyst is still compatible with ModelingToolkit for users who want to leverage more powerful, but non-MIT licensed, structural simplification libraries (e.g. for Catalyst-generated DAE models).
- Hybrid models — New
HybridProblemandhybrid_modelallow mixing ODE, SDE, and Jump reactions in a single system via per-reactionPhysicalScalemetadata. - Simplified jump API — Create jump problems directly with
JumpProblem(rs, u0, tspan, ps), with noDiscreteProblemorJumpInputsintermediate. - New DSL options —
@browniansand@poissoniansfor coupling environmental noise,@discretesfor event-modified parameters,@tstopsfor solver time stops, and=>syntax for event affects. - Modernized conversion API —
ode_model,sde_model,jump_model, andss_ode_modelreplace the oldconvert(ODESystem, rs)pattern, and all generate ModelingToolkitBaseSystems. - Unit validation —
@unit_checksDSL option andvalidate_units/assert_valid_unitsfunctions with full support for non-SI units via DynamicQuantities.jl symbolic units.
Tutorials and documentation
The latest tutorials and information on using Catalyst are available in the stable documentation. The in-development documentation describes unreleased features in the current master branch.
An overview of the package, its features, and comparative benchmarking (as of version 13) can also be found in its corresponding research paper, Catalyst: Fast and flexible modeling of reaction networks.
Features
- DSL for reaction networks — a readable, concise format for specifying models using chemical reaction notation.
- Multiple simulation types — generate and simulate ODE, steady-state ODE, SDE, jump, and hybrid models from a single
ReactionSystem. - Coupled models — combine reactions with differential equations, events, Brownian noise (
@brownians), and Poisson jumps (@poissonians). - Network analysis — compute linkage classes, deficiencies, reversibility, and other network properties.
- Compositional modeling — build models hierarchically using
@network_component,compose, andextend. - Spatial modeling — simulate reaction networks on discrete spatial domains.
- Steady state analysis — find and analyze steady states, stability, and bifurcation diagrams.
- Inverse problems — parameter estimation, sensitivity analysis, and structural identifiability.
- Model I/O — import from SBML and BioNetGen
.netfiles, export to LaTeX and other formats. - Visualization — reaction network graphs and LaTeX rendering.
Quick examples
Deterministic ODE simulation of Michaelis-Menten enzyme kinetics
Here we show a simple example where a model is created using the Catalyst DSL, and then simulated as an ordinary differential equation.
# Fetch required packages.
using Catalyst, OrdinaryDiffEqDefault, Plots
# Create model.
model = @reaction_network begin
kB, S + E --> SE
kD, SE --> S + E
kP, SE --> P + E
end
# Create an ODE that can be simulated.
u0 = [:S => 50.0, :E => 10.0, :SE => 0.0, :P => 0.0]
tspan = (0., 200.)
ps = [:kB => 0.01, :kD => 0.1, :kP => 0.1]
ode = ODEProblem(model, u0, tspan, ps)
# Simulate ODE and plot results.
sol = solve(ode)
plot(sol; lw = 5)
Stochastic jump simulations
The same model can be used as input to other types of simulations. E.g. here we instead generate and simulate a stochastic chemical kinetics jump process model for the reaction network. An exact realization of the jump process is sampled using an auto-selected stochastic simulation algorithm (SSA) (which for the small network in the current example ends up being Gillespie's Direct method):
# The initial conditions are now integers as we track exact populations for each species.
using JumpProcesses
u0_integers = [:S => 50, :E => 10, :SE => 0, :P => 0]
jprob = JumpProblem(model, u0_integers, tspan, ps)
jump_sol = solve(jprob)
plot(jump_sol; lw = 2)
SDE simulation with coupled equations, events, and environmental noise
This example demonstrates several Catalyst features composing together. We model
a cell whose volume ($V$) grows proportionally to a phosphorylated growth factor
($G^P$), with environmental stochasticity ($\sigma,dW$) added via the @brownians
DSL option. The phosphorylation of $G$ ($G \to G^P$) is driven by a cyclic
sunlight signal $k_p(\sin(t)+1)$, and cell division occurs when the volume
reaches a critical threshold $V_m$:
using Catalyst
cell_model = @reaction_network begin
@parameters Vₘ g σ
@brownians W
@equations begin
D(V) ~ g*Gᴾ + σ*W
end
@continuous_events begin
[V ~ Vₘ] => [V => V/2]
end
kₚ*(sin(t)+1)/V, G --> Gᴾ
kᵢ/V, Gᴾ --> G
end
We now study the system as a Chemical Langevin Dynamics SDE model:
u0 = [:V => 25.0, :G => 50.0, :Gᴾ => 0.0]
tspan = (0.0, 20.0)
ps = [:Vₘ => 50.0, :g => 0.3, :kₚ =>
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
openclaw-plugin-loom
Loom Learning Graph Skill This skill guides agents on how to use the Loom plugin to build and expand a learning graph over time. Purpose - Help users navigate learning paths (e.g., Nix, German)
groundhog
398Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
sec-edgar-agentkit
10AI agent toolkit for accessing and analyzing SEC EDGAR filing data. Build intelligent agents with LangChain, MCP-use, Gradio, Dify, and smolagents to analyze financial statements, insider trading, and company filings.
