Skip to content

Commit 2a211f5

Browse files
fix: remove occurrences of dummy parameters when remaking initializeprob
1 parent 7cb12ed commit 2a211f5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/systems/nonlinear/initializesystem.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,16 @@ function SciMLBase.remake_initialization_data(
411411
merge!(guesses, meta.additional_guesses)
412412
use_scc = get(meta.extra_metadata, :use_scc, true)
413413
initialization_eqs = meta.additional_initialization_eqs
414+
415+
# remove occurrences of `keys(new_params)` from `u0map` and `pmap`
416+
for (newvar, oldvar) in meta.new_params
417+
if isequal(get(u0map, oldvar, nothing), newvar)
418+
u0map[oldvar] = pmap[newvar]
419+
elseif isequal(get(pmap, oldvar, nothing), newvar)
420+
pmap[oldvar] = pmap[newvar]
421+
end
422+
delete!(pmap, newvar)
423+
end
414424
end
415425
else
416426
# there is no initializeprob, so the original problem construction

0 commit comments

Comments
 (0)