% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rxsolve.R
\name{rxSolve}
\alias{rxSolve}
\alias{rxSolve.function}
\alias{rxSolve.rxUi}
\alias{rxSolve.rxode2tos}
\alias{rxSolve.nlmixr2FitData}
\alias{rxSolve.nlmixr2FitCore}
\alias{rxSolve.default}
\alias{update.rxSolve}
\alias{rxSolve.rxSolve}
\alias{predict.rxode2}
\alias{predict.function}
\alias{predict.rxUi}
\alias{predict.rxSolve}
\alias{predict.rxEt}
\alias{predict.rxParams}
\alias{simulate.rxode2}
\alias{simulate.rxSolve}
\alias{simulate.rxParams}
\alias{solve.rxSolve}
\alias{solve.rxUi}
\alias{solve.function}
\alias{solve.rxode2}
\alias{solve.rxParams}
\alias{solve.rxEt}
\alias{rxControl}
\title{Options, Solving & Simulation of an ODE/solved system}
\usage{
rxSolve(
  object,
  params = NULL,
  events = NULL,
  inits = NULL,
  scale = NULL,
  method = c("liblsoda", "lsoda", "dop853", "indLin", "f78", "rk4", "ck54", "ab", "abm",
    "dop5", "bs", "ros4", "iem", "sem", "sb3a", "sb3am4", "vv", "mm", "em", "cvode",
    "trapz", "ssp3", "f32", "rk43", "dop54", "vern65", "vern76", "dop87", "vern98",
    "ros43", "ros6", "backwardEuler", "gauss6", "iiic6", "radauiia5", "geng5", "sdirk43",
    "euler", "midpoint", "heun", "ssp22", "rk3", "ssp53", "s4", "r4", "ls44", "ls54",
    "ssp54", "s5", "rk5", "c5", "l5", "lk5a", "lk5b", "b6", "s7", "s8_10", "cv8",
    "s8_12", "s10", 
     "z10", "o10", "h10", "dp54", "v65e", "v76e", "dp87", "v98e",
    "ssp33", "bs32", "ssp43", "f45", "t54", "s54", "pp54", "pp54b", "bs54", "ss54",
    "dp65", "c65", "tp64", "v65r", "v65", "dverk65", "tf65", "tp75", "tmy7", "tmy7s",
    "v76r", "ss76", "v78", "dverk78", "dp85", "tp86", "v87e", "v87r", "ev87", "k87",
    "f89", "v89", "t98a", "v98r", "s98", "f108", "c108", "b109", "s1110a", "f1210",
    "o129", "f1412", "lsode", "bdf", "rk4s", "eulers", "midpoints", "heuns", "dop5s",
    "dop853s", "ck54s", "bs32s", "vern65s", 
     "vern76s", "dop87s", "f78s", "ros4s",
    "radauiia5s", "backwardEulers", "gauss6s", "sdirk43s", "iiic6s", "ros43s", "ros6s",
    "geng5s", "rk3s", "rk43s", "cvodesadj", "liblsodaadj", "abs", "dop54s", "dp54s",
    "vern98s", "f45s", "t54s", "pp54s", "pp54bs", "bs54s", "ss54s", "dp65s", "c65s",
    "tp64s", "v65rs", "dverk65s", "tf65s", "tp75s", "tmy7sadj", "tmy7adj", "v76rs",
    "ss76s", "v78s", "dverk78s", "dp85s", "tp86s", "v87es", "v87rs", "ev87s", "k87s",
    "v89s", "t98as", "v98rs", "s98s", "c108s", "b109s", 
     "s1110as", "o129s"),
  sigdig = NULL,
  atol = 1e-08,
  rtol = 1e-06,
  maxsteps = 70000L,
  hmin = 0,
  hmax = NA_real_,
  hmaxSd = 0,
  hini = 0,
  maxordn = 12L,
  maxords = 5L,
  order = 5L,
  ...,
  cores,
  covsInterpolation = c("locf", "linear", "nocb", "midpoint"),
  naInterpolation = c("locf", "nocb"),
  keepInterpolation = c("na", "locf", "nocb"),
  addCov = TRUE,
  sigma = NULL,
  sigmaDf = NULL,
  sigmaLower = -Inf,
  sigmaUpper = Inf,
  nCoresRV = 1L,
  sigmaIsChol = FALSE,
  sigmaSeparation = c("auto", "lkj", "separation"),
  sigmaXform = c("identity", "variance", "log", "nlmixrSqrt", "nlmixrLog",
    "nlmixrIdentity"),
  nDisplayProgress = 10000L,
  amountUnits = NA_character_,
  timeUnits = "hours",
  theta = NULL,
  thetaLower = -Inf,
  thetaUpper = Inf,
  eta = NULL,
  addDosing = FALSE,
  stateTrim = Inf,
  updateObject = FALSE,
  omega = NULL,
  omegaDf = NULL,
  omegaIsChol = FALSE,
  omegaSeparation = c("auto", "lkj", "separation"),
  omegaXform = c("variance", "identity", "log", "nlmixrSqrt", "nlmixrLog",
    "nlmixrIdentity"),
  omegaLower = -Inf,
  omegaUpper = Inf,
  nSub = 1L,
  thetaMat = NULL,
  thetaDf = NULL,
  thetaIsChol = FALSE,
  nStud = 1L,
  dfSub = 0,
  dfObs = 0,
  returnType = c("rxSolve", "matrix", "data.frame", "data.frame.TBS", "data.table",
    "tbl", "tibble"),
  seed = NULL,
  nsim = NULL,
  minSS = 10L,
  maxSS = 10000L,
  infSSstep = 12,
  strictSS = TRUE,
  istateReset = TRUE,
  subsetNonmem = TRUE,
  maxAtolRtolFactor = 0.1,
  from = NULL,
  to = NULL,
  by = NULL,
  length.out = NULL,
  iCov = NULL,
  keep = NULL,
  indLinPhiTol = 1e-07,
  indLinPhiM = 0L,
  indLinMatExpType = c("expokit", "Al-Mohy", "arma"),
  indLinMatExpOrder = 6L,
  drop = NULL,
  idFactor = TRUE,
  mxhnil = 0,
  hmxi = 0,
  warnIdSort = TRUE,
  warnDrop = TRUE,
  ssAtol = 1e-08,
  ssRtol = 1e-06,
  safeZero = TRUE,
  safeLog = TRUE,
  safePow = TRUE,
  sumType = c("pairwise", "fsum", "kahan", "neumaier", "c"),
  prodType = c("long double", "double", "logify"),
  resample = NULL,
  resampleID = TRUE,
  maxwhile = 1e+05,
  atolSens = 1e-08,
  rtolSens = 1e-06,
  ssAtolSens = 1e-08,
  ssRtolSens = 1e-06,
  simVariability = NA,
  nLlikAlloc = NULL,
  useStdPow = FALSE,
  naTimeHandle = c("ignore", "warn", "error"),
  addlKeepsCov = FALSE,
  addlDropSs = TRUE,
  ssAtDoseTime = TRUE,
  ss2cancelAllPending = FALSE,
  ssSolved = TRUE,
  linCmtSensType = c("auto", "endpoint5", "endpoint5G", "forward3", "forward3G", "AD",
    "ADr", "central", "forward", "forwardG", "forwardH", "centralH", "forward3H",
    "endpointH5", "forwardG"),
  linCmtSensH = 1e-04,
  linCmtGillFtol = 0,
  linCmtGillK = 20L,
  linCmtGillStep = 4,
  linCmtGillRtol = sqrt(.Machine$double.eps),
  linCmtShiErr = sqrt(.Machine$double.eps),
  linCmtShiMax = 20L,
  linCmtScale = FALSE,
  linCmtHcmt = NULL,
  linCmtHmeanI = c("geometric", "arithmetic", "harmonic"),
  linCmtHmeanO = c("geometric", "arithmetic", "harmonic"),
  linCmtSuspect = 1e-06,
  linCmtForwardMax = 2L,
  indOwnAlloc = NA,
  maxExtra = 1000L,
  tolFactor = NULL,
  serializeFile = NULL,
  dense = FALSE,
  cvodeLinSolver = c("dense", "band", "gmres", "bicgstab", "tfqmr"),
  autoSwitchNonstifftol = 9/10,
  autoSwitchStifftol = 9/10,
  autoSwitchDtfac = 2,
  autoSwitchMaxStiff = 10L,
  autoSwitchMaxNonstiff = 3L,
  autoSwitchStiffFirst = FALSE,
  autoSwitchSwitchMax = 5L,
  stiff2 = 0L,
  useLinCmt = getOption("rxode2.useLinCmt", TRUE),
  file = NULL,
  chunkSize = NULL,
  parallel = 0L,
  envir = parent.frame()
)

\method{rxSolve}{`function`}(
  object,
  params = NULL,
  events = NULL,
  inits = NULL,
  ...,
  theta = NULL,
  eta = NULL,
  envir = parent.frame()
)

\method{rxSolve}{rxUi}(
  object,
  params = NULL,
  events = NULL,
  inits = NULL,
  ...,
  useLinCmt = TRUE,
  theta = NULL,
  eta = NULL,
  envir = parent.frame()
)

\method{rxSolve}{rxode2tos}(
  object,
  params = NULL,
  events = NULL,
  inits = NULL,
  ...,
  useLinCmt = TRUE,
  theta = NULL,
  eta = NULL,
  envir = parent.frame()
)

\method{rxSolve}{nlmixr2FitData}(
  object,
  params = NULL,
  events = NULL,
  inits = NULL,
  ...,
  theta = NULL,
  eta = NULL,
  envir = parent.frame()
)

\method{rxSolve}{nlmixr2FitCore}(
  object,
  params = NULL,
  events = NULL,
  inits = NULL,
  ...,
  theta = NULL,
  eta = NULL,
  envir = parent.frame()
)

\method{rxSolve}{default}(
  object,
  params = NULL,
  events = NULL,
  inits = NULL,
  ...,
  indOwnAlloc = TRUE,
  theta = NULL,
  eta = NULL,
  envir = parent.frame()
)

\method{update}{rxSolve}(object, ...)

\method{rxSolve}{rxSolve}(
  object,
  params = NULL,
  events = NULL,
  inits = NULL,
  ...,
  theta = NULL,
  eta = NULL,
  envir = parent.frame()
)

\method{predict}{rxode2}(object, ...)

\method{predict}{`function`}(object, ...)

\method{predict}{rxUi}(object, ...)

\method{predict}{rxSolve}(object, ...)

\method{predict}{rxEt}(object, ...)

\method{predict}{rxParams}(object, ...)

\method{simulate}{rxode2}(object, nsim = 1L, seed = NULL, ...)

\method{simulate}{rxSolve}(object, nsim = 1L, seed = NULL, ...)

\method{simulate}{rxParams}(object, nsim = 1L, seed = NULL, ...)

\method{solve}{rxSolve}(a, b, ...)

\method{solve}{rxUi}(a, b, ...)

\method{solve}{`function`}(a, b, ...)

\method{solve}{rxode2}(a, b, ...)

\method{solve}{rxParams}(a, b, ...)

\method{solve}{rxEt}(a, b, ...)

rxControl(
  ...,
  params = NULL,
  events = NULL,
  inits = NULL,
  envir = parent.frame()
)
}
\arguments{
\item{object}{is a either a rxode2 family of objects, or a file-name
with a rxode2 model specification, or a string with a rxode2
model specification.}

\item{params}{a numeric named vector with values for every
parameter in the ODE system; the names must correspond to the
parameter identifiers used in the ODE specification;}

\item{events}{an \code{eventTable} object describing the input
(e.g., doses) to the dynamic system and observation sampling
time points (see \code{\link[=eventTable]{eventTable()}});}

\item{inits}{a vector of initial values of the state variables
(e.g., amounts in each compartment), and the order in this
vector must be the same as the state variables (e.g., PK/PD
compartments);}

\item{scale}{a numeric named vector with scaling for ode
parameters of the system.  The names must correspond to the
parameter identifiers in the ODE specification. Each of the
ODE variables will be divided by the scaling factor.  For
example \code{scale=c(center=2)} will divide the center ODE
variable by 2.}

\item{method}{The method for solving ODEs.  Currently this supports:
\itemize{
\item \code{"liblsoda"} thread safe lsoda.  This supports parallel
thread-based solving, and ignores user Jacobian specification.
\item \code{"lsoda"} -- LSODA solver.  Does not support parallel thread-based
solving, but allows user Jacobian specification.
\item \code{"dop853"} -- DOP853 solver.  Does not support parallel thread-based
solving nor user Jacobian specification
\item \code{"indLin"} -- Solving through inductive linearization.  The rxode2 dll
must be setup specially to use this solving routine.
\item \code{"f78"} -- Runge-Kutta Fehlberg 78 solver using Boost's odeint library.
\item \code{"rk4"} -- Runge-Kutta 4 solver using Boost's odeint library.
\item \code{"ck54"} -- Cash-Karp 5(4) solver using Boost's odeint library.
\item \code{"ab"} -- Adams-Bashforth multi-step solver with a direct implementation
(order 1-8, default 5). Uses RK4 to initialize the derivative history and
then applies the Adams-Bashforth extrapolation formula. Is a fixed-step
method (step size controlled by \code{hmin}).
\item \code{"abm"} -- Adams-Bashforth-Moulton solver using Boost's odeint library.
\item \code{"dop5"} -- DOPRI5 solver using Boost's odeint library (supports dense output).
\item \code{"bs"} -- Bulirsch-Stoer solver using Boost's odeint library (supports dense output).
\item \code{"ros4"} \strong{(implicit)} -- Rosenbrock 4 solver using Boost's odeint library (supports dense output).
Requires an analytical Jacobian (auto-computed from the model when not provided);
falls back to \code{liblsoda} if Jacobian generation fails.
\item \code{"ros43"} \strong{(implicit)} -- Kaps-Rentrop 4th-order A-stable Rosenbrock method (GRK4A) from libode.
Adaptive step size via embedded 3rd-order error estimate.
Requires an analytical Jacobian (auto-computed from the model when not provided);
falls back to \code{liblsoda} if Jacobian generation fails.
\item \code{"ros6"} \strong{(implicit)} -- Kaps-Wanner 6th-order A-stable Rosenbrock method (ROW6A) from libode.
Fixed step size (set with \code{hmin}). Requires Jacobian; falls back to \code{liblsoda} if unavailable.
\item \code{"backwardEuler"} \strong{(implicit)} -- Backward Euler (BDF-1), 1st-order L-stable fully implicit method from libode.
Fixed step size (set with \code{hmin}). Requires Jacobian; falls back to \code{liblsoda} if unavailable.
\item \code{"gauss6"} \strong{(implicit)} -- Gauss-Legendre 6th-order A-stable fully-implicit method (3 stages) from libode.
Fixed step size. Requires Jacobian; falls back to \code{liblsoda} if unavailable.
\item \code{"iiic6"} \strong{(implicit)} -- Lobatto IIIC 6th-order L-stable fully-implicit method (4 stages) from libode.
Fixed step size. Requires Jacobian; falls back to \code{liblsoda} if unavailable.
\item \code{"radauiia5"} \strong{(implicit)} -- Radau IIA 5th-order L-stable fully-implicit method (3 stages) from libode.
Fixed step size (set with \code{hmin}). Requires Jacobian; falls back to \code{liblsoda} if unavailable.
\item \code{"geng5"} \strong{(implicit)} -- Geng 5th-order symplectic fully-implicit method (3 stages) from libode.
Fixed step size. Requires Jacobian; falls back to \code{liblsoda} if unavailable.
\item \code{"sdirk43"} \strong{(implicit)} -- L-stable SDIRK 4(3) pair from libode.
Adaptive step size via embedded 3rd-order error estimate.
Requires Jacobian; falls back to \code{liblsoda} if unavailable.
\item \code{"iem"} \strong{(implicit)} -- Implicit Euler solver using Boost's odeint library.
Requires an explicit Jacobian (auto-generated via \code{calcJac=TRUE} when not provided).
Uses Boost.uBLAS vectors and is a fixed-step method (step size controlled by \code{hmin}).
\item \code{"sem"} -- Symplectic Euler solver using Boost's odeint library.
Requires splitting the state into coordinate-momentum pairs (and
automatically pads odd-dimensional systems).  Is a fixed-step
method (step size controlled by \code{hmin}).
\item \code{"sb3a"} -- Symplectic Runge-Kutta-Nystrom SB3A McLachlan stepper
using Boost's odeint library.  Requires splitting the state into
coordinate-momentum pairs (and automatically pads odd-dimensional
systems).  Is a fixed-step method (step size controlled by
\code{hmin}).
\item \code{"sb3am4"} -- Symplectic Runge-Kutta-Nystrom SB3A M4 McLachlan
stepper using Boost's odeint library.  Requires splitting the
state into coordinate-momentum pairs (and automatically pads
odd-dimensional systems).  Is a fixed-step method (step size
controlled by \code{hmin}).
\item \code{"vv"} -- Velocity Verlet stepper using Boost's odeint library.
Requires splitting the state into coordinate-momentum pairs (and
automatically pads odd-dimensional systems).  Is a fixed-step
method (step size controlled by \code{hmin}).
\item \code{"mm"} -- Modified Midpoint stepper using Boost's odeint library.
Is a fixed-step method (step size controlled by \code{hmin}) and uses
the \code{order} parameter to configure the number of intermediate
steps.
\item \code{"em"} -- Explicit Euler stepper using Boost's odeint library.
Is a fixed-step method (step size controlled by \code{hmin}).
\item \code{"cvode"} -- CVODE BDF stiff solver from the SUNDIALS library (sources
and headers vendored into rxode2).  Supports thread-parallel solving and
per-compartment absolute tolerances.
\item \code{"trapz"} -- Explicit trapezoidal rule (Heun's method), a 2nd-order
fixed-step Runge-Kutta method implemented via the libode library.
Each inter-event interval is integrated with fixed steps of size
\code{hmin} (default \code{0.01} when \code{hmin=0}).  If \code{hmin} would require
more than \code{maxsteps} steps to span the interval, the step size is
automatically enlarged to stay within that limit.  When an
inter-event interval is shorter than the nominal step size (e.g.,
two doses very close together), the step is silently clamped to the
interval length so that short intervals are always handled correctly.
Supports parallel thread-based solving and steady-state (\code{ss=1})
dosing.  The method does not use \code{atol} or \code{rtol} (fixed-step; no
error control).  Steady-state convergence is governed by \code{ssAtol},
\code{ssRtol}, \code{minSS}, \code{maxSS}, and \code{strictSS}.
\item \code{"ssp3"} -- Strong Stability-Preserving Runge-Kutta of order 3 (SSP-RK3,
Shu-Osher method), implemented via the libode library.  A 3-stage,
3rd-order explicit fixed-step method with superior non-oscillatory
properties for problems with discontinuities or sharp fronts.  Uses
the Butcher tableau c2=1, a21=1; c3=1/2, a31=1/4, a32=1/4;
b1=1/6, b2=1/6, b3=2/3.  The step-size behavior, clamping, and
steady-state options (\code{hmin}, \code{maxsteps}, \code{ssAtol}, \code{ssRtol},
\code{minSS}, \code{maxSS}, \code{strictSS}) are identical to \code{"trapz"}.  Does
not use \code{atol} or \code{rtol} (fixed-step; no error control).  Supports
parallel thread-based solving and steady-state (\code{ss=1}) dosing.
\item \code{"f32"} -- Fehlberg 3(2) embedded pair from libode (class \code{OdeRKF32}).
A 3-stage, 3rd-order adaptive method with a built-in 2nd-order error
estimate for automatic step-size control.  Tableau: c2=1, a21=1;
c3=1/2, a31=1/4, a32=1/4; primary (3rd-order) weights d1=1/6, d2=1/6,
d3=4/6; embedded (2nd-order) weights b1=1/2, b2=1/2.  Uses \code{atol} and \code{rtol}
for error control.  The \code{hmin}
parameter sets the initial step size (default \code{0.01}); subsequent steps
are chosen adaptively.  The total number of accepted and rejected steps
is bounded by \code{maxsteps}.  Supports parallel thread-based solving and
steady-state (\code{ss=1}) dosing with convergence governed by \code{ssAtol},
\code{ssRtol}, \code{minSS}, \code{maxSS}, and \code{strictSS}.
\item \code{"rk43"} -- Runge-Kutta 4(3) pair from libode.  A 5-stage, 4th-order
adaptive method with a built-in 3rd-order embedded error estimate for
automatic step-size control.  Tableau: c2=1/3, a21=1/3; c3=2/3,
a31=-1/3, a32=1; c4=1, a41=1, a42=-1, a43=1; a5j=bj (FSAL).
Primary (4th-order) weights b1=b4=1/8, b2=b3=3/8; embedded (3rd-order)
weights d1=1/12, d2=1/2, d3=1/4, d5=1/6.  Since a5j=bj the 5th stage
evaluation is reused as the 1st stage of the next step (FSAL).
Uses \code{atol} and \code{rtol} for error control.  The \code{hmin} parameter sets
the initial step size (default \code{0.01}); subsequent steps are chosen
adaptively.  The
total number of steps is bounded by \code{maxsteps}.  Supports parallel
thread-based solving and steady-state (\code{ss=1}) dosing with convergence
governed by \code{ssAtol}, \code{ssRtol}, \code{minSS}, \code{maxSS}, and \code{strictSS}.
\item \code{"dop54"} -- Dormand-Prince 5(4) FSAL method (Dormand & Prince 1980),
implemented via the libode library.  The same algorithm as MATLAB's
\code{ode45}.  A 7-stage, 5th-order adaptive method with an embedded
4th-order error estimate for automatic step-size control (FSAL: the
7th stage evaluation is reused as the 1st stage of the next step,
giving effectively 6 function evaluations per accepted step).  Uses
\code{atol} and \code{rtol} for error control.  The \code{hmin} parameter sets the
initial step size (default \code{0.01}); subsequent steps are chosen
adaptively.  The total number of steps is bounded by \code{maxsteps}.
Supports parallel thread-based solving and steady-state (\code{ss=1})
dosing with convergence governed by \code{ssAtol}, \code{ssRtol}, \code{minSS},
\code{maxSS}, and \code{strictSS}.  NaN/Inf in derivatives (e.g. from NA
parameters) is detected immediately and the solve exits with NA
output for the affected subject.
\item \code{"vern65"} -- Jim Verner's "most efficient" 6(5) FSAL pair (9 stages),
implemented via the libode library using coefficients from Verner's own
website (RKV65.IIIXb.Efficient).  A 6th-order adaptive method with an
embedded 5th-order error estimate.  The sparse tableau (many zero
a-coefficients) reduces function evaluations; the FSAL property means the
9th stage evaluation is reused as the 1st stage of the next step, giving
effectively 8 function evaluations per accepted step.  Uses \code{atol} and
\code{rtol} for error control.  The \code{hmin} parameter sets the initial step
size (default \code{0.01}); subsequent steps are chosen adaptively.  The total
number of steps is bounded by \code{maxsteps}.  Supports parallel thread-based
solving and steady-state (\code{ss=1}) dosing with convergence governed by
\code{ssAtol}, \code{ssRtol}, \code{minSS}, \code{maxSS}, and \code{strictSS}.  NaN/Inf in
derivatives is detected immediately and the solve exits with NA output.
\item \code{"vern76"} -- Jim Verner's "most efficient" 7(6) pair (10 stages),
implemented via the libode library using coefficients from Verner's own
website (RKV76.IIa.Efficient).  A 7th-order adaptive method with an
embedded 6th-order error estimate.  The sparse tableau reduces function
evaluations per step.  Uses \code{atol} and \code{rtol} for error control.  The
\code{hmin} parameter sets the initial step size (default \code{0.01}); subsequent
steps are chosen adaptively.  The total number of steps is bounded by
\code{maxsteps}.  Supports parallel thread-based solving and steady-state
(\code{ss=1}) dosing with convergence governed by \code{ssAtol}, \code{ssRtol},
\code{minSS}, \code{maxSS}, and \code{strictSS}.  NaN/Inf in derivatives is detected
immediately and the solve exits with NA output.
\item \code{"dop87"} -- Dormand-Prince 8(7) pair (13 stages), implemented via the
libode library using coefficients from Hairer, Norsett and Wanner (1993)
"Solving ODEs I" (2nd ed.).  An 8th-order adaptive method with an
embedded 7th-order error estimate.  Both solutions are computed from the
original state in the final step loop.  Uses \code{atol} and \code{rtol} for error
control.  The \code{hmin} parameter sets the initial step size (default
\code{0.01}); subsequent steps are chosen adaptively.  The total number of
steps is bounded by \code{maxsteps}.  Supports parallel thread-based solving
and steady-state (\code{ss=1}) dosing with convergence governed by \code{ssAtol},
\code{ssRtol}, \code{minSS}, \code{maxSS}, and \code{strictSS}.  NaN/Inf in derivatives is
detected immediately and the solve exits with NA output.
\item \code{"vern98"} -- Jim Verner's "most efficient" 9(8) pair (16 stages),
implemented via the libode library using coefficients from Verner's own
website (RKV98.IIa.Efficient).  A 9th-order adaptive method with an
embedded 8th-order error estimate.  The highly sparse tableau (stages
8-16 use only \eqn{k_{0}}{x_0} and \eqn{k_{5..}}{k_5..}) minimizes function evaluations per
step.  Both solutions are computed from the original state in the final
step loop.  Uses \code{atol} and \code{rtol} for error control.  The \code{hmin}
parameter sets the initial step size (default \code{0.01}); subsequent steps
are chosen adaptively.  The total number of steps is bounded by
\code{maxsteps}.  Supports parallel thread-based solving and steady-state
(\code{ss=1}) dosing with convergence governed by \code{ssAtol}, \code{ssRtol},
\code{minSS}, \code{maxSS}, and \code{strictSS}.  NaN/Inf in derivatives is detected
immediately and the solve exits with NA output.
}

\strong{Aliases for existing methods} (no additional C++ code; \code{hmin}, \code{atol},
\code{rtol}, and \code{maxsteps} follow the aliased method):
\itemize{
\item \code{"dp54"} -- alias for \code{"dop54"} (Dormand-Prince 5(4) FSAL, libode).
\item \code{"v65e"} -- alias for \code{"vern65"} (Verner 6(5) efficient, libode).
\item \code{"v76e"} -- alias for \code{"vern76"} (Verner 7(6) efficient, libode).
\item \code{"dp87"} -- alias for \code{"dop87"} (Dormand-Prince 8(7), libode).
\item \code{"v98e"} -- alias for \code{"vern98"} (Verner 9(8) efficient, libode).
\item \code{"ssp33"} -- alias for \code{"ssp3"} (Strong Stability-Preserving RK3, libode).
}

\strong{libode fixed-step explicit methods}.  All use \code{hmin} as the fixed step
size (default \code{0.01} when \code{hmin=0}); \code{atol} and \code{rtol} are ignored (no
error control); \code{maxsteps} bounds the total number of steps; NaN/Inf in
derivatives sets \code{ind$err} and the subject exits with NA output.  All
support parallel thread-based solving.
\itemize{
\item \code{"euler"} -- Forward (explicit) Euler, 1st-order, 1 stage.  Requires a
very small step size for accuracy (e.g., \code{hmin=1e-4}); intended for
pedagogical use or method-comparison baselines.
\item \code{"midpoint"} -- Explicit midpoint rule, 2nd-order, 2 stages.
\item \code{"heun"} -- Heun's method (explicit trapezoid), 2nd-order, 2 stages.
Identical in structure to \code{"trapz"} but uses the libode fixed-step driver.
\item \code{"ssp22"} -- Strong Stability-Preserving 2-stage 2nd-order method
(SSP-RK22), 2 stages.  Superior non-oscillatory properties near
discontinuities.
\item \code{"rk3"} -- Classical 3rd-order Runge-Kutta (Kutta 1901), 3 stages.
\item \code{"ssp53"} -- Strong Stability-Preserving 5-stage 3rd-order method
(SSP-RK53), 5 stages.  High SSP coefficient for hyperbolic PDEs or
event-heavy ODE systems.
\item \code{"s4"} -- Shanks 4th-order method, 4 stages.
\item \code{"r4"} -- Ralston's 4th-order method, 4 stages.  Minimizes local
truncation error among classical 4-stage 4th-order methods.
\item \code{"ls44"} -- Low-storage 4th-order method, 4 stages.  Uses a 2-register
update scheme that minimizes memory bandwidth at the cost of a less
general tableau structure.
\item \code{"ls54"} -- Low-storage 4th-order method, 5 stages.  Five-stage
variant of the 2-register low-storage scheme.
\item \code{"ssp54"} -- Strong Stability-Preserving 5-stage 4th-order method
(SSP-RK54), 5 stages.
\item \code{"s5"} -- Shanks 5th-order method, 5 stages.
\item \code{"rk5"} -- Classical 5th-order Runge-Kutta, 6 stages.
\item \code{"c5"} -- Cassity 5th-order method, 6 stages.
\item \code{"l5"} -- Lawson 5th-order method, 6 stages.
\item \code{"lk5a"} -- Luther-Konen 5th-order method, variant A, 6 stages.
\item \code{"lk5b"} -- Luther-Konen 5th-order method, variant B, 6 stages.
\item \code{"b6"} -- Butcher 6th-order method, 7 stages.
\item \code{"s7"} -- Shanks 7th-order method, 9 stages.
\item \code{"s8_10"} -- Shanks 8th-order method, 10 stages.
\item \code{"cv8"} -- Cooper-Verner 8th-order method, 11 stages.
\item \code{"s8_12"} -- Shanks 8th-order method, 12 stages.
\item \code{"s10"} -- Stepanov 10th-order method, 15 stages.  Requires a moderate
step size (e.g., \code{hmin=1.0}) because a single step is accurate to very
high order.
\item \code{"z10"} -- Zhang 10th-order method, 16 stages.
\item \code{"o10"} -- Ono 10th-order method, 17 stages.
\item \code{"h10"} -- Hairer 10th-order method, 17 stages.
}

\strong{libode adaptive (variable-step) explicit methods}.  All use \code{atol} and
\code{rtol} for error control;
\code{hmin} sets the initial step size (default \code{0.01} when \code{hmin=0}); \code{hmax}
sets the maximum step size; \code{maxsteps} bounds total steps; NaN/Inf in
derivatives sets \code{ind$err} and the subject exits with NA output.  All
support parallel thread-based solving and steady-state (\code{ss=1}) dosing
(convergence governed by \code{ssAtol}, \code{ssRtol}, \code{minSS}, \code{maxSS}, \code{strictSS}).
\itemize{
\item \code{"bs32"} -- Bogacki-Shampine 3(2) FSAL pair, 4 stages (Bogacki &
Shampine 1989).  3rd-order primary with 2nd-order embedded error estimate.
FSAL: the 4th-stage evaluation is reused as the 1st stage of the next
step.  The same algorithm as Julia \code{BS3()} and MATLAB \code{ode23}.
\item \code{"ssp43"} -- Strong Stability-Preserving 4(3) pair, 4 stages.
Adaptive SSP method with a 3rd-order embedded error estimate.
\item \code{"f45"} -- Fehlberg 4(5) pair, 6 stages (Fehlberg 1970).  4th-order
primary solution with a 5th-order embedded estimate used for error
control.
\item \code{"t54"} -- Tsitouras 5(4) FSAL pair, 7 stages (Tsitouras 2011).
5th-order primary with 4th-order embedded error estimate.  FSAL: the
7th stage is reused as the 1st stage of the next step.  The same
Butcher tableau as Julia's \code{Tsit5()}.
\item \code{"s54"} -- Stepanov 5(4) FSAL pair, 7 stages.  5th-order primary
with 4th-order embedded error estimate.
\item \code{"pp54"} -- Papakostas-Papageorgiou 5(4) FSAL pair, 7 stages.
\item \code{"pp54b"} -- Papakostas-Papageorgiou 5(4) variant B FSAL pair,
7 stages.
\item \code{"bs54"} -- Bogacki-Shampine 5(4) pair, 8 stages.  5th-order primary
with 4th-order embedded error estimate (non-FSAL).
\item \code{"ss54"} -- Sharp-Smart 5(4) pair, 7 stages.
\item \code{"dp65"} -- Dormand-Prince 6(5) pair, 8 stages.  6th-order primary
with 5th-order embedded error estimate.
\item \code{"c65"} -- Calvo 6(5) pair, 9 stages.
\item \code{"tp64"} -- Tsitouras-Papakostas 6(4) pair, 7 stages.  6th-order
primary with 4th-order embedded error estimate.
\item \code{"v65r"} -- Verner "robust" 6(5) FSAL pair, 9 stages.  Robust
variant of Verner's 6(5) family with wider stability region.
\item \code{"v65"} -- Verner 6(5) pair, 8 stages (non-FSAL).
\item \code{"dverk65"} -- Verner DVERK 6(5) pair, 8 stages.  Coefficients from
the classic DVERK Fortran code distributed by Hull and Enright.
\item \code{"tf65"} -- Tsitouras-Famelis 6(5) FSAL pair, 9 stages.
\item \code{"tp75"} -- Tsitouras-Papakostas 7(5) pair, 9 stages.  7th-order
primary with 5th-order embedded error estimate.
\item \code{"tmy7"} -- Tanaka-Muramatsu-Yamashita 7th-order pair, 10 stages.
The same family as Julia's \code{TanYam7()}.
\item \code{"tmy7s"} -- Tanaka-Muramatsu-Yamashita 7th-order stable variant,
10 stages.  Alternative coefficient set with wider stability region.
\item \code{"v76r"} -- Verner "robust" 7(6) pair, 10 stages.
\item \code{"ss76"} -- Sharp-Smart 7(6) pair, 11 stages.
\item \code{"v78"} -- Verner 7(8) pair, 13 stages.  7th-order primary with
8th-order embedded error estimate.  Closest rxode2 analog to Julia
\code{Vern8()}.
\item \code{"dverk78"} -- Verner DVERK 7(8) pair, 13 stages.  Coefficients from
the classic DVERK Fortran code; companion to \code{"dverk65"}.  Also close
to Julia \code{Vern8()}.
\item \code{"dp85"} -- Dormand-Prince 8(5) pair, 12 stages.  8th-order primary
with 5th-order embedded error estimate.
\item \code{"tp86"} -- Tsitouras-Papakostas 8(6) pair, 12 stages.  The same
family as Julia's \code{TsitPap8()}.
\item \code{"v87e"} -- Verner "efficient" 8(7) pair, 13 stages.
\item \code{"v87r"} -- Verner "robust" 8(7) pair, 13 stages.
\item \code{"ev87"} -- Enright-Verner 8(7) pair, 13 stages.
\item \code{"k87"} -- Kovalnogov-Fedorov-Karpukhina-Simos 8(7) pair, 13 stages.
\item \code{"f89"} -- Fehlberg 8(9) pair, 17 stages.  8th-order primary with
9th-order embedded estimate.  Same family as MATLAB \code{ode89}.
\item \code{"v89"} -- Verner 8(9) pair, 16 stages.  Alternative to \code{"f89"}
in the same order bracket.  Also close to MATLAB \code{ode89}.
\item \code{"t98a"} -- Tsitouras 9(8) variant A pair, 16 stages.
\item \code{"v98r"} -- Verner "robust" 9(8) pair, 16 stages.
\item \code{"s98"} -- Sharp 9(8) pair, 16 stages.
\item \code{"f108"} -- Feagin 10(8) pair, 17 stages (Feagin 2007).  10th-order
primary with 8th-order embedded error estimate.  The same method as
Julia's \code{Feagin10()}.  The large number of stages carries elevated
transcription-error risk; verified against Williams' libode canonical order test.
\item \code{"c108"} -- Curtis 10(8) pair, 21 stages.
\item \code{"b109"} -- Baker 10(9) pair, 21 stages.
\item \code{"s1110a"} -- Stone 11(10) variant A pair, 26 stages.  11th-order
primary; very few published references.
\item \code{"f1210"} -- Feagin 12(10) pair, 25 stages (Feagin 2007).  12th-order
primary with 10th-order embedded error estimate.  The same method as
Julia's \code{Feagin12()}.  Elevated transcription-error risk due to many
stages; verified against Williams' libode canonical order test.
\item \code{"o129"} -- Ono 12(9) pair, 29 stages.
\item \code{"f1412"} -- Feagin 14(12) pair, 35 stages (Feagin 2007).  14th-order
primary with 12th-order embedded error estimate.  The same method as
Julia's \code{Feagin14()}.  The highest-order method in rxode2; elevated
transcription-error risk due to 35 stages; verified against
Williams' libode canonical order test.
}

\strong{deSolve-derived Fortran solvers} (from the deSolve R package).  Both
use non-reentrant Fortran COMMON blocks and therefore run single-threaded
only, regardless of the \code{cores} setting.  They are BDF (Backward
Differentiation Formula) stiff solvers and are most useful when you want
behavior comparable to deSolve's \code{lsode()} or \code{bdf()}/\code{vode()} functions.
\itemize{
\item \code{"lsode"} -- DLSODE (Hindmarsh 1983, ODEPACK) in Adams (non-stiff) mode,
MF=10.  Variable-order Adams method, order 1-12; no Jacobian evaluation.
Corresponds to deSolve's \code{lsode(method="adams")}.  Adaptive step-size;
error controlled by \code{atol} and \code{rtol}.
\strong{Not thread-safe} -- always runs on a single core.
\item \code{"bdf"} -- DLSODE (Hindmarsh 1983, ODEPACK) in BDF (stiff) mode, MF=22.
Variable-order BDF method, order 1-5; internally generated dense Jacobian.
Corresponds to deSolve's \code{bdf()} / \code{vode(method="bdf")}.  Adaptive
step-size; error controlled by \code{atol} and \code{rtol}.
\strong{Not thread-safe} -- always runs on a single core.
}}

\item{sigdig}{Specifies the "significant digits" that the ODE
solving requests.  This is \code{NULL} by default, and while it is
\code{NULL} it has no effect at all: \code{rxSolve()} uses the standard
\code{atol}/\code{rtol} (and the standard sensitivity and steady-state
tolerances).  \code{sigdig} only changes a tolerance when you ask for
it explicitly.

When it is supplied, the tolerances are derived with one
solver-independent formula -- the same for stiff, non-stiff and
auto-switching solvers.  The \code{rtol} exponent IS \code{sigdig} and
\code{atol} sits three orders below it:
\itemize{
\item \code{rtol = 10^(-sigdig)}, \code{atol = 10^(-sigdig-3)}
\item the sensitivity tolerances match the main solve, so
\code{rtolSens = rtol} and \code{atolSens = atol} (gradients and
covariances are built from them)
\item the steady-state tolerances run one order looser than the
corresponding main tolerance, so \code{ssRtol = ssRtolSens = 10*rtol}
and \code{ssAtol = ssAtolSens = 10*atol}
}

Each of these is set only when you did not pass that tolerance
yourself; a tolerance you supply always wins.  Because they are
resolved independently, an explicit \code{atol}/\code{rtol} overrides the
main solve but does \emph{not} propagate to the sensitivity or
steady-state tolerances -- set those directly if you need them
changed too.

This mapping matches how \code{nlmixr2est} derives solver tolerances
from its optimization \code{sigdig}, so a \code{sigdig} used for estimation
and the same \code{sigdig} used for a plain \code{rxSolve()} mean the same
thing.  Note it is keyed to \code{sigdig} as a request for that many
significant digits, and is looser than the \code{atol}/\code{rtol} defaults
for small \code{sigdig} -- at \code{sigdig = 4} it gives \code{rtol = 1e-4}
against a default \code{rtol = 1e-6}.  Raise \code{sigdig}, or set
\code{atol}/\code{rtol} directly, when you want a tighter solve.}

\item{atol}{a numeric absolute tolerance (1e-8 by default) used
by the ODE solver to determine if a good solution has been
achieved;  This is also used in the solved linear model to check
if prior doses do not add anything to the solution.}

\item{rtol}{a numeric relative tolerance (\code{1e-6} by default) used
by the ODE solver to determine if a good solution has been
achieved. This is also used in the solved linear model to check
if prior doses do not add anything to the solution.}

\item{maxsteps}{maximum number of (internally defined) steps allowed
during one call to the solver. (5000 by default)}

\item{hmin}{The minimum absolute step size allowed. The default
value is 0.

\if{html}{\out{<div class="sourceCode">}}\preformatted{For the fixed-step Boost methods `"rk4"`, `"trapz"`, `"ssp3"`, `"ab"`,
`"abm"`, `"sem"`, `"sb3a"`, `"sb3am4"`, `"vv"`, `"mm"`, `"em"`, `"ros6"`,
`"backwardEuler"`, `"gauss6"`, `"iiic6"`, `"radauiia5"`, `"geng5"`, and the
libode fixed-step family (`"euler"`, `"midpoint"`, `"heun"`, `"ssp22"`,
`"rk3"`, `"ssp53"`, `"s4"`, `"r4"`, `"ls44"`, `"ls54"`,
`"ssp54"`, `"s5"`, `"rk5"`, `"c5"`, `"l5"`, `"lk5a"`, `"lk5b"`,
`"b6"`, `"s7"`, `"s8_10"`, `"cv8"`, `"s8_12"`, `"s10"`, `"z10"`,
`"o10"`, `"h10"`), this specifies the fixed step size.
If `hmin=0` (the default), it uses a default of `0.01` for `"rk4"`,
`"trapz"`, `"ssp3"`, `"ros6"`, `"backwardEuler"`, `"gauss6"`, `"iiic6"`,
`"radauiia5"`, `"geng5"`, and all libode fixed-step methods; `0.0001` for
`"ab"`, `"abm"`, `"sem"`, `"sb3a"`, `"sb3am4"`, `"vv"`, `"mm"`, and `"em"`.
If the requested step size would cause the number of steps to exceed
`maxsteps`, the step size is automatically increased to ensure the
integration completes within the `maxsteps` limit.  For `"trapz"`, the step
is also silently clamped to the interval length when the inter-event
interval is shorter than the nominal step size, so short intervals (e.g.,
between closely spaced doses) are always handled correctly.

For the adaptive methods `"f78"`, `"ck54"`, `"dop5"`, `"bs"`, `"f32"`,
`"rk43"`, `"dop54"`, `"vern65"`, `"vern76"`, `"dop87"`, `"vern98"`,
`"ros43"`, `"sdirk43"`, and all libode adaptive methods (`"bs32"`,
`"ssp43"`, `"f45"`, `"t54"`, `"s54"`, `"pp54"`, `"pp54b"`,
`"bs54"`, `"ss54"`, `"dp65"`, `"c65"`, `"tp64"`, `"v65r"`,
`"v65"`, `"dverk65"`, `"tf65"`, `"tp75"`, `"tmy7"`, `"tmy7s"`,
`"v76r"`, `"ss76"`, `"v78"`, `"dverk78"`, `"dp85"`, `"tp86"`,
`"v87e"`, `"v87r"`, `"ev87"`, `"k87"`, `"f89"`, `"v89"`,
`"t98a"`, `"v98r"`, `"s98"`, `"f108"`, `"c108"`, `"b109"`,
`"s1110a"`, `"f1210"`, `"o129"`, `"f1412"`, the libode aliases
`"dp54"`, `"v65e"`, `"v76e"`, `"dp87"`, `"v98e"`,
`"ssp33"`, and the deSolve-derived methods `"lsode"`, `"bdf"`),
this specifies the initial step size (default `0.01` when
`hmin=0`); subsequent steps are chosen adaptively using `atol`, `rtol`,
and `maxsteps`.
}\if{html}{\out{</div>}}}

\item{hmax}{The maximum absolute step size allowed.  When
\code{hmax=NA} (default), uses the average difference +
hmaxSd*sd in times and sampling events. The \code{hmaxSd} is a user
specified parameter and which defaults to zero.  When
\code{hmax=NULL} rxode2 uses the maximum difference in times in
your sampling and events.  The value 0 is equivalent to infinite
maximum absolute step size.

Note that for dense output methods (\code{"dop853"}, \code{"dop5"}, \code{"bs"},
\code{"ros4"}), \code{hmax} defaults to \code{NULL} to allow the solvers to
determine the step size when \code{dense=TRUE}

For \code{method="indLin"}, \code{hmax} caps how long an interval is treated
as having a CONSTANT Jacobian/matrix-exponential term before
re-linearizing (previously silently ignored for this method). For a
true (state-independent) \code{matExp()} model this makes no numerical
difference; for an \code{indLin()}-forcing model with a state-dependent
term (e.g. Michaelis-Menten elimination), the default \code{hmax} (tied to
the spacing of your own sampling/dosing times) may be too coarse for
the desired accuracy -- set an explicit, smaller \code{hmax} to force more
frequent relinearization.}

\item{hmaxSd}{The number of standard deviations of the time
difference to add to hmax. The default is 0}

\item{hini}{The step size to be attempted on the first step. The
default value is determined by the solver (when \code{hini = 0})}

\item{maxordn}{The maximum order to be allowed for the nonstiff
(Adams) method.  The default is 12.  It can be between 1 and
12.}

\item{maxords}{The maximum order to be allowed for the stiff (BDF)
method.  The default value is 5.  This can be between 1 and 5.}

\item{order}{The order for the \code{"ab"}, \code{"abm"}, and \code{"mm"} methods.
For \code{"ab"} and \code{"abm"}, the default is 5, and it can be between 1 and 8.
For \code{"mm"} (Modified Midpoint), it represents the number of intermediate steps,
the default is 5, and it must be a positive integer (>= 1).}

\item{...}{Other arguments including scaling factors for each
compartment.  This includes \code{S# =} numeric will scale a compartment
\code{#} by a dividing the compartment amount by the scale factor,
like NONMEM.}

\item{cores}{Number of cores used in parallel ODE solving.  This
is equivalent to calling \code{\link[=setRxThreads]{setRxThreads()}}}

\item{covsInterpolation}{specifies the interpolation method for
time-varying covariates. When solving ODEs it often samples
times outside the sampling time specified in \code{events}.
When this happens, the time varying covariates are
interpolated.  Currently this can be:
\itemize{
\item \code{"linear"} interpolation, which interpolates the covariate
by solving the line between the observed covariates and extrapolating the new
covariate value.
\item \code{"locf"} -- Last observation carried forward (the default).
\item \code{"nocb"} -- Next Observation Carried Backward.  This is the same method
that NONMEM uses.
\item \code{"midpoint"} Last observation carried forward to midpoint; Next observation
carried backward to midpoint.

For time-varying covariates where a missing value is present, the
interpolation method will use either "locf" or "nocb" throughout
if they are the type of covariate interpolation that is selected.

When using the linear or midpoint interpolation, the lower point
in the interpolation will use locf to interpolate missing
covariates and the upper point will use the nocb to interpolate
missing covariates.
}}

\item{naInterpolation}{specifies the interpolation method for
time-varying covariates when the instantaneous value is \code{NA} (not
during an explicit interpolation) and the \code{covsInterpolation} is
either \code{"midpoint"} or \code{"linear"}. This can be:
\itemize{
\item \code{"locf"} -- last observation carried forward (default)
\item \code{"nocb"} -- next observation carried backward.
}

This will look for the prior value (backwards/locf) when
instantaneously missing, or the next value when instantaneously
missing.  If all the covariates are missing and you find the
end/beginning of the individual record, switch direction.  If all
are really missing, then return missing.}

\item{keepInterpolation}{specifies the interpolation method for
variables in the \code{keep} column.  When \code{nlmixr2} creates \code{mtime},
\code{addl} doses etc, these items were not originally in the dataset.
The interpolation methods you can choose are:
\itemize{
\item \code{"locf"} -- last observation carried forward (default)
\item \code{"nocb"} -- next observation carried backward.
\item \code{"na"} -- no interpolation, simply put \code{NA} for the
interpolated \code{keep} covariates.
}}

\item{addCov}{A boolean indicating if covariates should be added
to the output matrix or data frame. By default this is
disabled.}

\item{sigma}{Named sigma covariance or Cholesky decomposition of a
covariance matrix.  The names of the columns indicate
parameters that are simulated.  These are simulated for every
observation in the solved system. When \code{sigma} is \code{NA} and you are using it with a
\code{rxode2} ui model, the unexplained variability described by
the \code{sigma} matrix are set to zero.}

\item{sigmaDf}{Degrees of freedom of the sigma t-distribution.  By
default it is equivalent to \code{Inf}, or a normal distribution.}

\item{sigmaLower}{Lower bounds for simulated unexplained variability (by default -Inf)}

\item{sigmaUpper}{Upper bounds for simulated unexplained variability (by default Inf)}

\item{nCoresRV}{Number of cores used for the simulation of the
sigma variables.  By default this is 1. To reproduce the results
you need to run on the same platform with the same number of
cores. This is the reason this is set to be one, regardless of
what the number of cores are used in threaded ODE solving.}

\item{sigmaIsChol}{Boolean indicating if the sigma is in the
Cholesky decomposition instead of a symmetric covariance}

\item{sigmaSeparation}{separation strategy for sigma;

Tells the type of separation strategy when
simulating covariance with parameter uncertainty with standard
deviations modeled in the \code{thetaMat} matrix.
\itemize{
\item \code{"lkj"} simulates the correlation matrix from the
\code{rLKJ1} matrix with the distribution parameter \code{eta}
equal to the degrees of freedom \code{nu} by \code{(nu-1)/2}
\item \code{"separation"} simulates from the identity inverse Wishart
covariance matrix with \code{nu} degrees of freedom.  This is then
converted to a covariance matrix and augmented with the modeled
standard deviations.  While computationally more complex than the
\code{"lkj"} prior, it performs better when the covariance matrix
size is greater or equal to 10
\item \code{"auto"} chooses \code{"lkj"} when the dimension of the
matrix is less than 10 and \code{"separation"} when greater
than equal to 10.
}}

\item{sigmaXform}{When taking \code{sigma} values from the \code{thetaMat}
simulations (using the separation strategy for covariance
simulation), how should the \code{thetaMat} values be turned int
standard deviation values:
\itemize{
\item \code{identity} This is when standard deviation values are
directly modeled by the \code{params} and \code{thetaMat} matrix
\item \code{variance} This is when the \code{params} and \code{thetaMat}
simulates the variance that are directly modeled by the
\code{thetaMat} matrix
\item \code{log} This is when the \code{params} and \code{thetaMat}
simulates \code{log(sd)}
\item \code{nlmixrSqrt} This is when the \code{params} and
\code{thetaMat} simulates the inverse cholesky decomposed matrix
with the \verb{x\\^2} modeled along the diagonal.  This only works
with a diagonal matrix.
\item \code{nlmixrLog} This is when the \code{params} and
\code{thetaMat} simulates the inverse cholesky decomposed matrix
with the \verb{exp(x\\^2)} along the diagonal.  This only works
with a diagonal matrix.
\item \code{nlmixrIdentity} This is when the \code{params} and
\code{thetaMat} simulates the inverse cholesky decomposed matrix.
This only works with a diagonal matrix.
}}

\item{nDisplayProgress}{An integer indicating the minimum number
of c-based solves before a progress bar is shown.  By default
this is 10,000.}

\item{amountUnits}{This supplies the dose units of a data frame
supplied instead of an event table.  This is for importing the
data as an rxode2 event table.}

\item{timeUnits}{This supplies the time units of a data frame
supplied instead of an event table.  This is for importing the
data as an rxode2 event table.}

\item{theta}{A vector of parameters that will be named \verb{THETA\[#\]} and
added to parameters}

\item{thetaLower}{Lower bounds for simulated population parameter
variability (by default \code{-Inf})}

\item{thetaUpper}{Upper bounds for simulated population unexplained
variability (by default \code{Inf})}

\item{eta}{A vector of parameters that will be named \verb{ETA\[#\]} and
added to parameters}

\item{addDosing}{Boolean indicating if the solve should add rxode2
EVID and related columns.  This will also include dosing
information and estimates at the doses.  Be default, rxode2
only includes estimates at the observations. (default
\code{FALSE}). When \code{addDosing} is \code{NULL}, only
include \code{EVID=0} on solve and exclude any model-times or
\code{EVID=2}. If \code{addDosing} is \code{NA} the classic
\code{rxode2} EVID events are returned. When \code{addDosing} is \code{TRUE}
add the event information in NONMEM-style format; If
\code{subsetNonmem=FALSE} rxode2 will also include extra event types
(\code{EVID}) for ending infusion and modeled times:
\itemize{
\item \code{EVID=-1} when the modeled rate infusions are turned
off (matches \code{rate=-1})
\item \code{EVID=-2} When the modeled duration infusions are
turned off (matches \code{rate=-2})
\item \code{EVID=-10} When the specified \code{rate} infusions are
turned off (matches \code{rate>0})
\item \code{EVID=-20} When the specified \code{dur} infusions are
turned off (matches \code{dur>0})
\item \verb{EVID=101,102,103,...} Modeled time where 101 is the
first model time, 102 is the second etc.
}}

\item{stateTrim}{When amounts/concentrations in one of the states
are above this value, trim them to be this value. By default
Inf.  Also trims to -stateTrim for large negative
amounts/concentrations.  If you want to trim between a range
say \code{c(0, 2000000)} you may specify 2 values with a lower and
upper range to make sure all state values are in the
reasonable range.}

\item{updateObject}{This is an internally used flag to update the
rxode2 solved object (when supplying an rxode2 solved object) as
well as returning a new object.  You probably should not
modify it's \code{FALSE} default unless you are willing to
have unexpected results.}

\item{omega}{Estimate of Covariance matrix. When omega is a list,
assume it is a block matrix and convert it to a full matrix for
simulations.  When \code{omega} is \code{NA} and you are using it with a
\code{rxode2} ui model, the between subject variability described by
the \code{omega} matrix are set to zero.}

\item{omegaDf}{The degrees of freedom of a t-distribution for
simulation.  By default this is \code{NULL} which is
equivalent to \code{Inf} degrees, or to simulate from a normal
distribution instead of a t-distribution.}

\item{omegaIsChol}{Indicates if the \code{omega} supplied is a
Cholesky decomposed matrix instead of the traditional
symmetric matrix.}

\item{omegaSeparation}{Omega separation strategy

Tells the type of separation strategy when
simulating covariance with parameter uncertainty with standard
deviations modeled in the \code{thetaMat} matrix.
\itemize{
\item \code{"lkj"} simulates the correlation matrix from the
\code{rLKJ1} matrix with the distribution parameter \code{eta}
equal to the degrees of freedom \code{nu} by \code{(nu-1)/2}
\item \code{"separation"} simulates from the identity inverse Wishart
covariance matrix with \code{nu} degrees of freedom.  This is then
converted to a covariance matrix and augmented with the modeled
standard deviations.  While computationally more complex than the
\code{"lkj"} prior, it performs better when the covariance matrix
size is greater or equal to 10
\item \code{"auto"} chooses \code{"lkj"} when the dimension of the
matrix is less than 10 and \code{"separation"} when greater
than equal to 10.
}}

\item{omegaXform}{When taking \code{omega} values from the \code{thetaMat}
simulations (using the separation strategy for covariance
simulation), how should the \code{thetaMat} values be turned int
standard deviation values:
\itemize{
\item \code{identity} This is when standard deviation values are
directly modeled by the \code{params} and \code{thetaMat} matrix
\item \code{variance} This is when the \code{params} and \code{thetaMat}
simulates the variance that are directly modeled by the
\code{thetaMat} matrix
\item \code{log} This is when the \code{params} and \code{thetaMat}
simulates \code{log(sd)}
\item \code{nlmixrSqrt} This is when the \code{params} and
\code{thetaMat} simulates the inverse cholesky decomposed matrix
with the \verb{x\\^2} modeled along the diagonal.  This only works
with a diagonal matrix.
\item \code{nlmixrLog} This is when the \code{params} and
\code{thetaMat} simulates the inverse cholesky decomposed matrix
with the \verb{exp(x\\^2)} along the diagonal.  This only works
with a diagonal matrix.
\item \code{nlmixrIdentity} This is when the \code{params} and
\code{thetaMat} simulates the inverse cholesky decomposed matrix.
This only works with a diagonal matrix.
}}

\item{omegaLower}{Lower bounds for simulated ETAs (by default -Inf)}

\item{omegaUpper}{Upper bounds for simulated ETAs (by default Inf)}

\item{nSub}{Number between subject variabilities (\code{ETAs}) simulated for every
realization of the parameters.}

\item{thetaMat}{Named theta matrix.}

\item{thetaDf}{The degrees of freedom of a t-distribution for
simulation.  By default this is \code{NULL} which is
equivalent to \code{Inf} degrees, or to simulate from a normal
distribution instead of a \code{t}-distribution.}

\item{thetaIsChol}{Indicates if the \code{theta} supplied is a
Cholesky decomposed matrix instead of the traditional
symmetric matrix.}

\item{nStud}{Number virtual studies to characterize uncertainty in estimated
parameters.}

\item{dfSub}{Degrees of freedom to sample the between subject variability matrix from the
inverse Wishart distribution (scaled) or scaled inverse chi squared distribution.}

\item{dfObs}{Degrees of freedom to sample the unexplained variability matrix from the
inverse Wishart distribution (scaled) or scaled inverse chi squared distribution.}

\item{returnType}{This tells what type of object is returned.  The
currently supported types are:
\itemize{
\item \code{"rxSolve"} (default) will return a reactive data frame
that can change easily change different pieces of the solve and
update the data frame.  This is the currently standard solving
method in rxode2,  is used for \code{rxSolve(object, ...)}, \code{solve(object,...)},
\item \code{"data.frame"} -- returns a plain, non-reactive data
frame; Currently very slightly faster than \code{returnType="matrix"}
\item \code{"matrix"} -- returns a plain matrix with column names attached
to the solved object.  This is what is used \code{object$run} as well as \code{object$solve}
\item \code{"data.table"} -- returns a \code{data.table}; The \code{data.table} is
created by reference (ie \code{setDt()}), which should be fast.
\item \code{"tbl"} or \code{"tibble"} returns a tibble format.
}}

\item{seed}{an object specifying if and how the random number
generator should be initialized}

\item{nsim}{represents the number of simulations.  For rxode2, if
you supply single subject event tables (created with
\verb{[eventTable()]})}

\item{minSS}{Minimum number of iterations for a steady-state dose}

\item{maxSS}{Maximum number of iterations for a steady-state dose}

\item{infSSstep}{Step size for determining if a constant infusion
has reached steady state.  By default this is large value,
12.}

\item{strictSS}{Boolean indicating if a strict steady-state is
required. If a strict steady-state is (\code{TRUE}) required
then at least \code{minSS} doses are administered and the
total number of steady states doses will continue until
\code{maxSS} is reached, or \code{atol} and \code{rtol} for
every compartment have been reached.  However, if ODE solving
problems occur after the \code{minSS} has been reached the
whole subject is considered an invalid solve. If
\code{strictSS} is \code{FALSE} then as long as \code{minSS}
has been reached the last good solve before ODE solving
problems occur is considered the steady state, even though
either \code{atol}, \code{rtol} or \code{maxSS} have not
been achieved.}

\item{istateReset}{When \code{TRUE}, reset the \code{ISTATE} variable to 1 for
lsoda and liblsoda with doses, like \code{deSolve}; When \code{FALSE}, do
not reset the \code{ISTATE} variable with doses.}

\item{subsetNonmem}{subset to NONMEM compatible EVIDs only.  By
default \code{TRUE}.}

\item{maxAtolRtolFactor}{The maximum \code{atol}/\code{rtol} that
FOCEi and other routines may adjust to.  By default 0.1}

\item{from}{When there is no observations in the event table,
start observations at this value. By default this is zero.}

\item{to}{When there is no observations in the event table, end
observations at this value. By default this is 24 + maximum
dose time.}

\item{by}{When there are no observations in the event table, this
is the amount to increment for the observations between \code{from}
and \code{to}.}

\item{length.out}{The number of observations to create if there
isn't any observations in the event table. By default this is 200.}

\item{iCov}{A data frame of individual non-time varying covariates
to combine with the \code{events} dataset.  The \code{iCov} dataset has one
covariate per ID and should match the event table}

\item{keep}{Columns to keep from either the input dataset or the
\code{iCov} dataset.  With the \code{iCov} dataset, the column
is kept once per line.  For the input dataset, if any records
are added to the data LOCF (Last Observation Carried forward)
imputation is performed.}

\item{indLinPhiTol}{the requested accuracy tolerance on
exponential matrix.}

\item{indLinPhiM}{the maximum size for the Krylov basis}

\item{indLinMatExpType}{This is them matrix exponential type that
is use for rxode2.  Currently the following are supported:
\itemize{
\item \code{Al-Mohy} Uses the exponential matrix method of Al-Mohy Higham (2009)
\item \code{arma} Use the exponential matrix from RcppArmadillo
\item \code{expokit} Use the exponential matrix from Roger B. Sidje (1998)
}}

\item{indLinMatExpOrder}{an integer, the order of approximation to
be used, for the \code{Al-Mohy} and \code{expokit} values.
The best value for this depends on machine precision (and
slightly on the matrix). We use \code{6} as a default.}

\item{drop}{Columns to drop from the output}

\item{idFactor}{This boolean indicates if original ID values
should be maintained. This changes the default sequentially
ordered ID to a factor with the original ID values in the
original dataset.  By default this is enabled.}

\item{mxhnil}{maximum number of messages printed (per problem)
warning that \code{T + H = T} on a step (\code{H} = step size).  This must
be positive to result in a non-default value.  The default
value is 0 (or infinite).}

\item{hmxi}{inverse of the maximum absolute value of \code{H} to are used.
hmxi = 0.0 is allowed and corresponds to an infinite \verb{hmax1 (default).  }hmin\code{and}hmxi\verb{may be changed at any time, but will not take effect until the next change of}H\verb{is considered. This option is only considered with}method="liblsoda"`.}

\item{warnIdSort}{Warn if the ID is not present and rxode2 assumes
the order of the parameters/iCov are the same as the order of
the parameters in the input dataset.}

\item{warnDrop}{Warn if column(s) were supposed to be dropped, but
were not present.}

\item{ssAtol}{Steady state atol convergence factor.  Can be
a vector based on each state.}

\item{ssRtol}{Steady state rtol convergence factor.  Can be a
vector based on each state.}

\item{safeZero}{Use safe zero divide. By default
this is turned on but you may turn it off if you wish.}

\item{safeLog}{Use safe log.  When enabled if your value that you are taking log() of is negative or zero, this will return \verb{log(machine epsilon)}.  By default this is turned on.}

\item{safePow}{Use safe powers.  When enabled if your power is
negative and your base is zero, this will return the \verb{machine epsilon^(negative power)}.  By default this is turned on.}

\item{sumType}{Sum type to use for \code{sum()} in
rxode2 code blocks.

\code{pairwise} uses the pairwise sum (fast, default)

\code{fsum} uses the PreciseSum package's fsum function (most accurate)

\code{kahan} uses Kahan correction

\code{neumaier} uses Neumaier correction

\code{c} uses no correction: default/native summing}

\item{prodType}{Product to use for \code{prod()} in rxode2 blocks

\verb{long double} converts to long double, performs the
multiplication and then converts back.

\code{double} uses the standard double scale for multiplication.}

\item{resample}{A character vector of model variables to resample
from the input dataset; This sampling is done with replacement.
When \code{NULL} or \code{FALSE} no resampling is done.  When
\code{TRUE} resampling is done on all covariates in the input
dataset}

\item{resampleID}{boolean representing if the resampling should be
done on an individual basis \code{TRUE} (ie. a whole patient is
selected) or each covariate is resampled independent of the
subject identifier \code{FALSE}.  When \code{resampleID=TRUE}
correlations of parameters are retained, where as when
\code{resampleID=FALSE} ignores patient covariate correaltions.
Hence the default is \code{resampleID=TRUE}.}

\item{maxwhile}{represents the maximum times a while loop is
evaluated before exiting.  By default this is 100000}

\item{atolSens}{Sensitivity atol, can be different than atol with
liblsoda.  This allows a less accurate solve for gradients (if desired)}

\item{rtolSens}{Sensitivity rtol, can be different than rtol with
liblsoda.  This allows a less accurate solve for gradients (if desired)}

\item{ssAtolSens}{Sensitivity absolute tolerance (atol) for
calculating if steady state has been achieved for sensitivity compartments.}

\item{ssRtolSens}{Sensitivity relative tolerance (rtol) for
calculating if steady state has been achieved for sensitivity compartments.}

\item{simVariability}{determines if the variability is simulated.
When \code{NA} (default) this is determined by the solver.}

\item{nLlikAlloc}{The number of log likelihood endpoints that are
used in the model.  This allows independent log likelihood per
endpoint in focei for nlmixr2.  It likely shouldn't be set,
though it won't hurt anything if you do (just may take up more
memory for larger allocations).}

\item{useStdPow}{This uses C's \code{pow} for exponentiation instead of
R's \code{R_pow} or \code{R_pow_di}.  By default this is \code{FALSE}}

\item{naTimeHandle}{Determines what time of handling happens when
the time becomes \code{NA}: current options are:
\itemize{
\item \code{ignore} this ignores the \code{NA} time input and passes it through.
\item \code{warn} (default) this will produce a warning at the end of the
solve, but continues solving passing through the \code{NA} time
\item \code{error} this will stop this solve if this is not a parallel
solved ODE (otherwise stopping can crash R)
}}

\item{addlKeepsCov}{This determines if the additional dosing items
repeats the dose only (\code{FALSE}) or keeps the covariates at the
record of the dose (\code{TRUE})}

\item{addlDropSs}{When there are steady state doses with an \code{addl}
specification the steady state flag is dropped with repeated
doses (when \code{TRUE}) or retained (when \code{FALSE})}

\item{ssAtDoseTime}{Boolean that when \code{TRUE} back calculates the
steady concentration at the actual time of dose, otherwise when
\code{FALSE} the doses are shifted}

\item{ss2cancelAllPending}{When \code{TRUE} the \code{SS=2} event type
cancels all pending doses like \code{SS=1}.  When \code{FALSE} the pending
doses not canceled with \code{SS=2} (the infusions started before
\code{SS=2} occurred are canceled, though).}

\item{ssSolved}{When \code{TRUE} this will return the solved steady
state solutions for the linear compartment model.  When \code{FALSE}
this will solve to steady state using the linear solutions
instead.  This is only used when the method only has \code{linCmt()}
and does not mix ODEs with the solution.  The default is \code{TRUE}.}

\item{linCmtSensType}{The type of linear compartment
sensitivity/gradients to use.  The current options are:
\itemize{
\item \code{auto} -- for one compartment models this will use the \code{AD}
method, for 2 and 3 compartment model this will use \code{forwardG}.
\item \code{AD} -- automatic differentiation (using stan math).  This now
uses forward-mode AD (\verb{stan::math::fvar}), which differentiates the
same analytic solution as the reverse-mode path but on the C++
stack with no reverse autodiff tape, matching the reverse result to
round-off while avoiding the per-call tape setup/teardown.
\item \code{ADr} -- reverse-mode automatic differentiation (the prior \code{AD}
behavior, \verb{stan::math::jacobian}).  Kept as an escape hatch for
validation; \code{AD} (forward) is preferred.
\item \code{forward} -- forward sensitivity where the step size is
determined by shi 2021 optimization (only once per problem)
\item \code{forwardG} -- forward sensitivity where the step size is determined by the
Gill 1983 optimization for forward differences (only once per problem).
\item \code{central} -- central sensitivity where the step size is
determined by shi 2021 optimization (only once per problem)
\item \code{forward3} -- three point central difference where step size is
determined by shi 2021 optimization for central differences (only
once per problem)
\item \code{endpoint5} -- five point endpoint difference where step size is
determined by the shi 2021 optimization for central differences
(only once per problem)
\item \code{fowardH} -- forward sensitivity where the step size is fixed
\item \code{centralH} -- central sensitivity where the step size is fixed
\item \code{forward3H} -- three point central difference where step size is fixed
\item \code{endpoint5H} -- five point endpoint difference where step size is fixed
}}

\item{linCmtSensH}{The step size for the forward and central
differences when using the option \code{centralH}, \code{forwardH},
\code{foward3H} or \code{endpoint5H} options.
#'}

\item{linCmtGillFtol}{The gillFtol is the gradient error tolerance that
is acceptable before issuing a warning/error about the gradient estimates.}

\item{linCmtGillK}{The total number of possible steps to determine the
optimal forward/central difference step size per parameter (by
the Gill 1983 method).  If 0, no optimal step size is
determined.  Otherwise this is the optimal step size
determined.}

\item{linCmtGillStep}{When looking for the optimal forward difference
step size, this is This is the step size to increase the
initial estimate by.  So each iteration the new step size =
(prior step size)*gillStep}

\item{linCmtGillRtol}{The relative tolerance used for Gill 1983
optimal step size determination.}

\item{linCmtShiErr}{Shi difference error}

\item{linCmtShiMax}{The maximum number of steps for the
optimization of the forward-difference step size in linear
compartment numeric difference.}

\item{linCmtScale}{The scale of the linear compartment model.  This
is applied to sensitivity approximation using numeric
differences.  When \code{TRUE} or \code{NULL} use default scaling, when
\code{FALSE} use no scaling.  If it is one elment numeric, the value
is duplicated 7 times and applies to all the parameters.
Otherwise this is a seven element numeric vector implying the
scaling for each of the linear compartmental model parameters.}

\item{linCmtHcmt}{This represents the compartments considered when
optimizing the forward difference step size.  When a character
vector it can be any of the following (multiple allowed):
\itemize{
\item \code{"depot"} -- depot compartment
\item \code{"central"} -- central compartment
\item \code{"peripheral1"} -- peripheral compartment
\item \code{"peripheral2"} -- second peripheral compartment
\item \code{"concentration"} -- concentration value (i.e. central
compartment/volume)
}}

\item{linCmtHmeanI}{This represents the type of sum done for each
time-point of the linear solved systems (as defined by \code{"linCmtHcmt"}).
\itemize{
\item \code{"arithmetic"} -- gives the arithmetic mean
\item \code{"geometric"} -- gives the geometric mean
\item \code{"harmonic"} -- gives the harmonic mean
}}

\item{linCmtHmeanO}{This represents the type of sum done for the
overall problem of the linear solved systems (first each time
point mean is calculated with \code{linCmtHmeanI}).
\itemize{
\item \code{"arithmetic"} -- gives the arithmetic mean
\item \code{"geometric"} -- gives the geometric mean
\item \code{"harmonic"} -- gives the harmonic mean
}}

\item{linCmtSuspect}{The tolerance for gradients in linear
compartment solutions to re-compute when gradients seem to be
zero.}

\item{linCmtForwardMax}{The maximum number of points in a forward
difference to take while calculating the gradients.  This is an
integer from 1 to 3.  There is at least 1 extra point taken for
gradient calculation, if the gradient is suspect another is taken
(if this value is 2), and finally a third is calculated if the
gradient is still suspect.}

\item{indOwnAlloc}{Logical; when \code{TRUE} each individual's \code{dose},
\code{ii}, \code{all_times}, and \code{solve} arrays are allocated independently
via \code{malloc}/\code{calloc} rather than as pointers into a single
global buffer.  This enables per-individual reallocation for dose
and observation-pushing with \code{evid_()} and related
functions. When \code{FALSE} these arrays are allocated as a single
global buffer, which is slightly faster and slightly more memory
efficient but does not allow for dynamic dosing/observations.  By
default this is \code{NA} which automatically decides based on if
there is any dosing or observation pushing in the model.}

\item{maxExtra}{Integer; maximum number of events (doses and
observations) that \code{evid_()} may push per individual per solve.
When an individual exceeds this limit the solve is aborted for
that individual (output filled with \code{NA}) and an error is raised
after the full parallel solve completes.  Set to \code{0L} to allow
unlimited pushes (use with care -- cascading \code{evid_()} calls can
grow without bound).  Default is \code{100L}.}

\item{tolFactor}{A per-individual tolerance multiplier (>= 1.0, or
\code{NULL} for no effect).  When supplied, each individual's
\code{atol}, \code{rtol}, \code{ssAtol}, and \code{ssRtol} are multiplied by
this factor before the ODE solver is called, loosening the
tolerances for that individual.  This is useful when a small
number of subjects are numerically stiff and would otherwise
cause solve failures: pass a larger factor for the
problematic subjects and leave the rest at 1.0 (or omit them).
The effective tolerance is always capped at \code{maxAtolRtolFactor}.

\if{html}{\out{<div class="sourceCode">}}\preformatted{`tolFactor` may be:
* `NULL` (default) -- no adjustment applied.
* A single numeric value -- the same factor is applied to
  the first `length(tolFactor)` subjects in order.
* A numeric vector -- applied element-wise to subjects in
  the order they appear.
* A **named** numeric vector -- names are matched to subject
  IDs; unmatched subjects retain `tolFactor = 1.0`.

The per-subject factors used (after matching) are stored back
in the solved object and accessible via `$tolFactor`.
}\if{html}{\out{</div>}}}

\item{serializeFile}{Controls serialization-driven solves. When
this is a file path, \code{rxSolve()} writes the pre-integration
serialized state to that file and returns the file path invisibly
without running the solve. When this is \code{TRUE}, \code{rxSolve()}
writes the serialized state to a temporary \code{.rxbin} file, solves
by reloading from that file, returns the solve result, and then
removes the temporary file (mostly for testing). When solving
from an existing serialization file via \code{rxSolve(model, "state.rxbin")}, only the model and serialization file are
allowed because the file already stores the solve inputs and
controls.}

\item{dense}{Logical; when \code{TRUE} and the method supports dense output,
enables continuous interpolation so the solver can take large internal
steps and reconstruct the solution cheaply at each observation time.
Dense-capable single methods are \code{"dop853"}, \code{"dop5"}, \code{"bs"}, and
\code{"ros4"}.  For composite AutoSwitch methods (e.g. \code{"dop5+ros4"}), dense
output is enabled only when \strong{both} the primary and stiff secondary
support dense output; \code{"ros4"} is the only stiff method that does, so
valid dense composites are \code{"dop853+ros4"}, \code{"dop5+ros4"}, and
\code{"bs+ros4"}.  A warning is issued and \code{dense} is set to \code{FALSE} when a
composite stiff secondary does not support dense output.  Silently
ignored for non-dense single methods.  Not yet supported for \code{linCmt()}
models (a warning is emitted and the standard path is used instead).}

\item{cvodeLinSolver}{Character; selects the linear solver used by the CVODE
integrator when \code{method = "cvode"}.  Ignored for all other methods.
Available choices and when to use them:
\itemize{
\item \code{"dense"} (default) -- Direct LU factorization of the full Jacobian.
Best for small to medium systems (typically fewer than ~50 compartments).
Requires \code{O(n^2)} storage and \code{O(n^3)} work per Newton iteration.
\item \code{"band"} -- Currently aliases to \code{"dense"}.  Kept for compatibility
until rxode2 can determine model bandwidth safely during solve setup.
\item \code{"gmres"} -- Generalized Minimal Residual iterative Krylov solver.
Avoids explicit Jacobian formation, making it practical for large stiff
systems (tens to hundreds of compartments) where LU factorization would
dominate runtime.  Generally the first iterative solver to try.
\item \code{"bicgstab"} -- Bi-Conjugate Gradient Stabilized iterative Krylov
solver.  Similar use case to \code{"gmres"} but can converge faster on some
non-symmetric problems.  Try if \code{"gmres"} is slow or fails to converge.
\item \code{"tfqmr"} -- Transpose-Free Quasi-Minimal Residual iterative Krylov
solver.  Another alternative for large systems; avoids the matrix
transpose required by classical QMR.
}

For most pharmacometric models with fewer than ~50 compartments the default
\code{"dense"} solver is fastest.  Switch to an iterative solver (\code{"gmres"} is
a good first choice) only for large QSP or PBPK models where Jacobian
factorization becomes the bottleneck.}

\item{autoSwitchNonstifftol}{Numeric in \verb{(0, 1]}; stiffness ratio threshold
used when the solver is in non-stiff mode.  If
\verb{rho * |dt| / S(primary) > autoSwitchNonstifftol}, the interval is
considered stiff and the secondary solver is tried.  Default \code{9/10}.}

\item{autoSwitchStifftol}{Numeric in \verb{(0, 1]}; non-stiffness ratio threshold
used when the solver is in stiff mode.  If
\verb{rho * |dt| / S(primary) < autoSwitchStifftol}, the interval is considered
non-stiff and the switch-back counter is incremented.  Default \code{9/10}.}

\item{autoSwitchDtfac}{Numeric \verb{>= 1}; factor by which the suggested step
size is multiplied when switching to the stiff solver, and divided when
switching back.  Default \code{2.0}.}

\item{autoSwitchMaxStiff}{Integer; number of consecutive stiff-detected
intervals before permanently switching to the stiff solver.  Default \code{10L}.}

\item{autoSwitchMaxNonstiff}{Integer; number of consecutive non-stiff
intervals (while in stiff mode) before switching back to the fast
non-stiff solver.  Default \code{3L}.}

\item{autoSwitchStiffFirst}{Logical; when \code{TRUE}, start each subject solve
with the stiff solver instead of the non-stiff primary.  Default \code{FALSE}.}

\item{autoSwitchSwitchMax}{Non-negative integer; minimum number of
integration intervals that must elapse after a switch before the solver
is allowed to switch back in the opposite direction.  Acts as an
oscillation guard: if the stiffness ratio fluctuates near a threshold,
this prevents rapid back-and-forth between solvers.  Set to \code{0L} to
disable the guard entirely.  Default \code{5L}.}

\item{stiff2}{Integer method code for the stiff secondary solver used in
AutoSwitch composite methods.  Normally set automatically when \code{method} is
a composite string of the form \code{"primary+stiff"} (e.g.
\code{"dop853+ros4"}); the \code{"+"} notation is the preferred way to configure
composite solving and \code{stiff2} need not be supplied directly.  When
supplied as a raw integer it must be a stiff method code as returned by
\code{\link[=odeMethodToInt]{odeMethodToInt()}}; \code{0L} (the default) disables the stiff secondary and
causes the solver to run as a plain non-composite method.  Dense output
(\code{dense = TRUE}) is silently disabled when \code{stiff2} names a stiff method
that does not support dense output; \code{"ros4"} (code \code{13L}) is the only
stiff secondary that does support it.}

\item{useLinCmt}{Logical; when \code{TRUE} and the model contains
linear-compartment ODEs that can be solved analytically,
automatically convert them to a \code{linCmt()} call before solving.
The detection and conversion use \code{\link[=odeToLin]{odeToLin()}}; the converted
model is cached so the compilation cost is paid only once.  Set
to \code{FALSE} to keep the original ODE solver.  This flag is also
stored in the returned \code{\link[=rxControl]{rxControl()}} object so that downstream
hooks (e.g. in nlmixr2) can read and apply it.  The default is to
use the value of \code{rxode2.useLinCmt} option (which when specified
is \code{TRUE} by default).}

\item{file}{Character string giving a file path prefix for out-of-memory
chunk solving. When set, \code{rxSolve()} splits subjects into chunks, writes
each chunk's result to \verb{<file>_chunk_NNNNN.parquet} (or \code{.rds} if
\code{arrow} is unavailable), and returns an \code{rxSolveOom} object. The manifest
is saved to \verb{<file>_manifest.rds}. Set to \code{NULL} (default) to use the
normal in-memory path.}

\item{chunkSize}{Integer; number of subjects per chunk when \code{file} is
set. If \code{NULL} (default), the chunk size is auto-computed from available
free RAM using \code{rxMemoryEstimate()}.}

\item{parallel}{Integer; number of \code{mirai} daemons to use for parallel
chunk solving when \code{file} is set. \code{0L} (default) uses serial solving.
Requires the \code{mirai} package.}

\item{envir}{is the environment to look for R user functions
(defaults to parent environment)}

\item{a}{when using \code{solve()}, this is equivalent to the
\code{object} argument.  If you specify \code{object} later in
the argument list it overwrites this parameter.}

\item{b}{when using \code{solve()}, this is equivalent to the
\code{params} argument.  If you specify \code{params} as a
named argument, this overwrites the output}
}
\value{
An \dQuote{rxSolve} solve object that stores the solved
value in a special data.frame or other type as determined by
\code{returnType}. By default this has as many rows as there are
sampled time points and as many columns as system variables (as
defined by the ODEs and additional assignments in the rxode2 model
code).  It also stores information about the call to allow
dynamic updating of the solved object.

The operations for the object are similar to a data-frame, but
expand the \code{$} and \verb{[[""]]} access operators and assignment
operators to resolve based on different parameter values, initial
conditions, solver parameters, or events (by updating the \code{time}
variable).

You can call the \code{\link[=eventTable]{eventTable()}} methods on the solved object to
update the event table and resolve the system of equations.
}
\description{
This uses rxode2 family of objects, file, or model specification to
solve a ODE system.  There are many options for a solved rxode2
model, the first are the required \code{object}, and \code{events} with the
some-times optional \code{params} and \code{inits}.
}
\details{
The rest of the document focus on the different ODE solving
methods, followed by the core solving method's options, rxode2 event
handling options, rxode2's numerical stability options, rxode2's
output options, and finally internal rxode2 options or compatibility
options.
}
\references{
"New Scaling and Squaring Algorithm for the Matrix Exponential", by
Awad H. Al-Mohy and Nicholas J. Higham, August 2009

Roger B. Sidje (1998).  EXPOKIT: Software package for computing
matrix exponentials.  ACM - Transactions on Mathematical Software
\emph{24}(1), 130-156.

Hindmarsh, A. C.
\emph{ODEPACK, A Systematized Collection of ODE Solvers}.
Scientific Computing, R. S. Stepleman et al. (Eds.),
North-Holland, Amsterdam, 1983, pp. 55-64.

Petzold, L. R.
\emph{Automatic Selection of Methods for Solving Stiff and Nonstiff
Systems of Ordinary Differential Equations}.
Siam J. Sci. Stat. Comput. 4 (1983), pp. 136-148.

Hairer, E., Norsett, S. P., and Wanner, G.
\emph{Solving ordinary differential equations I, nonstiff problems}.
2nd edition, Springer Series in Computational Mathematics,
Springer-Verlag (1993).
}
\seealso{
\code{\link[=rxode2]{rxode2()}}
}
\author{
Matthew Fidler, Melissa Hallow and  Wenping Wang
}
