fixing sensitivity analysis in simulation.#9
Conversation
There was a problem hiding this comment.
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
pfuncandpintoGXBeam.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.
| # if ielem==length(assembly.elements) | ||
| # @show distributed_loads[ielem] | ||
| # end |
There was a problem hiding this comment.
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.
| # if ielem==length(assembly.elements) | |
| # @show distributed_loads[ielem] | |
| # end |
|
|
||
|
|
||
|
|
||
| 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) |
There was a problem hiding this comment.
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.
3e113e1 to
14cd905
Compare
The sensitivity parameter vector wasn't getting updated inside of GXBeam, so it was using the initial loading for all time steps.