Skip to content

Commit dbbab46

Browse files
committed
fix initdt calculation
1 parent 1d34a43 commit dbbab46

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/OrdinaryDiffEqCore/src/initdt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
oneunit_tType = oneunit(_tType)
99
dtmax_tdir = tdir * dtmax
1010

11-
dtmin = nextfloat(integrator.opts.dtmin)
12-
smalldt = convert(_tType, oneunit_tType * 1 // 10^(6))
11+
dtmin = nextfloat(max(integrator.opts.dtmin, eps(t)))
12+
smalldt = max(dtmin, convert(_tType, oneunit_tType * 1 // 10^(6)))
1313

1414
if integrator.isdae
1515
return tdir * max(smalldt, dtmin)
@@ -235,7 +235,7 @@ end
235235
oneunit_tType = oneunit(_tType)
236236
dtmax_tdir = tdir * dtmax
237237

238-
dtmin = nextfloat(integrator.opts.dtmin)
238+
dtmin = nextfloat(max(integrator.opts.dtmin, eps(t)))
239239
smalldt = convert(_tType, oneunit_tType * 1 // 10^(6))
240240

241241
if integrator.isdae

0 commit comments

Comments
 (0)