Skip to content

Commit

Permalink
orbital multiple shooting
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Sep 28, 2023
1 parent 4ca99de commit b14d32c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/orbital.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ for autodiff in (AutoForwardDiff(), AutoFiniteDiff(; fdtype = Val(:central)),
@time sol = solve(bvp, Shooting(DP5(); nlsolve); force_dtmin = true, abstol = 1e-13, reltol = 1e-13)
cur_bc!(resid_f, sol, nothing, sol.t)
@test norm(resid_f, Inf) < TestTol

@time sol = solve(bvp, MultipleShooting(10, DP5(); nlsolve); abstol = 1e-6,
reltol = 1e-6)
@test SciMLBase.successful_retcode(sol)
cur_bc!(resid_f, sol, nothing, sol.t)
@test norm(resid_f, Inf) < 1e-6
end

### Using the TwoPoint BVP Structure
Expand All @@ -85,7 +91,15 @@ for autodiff in (AutoForwardDiff(), AutoFiniteDiff(; fdtype = Val(:central)),
AutoSparseForwardDiff(), AutoFiniteDiff(; fdtype = Val(:forward)),
AutoSparseFiniteDiff())
nlsolve = NewtonRaphson(; autodiff)
@time sol = solve(bvp, Shooting(DP5(); nlsolve); force_dtmin = true, abstol = 1e-13, reltol = 1e-13)

@time sol = solve(bvp, Shooting(DP5(); nlsolve); force_dtmin = true, abstol = 1e-13,
reltol = 1e-13)
cur_bc_2point!(resid_f_2p, (sol(t0), sol(t1)), nothing)
@test norm(vcat(resid_f_2p...), Inf) < TestTol

@time sol = solve(bvp, MultipleShooting(10, DP5(); nlsolve); abstol = 1e-6,
reltol = 1e-6)
@test SciMLBase.successful_retcode(sol)
cur_bc_2point!(resid_f_2p, (sol(t0), sol(t1)), nothing)
@test norm(vcat(resid_f_2p...), Inf) < TestTol
end

0 comments on commit b14d32c

Please sign in to comment.