library(ggplot2)
ana2CMToral <- function(Dose,pars,t){
  with(as.list(pars),{
    (Dose * C1 * KA/(KA-L1) * (exp(-L1*t) - exp(-KA*t))) + (Dose * C2 * KA/(KA-L2) * (exp(-L2*t) - exp(-KA*t)))
  })

}
pars   <- c(KA=0.1,C1=500,L1=2,C2=10,L2=0.01)
times  <- seq(0,24,length.out=200)
out    <- amp.sim::mdose(Dose=10,tau=24,ndose=1,t=times,func=ana2CMToral,pars=pars)
ggplot(out,aes(time,y)) + geom_line()
