Background
rxSensMatExp() (R/indLin.R:230-526) builds the Jacobian A[i,j] from the
materialized rx__d_dt_<state>__ symbols (:274-306) and emits the sensitivity
system as k_... micro-constants plus k_..._nd non-depleting cross terms
(:390-397).
Once nonlinear terms move into the forcing, part of the dynamics no longer lives
in A, so the sensitivity compartments need the forcing's own contribution:
.rxIndLinTotalD() (R/indLin.R:125-156) already computes exactly this shape --
the explicit partial plus chain terms through every state and through any
existing rx__sens_* symbol.
Change
Emit indLin(rx__sens_<s>_BY_<p>__) <- ... alongside the existing cross terms,
reusing .rxIndLinTotalD().
Test
The established idiom at tests/testthat/test-mexp-nonmem.R:205 -- build the same
model both ways and compare the rx__sens_* columns against the ordinary
calcSens= ODE path at 1e-4.
Blocked by #1186.
Background
rxSensMatExp()(R/indLin.R:230-526) builds the JacobianA[i,j]from thematerialized
rx__d_dt_<state>__symbols (:274-306) and emits the sensitivitysystem as
k_...micro-constants plusk_..._ndnon-depleting cross terms(
:390-397).Once nonlinear terms move into the forcing, part of the dynamics no longer lives
in
A, so the sensitivity compartments need the forcing's own contribution:.rxIndLinTotalD()(R/indLin.R:125-156) already computes exactly this shape --the explicit partial plus chain terms through every state and through any
existing
rx__sens_*symbol.Change
Emit
indLin(rx__sens_<s>_BY_<p>__) <- ...alongside the existing cross terms,reusing
.rxIndLinTotalD().Test
The established idiom at
tests/testthat/test-mexp-nonmem.R:205-- build the samemodel both ways and compare the
rx__sens_*columns against the ordinarycalcSens=ODE path at 1e-4.Blocked by #1186.