[R] lsoda

Timothy H. Keitt Timothy.Keitt at StonyBrook.Edu
Fri May 11 19:58:01 CEST 2001


Ah.  Now I remember.  This was quite confusing to me too at first; you 
have to return a list, even if it only has one element.  I think it 
would be much better to simply return a single vector of derivatives and 
allow for passing an optional second function that can compute stats, 
make plots, etc. while the the integration is running.  An alternative 
would be to check whether the function is returning a vector or list in 
your code.  Putting in default atol and rtol values would also be nice.

Tim

Setzer.Woodrow at epamail.epa.gov wrote:

> If you do not have any such 'global' variables, you don't need to force it!
> Just return a list with one component, the ode solution.   So, for your
> problem, just return:
> list(c(dN1.dt,dN2.dt))
> However, make sure you are returning a list, and not a simple vector --
> lsoda will bomb (I've done that too many times).
> 


-- 
Timothy H. Keitt
Department of Ecology and Evolution
State University of New York at Stony Brook
Phone: 631-632-1101, FAX: 631-632-7626
http://life.bio.sunysb.edu/ee/keitt/

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list