compartment {assemblerr}R Documentation

Compartment

Description

Defines name and volume of a compartment.

Usage

compartment(name, volume = 1)

cmp(name, volume = 1)

Arguments

name

Name of the compartment

volume

Volume as a number, formula or parameter name

Details

In most applications, compartments contain kinetically homogeneous amount of drug (applications where the compartment content represents other quantities are also possible). In assemblerr, a compartment is defined by providing a a name and the compartment volume.

Compartment names

Every compartment must have a valid name. A compartment name can contain letters, numbers as well as the underscore character, and needs to start with a letter. Adding a compartment with an already existing name will replace the definition of the compartment.

Compartment volumes

The compartment volume can be provided as a number, R formula, or a parameter name. It will be used by assemblerr to replace references to the compartment concentration (e.g., ~C["central"]) with the corresponding amount devided by volume (e.g., ~A["central]/vc).

Value

A building block of type 'compartment'

See Also

flow for how to describe compartment kinetics

Examples

# model with depot and central compartment
m <- model() +
 compartment("depot", volume = 1) +
 compartment("central", volume = "vc") +
 flow(~ka*A, from = "depot", to = "central") +
 flow(~cl*C, from = "central") +
 prm_log_normal("ka") +
 prm_log_normal("cl") +
 prm_log_normal("vc") +
 obs_additive(conc~C["central"])

render(
  model = m,
  options = assemblerr_options(
    ode.use_special_advans = FALSE,
    ode.use_general_linear_advans = FALSE
   )
)

[Package assemblerr version 0.1.0 Index]