Skip to contents

Recast model in terms of sum/prod

Usage

rxSumProdModel(model, expand = FALSE, sum = TRUE, prod = TRUE)

Arguments

model

rxode2 model

expand

Boolean indicating if the expression is expanded.

sum

Use sum(...)

prod

Use prod(...)

Value

model string with prod(.) and sum(.) for all these operations.

Author

Matthew L. Fidler

Examples

# \donttest{
pk <- function() {
  model({
    d/dt(depot) <- -ka * depot
    d/dt(central) <- ka * depot - cl / v * central
  })
}
writeLines(rxSumProdModel(pk))
#>  
#>  
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> d/dt(depot) = prod(-ka, depot)
#> d/dt(central) = sum(prod(ka, depot), -(prod(cl, 1/v, central)))
# }