Generate the model objects for use in Xs (models with sensitivities)

Share:

Description

Generate the model objects for use in Xs (models with sensitivities)

Usage

1
2
odemodel(f, deriv = TRUE, forcings = NULL, fixed = NULL,
  modelname = "odemodel", gridpoints = NULL, verbose = FALSE, ...)

Arguments

f

Something that can be converted to eqnvec, e.g. a named character vector with the ODE

deriv

logical, generate sensitivities or not

forcings

Character vector with the names of the forcings

fixed

Character vector with the names of parameters (initial values and dynamic) for which no sensitivities are required (will speed up the integration).

modelname

Character, the name of the C file being generated.

gridpoints

Integer, the minimum number of time points where the ODE is evaluated internally

verbose

Print compiler output to R command line.

...

Further arguments being passed to funC.

Value

list with func (ODE object) and extended (ODE+Sensitivities object)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 

## Generate a compiled ODE model from an equation vector
## The model will not return sensitivities for "switch"
## Files will be generated in your working directory!

f <- eqnvec(A = "-k*A + switch*F")
model <- odemodel(f, forcings = "F", fixed = "switch")
print(model)

## Generate the same model from an equation list
f <- addReaction(NULL, from = "", to = "A", rate = "switch*F", description = "production")
f <- addReaction(f   , from = "A", to = "", rate = "k*A", description = "degradation")
print(f)

model <- odemodel(f, forcings = "F", fixed = "switch")
print(model)


## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.