Description Usage Arguments Value See Also Examples
This function creates an object of class solver
, which holds the basic information of numeric solver applied to the ode
-systems.
1 |
name |
Character string naming the ODE-solver. Must be one of: "rk23" (Runge-Kutta order 2/3), "bs23" (Bogacki-Shampine order 2/3), "dp45" (Dormand-Prince order 4/5) or "rkf45" (Runge-Kutta-Fehlberg order 4/5, default). |
step_max |
Positive integer giving the maximal number of steps the solver may take between two consecutive time points. |
tol |
Positive numeric tolerance level used for embedded pair solver. |
h_init |
Positive numeric giving initial discretisation of time interval for solver. |
... |
Additional arguments passed to |
An object with S3 class "solver".
ode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Use 'solver' object to specify numerical solver when creating 'ode' objects
# Example: power law kinetics with Dormand-Prince order 4/5 solver
A <- matrix(
c(1, 1, 0, 0,
0, 0, 1, 0,
0, 0, 1, 0), ncol = 4, byrow = TRUE)
p <- plk(A, s = solver("dp45"))
# Example: ... and with more steps
p <- plk(A, s = solver("dp45", step_max = 1e3))
# Example: rational mass action kinetics with Runge-Kutta order 2/3 solver
B <- matrix(
c(0, 0, 1, 0,
1, 1, 0, 0,
1, 0, 0, 1), ncol = 4, byrow = TRUE)
rmak <- ratmak(A, B, s = solver("rk23"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.