% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/adjointDiscrete.R
\name{.rxDiscreteForwardSens}
\alias{.rxDiscreteForwardSens}
\title{Discrete forward sensitivity of a fixed-step RK4 solve}
\usage{
.rxDiscreteForwardSens(build, X0, params, h, nStep, doses = NULL, S0 = NULL)
}
\arguments{
\item{build}{object from \code{\link[=.rxDiscreteAdjointBuild]{.rxDiscreteAdjointBuild()}}.}

\item{X0}{named numeric initial state (order = \code{build$st}).}

\item{params}{named numeric parameter vector.}

\item{h}{fixed step size.}

\item{nStep}{number of RK4 steps (final time \verb{= h * nStep}).}

\item{doses}{optional list of additive-bolus dose specs, each
\verb{list(step = <0-based grid step>, cmt = <state name>, amt = <numeric>)};
applied (with bioavailability \code{f(cmt)} if defined) at the start of the step.}

\item{S0}{optional initial sensitivity (\verb{ns x np}); default zero.}
}
\value{
list with \code{XN}, \code{SN} (\verb{ns x np}), \code{Sall} (per-step \code{S}), \code{stages}.
}
\description{
Integrates the state and its exact derivative \code{S = dX/dtheta} through the RK4
map, storing the stages for the discrete adjoint.
}
\author{
Matthew L. Fidler
}
\keyword{internal}
