|
1 | 1 | @testitem "BigFloat compatibility" begin |
2 | 2 | using BoundaryValueDiffEq |
| 3 | + # Need Sparspak for BigFloat |
| 4 | + using Sparspak |
| 5 | + |
3 | 6 | tspan = (0.0, pi / 2) |
4 | 7 | function simplependulum!(du, u, p, t) |
5 | 8 | θ = u[1] |
|
12 | 15 | residual[2] = u(pi / 2)[1] - big(pi / 2) |
13 | 16 | end |
14 | 17 | u0 = BigFloat.([pi / 2, pi / 2]) |
15 | | - prob = BVProblem(simplependulum!, bc!, u0, tspan) |
16 | | - sol1 = solve(prob, MIRK4(), dt = 0.05) |
17 | | - @test SciMLBase.successful_retcode(sol1.retcode) |
| 18 | + multi_point_bvp = BVProblem(simplependulum!, bc!, u0, tspan) |
| 19 | + |
| 20 | + @testset "BigFloat compatiability with Multi-point BVP" begin |
| 21 | + for solver in [MIRK4(), RadauIIa5(), LobattoIIIa4(nested_nlsolve = true)] |
| 22 | + sol = solve(multi_point_bvp, solver, dt = 0.05) |
| 23 | + @test SciMLBase.successful_retcode(sol.retcode) |
| 24 | + end |
| 25 | + end |
18 | 26 |
|
19 | | - sol2 = solve(prob, RadauIIa5(), dt = 0.05) |
20 | | - @test SciMLBase.successful_retcode(sol2.retcode) |
| 27 | + function f!(du, u, p, t) |
| 28 | + du[1] = u[2] |
| 29 | + du[2] = u[1] |
| 30 | + end |
| 31 | + function bca!(resid_a, u_a, p) |
| 32 | + resid_a[1] = u_a[1] - 1 |
| 33 | + end |
| 34 | + function bcb!(resid_b, u_b, p) |
| 35 | + resid_b[1] = u_b[1] |
| 36 | + end |
| 37 | + bvp_function = BVPFunction( |
| 38 | + f!, (bca!, bcb!), bcresid_prototype = (zeros(1), zeros(1)), twopoint = Val(true)) |
| 39 | + tspan = (0.0, 1.0) |
| 40 | + two_point_bvp = BVProblem(bvp_function, BigFloat.([1.0, 0.0]), tspan) |
21 | 41 |
|
22 | | - sol3 = solve(prob, LobattoIIIa4(nested_nlsolve = true), dt = 0.05) |
23 | | - @test SciMLBase.successful_retcode(sol3.retcode) |
| 42 | + @testset "BigFloat compatiability with Two-point BVP" begin |
| 43 | + for solver in [MIRK4(), RadauIIa5(), LobattoIIIa4(nested_nlsolve = true)] |
| 44 | + sol = solve(two_point_bvp, solver, dt = 0.05) |
| 45 | + @test SciMLBase.successful_retcode(sol.retcode) |
| 46 | + end |
| 47 | + end |
24 | 48 |
|
25 | 49 | function second_f!(ddu, du, u, p, t) |
26 | 50 | ϵ = 0.1 |
|
0 commit comments