UNIHIVE

Study Hub UNIPORT MTH 492

MTH 492 · Numerical Methods

The shooting method

Turning a boundary value problem into initial value problems and correcting the missing slope.

Our notes

2 min read

The 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).

  1. Shot 1: s = 1. Then y = x solves the ODE exactly (y″ = 0 = 4(x − x)), so y(1) = 1.
  2. Shot 2: s = 2. RK4 with h = 0.025 gives y(1) = 2.81343.
  3. Interpolate: s = 1 + (2 − 1)(2 − 1)/(2.81343 − 1) = 1 + 1/1.81343 = 1.55144.
  4. 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

ForAgainst
Uses accurate adaptive IVP solversCan blow up if the IVP is unstable over [a, b]
Simple to codeA poor first guess may not converge (non-linear)
Good accuracy with few unknownsNeeds 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

Watch

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.

All MTH 492 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.