[Rcpp-devel] C++ code for ordinary differential equations

Jonas Rauch jonas.rauch at googlemail.com
Thu Oct 6 06:32:14 CEST 2011


And here is what I meant:
http://cran.r-project.org/web/packages/Rsundials/index.html
Sadly, the package has not been updated for a long time and like I said
before, it only covers basic functionality like solving an ODE. If that is
all you want to do, it might still work for you though. What I needed when I
looked into it was the sensitivity generation functionality of Sundials,
which is not implemented for R as far as I can see. So I did that "by hand"
with deSolve and it's working fine.
Other solvers I know of in C++ are the ode-initval2 solver included in the
GSL and various implementations of Runge-Kutta methods that you can find in
code-snippets around the web, mostly without error estimation or stepsize
control.
But, since most integration schemes were developed in the 70's and 80's,
there are a lot of solvers that are only available in Fortran versions. ;-(
Jonas

On Thu, Oct 6, 2011 at 12:18 AM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 5 October 2011 at 16:59, Douglas Bates wrote:
> | On Wed, Oct 5, 2011 at 2:45 PM, Dirk Eddelbuettel <edd at debian.org>
> wrote:
> | >
> | > On 5 October 2011 at 14:07, Douglas Bates wrote:
> | > | On Wed, Oct 5, 2011 at 1:31 PM, Jonas Rauch <
> jonas.rauch at googlemail.com> wrote:
> | > | > I am using the deSolve package successfully and I think it is
> probably your
> | > | > best option if you want to do things in R.
> | > | > The most widespread solver in C++ is the Sundials Suite as far as I
> know:
> | > | > https://computation.llnl.gov/casc/sundials/main.html
> | > | > I think someone starting writing an interface to R, but it only
> covers the
> | > | > really basic functions.
> | > | > Regards,
> | > | > Jonas
> | > |
> | > | Thanks for the suggestion.  Because downloading the Sundials source
> | > | code requires registration I don't think it would be suitable to
> | > | include it in an R package on CRAN.
> | >
> | > Tst tst tst: You're loosing your Debian/Ubuntu instincts:
> | >
> | > edd at max:~$ wajig search sundials
> | > libsundials-cvode1 - ordinary differentialequation solver (SUNDIALS
> library)
> | > libsundials-cvodes2 - ODE solver with sensistivity analysis (SUNDIALS
> library)
> | > libsundials-ida2 - differential-algebraic system solver (SUNDIALS
> library)
> | > libsundials-idas0 - IDA solver with sensitivity capabilities (SUNDIALS
> library)
> | > libsundials-kinsol1 - KINSOL solver (SUNDIALS library)
> | > libsundials-nvecserial0 - vector operations library (SUNDIALS library)
> | > libsundials-serial - SUit of Nonlinear and DIfferential/ALgebraic
> equation Solvers
> | > libsundials-serial-dev - SUNDIALS development files
> | > edd at max:~$
> |
> | For someone who wants to wrestle with C code that generates all its
> | own linear algebra calls and uses malloc, free, printf, etc.
> | liberally.
> |
> | Been there, done that, got the t-shirt.
>
> I see.  And the scars, but those usually stay beneath the t-shirt.
>
> Dirk
>
>
> --
> New Rcpp master class for R and C++ integration is scheduled for
> San Francisco (Oct 8), more details / reg.info available at
>
> http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20111006/c644afcf/attachment-0001.htm>


More information about the Rcpp-devel mailing list