Skip to content

feat(indLin): first-order sensitivities of the indLin() forcing #1187

Description

@mattfidler

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:

d/dp f  +  (df/dy) . S^p

.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions