% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mdose.r
\name{mdose}
\alias{mdose}
\title{Performs multiple dosing in case of analytical solution of model}
\usage{
mdose(Dose, tau, ndose, t, func, ...)
}
\arguments{
\item{Dose}{numeric vector with the dosing height}

\item{tau}{numeric vector with the tau of dosing}

\item{ndose}{numeric vector with the number of doses}

\item{t}{numeric vector with the time-points that should be outputted}

\item{func}{name of the function for which multiple dosing should be applied}

\item{...}{arguments for func}
}
\value{
a data frame with the superimposed results
}
\description{
This function takes a function that defines a model in analytical solution and performs multiple dosing for it
}
\details{
This function will create a list that can be used to perform superposition
which is necessary in case of an analytical solution in a multiple dose setting.
The function will check if there is an overlap in arguments and will use the arguments
given to \code{mdose} for the function given in \code{func} if applicable (e.g. it is
likely that \code{func} has an argument for Dose, in this case it will use the Dose argument
provide in \code{mdose})
The function can have any number of arguments that can be passed using "...". However there
should at least be an argument \code{t} which is the time vector for which simulations are
necessary.
}
\examples{

ana1CMTiv <- function(Dose,pars,t){
  Dose * pars['C'] * exp(-pars['L']*t)
}
res <- mdose(10, tau = 24, ndose = 5, t = 0:240, 
             func = ana1CMTiv, pars = c(L=.01,C=5))
plot(res$time,res$y, type="l")

}
\author{
Richard Hooijmaijers
}
