[R] odesolve: lsoda vs rk4
p.dalgaard at biostat.ku.dk
Thu Jun 10 18:26:19 CEST 2004
Chris Knight <christopher.knight at plant-sciences.oxford.ac.uk> writes:
> I'm trying to use odesolve for integrating various series of coupled 1st
> order differential equations (derived from a system of enzymatic
> catalysis and copied below, apologies for the excessively long set of
> The thing that confuses me is that, whilst I can run the function rk4:
> I run into problems with a series of 'Excessive precision requested'
> warnings with no output beyond the first time point.
> Fiddling with rtol and atol doesn't seem to do very much.
> parms<-c(p1=4.8e5, p2=1.25, p3=1.3, p4=1e6, p5=1, p6=1.25, p7=1e6,
> p8=16, p9=0.35, p10=0.235e-6)
> y<-c(A=2.5e-6,B=2.5e-6, C=1.7e-6, D=0.57e-6)
> times <- c(0.05 * (0:999))
I'm not going to dig deeply into your problem formulation, but my
hunch is that you need to rescale your problem so that you get rid of
the very small and large numbers in the parameters and starting
values. Extreme values there tend to confuse convergence criteria.
(The difference between the two solvers is probably exactly that lsoda
has internal loops and convergence criteria, whereas rk4 just chugs
along in fixed time steps.)
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help