@@ -155,12 +155,12 @@ The **shooting function** encodes:
155155
156156``` @example initial_time
157157function shoot!(s, p0, t1, t0)
158- x1, p1 = f_pos(t0, x0, p0, t1)
159- x2, p2 = f_neg(t1, x1, p1, tf)
158+ x1, p1 = f_pos(t0, x0, p0, t1, t0 )
159+ x2, p2 = f_neg(t1, x1, p1, tf, t0 )
160160
161- s[1:2] = x2 - xf # Final state match
162- s[3] = H(x0, p0, u_pos) - 1 # Hamiltonian normalization
163- s[4] = p1[2] # Switching condition
161+ s[1:2] = x2 - xf # Final state match
162+ s[3] = H(x0, p0, u_pos) - 1 # Hamiltonian normalization
163+ s[4] = p1[2] # Switching condition
164164end
165165nothing # hide
166166```
@@ -211,6 +211,6 @@ Compare with the direct solution:
211211
212212``` @example initial_time
213213f = f_pos * (t1, f_neg) # Concatenate bang-bang flow
214- indirect_sol = f((t0, tf), x0, p0; saveat=range(t0, tf, 200))
214+ indirect_sol = f((t0, tf), x0, p0, t0 ; saveat=range(t0, tf, 200))
215215plot!(plt, indirect_sol; label="indirect", color=:red, linestyle=:dash)
216216```
0 commit comments