Skip to content

Commit

Permalink
try test without relaxation
Browse files Browse the repository at this point in the history
  • Loading branch information
Theozeud committed May 28, 2024
1 parent 7fada13 commit 653436b
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/regression/test_regression.jl
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 653436b

Please sign in to comment.