[R-sig-dyn-mod] deSolve question
Thomas Petzoldt
thomas.petzoldt at tu-dresden.de
Wed Jun 19 13:43:09 CEST 2013
Hi Andras,
the / is the division operator and no fraction line, so it does not
imply parentheses.
Here you divide only inp by par$v:
> dy1 <- - pars$k * state[1] + inp/pars$v
but both terms the second:
> #note the added ()
> dy1 <- (- pars$k * state[1] + inp)/pars$v
An equivalent to version 2 would be:
pars$k * state[1]/pars$v + inp/pars$v
ThPe
More information about the R-sig-dynamic-models
mailing list