Skip to content

Fix sensitivity analysis for step_system!#140

Merged
Cardoza2 merged 4 commits intomasterfrom
fix/step-sensitivity
Mar 27, 2026
Merged

Fix sensitivity analysis for step_system!#140
Cardoza2 merged 4 commits intomasterfrom
fix/step-sensitivity

Conversation

@Cardoza2
Copy link
Copy Markdown
Member

Summary

  • Adds sensitivity parameters to paug in step_system! when design variables p are provided, fixing incorrect sensitivity analysis for the implicit Euler stepper
  • Removes leftover debug @show statements from take_step and newmark_output

Test plan

  • Existing step_system! / implicit_euler tests pass (CI)
  • Verify sensitivity values are correct when using ImplicitAD with step_system!

🤖 Generated with Claude Code

Cardoza2 and others added 2 commits March 27, 2026 11:17
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes sensitivity propagation for stepped Newmark solves by ensuring design variables are written into the augmented parameter vector (paug) when step_system! is used with p, and performs small cleanup/version bump.

Changes:

  • Update step_system! to copy sensitivity/design parameters p into the tail of paug.
  • Remove commented-out debug @show lines in take_step and newmark_output.
  • Bump package version to 1.1.2.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/analyses.jl Ensures paug includes p during step_system! for correct sensitivity behavior; removes leftover debug comments.
Project.toml Patch version bump consistent with a bugfix release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3081 to +3085
# update paug with sensitivity parameters, if they exist
if !isnothing(p)
np = length(assembly.points)
paug[12*np + 1 : 12*np + length(p)] .= p
end
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters sensitivity behavior when p is provided, but there is no regression test covering step_system! with a non-nothing p. Adding a test (e.g., using ForwardDiff or ImplicitAD to differentiate a simple stepped response w.r.t. a design variable) would prevent future regressions.

Copilot uses AI. Check for mistakes.
Cardoza2 and others added 2 commits March 27, 2026 11:30
Adding a explicit check on `paug` length for `step_system!`.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
White space cleaning.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Cardoza2 Cardoza2 merged commit 981760d into master Mar 27, 2026
8 checks passed
@Cardoza2
Copy link
Copy Markdown
Member Author

@JuliaRegistrator register

Release notes:

Step system sensitivity analysis patch

Patch on step_system! to insure update of sensitivity parameters every time the function is called.

@JuliaRegistrator
Copy link
Copy Markdown

Comments on pull requests will not trigger Registrator, as it is disabled. Please try commenting on a commit or issue.

@Cardoza2 Cardoza2 deleted the fix/step-sensitivity branch March 27, 2026 19:42
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.

4 participants