Learn R Programming

dMod (version 0.1)

Xs: Model evaluation.

Description

Interface to combine an ODE and its sensitivity equations into one model function x(times, pars, forcings, events, deriv = TRUE) returning ODE output and sensitivities.

Usage

Xs(func, extended, forcings = NULL, events = NULL,
  optionsOde = list(method = "lsoda"), optionsSens = list(method =
  "lsodes"))

Arguments

func
return value from funC(f) where f defines the ODE.
extended
return value from funC(c(f, sensitivitiesSymb(f))).
forcings
data.frame with columns name (factor), time (numeric) and value (numeric). The ODE forcings.
events
data.frame of events with columns "var" (character, the name of the state to be affected), "time" (numeric, time point), "value" (numeric, value), "method" (character, either "replace", "add" or "multiply"). See event
optionsOde
list with arguments to be passed to odeC() for the ODE integration.
optionsSens
list with arguments to be passed to odeC() for integration of the extended system

Value

  • A model prediction function x(times, pars, forcings, events, deriv = TRUE) representing the model evaluation. The result of x(times, pars, forcings, events, deriv = TRUE) contains attributes "sensitivities" and "deriv" with the sensitivities if deriv=TRUE. If deriv=FALSE, sensitivities are not computed (saving time). If pars is the result of p(pouter) (see P), the Jacobian of the parameter transformation and the sensitivities of the ODE are multiplied according to the chain rule for differentiation. The result is saved in the attributed "deriv", i.e. in this case the attibutes "deriv" and "sensitivities" do not coincide.