Skip to content

feat(ivp): first-class sensitivity analysis API#93

Open
Ryan-D-Gast wants to merge 1 commit into
masterfrom
feat-ivp-first-class-sensitivity-api-7475342233764524364
Open

feat(ivp): first-class sensitivity analysis API#93
Ryan-D-Gast wants to merge 1 commit into
masterfrom
feat-ivp-first-class-sensitivity-api-7475342233764524364

Conversation

@Ryan-D-Gast
Copy link
Copy Markdown
Owner

🎯 What
Introduces a first-class structured API within the IVP builder for computing parametric sensitivities (both Forward and Adjoint) dynamically and explicitly.

  • ParametrizedODE Trait: A new mathematical abstraction providing parameter declarations and the requisite parameter Jacobian (jacobian_p) evaluations.
  • System Wrappers: Reusable ForwardSensitivityOde and AdjointOde structs that cleanly wrap an underlying generic ODE, seamlessly generating the augmented derivative computations via dS/dt = J_y * S + J_p (Forward) and backward evaluation via J_y^T, J_p^T transpositions alongside exact internal endpoint cubic Hermite interpolation.
  • IVP Enhancements: Brand new first-class ode_forward_sensitivity and ode_adjoint_sensitivity initialization methods right on the IVP builder.

📊 Coverage
Refactored and tested Example 15 (ode_15_forward_sensitivity_analysis) and Example 16 (ode_16_adjoint_sensitivities) to directly leverage the IVP builder 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

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ivp): first-class sensitivity analysis API

1 participant