Skip to contents

Convert linCmt rxUi models to ODE rxUi models

Usage

linToOde(ui)

Arguments

ui

rxUi-like model object

Value

rxUi model with linCmt() translated to explicit ODEs

Author

Matthew Fidler

Examples

oneCmt <- function() {
  ini({
    tka <- 0.45
    tcl <- log(2.7)
    tv <- 3.45
    add.sd <- 0.7
  })
  model({
    ka <- exp(tka)
    cl <- exp(tcl)
    v <- exp(tv)
    cp <- linCmt()
    cp ~ add(add.sd)
  })
}

oneCmtOde <- linToOde(oneCmt)
#>  
#>  
#>  parameter labels from comments are typically ignored in non-interactive mode
#>  Need to run with the source intact to parse comments



pkpd <- function() {
  ini({
    ka <- 1
    cl <- 2
    v <- 20
    kin <- 1
    kout <- 1
    ec50 <- 2
  })
  model({
    cp <- linCmt(ka, cl, v)
    eff(0) <- 1
    d/dt(eff) <- kin - kout * (1 - cp/(ec50 + cp)) * eff
  })
}

pkpdOde <- linToOde(pkpd)
#>  
#>  
#>  parameter labels from comments are typically ignored in non-interactive mode
#>  Need to run with the source intact to parse comments