Skip to content

Commit a8161d2

Browse files
test: use RadauIIA5 instead of radau5 for fractional diffeq tests
1 parent 4ed4b7f commit a8161d2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/fractional_to_ordinary.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ModelingToolkit, OrdinaryDiffEq, ODEInterfaceDiffEq, SpecialFunctions, LinearAlgebra
1+
using ModelingToolkit, OrdinaryDiffEq, SpecialFunctions, LinearAlgebra
22
using Test
33

44
# Testing for α < 1
@@ -19,7 +19,7 @@ eqs += (gamma(9)*t^(8 - α)/gamma(9 - α)) + (3/2*t^(α/2)-t^4)^3 - x^(3/2)
1919
sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1)
2020

2121
prob = ODEProblem(sys, [], tspan)
22-
sol = solve(prob, radau5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
22+
sol = solve(prob, RadauIIA5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
2323

2424
for time in 0:0.1:1
2525
@test isapprox(expect(time, α), sol(time, idxs=x), atol=1e-7)
@@ -32,7 +32,7 @@ eqs += (gamma(9)*t^(8 - α)/gamma(9 - α)) + (3/2*t^(α/2)-t^4)^3 - x^(3/2)
3232
sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1; matrix=true)
3333

3434
prob = ODEProblem(sys, [], tspan)
35-
sol = solve(prob, radau5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
35+
sol = solve(prob, RadauIIA5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
3636

3737
for time in 0:0.1:1
3838
@test isapprox(expect(time, α), sol(time, idxs=x), atol=1e-7)
@@ -44,7 +44,7 @@ eqs += (gamma(9)*t^(8 - α)/gamma(9 - α)) + (3/2*t^(α/2)-t^4)^3 - x^(3/2)
4444
sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1)
4545

4646
prob = ODEProblem(sys, [], tspan)
47-
sol = solve(prob, radau5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
47+
sol = solve(prob, RadauIIA5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
4848

4949
for time in 0:0.1:1
5050
@test isapprox(expect(time, α), sol(time, idxs=x), atol=1e-7)
@@ -58,7 +58,7 @@ tspan = (0., 220.)
5858

5959
sys = fractional_to_ordinary([1 - 4*x + x^2 * y, 3*x - x^2 * y], [x, y], [1.3, 0.8], 10^-8, 220; initials=[[1.2, 1], 2.8], matrix=true)
6060
prob = ODEProblem(sys, [], tspan)
61-
sol = solve(prob, radau5(), abstol = 1e-8, reltol = 1e-8)
61+
sol = solve(prob, RadauIIA5(), abstol = 1e-8, reltol = 1e-8)
6262

6363
@test isapprox(1.0097684171, sol(220, idxs=x), atol=1e-5)
6464
@test isapprox(2.1581264031, sol(220, idxs=y), atol=1e-5)
@@ -75,12 +75,12 @@ end
7575

7676
sys = linear_fractional_to_ordinary([3, 2.5, 2, 1, .5, 0], [1, 1, 1, 4, 1, 4], 6*cos(t), 10^-5, 5000; initials=[1, 1, -1])
7777
prob = ODEProblem(sys, [], tspan)
78-
sol = solve(prob, radau5(), abstol = 1e-5, reltol = 1e-5)
78+
sol = solve(prob, RadauIIA5(), abstol = 1e-5, reltol = 1e-5)
7979

8080
@test isapprox(expect(5000), sol(5000, idxs=x_0), atol=1e-5)
8181

8282
msys = linear_fractional_to_ordinary([3, 2.5, 2, 1, .5, 0], [1, 1, 1, 4, 1, 4], 6*cos(t), 10^-5, 5000; initials=[1, 1, -1], matrix=true)
8383
mprob = ODEProblem(sys, [], tspan)
84-
msol = solve(prob, radau5(), abstol = 1e-5, reltol = 1e-5)
84+
msol = solve(prob, RadauIIA5(), abstol = 1e-5, reltol = 1e-5)
8585

8686
@test isapprox(expect(5000), msol(5000, idxs=x_0), atol=1e-5)

0 commit comments

Comments
 (0)