| .rxAdjoint | R Documentation |
Symbolically generates the continuous-adjoint ODE system mirroring the
forward sensitivity output (.rxSens), reusing the same
rx__sens_<state>_BY_<param>__ output names. For each output state k it
emits two backward-in-time blocks: a costate
d/dt(rx__adjLambda_<k>_<i>__) = -(J^T lambda)_i and a quadrature
d/dt(rx__sens_<k>_BY_<p>__) = -(lambda^T df/dp)_p. The derivatives are
taken from the rx__df_* symbols .rxJacobian() already materialised, so no
new differentiation is done; the costate symbols are registered as bare
symengine Symbols.
.rxAdjoint(model, vars, states)
model |
symengine model environment (as returned by |
vars |
character vector of parameter names to differentiate with
respect to (the |
states |
character vector of output states of interest (the |
character vector of d/dt(...) = ... lines (costate block followed
by quadrature block). The costate (rx__adjLambda_*) lines are internal
scaffolding; only the quadrature (rx__sens_*) lines carry user-visible
output. Also stashes the result in model$..adjoint.
Matthew L. Fidler
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.