@@ -127,7 +127,7 @@ function first_integrals_manifold(residual, u, p, t)
127127 residual[3:4] .= initial_first_integrals[2] - L(u[1:2], u[3:4])
128128end
129129
130- cb = ManifoldProjection(first_integrals_manifold)
130+ cb = ManifoldProjection(first_integrals_manifold, autodiff = AutoForwardDiff() )
131131sol5 = solve(prob2, RK4(), dt = 1 // 5, adaptive = false, callback = cb)
132132analysis_plot2(sol5, H, L)
133133```
@@ -139,7 +139,7 @@ function energy_manifold(residual, u, p, t)
139139 residual[1:2] .= initial_first_integrals[1] - H(u[1:2], u[3:4])
140140 residual[3:4] .= 0
141141end
142- energy_cb = ManifoldProjection(energy_manifold)
142+ energy_cb = ManifoldProjection(energy_manifold, autodiff = AutoForwardDiff() )
143143sol6 = solve(prob2, RK4(), dt = 1 // 5, adaptive = false, callback = energy_cb)
144144analysis_plot2(sol6, H, L)
145145```
@@ -151,7 +151,7 @@ function angular_manifold(residual, u, p, t)
151151 residual[1:2] .= initial_first_integrals[2] - L(u[1:2], u[3:4])
152152 residual[3:4] .= 0
153153end
154- angular_cb = ManifoldProjection(angular_manifold)
154+ angular_cb = ManifoldProjection(angular_manifold, autodiff = AutoForwardDiff() )
155155sol7 = solve(prob2, RK4(), dt = 1 // 5, adaptive = false, callback = angular_cb)
156156analysis_plot2(sol7, H, L)
157157```
0 commit comments