Skip to content

Tutorials

Learning Paths

Follow these progressive learning paths based on your experience level and goals.

Beginner Track

Perfect for those new to Diffid or optimisation:

  • Optimisation Basics


    Learn scalar optimisation with the Rosenbrock function. Compare Nelder-Mead, CMA-ES, and Adam optimisers.

    Optimisation Basics

  • ODE Fitting with DiffSL


    Fit a logistic growth model to data using DiffSL and Diffsol.

    ODE Fitting with DiffSL

Intermediate Track

Building on the basics with real-world applications:

  • Parameter Uncertainty


    Go from optimisation to MCMC sampling. Quantify parameter uncertainty with confidence intervals.

    Parameter Uncertainty

  • Model Comparison


    Use Dynamic Nested Sampling to calculate model evidence and Bayes factors.

    Model Comparison

Advanced Track

Complex problems and advanced techniques:

  • Multi-Backend ODE Solving


    Compare Diffsol, JAX/Diffrax, and Julia/DifferentialEquations.jl for predator-prey models.

    Multi-Backend ODE Solving

Quick Reference

Tutorial Difficulty Key Concepts Prerequisites
Optimisation Basics Beginner ScalarBuilder, Optimisers None
ODE Fitting Beginner DiffsolBuilder, DiffSL Optimisation Basics
Parameter Uncertainty Intermediate MCMC, uncertainty Optimisation Basics, ODE Fitting
Model Comparison Intermediate Nested sampling, evidence Optimisation Basics, ODE Fitting, Parameter Uncertainty
Multi-Backend Advanced VectorBuilder, JAX, Julia Optimisation Basics, ODE Fitting

Running the Notebooks

Installation

Install Diffid with Jupyter and plotting support:

pip install diffid jupyter matplotlib
uv pip install diffid jupyter matplotlib

Clone and Run

# Clone the repository
git clone https://github.com/bradyplanden/diffid.git
cd diffid/docs/tutorials/notebooks

# Launch Jupyter
jupyter notebook

Alternative: Python Scripts

Prefer scripts to notebooks? Check out the examples directory:

  • python_problem.py - Basic scalar optimisation
  • logistic_growth.py - ODE fitting
  • bouncy_ball.py / bouncy_ball_sampling.py - Optimisation and MCMC
  • bicycle_model_evidence.py - Model comparison
  • predator_prey/ - Multi-backend comparisons

Contributing

Found an issue or want to improve a tutorial?

  1. Fork the repository
  2. Edit notebooks in docs/tutorials/notebooks/
  3. Test your changes locally
  4. Submit a pull request

See the Contributing Guide for details.

Next Steps

After completing the tutorials: