Skip to content

simonbeyer1/CppODE

Repository files navigation

CppODE

R-CMD-check

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.

Features

  • 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

Installation

install.packages("devtools")
devtools::install_github("simonbeyer1/CppODE")

Getting started

For a worked example — defining an ODE system, computing sensitivities, and plotting the results — see the Predator–Prey vignette.

License

MIT

About

Generates and compiles C++ code for solving systems of ordinary differential equations (ODEs) with automatic differentiation for sensitivity analysis. Uses Boost.Odeint for numerical integration and FADBAD++ for dual number arithmetic. Supports event handling via deSolve-style logic.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors