Skip to content

Commit

Permalink
Fix single shooting failing
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikQQY committed Oct 26, 2024
1 parent b799b32 commit 3994974
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/BoundaryValueDiffEqShooting/test/orbital_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@
AutoFiniteDiff(; fdtype = Val(:forward)), AutoSparse(AutoFiniteDiff()))
nlsolve = TrustRegion(; autodiff)

sol = solve(
bvp, Shooting(DP5(); nlsolve); force_dtmin = true, abstol = 1e-6, reltol = 1e-6,
verbose = false, odesolve_kwargs = (abstol = 1e-6, reltol = 1e-3))
jac_alg = BVPJacobianAlgorithm(; nonbc_diffmode = autodiff,
bc_diffmode = BoundaryValueDiffEqShooting.__get_non_sparse_ad(autodiff))

sol = solve(bvp, Shooting(DP5(); nlsolve, jac_alg); force_dtmin = true,
abstol = 1e-6, reltol = 1e-6, verbose = false,
odesolve_kwargs = (abstol = 1e-6, reltol = 1e-3))

@test SciMLBase.successful_retcode(sol)
@test norm(sol.resid, Inf) < 1e-6

jac_alg = BVPJacobianAlgorithm(; nonbc_diffmode = autodiff,
bc_diffmode = BoundaryValueDiffEqShooting.__get_non_sparse_ad(autodiff))
sol = solve(bvp, MultipleShooting(10, DP5(); nlsolve, jac_alg);
force_dtmin = true, abstol = 1e-6, reltol = 1e-6,
verbose = false, odesolve_kwargs = (abstol = 1e-6, reltol = 1e-3))
Expand All @@ -82,14 +83,15 @@
AutoSparse(AutoForwardDiff(; chunksize = 6)))
nlsolve = TrustRegion(; autodiff)

sol = solve(
bvp, Shooting(DP5(); nlsolve); force_dtmin = true, abstol = 1e-6, reltol = 1e-6,
verbose = false, odesolve_kwargs = (abstol = 1e-6, reltol = 1e-3))
jac_alg = BVPJacobianAlgorithm(; nonbc_diffmode = autodiff, bc_diffmode = autodiff)

sol = solve(bvp, Shooting(DP5(); nlsolve, jac_alg); force_dtmin = true,
abstol = 1e-6, reltol = 1e-6, verbose = false,
odesolve_kwargs = (abstol = 1e-6, reltol = 1e-3))

@test SciMLBase.successful_retcode(sol)
@test norm(sol.resid, Inf) < 1e-6

jac_alg = BVPJacobianAlgorithm(; nonbc_diffmode = autodiff, bc_diffmode = autodiff)
sol = solve(bvp, MultipleShooting(10, DP5(); nlsolve, jac_alg);
force_dtmin = true, abstol = 1e-6, reltol = 1e-6,
verbose = false, odesolve_kwargs = (abstol = 1e-6, reltol = 1e-3))
Expand Down

0 comments on commit 3994974

Please sign in to comment.