Re: [R] lsoda question from deSolve package

2013-04-21 Thread Thomas Petzoldt
Hi Andreas, adding a varying amount of something over time is even easier than implementing an "immediate" event. It can be implemented as a "forcing", see ?forcings and example below. Hope it helps, Thomas require(deSolve) pkmod <- function(t, y, p) { inp <- forc(t) if (t < tin) R <

[R] lsoda question from deSolve package

2013-04-21 Thread Andras Farkas
Dear List, Wonder if you have some thoughts on the following question using lsoda in desolve: I have the following data and function: require(deSolve) times <- c(0:24) tin  <- 0.5 D <- 400 V    <- 26.3 k <-0.056 k12  <- 0.197118 k21  <- 0.022665 yini <- c(dy1 = 0,dy2 = 0)  events <- data.fr