Skip to content

Commit 6417db0

Browse files
Merge branch 'dtmin0'
2 parents 4448611 + 8fdf4bf commit 6417db0

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OrdinaryDiffEq"
22
uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
33
authors = ["Chris Rackauckas <[email protected]>", "Yingbo Ma <[email protected]>"]
4-
version = "6.65.0"
4+
version = "6.66.0"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

src/solve.jl

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function DiffEqBase.__init(prob::Union{DiffEqBase.AbstractODEProblem,
3131
(dense) || !isempty(saveat), # and no dense output
3232
dt = alg isa FunctionMap && isempty(tstops) ?
3333
eltype(prob.tspan)(1) : eltype(prob.tspan)(0),
34-
dtmin = nothing,
34+
dtmin = eltype(prob.tspan)(0),
3535
dtmax = eltype(prob.tspan)((prob.tspan[end] - prob.tspan[1])),
3636
force_dtmin = false,
3737
adaptive = anyadaptive(alg),
@@ -281,7 +281,7 @@ function DiffEqBase.__init(prob::Union{DiffEqBase.AbstractODEProblem,
281281
# For fixed dt, the only time dtmin makes sense is if it's smaller than eps().
282282
# Therefore user specified dtmin doesn't matter, but we need to ensure dt>=eps()
283283
# to prevent infinite loops.
284-
abs(dt) < DiffEqBase.prob2dtmin(prob) &&
284+
abs(dt) < dtmin &&
285285
throw(ArgumentError("Supplied dt is smaller than dtmin"))
286286
steps = ceil(Int, internalnorm((tspan[2] - tspan[1]) / dt, tspan[1]))
287287
end
@@ -358,8 +358,6 @@ function DiffEqBase.__init(prob::Union{DiffEqBase.AbstractODEProblem,
358358
controller = default_controller(_alg, cache, qoldinit, beta1, beta2)
359359
end
360360

361-
dtmin === nothing && (dtmin = DiffEqBase.prob2dtmin(prob))
362-
363361
save_end_user = save_end
364362
save_end = save_end === nothing ?
365363
save_everystep || isempty(saveat) || saveat isa Number ||

test/algconvergence/symplectic_tests.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ prob_direct=SecondOrderODEProblem(motionfuncDirect1,v0_direct,u0_direct,tspan,pa
8989
dt=2e-8
9090
ref=solve(prob_direct,DPRKN12(),abstol=1e-12,reltol=1e-12,maxiters=1e7,saveat=0.01)
9191

92-
@testset "symplectic time-dependent $alg-$iip-$pa" for (alg, x, d) in ALGOS
93-
sol=solve(prob_direct,alg,dt=dt,saveat=0.01)
94-
@test maximum(ref-sol) < 1e-3
92+
@testset "symplectic time-dependent $alg" for (alg, x, d) in ALGOS
93+
sol=solve(prob_direct,alg(),dt=dt,saveat=0.01)
94+
@test maximum(ref[4,:]-sol[4,:]) < 3e-3
9595
end

test/downstream/delaydiffeq.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using Test
2424
@test sol.errors[:l∞] < error
2525

2626
sol_scalar = solve(prob_scalar, ddealg)
27-
@test sol.t sol_scalar.t
27+
@test sol.t sol_scalar.t atol=1e-6
2828
@test sol[1, :] sol_scalar.u
2929
end
3030
end

test/integrators/check_error.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ u0 = 0.0 # explosion time is 1.0
55
tspan = (0.0, 10.0)
66
prob = ODEProblem(f_ec, u0, tspan)
77
options = [:reltol => 1e-8, :abstol => 1e-8, :verbose => false]
8-
desired_code = ReturnCode.DtLessThanMin
8+
desired_code = ReturnCode.MaxIters
99

1010
# Test that sol.retcode is set to the correct value by various ways to
1111
# invoke integrator.

test/interface/ode_initdt_tests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ prob = remake(prob, u0 = u0, tspan = tspan)
2828
tspan = T.((2000, 2100))
2929
prob = remake(prob, tspan = tspan)
3030
# set maxiters to prevent infinite loop on test failure
31-
@test_throws ArgumentError solve(prob, Euler(); dt = T(0.0001), maxiters = 10)
31+
@test solve(prob, Euler(); dt = T(0.0001), maxiters = 10).retcode == SciMLBase.ReturnCode.MaxIters
3232

3333
function rober(du, u, p, t)
3434
y₁, y₂, y₃ = u

0 commit comments

Comments
 (0)