Skip to content

Commit 2c3dfc9

Browse files
Update fractional_to_ordinary.jl
1 parent 90be611 commit 2c3dfc9

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

test/fractional_to_ordinary.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1)
2121
prob = ODEProblem(sys, [], tspan)
2222
sol = solve(prob, radau5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
2323

24-
time = 0
25-
while(time <= 1)
24+
for time in 0:0.1:1
2625
@test isapprox(expect(time, α), sol(time, idxs=x), atol=1e-7)
2726
time += 0.1
2827
end
@@ -35,10 +34,8 @@ sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1; matrix=true)
3534
prob = ODEProblem(sys, [], tspan)
3635
sol = solve(prob, radau5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
3736

38-
time = 0
39-
while(time <= 1)
37+
for time in 0:0.1:1
4038
@test isapprox(expect(time, α), sol(time, idxs=x), atol=1e-7)
41-
time += 0.1
4239
end
4340

4441
α = 0.9
@@ -49,10 +46,8 @@ sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1)
4946
prob = ODEProblem(sys, [], tspan)
5047
sol = solve(prob, radau5(), saveat=timepoint, abstol = 1e-10, reltol = 1e-10)
5148

52-
time = 0
53-
while(time <= 1)
49+
for time in 0:0.1:1
5450
@test isapprox(expect(time, α), sol(time, idxs=x), atol=1e-7)
55-
time += 0.1
5651
end
5752

5853
# Testing for example 2 of Section 7
@@ -88,4 +83,4 @@ msys = linear_fractional_to_ordinary([3, 2.5, 2, 1, .5, 0], [1, 1, 1, 4, 1, 4],
8883
mprob = ODEProblem(sys, [], tspan)
8984
msol = solve(prob, radau5(), abstol = 1e-5, reltol = 1e-5)
9085

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

0 commit comments

Comments
 (0)