
To convert from infusion/intravenous administration to first-order oral absorption
Source:R/addDepot.R
addDepot.RdTo convert from infusion/intravenous administration to first-order oral absorption
Examples
pk2cmtNoDepot <- function() {
ini({
lcl <- 1; label("Clearance (CL)")
lvc <- 3; label("Central volume of distribution (V)")
lvp <- 5; label("Peripheral volume of distribution (Vp)")
lq <- 0.1; label("Intercompartmental clearance (Q)")
propSd <- 0.5; label("Proportional residual error (fraction)")
})
model({
cl <- exp(lcl)
vc <- exp(lvc)
vp <- exp(lvp)
q <- exp(lq)
kel <- cl / vc
k12 <- q / vc
k21 <- q / vp
d/dt(central) <- -kel * central - k12 * central + k21 * peripheral1
d/dt(peripheral1) <- k12 * central - k21 * peripheral1
Cc <- central / vc
Cc ~ prop(propSd)
})
}
# most of the examples in the model library already have a depot
# the PK_2cmt_no_depot is an exception
pk2cmtNoDepot |> addDepot()
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> ── rxode2-based free-form 3-cmt ODE model ──────────────────────────────────────
#> ── Initalization: ──
#> Fixed Effects ($theta):
#> lcl lvc lvp lq propSd lka
#> 1.0 3.0 5.0 0.1 0.5 0.1
#>
#> States ($state or $stateDf):
#> Compartment Number Compartment Name
#> 1 1 depot
#> 2 2 central
#> 3 3 peripheral1
#> ── Model (Normalized Syntax): ──
#> function() {
#> ini({
#> lcl <- 1
#> label("Clearance (CL)")
#> lvc <- 3
#> label("Central volume of distribution (V)")
#> lvp <- 5
#> label("Peripheral volume of distribution (Vp)")
#> lq <- 0.1
#> label("Intercompartmental clearance (Q)")
#> propSd <- c(0, 0.5)
#> label("Proportional residual error (fraction)")
#> lka <- 0.1
#> label("First order absorption rate (ka)")
#> })
#> model({
#> cl <- exp(lcl)
#> vc <- exp(lvc)
#> vp <- exp(lvp)
#> q <- exp(lq)
#> kel <- cl/vc
#> k12 <- q/vc
#> k21 <- q/vp
#> ka <- exp(lka)
#> d/dt(depot) <- -ka * depot
#> d/dt(central) <- -kel * central - k12 * central + k21 *
#> peripheral1 + ka * depot
#> d/dt(peripheral1) <- k12 * central - k21 * peripheral1
#> Cc <- central/vc
#> Cc ~ prop(propSd)
#> })
#> }