Automated C++ code generation for ODE integration with sensitivity calculation using FADBAD++.
CppODE generates, compiles, and runs C++ solvers for ODE systems, with optional first- and second-order parameter sensitivities computed automatically via forward-mode automatic differentiation.
- BDF solver (variable-order 1–5, variable-step, Nordsieck form) adapted from SUNDIALS/CVODE, with dense LU via R’s LAPACK interface or sparse LU via KLU (bundled SuiteSparse)
- Rosenbrock4 solver extended from Boost.Odeint
- Automatic differentiation — FADBAD++ dual numbers for exact first- and second-order parameter sensitivities in a single integration pass
- Event handling — time-based and root-triggered events with saltation matrix corrections for sensitivity continuity
- Symbolic Jacobian — automatically derived and compiled as analytic C++ code
- Sparse support — auto-detection of Jacobian sparsity with KLU factorization for large systems
install.packages("devtools")
devtools::install_github("simonbeyer1/CppODE")For a worked example — defining an ODE system, computing sensitivities, and plotting the results — see the Predator–Prey vignette.
MIT