\inputencoding{utf8}
\HeaderA{create.intervals}{Create Integration Intervals Based on Dosing History}{create.intervals}
\keyword{method}{create.intervals}
%
\begin{Description}\relax
\code{create.intervals} is a utility function that is called by the model
template based on ordinary differential equations. It allows the overall
integration interval to be split into sub-intervals based upon dosing history.
This allows for the exact implementation of bolus inputs into the system.
\end{Description}
%
\begin{Usage}
\begin{verbatim}
  create.intervals(xdata = NULL,
                   dosing = NULL)
\end{verbatim}
\end{Usage}
%
\begin{Arguments}
\begin{ldescription}
\item[\code{xdata}] A vector of numerical observations times.
\item[\code{dosing}] A d x 4 data.frame of dosing history containing the following 
columns: \begin{description}

\item[Time] Dosing event times.
\item[State] State where the input should be assigned to.
\item[Bolus] Amount that should be assigned to system \code{state} at the
corresponding \code{Time}.
\item[Infusion.Rate] Rate of input that should be assigned to system
\code{state} at the corresponding \code{Time}. See
\code{vignette('scaRabee',package='scaRabee')} for more details about
the interpolation of the input rate at time not specified in
\code{dosing}.

\end{description}


\end{ldescription}
\end{Arguments}
%
\begin{Details}\relax
\code{create.intervals} determines the number of unique bolus dosing events
there is by system state in \code{dosing}. It then creates the sub-intervals
using these unique event times. If the first dosing events occurs after the
first observation time, an initial sub-interval is added. 
\end{Details}
%
\begin{Value}
Returns a 2 x v matrix of numerical values, giving the beginning and the end
of the integration intervals.
\end{Value}
%
\begin{Author}\relax
Sebastien Bihorel (\email{sb.pmlab@gmail.com})
\end{Author}
