Ewance
← All challenges Software Engineer

ODE Integrator Benchmark for a Pharma PK/PD Pipeline

Duration
3 weeks
Level
Advanced
Type
Analysis
Team
1 to 5 people

The situation

The consultancy (mostly fixed-price phase-1 contracts) ships population simulations weekly — integrator failures cost rerun cycles that eat fixed-price margin directly.

Your task

Benchmark stiff-aware ODE integrators on three PK/PD model classes and produce an integrator-selection policy that eliminates the current pipeline's failure rate.

The brief

What you do

  1. Use SciPy's solve_ivp + SUNDIALS (via scikit-sundae or diffeqpy) to benchmark: RK45 (baseline), LSODA, BDF (CVODE), Radau, and Rosenbrock.
  2. Run on three model classes (insulin-glucose 22 states, drug-receptor binding 14 states, hepatic clearance 9 states) at 10,000 parameter samples each.
  3. Report success rate, wall time per trajectory, accuracy vs a reference high-precision solution.

You deliver

A Python benchmark harness, results report, and a 5-page integrator-selection policy memo (model class → recommended integrator + tolerances).

What you will practice

  • Diagnose ODE stiffness using eigenvalue spectra or numerical signatures
  • Compare BDF, Rosenbrock, and implicit Runge-Kutta methods on stiff systems
  • Choose absolute and relative tolerances defensibly for population workloads
  • Build a model-class-to-integrator policy reusable across sponsors

A suggested way in

  1. Stiffness detection: estimate the spectral radius / smallest-decaying-mode ratio; high ratio means stiff
  2. Tolerances should be set per state, not globally — concentrations near zero need different abs tolerance than peak states
  3. Always compare against a high-precision reference (Radau at 1e-12) — relative error against another fast integrator is circular

Skills you will practice

Numerical odes, Stiff integrators, Scientific python, Benchmarking, Pk pd modeling, Numerical tolerance tuning

How it is assessed

  • Benchmark rigor30%

    Three model classes × five integrators × 10,000 samples, reproducible.

  • Stiffness diagnosis20%

    Stiffness characterized for each model class with quantitative evidence.

  • Tolerance tuning25%

    Per-state tolerances justified against accuracy and runtime trade.

  • Policy clarity25%

    Memo gives a deterministic integrator-selection rule per model class.

Resources

  • PythonTool

    Pipeline language for the consultancy's existing PK/PD stack.

  • SciPyTool

    solve_ivp covers RK45, BDF, LSODA, Radau out of the box.

  • NumPyTool

    Eigenvalue analysis for stiffness diagnosis.

  • JupyterTool

    Stiffness exploration and tolerance-sensitivity notebooks.

  • MatplotlibTool

    Per-integrator accuracy vs runtime scatter plots.

  • NotionTool

    Integrator-selection policy memo.

Sample Ewance certificate of completion, verified by LearnCoin
Sample certificate
Your proof

Finish it. Earn this.

A verified certificate with your name. Anyone can check it.

Time to practice.

Solve this challenge
Related challenges

More like this.