[R-sig-dyn-mod] Jacobian in compiled code

John Harrold john.m.harrold at gmail.com
Sat Apr 11 05:46:44 CEST 2015


Hello Daniel,

Sorry, I think I sent this prematurely before :). If you download this zip
file:

https://dl.dropboxusercontent.com/u/1901170/ubiquity/playground.zip

It has an implementation of this model:

http://www.ncbi.nlm.nih.gov/pubmed/22143261

This example is parameterized for the mouse. I should probably mention that
I work in drug discovery and development. And this is a physiologically
based pharmacokinetic model of antibodies. This model has 132 parameters,
and 93 states.

The file test.m will run the model in Matlab. If you have a simulink
license it'll use compiled C, if you don't it'll use the m-file. The file
test.R will run the model as both an R script and a compiled C file. The C
code for R is in ./r_ode_model.c, and the version used in the R-script is
the system_DYDT function in this file: transient/auto_rcomponents.R

When I run this it takes about 3.2 seconds to use the C file and 45 seconds
to run it using the R script. Remember I'm new to R, so don't be too harsh
on my coding.

Let me know if you have any questions.
Thanks
John

On Fri, Apr 10, 2015 at 2:22 AM daniel kaschek <
daniel.kaschek at physik.uni-freiburg.de> wrote:

> Which integrator did you use? If you don't mind, could you share the
> equations?
>
> Cheers,
> Daniel
>
> On Friday, April 10, 2015 6:38:57 AM CEST, John Harrold wrote:
> > Daniel and Thomas,
> >
> > I got it implemented and it is much faster.
> >
> > Thanks guys, I appreciate the help.
> >
> > John
> >
> > On Thu, Apr 9, 2015 at 8:08 AM Thomas Petzoldt <
> > thomas.petzoldt at tu-dresden.de> wrote:
> >
> >> Hello,
> >>
> >> the Jacobian is optional, so you can safely omit it. However, specifying
> >> the Jacobian (or at least its structure) can speed up the integration of
> >> the odepack solvers, e.g. for 1D, 2D and 3D systems. The Runge-Kutta
> >> solvers don't use the Jacobian.
> >>
> >> More, see help files ?lsoda ?lsode etc.
> >>
> >> Thomas
> >>
> >> _______________________________________________
> >> R-sig-dynamic-models mailing list
> >> R-sig-dynamic-models at r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models
> >>
> >
> >       [[alternative HTML version deleted]]
> >
>
>
> --
> Sent using Dekko from my Ubuntu device
>
> _______________________________________________
> R-sig-dynamic-models mailing list
> R-sig-dynamic-models at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models
>

	[[alternative HTML version deleted]]



More information about the R-sig-dynamic-models mailing list