MTH 492 · Numerical Methods
Our notes
2 min readThe idea
Guess the missing initial slope s = y′(a), solve the IVP (by RK4) to x = b, and see whether y(b) hits the target β. Adjust s and "shoot" again, like correcting the aim of a cannon.
Linear problems: two shots are enough
For a linear ODE, y(b) depends linearly on s. Shoot with s₁ and s₂, getting y(b) = B₁ and B₂. Then
s = s₁ + (β − B₁)(s₂ − s₁)/(B₂ − B₁)
gives the exact slope (up to the IVP solver's error).
Worked example
Same problem as the last topic: y″ = 4(y − x), y(0) = 0, y(1) = 2. As a system: y′ = v, v′ = 4(y − x).
- Shot 1: s = 1. Then y = x solves the ODE exactly (y″ = 0 = 4(x − x)), so y(1) = 1.
- Shot 2: s = 2. RK4 with h = 0.025 gives y(1) = 2.81343.
- Interpolate: s = 1 + (2 − 1)(2 − 1)/(2.81343 − 1) = 1 + 1/1.81343 = 1.55144.
- Exact: y′(0) = 1 + 2/sinh 2 = 1.55144. ✓ A third shot with s = 1.55144 lands on y(1) = 2.00000.
Non-linear problems: iterate
y(b; s) is no longer linear in s. Treat F(s) = y(b; s) − β = 0 as a root-finding problem:
- Secant method: sₖ₊₁ = sₖ − F(sₖ)(sₖ − sₖ₋₁)/(F(sₖ) − F(sₖ₋₁)). Each F needs one full IVP solve.
- Newton's method: needs dF/ds, found by solving the variational equation alongside the ODE (for y″ = f(x, y, y′), the sensitivity z = ∂y/∂s obeys z″ = f_y z + f_{y′} z′, z(a) = 0, z′(a) = 1).
Strengths and weaknesses
| For | Against |
|---|---|
| Uses accurate adaptive IVP solvers | Can blow up if the IVP is unstable over [a, b] |
| Simple to code | A poor first guess may not converge (non-linear) |
| Good accuracy with few unknowns | Needs care for long intervals |
Multiple shooting splits [a, b] into pieces, shoots on each and matches them, to tame unstable problems.
Exams usually ask
- Solve a linear BVP by two shots and linear interpolation (with given IVP results, or with one RK4 step each).
- Write the secant iteration for a non-linear BVP.
Common mistake
Expecting the secant formula to finish in one step for a non-linear problem. Only the linear case is exact after two shots.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Shooting method
(opens en.wikipedia.org in a new tab)
Wikipedia, Shooting method, CC BY-SA 4.0 · licence
Watch
-
Best pick Chapter 08.06: Lesson: Shooting Method: Example: Part 1 of 4
8 min · ≈ 36 MB · about ₦20
(opens youtube.com in a new tab)
-
Shooting Method for Boundary Value Problems | Lecture 57 | Numerical Methods for Engineers
12 min · ≈ 54 MB · about ₦30
(opens youtube.com in a new tab)
-
Shooting Method - EXAMPLE (Part 1 of 2)
15 min · ≈ 68 MB · about ₦38
(opens youtube.com in a new tab)
-
Numerical Methods # ch:5 solution of ODE # Shooting methods # old question solution with easy way
16 min · ≈ 72 MB · about ₦40
(opens youtube.com in a new tab)
-
Mod-20 Lec-20 Shooting Method BVPs
59 min · ≈ 266 MB · about ₦149
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.