Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GXBeam"
uuid = "974624c9-1acb-4ad6-a627-8ac40fc27a3e"
authors = ["Taylor McDonnell <taylor.golden.mcdonnell@gmail.com> and Andrew Ning"]
version = "1.1.1"
version = "1.1.2"

[deps]
ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d"
Expand Down
18 changes: 14 additions & 4 deletions src/analyses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3078,6 +3078,20 @@ function step_system!(system::DynamicSystem, paug, x, constants, initial_state,
paug[irate+10:irate+12] = 2/dt*Ω + Ωdot
end

# update paug with sensitivity parameters, if they exist
if !isnothing(p)
np = length(assembly.points)
required_len = 12 * np + length(p)
if length(paug) < required_len
throw(ArgumentError(
"paug has length $(length(paug)), but at least $required_len elements " *
"are required to store initialization terms for $(np) points and a " *
"parameter vector p of length $(length(p)).",
))
end
paug[12*np + 1 : 12*np + length(p)] .= p
end
Comment on lines +3081 to +3093
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.

# solve for the new set of state variables
if linear
if update_linearization
Expand Down Expand Up @@ -3207,8 +3221,6 @@ function take_step(x, dx, system, assembly, t, tprev,
#TODO: Make an inplace version that doesn't allocate.
@unpack force_scaling, indices = system

# @show x
# @show dx

### Prepare the vector of design vars (which includes the states and state rates)
if isnothing(p)
Expand Down Expand Up @@ -3485,8 +3497,6 @@ function newmark_output(system, x, p, constants)
dual_safe_copy!(system.x, x)
dual_safe_copy!(system.dx, dx)

# @show x
# @show dx

# return result
return AssemblyState(dx, x, system, assembly; prescribed_conditions=pcond)
Expand Down
Loading