% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rxLinCmt.R
\name{linToOde}
\alias{linToOde}
\title{Convert linCmt rxUi models to ODE rxUi models}
\usage{
linToOde(ui)
}
\arguments{
\item{ui}{rxUi-like model object}
}
\value{
rxUi model with \code{linCmt()} translated to explicit ODEs
}
\description{
Convert linCmt rxUi models to ODE rxUi models
}
\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)



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)

}
\author{
Matthew Fidler
}
