[R] lsoda warning "too much accuracy requested"

From: Colleen Carlson <carlsonc_at_vt.edu>
Date: Fri, 21 Nov 2008 11:38:55 -0500

Dear list -  

Does anyone have any ideas / comments about why I am receiving the following warning when I run lsoda:  

  1. lsoda-- at t (=r1), too much accuracy requested in: lsoda(start, times, model, parms)
  2. for precision of machine.. see tolsf (=r2) in: lsoda(start, times, model, parms)

I have tried changing both rtol and atol but without success. I saw the thread in the R-archive of 11 June 2004 but this has not helped me.  

I have built the model in stages and the problem only occurs when the exponent beta in the third DE is anything other than 0 or 1. If beta = 0 or 1 then the solver gives me perfectly justifiable results. Just changing beta to 0.9 or similar causes the problem.  

I am still new to R so I am unsure if it is my programming or my understanding of the way lsoda works.  

Any comments or input would be welcome.

Many thanks



My code is:  


SI <- 80

model <- function(t, x, parms) {

            H <- x[1]

            BA <- x[2]

            N <- x[3]

with(as.list(parms), {

            dHdt <- (b/c)*(((a**c)*((H)**(1-c))-H))

            dBAdt <- -(BA*b)*(c0+(c1*SI)-log(BA))/(log(1-((H/a)**c)))

            dNdt <- N*alpha*(((log(1-((H/a)**c)))/b)**beta) - (gamma*BA)

            list(c(dHdt, dBAdt, dNdt))



times <- seq(0, 40, 1)  

parms <- c(a=(SI*1.258621)-1.32759, b=0.1, c=0.4, c0=4.6012, c1=0.013597, alpha=0.0005, beta=0.5, gamma=0.01)

start <- c(H=0.1, BA=0.1, N=600)  

out <- as.data.frame(lsoda(start, times, model, parms))

        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 21 Nov 2008 - 16:40:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 21 Nov 2008 - 17:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive