dot-rxAdjointExpand: Build the adjoint-expansion model text for an in-engine...

.rxAdjointExpandR Documentation

Build the adjoint-expansion model text for an in-engine discrete-adjoint solve

Description

Exposes the state Jacobian F_X = dF/dy and parameter forcing F_p = dF/dtheta as rxode2 lhs assignments spliced onto the base ODE, so the C++ backward sweep can evaluate them at any stage state via calc_lhs. The lhs are emitted in a fixed order: all F_X entries row-major (rx__adjFX_i_j__ at index i*ns + j), then F_p (rx__adjFP_i_p__ at ns*ns + i*np + p).

Usage

.rxAdjointExpand(object, calcSens, stiff = FALSE)

Arguments

object

model definition accepted by rxode2().

calcSens

character vector of parameters to differentiate w.r.t.

Value

list with text (expanded model text), st, ns, np, calcSens, and lhs layout fxOff (=0), fpOff (=ns*ns), nlhsAdj.

Author(s)

Matthew L. Fidler


rxode2 documentation built on July 28, 2026, 5:08 p.m.