Skip to content

Commit a70b00b

Browse files
fix: provide history function to reconstruct_fn in remake_initialization_data
1 parent af02851 commit a70b00b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/systems/nonlinear/initializesystem.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,13 @@ function SciMLBase.remake_initialization_data(
403403
else
404404
reconstruct_fn = ReconstructInitializeprob(sys, oldinitsys)
405405
end
406+
# the history function doesn't matter because `reconstruct_fn` is only going to
407+
# update the values of parameters, which aren't time dependent. The reason it
408+
# is called is because `Initial` parameters are calculated from the corresponding
409+
# state values.
410+
history_fn = is_time_dependent(sys) && !is_markovian(sys) ? Returns(newu0) : nothing
406411
new_initu0, new_initp = reconstruct_fn(
407-
ProblemState(; u = newu0, p = newp, t = t0), oldinitprob)
412+
ProblemState(; u = newu0, p = newp, t = t0, h = history_fn), oldinitprob)
408413
if oldinitprob.f.resid_prototype === nothing
409414
newf = oldinitprob.f
410415
else

0 commit comments

Comments
 (0)