@@ -66,8 +66,8 @@ resid_f_2p = (Array{Float64, 1}(undef, 3), Array{Float64, 1}(undef, 3))
66
66
67
67
# ## Now use the BVP solver to get closer
68
68
bvp = BVProblem (orbital!, cur_bc!, y0, tspan)
69
- for autodiff in (AutoForwardDiff (), AutoFiniteDiff (; fdtype = Val (:central )),
70
- AutoSparseForwardDiff (), AutoFiniteDiff (; fdtype = Val (:forward )),
69
+ for autodiff in (AutoForwardDiff (; chunksize = 6 ), AutoFiniteDiff (; fdtype = Val (:central )),
70
+ AutoSparseForwardDiff (; chunksize = 6 ), AutoFiniteDiff (; fdtype = Val (:forward )),
71
71
AutoSparseFiniteDiff ())
72
72
nlsolve = TrustRegion (; autodiff)
73
73
@time sol = solve (bvp, Shooting (DP5 (); nlsolve); force_dtmin = true , abstol = 1e-13 ,
@@ -76,19 +76,22 @@ for autodiff in (AutoForwardDiff(), AutoFiniteDiff(; fdtype = Val(:central)),
76
76
@info " Single Shooting Lambert's Problem: $(norm (resid_f, Inf )) "
77
77
@test norm (resid_f, Inf ) < 0.005
78
78
79
- jac_alg = BVPJacobianAlgorithm (; nonbc_diffmode = autodiff)
80
- @time sol = solve (bvp, MultipleShooting (10 , AutoVern7 (Rodas5P ()); nlsolve, jac_alg);
81
- abstol = 1e-6 , reltol = 1e-6 , verbose = false )
82
- cur_bc! (resid_f, sol, nothing , sol. t)
83
- @info " Multiple Shooting Lambert's Problem: $(norm (resid_f, Inf )) "
84
- @test norm (resid_f, Inf ) < 0.005
79
+ # Older versions take too long on the first run
80
+ if VERSION ≥ v " 1.10-"
81
+ jac_alg = BVPJacobianAlgorithm (; nonbc_diffmode = autodiff)
82
+ @time sol = solve (bvp, MultipleShooting (10 , DP5 (); nlsolve, jac_alg);
83
+ force_dtmin = true , abstol = 1e-6 , reltol = 1e-6 , verbose = false )
84
+ cur_bc! (resid_f, sol, nothing , sol. t)
85
+ @info " Multiple Shooting Lambert's Problem: $(norm (resid_f, Inf )) "
86
+ @test norm (resid_f, Inf ) < 0.005
87
+ end
85
88
end
86
89
87
90
# ## Using the TwoPoint BVP Structure
88
91
bvp = TwoPointBVProblem (orbital!, (cur_bc_2point_a!, cur_bc_2point_b!), y0, tspan;
89
92
bcresid_prototype = (Array {Float64} (undef, 3 ), Array {Float64} (undef, 3 )))
90
- for autodiff in (AutoForwardDiff (), AutoFiniteDiff (; fdtype = Val (:central )),
91
- AutoSparseForwardDiff (), AutoFiniteDiff (; fdtype = Val (:forward )),
93
+ for autodiff in (AutoForwardDiff (; chunksize = 6 ), AutoFiniteDiff (; fdtype = Val (:central )),
94
+ AutoSparseForwardDiff (; chunksize = 6 ), AutoFiniteDiff (; fdtype = Val (:forward )),
92
95
AutoSparseFiniteDiff ())
93
96
nlsolve = TrustRegion (; autodiff)
94
97
@time sol = solve (bvp, Shooting (DP5 (); nlsolve); force_dtmin = true , abstol = 1e-13 ,
@@ -98,11 +101,14 @@ for autodiff in (AutoForwardDiff(), AutoFiniteDiff(; fdtype = Val(:central)),
98
101
@info " Single Shooting Lambert's Problem: $(norm (reduce (vcat, resid_f_2p), Inf )) "
99
102
@test norm (reduce (vcat, resid_f_2p), Inf ) < 0.005
100
103
101
- jac_alg = BVPJacobianAlgorithm (; nonbc_diffmode = autodiff, bc_diffmode = autodiff)
102
- @time sol = solve (bvp, MultipleShooting (10 , AutoVern7 (Rodas5P ()); nlsolve, jac_alg);
103
- abstol = 1e-6 , reltol = 1e-6 , verbose = false )
104
- cur_bc_2point_a! (resid_f_2p[1 ], sol (t0), nothing )
105
- cur_bc_2point_b! (resid_f_2p[2 ], sol (t1), nothing )
106
- @info " Multiple Shooting Lambert's Problem: $(norm (reduce (vcat, resid_f_2p), Inf )) "
107
- @test norm (reduce (vcat, resid_f_2p), Inf ) < 0.005
104
+ # Older versions take too long on the first run
105
+ if VERSION ≥ v " 1.10-"
106
+ jac_alg = BVPJacobianAlgorithm (; nonbc_diffmode = autodiff, bc_diffmode = autodiff)
107
+ @time sol = solve (bvp, MultipleShooting (10 , DP5 (); nlsolve, jac_alg);
108
+ force_dtmin = true , abstol = 1e-6 , reltol = 1e-6 , verbose = false )
109
+ cur_bc_2point_a! (resid_f_2p[1 ], sol (t0), nothing )
110
+ cur_bc_2point_b! (resid_f_2p[2 ], sol (t1), nothing )
111
+ @info " Multiple Shooting Lambert's Problem: $(norm (reduce (vcat, resid_f_2p), Inf )) "
112
+ @test norm (reduce (vcat, resid_f_2p), Inf ) < 0.005
113
+ end
108
114
end
0 commit comments