Skip to content

fixing sensitivity analysis in simulation.#9

Merged
Cardoza2 merged 1 commit intomasterfrom
sensitivity_analysis
Mar 27, 2026
Merged

fixing sensitivity analysis in simulation.#9
Cardoza2 merged 1 commit intomasterfrom
sensitivity_analysis

Conversation

@Cardoza2
Copy link
Copy Markdown
Member

The sensitivity parameter vector wasn't getting updated inside of GXBeam, so it was using the initial loading for all time steps.

Copy link
Copy Markdown

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 aerostructural sensitivity analysis by ensuring GXBeam receives the updated parameter vector each time step (instead of reusing the initial loading throughout the simulation).

Changes:

  • Pass pfunc and p into GXBeam.step_system! during the time loop so sensitivities/parameters can update per step.
  • Minor cleanup of commented/debug code in the simulation initialization/time-loop sections.
  • Adds a small commented debug snippet in update_forces! (currently disabled).

Reviewed changes

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

File Description
src/gxbeam.jl Adds (commented-out) debug printing around distributed loads inside update_forces!.
src/aerostructural.jl Ensures GXBeam.step_system! is called with pfunc/p so parameter/sensitivity updates propagate across time steps.

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

Comment on lines +490 to +492
# if ielem==length(assembly.elements)
# @show distributed_loads[ielem]
# 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.

The commented-out debug block (@show distributed_loads[ielem]) adds noise in a hot-path function. If you still need this for troubleshooting, consider guarding it behind an existing verbose/debug flag or removing it before merging.

Suggested change
# if ielem==length(assembly.elements)
# @show distributed_loads[ielem]
# end

Copilot uses AI. Check for mistakes.



system, gxhistory[i], constants, paug, xgx, convergedi = GXBeam.step_system!(system, paug, xgx, constants, gxhistory[i-1], assembly, tvec, i; prescribed_conditions, distributed_loads, structural_damping, gravity, angular_velocity=Omega, pfunc=pfunc, p=p)
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.

For consistency with other GXBeam calls in this file (e.g., initialize_system!), consider using Julia's keyword shorthand (; pfunc, p) and wrapping this long call across multiple lines. Also remove the trailing whitespace at the end of the line to avoid churn in future diffs.

Copilot uses AI. Check for mistakes.
@Cardoza2 Cardoza2 force-pushed the sensitivity_analysis branch from 3e113e1 to 14cd905 Compare March 27, 2026 16:28
@Cardoza2 Cardoza2 merged commit 0387c00 into master Mar 27, 2026
4 of 6 checks passed
@Cardoza2 Cardoza2 deleted the sensitivity_analysis branch March 27, 2026 19:33
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.

2 participants