AbstractODESolver-class: AbstractODESolver class

Description Usage Arguments Details Examples

Description

Defines the basic methods for all the ODE solvers.

AbstractODESolver generic

AbstractODESolver constructor missing

AbstractODESolver constructor ODE. Uses this constructor when ODE object is passed

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
AbstractODESolver(ode, ...)

## S4 method for signature 'AbstractODESolver'
step(object, ...)

## S4 method for signature 'AbstractODESolver'
getODE(object, ...)

## S4 method for signature 'AbstractODESolver'
setStepSize(object, stepSize, ...)

## S4 method for signature 'AbstractODESolver'
init(object, stepSize, ...)

## S4 replacement method for signature 'AbstractODESolver'
init(object, ...) <- value

## S4 method for signature 'AbstractODESolver'
getStepSize(object, ...)

## S4 method for signature 'missing'
AbstractODESolver(ode, ...)

## S4 method for signature 'ODE'
AbstractODESolver(ode, ...)

Arguments

ode

an ODE object

...

additional parameters

object

a class object

stepSize

the size of the step

value

the step size value

Details

Inherits from: ODESolver class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# This is how we start defining a new ODE solver: Euler
.Euler <- setClass("Euler",              # Euler solver very simple; no slots
     contains = c("AbstractODESolver"))



# Here we define the ODE solver Verlet
.Verlet <- setClass("Verlet", slots = c(
    rate1 = "numeric",                          # Verlet calculates two rates
    rate2 = "numeric",
    rateCounter = "numeric"),
contains = c("AbstractODESolver"))



# This is the definition of the ODE solver Runge-Kutta 4
.RK4 <- setClass("RK4", slots = c(       # On the other hand RK4 uses 4 rates
   rate1 = "numeric",
   rate2 = "numeric",
   rate3 = "numeric",
   rate4 = "numeric",
   estimated_state = "numeric"),         # and estimates another state
contains = c("AbstractODESolver"))

f0nzie/rODE documentation built on May 14, 2019, 10:34 a.m.