https://github.com/cran/simecol
Tip revision: 44745b370810a0fdf335cb0db1ecacad338283e0 authored by Thomas Petzoldt on 10 October 2007, 00:00:00 UTC
version 0.5-3
version 0.5-3
Tip revision: 44745b3
rk4.R
## Classical Runge-Kutta-fixed-step-integration
## using imported function from package odesolve
setGeneric("rk4")
setMethod("rk4", "odeModel",
function(y, times=NULL, func=NULL, parms=NULL) {
times <- fromtoby(y@times)
func <- y@main
inputs <- y@inputs
equations <- y@equations
parms <- y@parms
environment(func) <- environment()
attach(equations)
on.exit(detach(equations))
rk4(y@init, times, func, parms)
}
)