Learn R Programming

dMod (version 0.4)

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

Description

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

Usage

odemodel(f, deriv = TRUE, forcings = NULL, fixed = NULL,
  modelname = "odemodel", solver = c("deSolve", "Sundials"),
  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.

solver

Solver for which the equations are prepared.

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

Run this code
# 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)

# }

Run the code above in your browser using DataLab