[R] DLSODA error

Thomas Petzoldt thpe at simecol.de
Thu Apr 28 23:30:47 CEST 2011


Kristian,

your example is rather complex and somewhat time consuming even on fast 
computers, so it is not easy to track your problem down to its original 
reason.

However, what is clear to me is that this is definitely *not*  not a 
problem of deSolve and most likely even not of optim, it is just a 
problem of your model specification. Your error messages point to a 
numerical problem:

DLSODA-  Warning..Internal T (=R1) and H (=R2) are
       such that in the machine, T + H = T on the next step
      (H = step size). Solver will continue anyway.

In above,  R1 =  0.2630651367072D+01   R2 =  0.2055665829864D-15

This is an internal message of the original lsoda Fortran code telling 
us that it cannot add H=0.2e-15 to to T=0.2e+01. Note that the relative 
numerical resolution of double precision arithmetic of the computer is 
about 1e-16.

To understand what I mean just try other ode methods, e.g.:


outmat <- ode(y = state, times = times,
   func = Kristian, parms = parameters, method="adams")

## or:

outmat <- ode(y = state, times = times,
   func = Kristian, parms = parameters, method="ode45")


Thomas P.



More information about the R-help mailing list