@@ -422,15 +422,15 @@ cond.rf_ip(out, [0, 1], p0, t0) # this should return 0
422
422
cond. rf_ip (out, [0 , 2 ], p0, t0)
423
423
@test out[2 ] ≈ 1 # signature is u,p,t
424
424
425
- sol = solve (prob, Tsit5 ())
425
+ sol = solve (prob, Tsit5 (); abstol = 1e-14 , reltol = 1e-14 )
426
426
@test minimum (t -> abs (t - 1 ), sol. t) < 1e-10 # test that the solver stepped at the first root
427
427
@test minimum (t -> abs (t - 2 ), sol. t) < 1e-10 # test that the solver stepped at the second root
428
428
429
429
@named sys = ODESystem (eqs, t, continuous_events = [x ~ 1 , x ~ 2 ]) # two root eqs using the same unknown
430
430
sys = complete (sys)
431
431
prob = ODEProblem (sys, Pair[], (0.0 , 3.0 ))
432
432
@test get_callback (prob) isa ModelingToolkit. DiffEqCallbacks. VectorContinuousCallback
433
- sol = solve (prob, Tsit5 ())
433
+ sol = solve (prob, Tsit5 (); abstol = 1e-14 , reltol = 1e-14 )
434
434
@test minimum (t -> abs (t - 1 ), sol. t) < 1e-10 # test that the solver stepped at the first root
435
435
@test minimum (t -> abs (t - 2 ), sol. t) < 1e-10 # test that the solver stepped at the second root
436
436
@@ -540,8 +540,8 @@ ev = [sin(20pi * t) ~ 0.0] => [vmeasured ~ v]
540
540
sys = structural_simplify (sys)
541
541
prob = ODEProblem (sys, zeros (2 ), (0.0 , 5.1 ))
542
542
sol = solve (prob, Tsit5 ())
543
- @test all (minimum ((0 : 0.1 : 5 ) .- sol. t' , dims = 2 ) .< 0.0001 ) # test that the solver stepped every 0.1s as dictated by event
544
- @test sol ([0.25 ])[vmeasured][] == sol ([0.23 ])[vmeasured][] # test the hold property
543
+ @test all (minimum ((0 : 0.05 : 5 ) .- sol. t' , dims = 2 ) .< 0.0001 ) # test that the solver stepped every 0.05s as dictated by event
544
+ @test sol ([0.25 - eps () ])[vmeasured][] == sol ([0.23 ])[vmeasured][] # test the hold property
545
545
546
546
# # https://github.com/SciML/ModelingToolkit.jl/issues/1528
547
547
Dₜ = D
0 commit comments