[Rd] typo and user-proofing in odesolve() (PR#1295)

bolker@zoo.ufl.edu bolker@zoo.ufl.edu
Fri, 1 Feb 2002 18:34:36 +0100 (MET)


  A couple of minor points about the odesolve package
(which I am otherwise enjoying very much):

 1. "scalar" is misspelled as "scaler" in the definitions of
the rtol and atol parameters

 2. it is possible to crash R by doing something dumb, e.g
failing to read the documentation carefully enough and (a)
returning only a vector of derivatives and not a list of
(derivatives, global values) and (b) making the derivative
vector shorter than the vector of initial conditions (see example below).

  I know that this is my fault, but it might be possible/useful
to "user-proof" lsoda() some more (try func() once and see if
it returns a list of the appropriate form, check the derivative
vector for length matching the IC vector, etc ...

tderiv <- function(t,x,parms) {
#  return(list(c(x[1]*parms[1],x[2]*parms[2],parms[3]*(x[1]+x[2])),NULL))
   return(c(x[1]*parms[1],x[2]*parms[2],parms[3]*(x[1]+x[2])))
}

lsoda(rep(1,2),c(0:20),tderiv,c(0.01,-0.01,1.2))


--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = 
 major = 1
 minor = 3.1
 year = 2001
 month = 08
 day = 31
 language = R

Search Path:
 .GlobalEnv, package:ctest, Autoloads, package:base

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._