compartment: Compartment

Description Usage Arguments Details Value See Also Examples

View source: R/compartment.R

Description

Defines name and volume of a compartment.

Usage

1
2
3
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 divided by volume (e.g., ~A["central]/vc).

Value

A building block of type 'compartment'

See Also

flow for how to describe compartment kinetics

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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
   )
)

assemblerr documentation built on Jan. 13, 2022, 1:07 a.m.