diff --git a/test/regression/test_regression.jl b/test/regression/test_regression.jl new file mode 100644 index 0000000000..f2467434c5 --- /dev/null +++ b/test/regression/test_regression.jl @@ -0,0 +1,37 @@ +using OrdinaryDiffEq, DiffEqDevTools, Test + +import ODEProblemLibrary: prob_ode_linear, + prob_ode_2Dlinear + + +probnum = prob_ode_linear +prob = prob_ode_2Dlinear + +dts = (1 / 2) .^ (7:-1:4) +testTol = 0.2 + +### Tsit5() + +println("Tsit5") +dts = (1 / 2) .^ (7:-1:3) +sim = test_convergence(dts, probnum, Tsit5()) +@test abs.(sim.𝒪est[:l2] - 5) < testTol + 0.2 +sim = test_convergence(dts, prob, Tsit5()) +@test abs.(sim.𝒪est[:l2] - 5) < testTol + 0.2 + +### Tsit5() with new structure + +println("Tsit5 with relaxation") +dts = (1 / 2) .^ (7:-1:3) +sim = test_convergence(dts, probnum, Tsit5_for_relaxation()) +@test abs.(sim.𝒪est[:l2] - 5) < testTol + 0.2 +#sim = test_convergence(dts, prob, Tsit5_for_relaxation()) # need to implement perform_step for not constant cache +#@test abs.(sim.𝒪est[:l2] - 5) < testTol + 0.2 # need to implement perform_step for not constant cache + + +sol1 = solve(probnum, Tsit5()) +sol2 = solve(probnum, Tsit5_for_relaxation()) + +using Plots +plot(sol1, label = "Old") +plot!(sol2, label = "New") \ No newline at end of file