Skip to content

Directional sensitivities - #68

Draft
Schlevidon wants to merge 24 commits into
publicfrom
sensitivities-specify-initial-values
Draft

Directional sensitivities#68
Schlevidon wants to merge 24 commits into
publicfrom
sensitivities-specify-initial-values

Conversation

@Schlevidon

Copy link
Copy Markdown
Collaborator

Changes

  • It is now possible to compute sensitivities w.r.t. specific directions instead of always computing the full Jacobian.
    • There are no changes to the interface itself (generateSensitivityFunction). Directions can be passed via the optional directions_y and directions_p arguments as a matrix where columns represent the individual directions. Previously, this would only work for the END_full method.
  • The algorithm for computing sensitivities has been changed in general to the "directional" approach.
    • The old method would first compute the full Jacobian for each continuous solution segment between switches with the initial sensitivity value set to the identity matrix for initial value sensitivities and the zero matrix for parameter sensitivities. The individual segments are then stitched together at the switches via matrix multiplication together with the update matrices.
    • The new method computes the solution sequentially. We first compute the directional sensitivity until the first switch by setting the initial values for VDE/disturbance direction for END according to the directions. At the switch, we then apply the updates to the sensitivities and continue computing the sensitivity for the next model based on these updated values (i.e. as the initial value/disturbance direction).
  • The old method can still be accessed by setting the optional legacy parameter to true. This can be useful if one wishes to examine the full solution segment and update matrices.

@Schlevidon
Schlevidon force-pushed the sensitivities-specify-initial-values branch from dfa1cfa to 5506fc8 Compare August 10, 2026 11:02
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.

1 participant