[R-sig-dyn-mod] question about the limit of conversion rate

Thomas Petzoldt Thomas.Petzoldt at TU-Dresden.de
Mon Jun 24 23:05:09 CEST 2013


Hi,

your "if switch" is a discontinuity, but differential equations describe 
continuous systems by definition. Most solvers of deSolve are quite 
robust against such violations, but may require some tuning in such cases.

A pragmatic idea would be to relax absolute and/or relative tolerance or 
to try another solver:



## reduced accuracy
out1 <- ode(y = state, t = times, func = Lorenz, parms = para, rtol=1e-3)

## another solver
out2 <- ode(y = state, t = times, func = Lorenz, parms = para, 
method="vode")

## fixed step solver, with reasonable small time step
times <- seq(0,300, by = .1) #
out3 <- ode(y = state, t = times, func = Lorenz, parms = para, method="rk4")

plot(out1, out2, out3)

.. but I think that it would be better to make the transition between 
the two parameter values smoother, e.g. with a sigmoid function.



Thomas



More information about the R-sig-dynamic-models mailing list