Skip to content

Commit

Permalink
Merge pull request #2912 from AayushSabharwal/as/linearization
Browse files Browse the repository at this point in the history
fix: fix some linearization bugs
  • Loading branch information
ChrisRackauckas authored Jul 31, 2024
2 parents c2e6e4a + beeaab2 commit ff989d2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2167,14 +2167,13 @@ function linearization_function(sys::AbstractSystem, inputs,
u_getter = isempty(unknowns(initsys)) ? (_...) -> nothing :
build_explicit_observed_function(
sys, unknowns(initsys); eval_expression, eval_module)
get_initprob_u_p = let p_getter,
get_initprob_u_p = let p_getter = p_getter,
p_setter! = setp(initsys, initsys_ps),
u_getter = u_getter

function (u, p, t)
state = ProblemState(; u, p, t)
p_setter!(oldps, p_getter(state))
newu = u_getter(state)
p_setter!(oldps, p_getter(u, p..., t))
newu = u_getter(u, p, t)
return newu, oldps
end
end
Expand Down

0 comments on commit ff989d2

Please sign in to comment.