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