A boundary value problem is linear iff
for continuous functions p, q, and r.
Linear Shooting Method
Solves a linear BVP by combining solutions to 2 initial value problems.
A unique solution exists if
- p, q, and r are continuous on [a,b]
- q(x)>0 for x∈[a,b]
Superposition Idea
If y1 solves
and y2 solves the homogeneous equation
then y=y1+cy2 solves the ODE for any constant c.
Auxiliary IVPs
Fix
Solve
with order 4 Runge-Kutta.
Combining Solutions
Choose c so that y(b)=β.
Linear Finite-Difference Method
Replace derivatives with centered differences at mesh points and solve the resulting linear system.
Mesh Points
Partition [a,b] into N+1 subintervals of length h=N+1b−a.
Linear Difference Equation
With y(xi)≈wi, w0=α, and wN+1=β,
for i=1,…,N, with truncation error O(h2).
where A is tridiagonal, with
Solve for w with LU decomposition or another linear solver.
If p, q, and r are continuous on [a,b] and q(x)≥0, the linear system has a unique solution whenever h<L2, where L=maxa≤x≤b∣p(x)∣.
Worked Examples
Example 1
Solve y′′=y, 0≤x≤1, y(0)=0, and y(1)=1 with the linear shooting method.
Solution Reveal Hide
p=0, q=1, and r=0.
Use step size h=0.25. For the shooting method, solve the auxiliary IVPs with order 4 Runge-Kutta:
y1′′=y1,y1(0)=0, y1′(0)=0and
y2′′=y2,y2(0)=0, y2′(0)=1The first IVP has y1(x)=0. Applying order 4 Runge-Kutta to the second IVP gives
x00.250.500.751.00y2(x)00.2526040.5210780.8222891.175158y2′(x)11.0314131.1276211.2946691.543052Therefore,
c=y2(1)1−y1(1)=1.1751581−0=0.8509Combining the auxiliary solutions gives
y(x)=y1(x)+cy2(x)≈0.8509y2(x)
Example 2
Solve y′′=y+1, 0≤x≤1, y(0)=0, and y(1)=1 with the linear shooting method. Use order 4 Runge-Kutta with h=0.25.
Solution Reveal Hide
Here p=0, q=1, and r=1. The auxiliary IVPs are
y1′′=y1+1,y1(0)=0, y1′(0)=0and
y2′′=y2,y2(0)=0, y2′(0)=1Order 4 Runge-Kutta gives
y1(1)≈0.543052,y2(1)≈1.175158Therefore,
c=y2(1)1−y1(1)=1.1751581−0.543052≈0.38884The shooting approximation is
y(x)≈y1(x)+0.38884y2(x)