Skip to contents

Removes the modeled duration on the central compartment, leaving the dose as an intravenous bolus input. The duration variable is taken from the right hand side of the dur(central) line: when it is defined by an assignment in the model (the tk0 <- exp(ltk0) added by addZeroOrderAbs() or the durCentral added by addDur()) the variable and its initial estimate are dropped too; a bare estimated parameter that is not used elsewhere in the model is dropped from the initial estimates. First-order absorption can be restored with addDepot().

Usage

removeZeroOrderAbs(ui, central = "central")

Arguments

ui

The model as a function (or something convertible to an rxUi object)

central

central compartment name

Value

a model where the zero-order absorption is removed

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 |> addZeroOrderAbs() |> removeZeroOrderAbs()
#>  
#>  
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> Warning: 'depot' removed for zero-order absorption model
#>  ── rxode2-based free-form 1-cmt ODE model ────────────────────────────────────── 
#>  ── Initalization: ──  
#> Fixed Effects ($theta): 
#>    lcl    lvc propSd 
#>   1.00   3.45   0.50 
#> 
#> States ($state or $stateDf): 
#>   Compartment Number Compartment Name
#> 1                  1          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)")
#>     })
#>     model({
#>         cl <- exp(lcl)
#>         vc <- exp(lvc)
#>         kel <- cl/vc
#>         d/dt(central) <- -kel * central
#>         Cc <- central/vc
#>         Cc ~ prop(propSd)
#>     })
#> }