WHY do these arise? Steady-state physics: temperature along a rod with both ends fixed, deflection of a beam clamped at both ends, electrostatic potential between two plates. Nothing evolves in time — the answer must satisfy constraints everywhere at once.
Apply to a linear BVPy′′=p(x)y′+q(x)y+r(x). Substitute stencils at each interior xi:
h2yi+1−2yi+yi−1=pi2hyi+1−yi−1+qiyi+ri.
Multiply by h2 and group yi−1,yi,yi+1:
lower(1+2hpi)yi−1diag−(2+h2qi)yi+upper(1−2hpi)yi+1=h2ri.
This is a tridiagonal linear systemAy=d with y0=α,yN=β moved to the right side. Solve in O(N) by the Thomas algorithm (tridiagonal Gaussian elimination).
Imagine you must throw a ball so it lands exactly in a far-off bucket. You don't know the right throwing angle. Shooting: throw once (too short), throw again (too far), then split the difference — keep adjusting the angle until it lands in the bucket. Finite difference: instead of throwing, you draw the ball's path as lots of tiny connected dots and force the dots to obey the rule "each dot is the average-ish of its neighbours," then solve the dot-puzzle so the first and last dots sit where they must. Both find the same curve — one by aiming, one by puzzle-solving.
BVP gives one condition at each endpoint (y(a),y(b)); IVP gives all conditions (y,y′) at a single point, so IVP can march but BVP cannot.
Core idea of the shooting method?
Guess the missing slope y′(a)=s, solve the resulting IVP, treat landing error ϕ(s)=y(b;s)−β, and root-find ϕ(s)=0 (usually via secant).
Why does the linear shooting shortcut give the answer in exactly 2 shots?
For a linear ODE, y(b;s) is linear in s, so ϕ(s) is a straight line determined exactly by two points — linear interpolation hits the root with no iteration.
Secant update formula for shooting?
sn+1=sn−ϕ(sn)ϕ(sn)−ϕ(sn−1)sn−sn−1.
Central difference for y′ and its order?
yi′≈2hyi+1−yi−1, accurate to O(h2).
Central difference for y′′ and its order?
yi′′≈h2yi+1−2yi+yi−1, accurate to O(h2) (the +1,−2,+1 stencil).
How do you derive the y′′ stencil?
Add the Taylor expansions of yi+1 and yi−1; odd-power terms cancel, leaving yi+1+yi−1=2yi+h2yi′′+O(h4), then solve for yi′′.
Dekho, BVP (boundary value problem) ka matlab hai ki tumhe do alag-alag ends par condition di gayi hai — jaise rod ke dono sire ka temperature, ya y(0) aur y(1). IVP me sab kuch ek hi point par milta hai isliye tum aage march kar sakte ho, lekin BVP me start ka slope y′(a) pata hi nahi hota, to direct march nahi chalega. Yahin do techniques kaam aati hain.
Shooting method ekdum cannon aim karne jaisa hai. Tum missing slope s=y′(a) ka ek guess maaro, us guess se IVP solve karo (RK4 vagaira se), aur dekho ki y(b) kahan gira. Agar target β se kam aaya to slope badhao, zyada aaya to ghatao. Yeh adjusting kaam secant method se hota hai. Mast baat: agar ODE linear hai, to sirf do shots me exact answer aa jata hai, kyunki landing y(b) slope ka straight-line function hota hai.
Finite difference thoda alag soch hai — yahan tum aim nahi karte, balki poore domain ko chhote-chhote grid points me kaat dete ho. Har point par derivative ko Taylor series se nikla hua formula laga dete ho: y′′≈h2yi+1−2yi+yi−1 (yaad rakho: beech me minus two!). Isse ek tridiagonal linear system ban jata hai jo Thomas algorithm se fatafat solve hota hai. Saare points ek saath solve hote hain, isliye yeh stiff problems me shooting se zyada stable rehta hai.
Exam tip: stencil ka sign mat bhulo, boundary values y0,yN ko RHS me shift karo, aur central difference hi use karo (forward difference order kam kar deta hai). Accuracy $O