Skip to content

Commit

Permalink
Update the TwoPointBVP code
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 9, 2023
1 parent 5edb3fa commit df3909c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/solve/multiple_shooting.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# TODO: incorporate `initial_guess` similar to MIRK methods
function SciMLBase.__solve(prob::BVProblem, alg::MultipleShooting; odesolve_kwargs = (;),
nlsolve_kwargs = (;), ensemblealg = EnsembleThreads(), verbose = true, kwargs...)
@unpack f, tspan = prob
Expand Down
13 changes: 6 additions & 7 deletions test/misc/type_stability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ function bc!(res, sol, p, t)
res[1] = sol[1][1] - 1
res[2] = sol[end][2] - 2
end
twobc((ua, ub), p) = ([ua[1] - 1], [ub[2] - 2])
function twobc!((resa, resb), (ua, ub), p)
resa[1] = ua[1] - 1
resb[1] = ub[2] - 2
end
twobc_a(ua, p) = [ua[1] - 1]
twobc_b(ub, p) = [ub[2] - 2]
twobc_a!(resa, ua, p) = (resa[1] = ua[1] - 1)
twobc_b!(resb, ub, p) = (resb[1] = ub[2] - 2)

u0 = Float64[0, 0]
tspan = (0.0, 1.0)
Expand Down Expand Up @@ -44,8 +43,8 @@ end

# Two-Point BVP
@testset "Two-Point BVP" begin
tpbvp_iip = TwoPointBVProblem(f!, twobc!, u0, tspan, p; bcresid_prototype)
tpbvp_oop = TwoPointBVProblem(f, twobc, u0, tspan, p)
tpbvp_iip = TwoPointBVProblem(f!, (twobc_a!, twobc_b!), u0, tspan, p; bcresid_prototype)
tpbvp_oop = TwoPointBVProblem(f, (twobc_a, twobc_b), u0, tspan, p)

@testset "Shooting Methods" begin
@inferred solve(tpbvp_iip, Shooting(Tsit5()))
Expand Down

0 comments on commit df3909c

Please sign in to comment.