Hi Benoit,

your problem is not really a problem of lsoda. The reason of the "crash" is a violation of the statistical assumptions of least squares regression due to dependency of residual variance on x. Due to this, K1 is varied over a very large range of values until numeric overflow occurs.

Note that you have an exponentially growing state, so log transformation will help:

        
res <- nls(log(foo) ~
  log(func(K1)),start=list(K1=1),data=data.frame(foo=y), trace=TRUE)

summary(res)


You may also consider using packages simecol (on CRAN) or FME (on R-Forge) that both support constrained optimization of ode systems.

Hope it helps

Thomas Petzoldt

______________________________________________
R-help@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.

Reply via email to