Examples Gallery¶
Visual gallery of Diffid applications and use cases.
Gallery Under Construction
This gallery is being populated with examples. Check the examples directory for current code.
Available Examples¶
Scalar Optimisation¶
Rosenbrock Function¶
Classic 2D optimisation test problem.
Files:
Topics: ScalarBuilder, contour plots, optimiser comparison
ODE Parameter Fitting¶
Logistic Growth¶
Single-variable ODE with DiffSL.
File: logistic_growth.py
Topics: DiffsolBuilder, DiffSL syntax, data fitting
Bouncy Ball¶
Physics-based model with event handling.
Files:
Topics: Event detection, parameter uncertainty, MCMC
Model Comparison¶
Bicycle Model¶
Comparing different bicycle dynamics formulations.
Files:
Topics: Model selection, evidence calculation, Bayes factors
Multi-Backend ODE Solving¶
Predator-Prey Models¶
Lotka-Volterra equations with multiple solver backends.
Files:
Topics: VectorBuilder, JAX/Diffrax, Julia/DifferentialEquations.jl, performance comparison
Running Examples¶
Clone the repository:
Install dependencies:
Run an example:
For ODE examples:
For multi-backend examples (requires additional dependencies):
# For Diffrax (JAX)
pip install jax diffrax
# For DifferentialEquations.jl (Julia)
pip install diffeqpy
# Then follow Julia setup instructions
python examples/predator_prey/predator_prey_diffrax.py
Contributing Examples¶
Have an interesting use case? We'd love to include it!
- Fork the repository
- Add your example to
examples/ - Include a brief comment header explaining the example
- Open a pull request
See the Contributing Guide for details.
See Also¶
- Tutorials - Interactive Jupyter notebooks
- Getting Started - Core concepts
- API Reference - Complete API docs