Skip to contents

The system is split the way indLin() splits it: a rate matrix that is constant in the states, expressed as k_from_to micro-constants, plus an indLin() forcing carrying everything else. Each sensitivity compartment gets the same rate matrix, the (dA/dp).X cross terms as non-depleting transfers, and its own forcing d(f)/dp + (df/dy).S^p.

Usage

rxSensMatExp(
  model,
  calcSens,
  calcSens2 = NULL,
  calcSens3 = NULL,
  doConst = FALSE,
  env = NULL
)

Arguments

model

rxode2 model, text, or function

calcSens

A character vector of parameter names for which sensitivities should be calculated.

calcSens2

character vector (or NULL) requesting second-order sensitivities rx__sens_<x>_BY_<p>_BY_<q>__ (p over calcSens, q over calcSens2; every calcSens2 element must also be in calcSens). Ignored for linCmt() states (those use Stan forward-AD).

calcSens3

character vector (or NULL) requesting third-order sensitivities rx__sens_<x>_BY_<p>_BY_<q>_BY_<r>__ (r over calcSens3). Requires calcSens2; every calcSens3 element must also be in calcSens2.

doConst

Replace constants with values; By default this is FALSE.

env

A pre-loaded symengine environment (from .rxLoadPrune()) to reuse instead of reloading model; when NULL it is built internally.

Value

A character string representing the matrix exponential sensitivity-expanded model code

Author

Matthew L. Fidler