Skip to content

Commit 05909e8

Browse files
Merge pull request #1970 from Keno/kf/uinitialdae
Re-evaluate u_initial after DAE initialization
2 parents 216a7a5 + 410555c commit 05909e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/solve.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,12 @@ function DiffEqBase.__init(
501501
integrator.saveiter += 1 # Starts at 1 so first save is at 2
502502
integrator.saveiter_dense += 1
503503
copyat_or_push!(ts, 1, t)
504+
# N.B.: integrator.u can be modified by initialized_dae!
504505
if save_idxs === nothing
505506
copyat_or_push!(timeseries, 1, integrator.u)
506507
copyat_or_push!(ks, 1, [rate_prototype])
507508
else
508-
copyat_or_push!(timeseries, 1, u_initial, Val{false})
509+
copyat_or_push!(timeseries, 1, integrator.u[save_idxs], Val{false})
509510
copyat_or_push!(ks, 1, [ks_prototype])
510511
end
511512
else

0 commit comments

Comments
 (0)