@@ -47,6 +47,36 @@ sim = test_convergence(dts, prob_big, ERKN7(), dense_errors = true)
4747@test sim. 𝒪est[:l2 ]≈ 7 rtol= 1e-1
4848@test sim. 𝒪est[:L2 ]≈ 4 rtol= 1e-1
4949
50+ # Float64 convergence tests for DPRKN methods
51+ # These tests ensure the CompiledFloats coefficients match the rational coefficients
52+ # (Regression test for https://github.com/SciML/OrdinaryDiffEq.jl/issues/1938)
53+ @testset " Float64 DPRKN convergence" begin
54+ # Use longer integration time to keep errors above machine precision
55+ prob_f64 = DynamicalODEProblem (ff_harmonic, ones (2 ), fill (0.0 , 2 ), (0.0 , 20.0 ))
56+ dts_f64 = 1.0 ./ 2.0 .^ (2 : 5 )
57+
58+ sim = test_convergence (dts_f64, prob_f64, DPRKN4 ())
59+ @test sim. 𝒪est[:l2 ]≈ 4 rtol= 1e-1
60+
61+ sim = test_convergence (dts_f64, prob_f64, DPRKN5 ())
62+ @test sim. 𝒪est[:l2 ]≈ 5 rtol= 1e-1
63+
64+ sim = test_convergence (dts_f64, prob_f64, DPRKN6 ())
65+ @test sim. 𝒪est[:l2 ]≈ 6 rtol= 1e-1
66+
67+ sim = test_convergence (dts_f64, prob_f64, DPRKN6FM ())
68+ @test sim. 𝒪est[:l2 ]≈ 6 rtol= 1e-1
69+
70+ # DPRKN8 needs larger timesteps and longer integration to avoid hitting machine precision
71+ prob_f64_long = DynamicalODEProblem (ff_harmonic, ones (2 ), fill (0.0 , 2 ), (0.0 , 50.0 ))
72+ dts_f64_large = [1.0 , 0.5 , 0.25 , 0.125 ]
73+ sim = test_convergence (dts_f64_large, prob_f64_long, DPRKN8 ())
74+ @test sim. 𝒪est[:l2 ]≈ 8 rtol= 1e-1
75+
76+ # DPRKN12 is too accurate for Float64 convergence testing (hits machine precision
77+ # even at dt=1.0), so we only test it with BigFloat (see tests above)
78+ end
79+
5080sol = solve (prob, Nystrom4 (), dt = 1 / 1000 )
5181
5282# Nyström method
0 commit comments