Skip to contents

Converts first order absorption model to Weibull absorption model

Usage

addWeibullAbs(
  ui,
  ntransit,
  central = "central",
  depot = "depot",
  transit = "transit",
  wa = "wa",
  wb = "wb",
  ka = "ka",
  ktr = "ktr"
)

Arguments

ui

The model as a function

ntransit

the number of transit compartments to be added

central

central compartment name

depot

depot compartment name

transit

the transit compartment prefix

wa

Weibull alpha parameter name

wb

Weibull beta parameter name

ka

absorption rate parameter name

ktr

the parameter name for the transit compartment rate

Value

model where first order absorption is changed to Weibull absorption model

Author

Matthew L. Fidler

Examples

pk1cmtDes <- function() {
  ini({
    lka <- 0.45; label("Absorption rate (Ka)")
    lcl <- 1; label("Clearance (CL)")
    lvc <- 3.45; label("Central volume of distribution (V)")
    propSd <- 0.5; label("Proportional residual error (fraction)")
  })
  model({
    ka <- exp(lka)
    cl <- exp(lcl)
    vc <- exp(lvc)
    kel <- cl / vc
    d/dt(depot) <- -ka * depot
    d/dt(central) <- ka * depot - kel * central
    Cc <- central / vc
    Cc ~ prop(propSd)
  })
}

pk1cmtDes |>
  addWeibullAbs()
#>  
#>  
#> ℹ 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 2-cmt ODE model ────────────────────────────────────── 
#>  ── Initalization: ──  
#> Fixed Effects ($theta): 
#>    lcl    lvc propSd    lwa    lwb 
#>   1.00   3.45   0.50   0.10   0.10 
#> 
#> States ($state or $stateDf): 
#>   Compartment Number Compartment Name
#> 1                  1            depot
#> 2                  2          central
#>  ── Model (Normalized Syntax): ── 
#> function() {
#>     ini({
#>         lcl <- 1
#>         label("Clearance (CL)")
#>         lvc <- 3.45
#>         label("Central volume of distribution (V)")
#>         propSd <- c(0, 0.5)
#>         label("Proportional residual error (fraction)")
#>         lwa <- 0.1
#>         label("Weibull absorption alpha (wa)")
#>         lwb <- 0.1
#>         label("Weibull absorption beta (wb)")
#>     })
#>     model({
#>         wa <- exp(lwa)
#>         wb <- exp(lwb)
#>         cl <- exp(lcl)
#>         vc <- exp(lvc)
#>         kel <- cl/vc
#>         d/dt(depot) <- -(wb/wa) * (tad0(depot)/wa)^(wb - 1) * 
#>             depot
#>         d/dt(central) <- (wb/wa) * (tad0(depot)/wa)^(wb - 1) * 
#>             depot - kel * central
#>         Cc <- central/vc
#>         Cc ~ prop(propSd)
#>     })
#> }