4.8.28 · D3Numerical Methods

Worked examples — Boundary value problems — shooting method, finite difference

2,668 words12 min readBack to topic

Before we start, a self-contained toolkit — every symbol used below, defined right here.

Two more words we lean on constantly:

  • Interior node: a grid point strictly between the two ends — the ones we must solve for. The ends are already given.
  • Residual: how far our current answer is from satisfying the rule. For shooting it is : the gap between where our shot landed and the bucket .

The scenario matrix

Cell What makes it different Example
A. Linear + shooting is a straight line → exact in 2 shots Ex 1
B. Nonlinear + shooting is curved → must iterate secant Ex 2
C. Linear FDM, symmetric tridiagonal, no convection Ex 3
D. Linear FDM, asymmetric off-diagonals (convection) Ex 4
E. Degenerate grid () only ONE interior node → single equation inside Ex 3
F. Limiting case: refine check error falls (halve error) Ex 5
G. Sign check: which side did we land? overshoot vs undershoot, negative residual Ex 6
H. Real-world word problem heated rod, units, physical read-off Ex 7
I. Exam twist: derivative (Neumann) boundary given, not → ghost node Ex 8

Every method-cell (A–I) is hit at least once below.


Ex 1 — Cell A: Linear shooting, exact in two shots


Ex 2 — Cell B: Nonlinear shooting, secant must iterate


Ex 3 — Cells C & E: Linear FDM, , degenerate single node


Ex 4 — Cell D: Linear FDM with convection


Ex 5 — Cell F: Limiting refinement, error


Ex 6 — Cell G: Sign of the residual (over/undershoot)

Figure — Boundary value problems — shooting method, finite difference

Figure: three shooting attempts for , all launched from the left end. The magenta curve (slope ) stays flat and ends below the navy dashed "bucket" line — an undershoot. The violet curve (slope ) rises steeply and ends above the bucket — an overshoot. The orange curve (slope ) lands exactly on the bucket. Read the sign of the residual straight off the picture: below the dashed line ⇒ , above ⇒ , on it ⇒ .


Ex 7 — Cell H: Real-world word problem (heated rod)


Ex 8 — Cell I: Exam twist, a derivative (Neumann) boundary


Recall Rapid self-test

Which matrix cell needs iteration even though shooting is used? ::: Cell B — nonlinear ODE makes curved. A negative residual means we shot… ::: short (undershot the target ). Halving in a central-difference FDM changes the error by roughly… ::: a factor of (it is ). With a Neumann boundary given, what do we add? ::: a ghost node plus a central-difference equation for the slope. Why is the lower off-diagonal bigger than the upper when ? ::: the convection term adds to the lower, subtracts from the upper.