Description Usage Arguments Value See Also Examples
Evaluates the vector field of the ODE system specified in the ode
object (and optionally its differentials with respect to the state and parameter vectors).
1 |
o |
An object of class |
x |
A non-negative numeric vector holding the state of the ODE system. |
param |
A non-negative numeric vector of parameter values for the ODE system (or list of these if multiple arguments are required). |
differentials |
Logical indicating if the differentials with respect to the state and parameter vector ought to be returned as well. |
... |
Additional arguments passed to field. |
If differentials
is FALSE
a vector (of length d
) holding the evaluated value of the field.
If differentials
is TRUE
a list is returned with
f |
A vector (length |
f_dx |
A sparse matrix (dxd) holding the state differential of the field. |
f_dparam |
A (list of) sparse matrix (dxp) holding the parameter differential of the field. |
ode, mak, plk, rlk, ratmak
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 26 27 28 29 30 31 32 33 34 35 | # Example: Michaelis-Menten system
A <- matrix(
c(1, 1, 0, 0,
0, 0, 1, 0,
0, 0, 1, 0), ncol = 4, byrow = TRUE)
B <- matrix(
c(0, 0, 1, 0,
1, 1, 0, 0,
1, 0, 0, 1), ncol = 4, byrow = TRUE)
k <- c(1, 2, 0.5)
x <- c(E = 1, S = 4, ES = 0, P = 0)
m <- mak(A, B)
# Vector field
field(m, x, k)
# ... with differentials
field(m, x, k, TRUE)
# Example: Power law kinetics
A <- matrix(c(1, 0, 1,
1, 1, 0), byrow = TRUE, nrow = 2)
p <- plk(A)
x <- c(10, 4, 1)
theta <- matrix(c(0, -0.25,
0.75, 0,
0, -0.1), byrow = TRUE, nrow = 3)
# Vector field
field(p, x, theta)
# ... with differentials
field(p, x, theta, TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.