The odelia package for R is an ODE solver in C++ header files, using RK4-5. There's potential to link to R via Rcpp. Code was first developed by Rich FitzJohn as part of the plant package. I'm spinning that code out into a package, as I want to use it elsewhere.
- system
- stepper
- solver
- runner
This package is released under the GNU Affero General Public License v3 (AGPL-3).
Contributions are welcome. By submitting a pull request or code to this repository, you agree to the terms of the Contributor License Agreement.
An ODE system in odelia consists of:
-
A system header (
inst/include/odelia/examples/*.hpp) — C++ class defining the ODE. Must implementode_size(),set_ode_state(),ode_state(), andode_rates(). Template on scalar type for AD support. -
An Rcpp interface (
src/*_interface.cpp) —[[Rcpp::export]]functions exposing the system to R. -
An R wrapper (
R/*-interface.R, optional) — R6 classes providing a friendlier API around the external pointers. -
A demo script (
examples/*/demo.R) — Runnable demonstration.
Use the Makefile targets below depending on the level of test coverage you want.
make testRuns package tests after local compile. Fast default for day-to-day work.
make test-localRuns testthat::test_local() from the source tree.
make test-installedInstalls with tests and runs testthat::test_package() against the installed package copy.