feat(ivp): first-class sensitivity analysis API#93
Conversation
Implements a structured API in IVP for computing parametric sensitivities (forward and adjoint) beyond basic examples. - Introduces the `ParametrizedODE` trait in `src/ode/sensitivity/traits.rs` to allow optional parameter definition and parameter Jacobian (`jacobian_p`) calculations. - Implements `ForwardSensitivityOde` and `AdjointOde` wrappers in `src/ode/sensitivity` to encapsulate mathematical state augmentations safely within standard ODE traits. - Expands the `IVP` builder with `ode_forward_sensitivity` and `ode_adjoint_sensitivity` constructor methods. - Updates Examples 15 and 16 to utilize the new native API. Closes #74 Co-authored-by: Ryan-D-Gast <148826144+Ryan-D-Gast@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 What
Introduces a first-class structured API within the
IVPbuilder for computing parametric sensitivities (both Forward and Adjoint) dynamically and explicitly.ParametrizedODETrait: A new mathematical abstraction providing parameter declarations and the requisite parameter Jacobian (jacobian_p) evaluations.ForwardSensitivityOdeandAdjointOdestructs that cleanly wrap an underlying generic ODE, seamlessly generating the augmented derivative computations viadS/dt = J_y * S + J_p(Forward) and backward evaluation viaJ_y^T,J_p^Ttranspositions alongside exact internal endpoint cubic Hermite interpolation.ode_forward_sensitivityandode_adjoint_sensitivityinitialization methods right on theIVPbuilder.📊 Coverage
Refactored and tested Example 15 (
ode_15_forward_sensitivity_analysis) and Example 16 (ode_16_adjoint_sensitivities) to directly leverage theIVPbuilder integrations over their previous manual ad-hoc setups. Output solutions correctly verify against analytical equations and central finite-differences.✨ Result
Provides a robust parameter-fitting and sensitivity calculation architecture immediately accessible to any standard numerical method implementation within the project via straightforward builder methodology.
Closes #74
PR created automatically by Jules for task 7475342233764524364 started by @Ryan-D-Gast