Skip to contents

This returns the model's compartments or states.

Usage

rxState(obj = NULL, state = NULL)

Arguments

obj

rxode2 family of objects

state

is a string indicating the state or compartment that you would like to lookup.

Value

If state is missing, return a character vector of all the states.

If state is a string, return the compartment number of the named state.

See also

Author

Matthew L.Fidler

Examples

# \donttest{
f <- function() {
  ini({
    ka <- 0.5; cl <- 1; v <- 10
  })
  model({
    d/dt(depot) <- -ka * depot
    d/dt(central) <- ka * depot - cl / v * central
    cp <- central / v
  })
}
m <- f()
rxState(m)
#> [1] "depot"   "central"
rxState(m, "central")
#> [1] 2
# }