forked from SciML/OrdinaryDiffEq.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiffdir_tests.jl
More file actions
29 lines (27 loc) · 885 Bytes
/
Copy pathdiffdir_tests.jl
File metadata and controls
29 lines (27 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Test, OrdinaryDiffEq
for Alg in (Rosenbrock23, TRBDF2)
tspan = (0, 10.0)
u0 = ones(2)
tstops = range(0, 10, length = 1000)
sol = solve(ODEProblem((du, u, p, t) -> du .= sin.(u), u0, tspan), Tsit5())
@test_nowarn solve(
ODEProblem((du, u, p, t) -> sol(du, t), u0, tspan), Alg(),
tstops = tstops
)
@test_nowarn solve(
ODEProblem((du, u, p, t) -> sol(du, t), u0, (tspan[2], tspan[1])),
Alg(), tstops = tstops
)
for u0 in (1.0, ones(2))
u0 = 1.0
sol = solve(ODEProblem((u, p, t) -> sin.(u), u0, tspan), Tsit5())
@test_nowarn solve(
ODEProblem((u, p, t) -> sol(t), u0, tspan), Alg(),
tstops = tstops
)
@test_nowarn solve(
ODEProblem((u, p, t) -> sol(t), u0, (tspan[2], tspan[1])), Alg(),
tstops = tstops
)
end
end