[R-sig-dyn-mod] forcings {deSolve}

Tom Sumner Tom.Sumner at lshtm.ac.uk
Wed Mar 4 16:36:52 CET 2015


Dear list,
 
I'm trying to learn how to use compiled model code (specifically C) with deSolve and am struggling with passing forcing functions to the model.
I've been able to do this for a single forcing function by following the examples in the deSolve Compiled Code vignette but can't work out how to pass multiple functions - is this possible?
 
I think I've understand how to set up the "forcc" function in the C code but I'm not sure how to pass multiple functions in the call to ode.
 
Below is an example from the vignette for a single forcing function where "forcings" is a two-column matrix of times and values. If I want to pass two functions (e.g.  forcings and forcings2) how do I specify these in the example below?
 
out <- ode(y=xstart, times, func = "derivsc",
parms = parms, dllname = "Forcing_lv",initforc = "forcc", 
forcings=forcings, initfunc = "parmsc", nout = 2, 
outnames = c("Sum","signal"), method = rkMethod("rk34f"))  
 
Apologies if this is in the wrong place and thanks in advance for any help.
 
All the best, 
 
Tom


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