R/RK45.R

Defines functions RK45

Documented in RK45

#' RK45 ODE solver class
#'
#' @param ode and ODE object
#'
#' @rdname RK45-class
#' @example ./inst/examples/ComparisonRK45App.R
#' @example ./inst/examples/KeplerApp.R
setClass("RK45",
    contains = c("DormandPrince45")
)

setMethod("initialize", "RK45", function(.Object, ode, ...) {
    # initialized the ODE solver
    .Object@ode <- ode                          # set the ode to ODESolver slot
    return(.Object)
})



#' RK45 class constructor
#'
#' @rdname RK45-class
#'
#' @export
RK45 <- function(ode) {
    rk45 <- DormandPrince45(ode)             # equivalent to Java "super(ode)"
    return(rk45)
}

Try the rODE package in your browser

Any scripts or data that you put into this service are public.

rODE documentation built on May 1, 2019, 10:17 p.m.