Unit 8: Boundary Value Problems for Ordinary Differential Equations: Shooting & Finite Differences
Mathematical formulation of two-point boundary value problems (BVPs), linear shooting via superposition, nonlinear shooting via Newton-Raphson and sensitivity variational equations, Finite Difference Methods (FDM), tridiagonal linear systems, and the Thomas algorithm (TDMA).
§8.1 Mathematical Formulation of Two-Point BVPs & Boundary Conditions
1. Two-Point Boundary Value Problems (BVPs)
In contrast to Initial Value Problems (IVPs) where all auxiliary conditions are specified at a single point $t_0$, Boundary Value Problems (BVPs) specify physical constraints at two or more distinct spatial endpoints $x = a$ and $x = b$.
A general second-order ODE on $x \in [a, b]$ is given by:
subject to boundary conditions at both endpoints.
2. Classification of Boundary Conditions
Boundary conditions are categorized based on function values and spatial derivatives:
1. Dirichlet Boundary Conditions (First Kind):
Fixed values of the state variable at the endpoints:
Physical Example: Prescribed temperatures at the ends of a conducting metal rod.
2. Neumann Boundary Conditions (Second Kind):
Fixed values of the outward flux or derivative:
Physical Example: Insulated adiabatic rod ends (zero heat flux: $y'(a) = 0$).
3. Robin / Mixed Boundary Conditions (Third Kind):
Linear combinations of state values and derivatives:
with $a_0, a_1, b_0, b_1 \ge 0$ and $a_0 + a_1 > 0, b_0 + b_1 > 0$. Physical Example: Newton's law of cooling / convective heat transfer at the boundary.
3. Existence and Uniqueness for Second-Order BVPs
Unlike IVPs where Picard's theorem ensures existence locally, BVPs can have no solutions, a unique solution, or infinitely many solutions (e.g., resonance in vibrating beams).
Theorem (Existence and Uniqueness for BVPs): Consider the Dirichlet BVP $y'' = f(x, y, y'), y(a) = \alpha, y(b) = \beta$ on $[a, b]$. Suppose $f$ is continuous on $D = [a, b] \times \mathbb{R}^2$ and satisfies:
- $\dfrac{\partial f}{\partial y}(x, y, y') > 0$ for all $(x, y, y') \in D$.
- There exists a constant $M > 0$ such that $\left|\dfrac{\partial f}{\partial y'}(x, y, y')\right| \le M$ on $D$.
Then the boundary value problem has a unique solution $y \in C^2([a, b])$. Significance of Condition 1: Positivity $\partial f / \partial y > 0$ prevents eigenvalues from crossing zero, ruling out resonant standing wave states.
§8.2 The Linear Shooting Method: Superposition of Particular & Homogeneous Solutions
1. Transformation into Two Initial Value Problems
Consider a general linear second-order two-point BVP:
with Dirichlet boundary conditions $y(a) = \alpha, y(b) = \beta$.
By the principle of linear superposition, the general solution can be written as:
where:
- $y_1(x)$ solves the non-homogeneous IVP:
- $y_2(x)$ solves the homogeneous IVP:
2. Determining the Superposition Coefficient
By construction, at the initial boundary $x = a$:
which matches the left boundary condition automatically for any choice of $c \in \mathbb{R}$!
To satisfy the right boundary condition $y(b) = \beta$:
Assuming $y_2(b) \ne 0$ (which holds whenever $q(x) > 0$), we solve directly for $c$:
Computational Algorithm:
- Convert the two second-order IVPs into two 2D first-order IVP systems.
- Integrate both systems from $x = a$ to $x = b$ using high-order single-step methods (e.g. classical RK4).
- Extract terminal values $y_1(b)$ and $y_2(b)$.
- Compute $c = \frac{\beta - y_1(b)}{y_2(b)}$.
- The initial slope is given directly by:
- Synthesize the complete spatial solution:
§8.3 The Nonlinear Shooting Method: Variational Equations & Newton-Raphson
1. Conceptual Framework of Nonlinear Shooting
For a nonlinear BVP:
superposition fails because the governing equation is nonlinear.
Instead, introduce an unknown initial slope parameter $s \in \mathbb{R}$ and define the parameter-dependent IVP:
Let $y(x; s)$ denote the solution to this IVP. We seek a value of $s$ such that the trajectory hits the target $\beta$ at the right boundary:
This is a scalar root-finding problem for $s$!
2. Newton-Raphson Iteration & Variational Sensitivity Equations
Applying Newton-Raphson to $F(s) = 0$:
To compute the derivative $\frac{\partial y}{\partial s}(x; s)$, define the variational sensitivity function:
Differentiating the governing ODE $y'' = f(x, y, y')$ with respect to the initial slope $s$:
Assuming smooth partial derivatives, interchange order of differentiation:
with initial conditions obtained by differentiating the boundary constraints:
Coupled 4D System for Nonlinear Shooting:
At each Newton iteration, integrate the coupled system of 4 first-order ODEs simultaneously from $x = a$ to $x = b$:
Then update:
Repeat until $|y_1(b) - \beta| < \text{TOL}$.
§8.4 Finite Difference Methods: Discretization, Tridiagonal Systems & Thomas Algorithm
1. Discretization of the Domain
Instead of integrating forward in space like shooting methods, Finite Difference Methods (FDM) discretize the spatial domain $[a, b]$ simultaneously into $N$ subintervals of width $h = \frac{b - a}{N}$:
Let $w_i \approx y(x_i)$ denote the discrete numerical approximations.
Using second-order centered difference approximations:
2. The Linear Tridiagonal System
Consider the linear BVP:
Substituting centered differences at interior grid points $i = 1, 2, \dots, N-1$:
Multiplying through by $-h^2$ and collecting terms:
Set:
This forms an $(N-1) \times (N-1)$ tridiagonal linear system:
3. The Thomas Algorithm (TDMA)
The Tridiagonal Matrix Algorithm (TDMA) is a specialized $\mathcal{O}(N)$ Gaussian elimination method that bypasses the general $\mathcal{O}(N^3)$ complexity:
1. Forward Sweep (Eliminate lower diagonal $a_i$):
2. Backward Substitution:
Total Operation Count: Exactly $5(N-1)$ additions and multiplications—massively faster and numerically stable whenever $q(x) > 0$ (strict diagonal dominance).
Tiered Solved Practice Problems & Examination Proofs
Comprehensive analytical derivations, multi-tier solutions (Foundational, Intermediate Algorithmic, and Honors/Proof Challenge) with complete line-by-line verification.
Consider the linear two-point BVP:
- Find the exact analytical solutions $y_1(x)$ and $y_2(x)$ to the corresponding non-homogeneous and homogeneous IVPs. 2. Calculate the exact initial slope $s = y'(0)$ via shooting superposition. 3. Verify that the synthesized solution satisfies $y(1) = 3$.
Step 1: Solve the Two IVPs Analytically The characteristic equation is $r^2 - 4 = 0 \implies r = \pm 2$. General solution form: $y(x) = A \cosh(2x) + B \sinh(2x)$.
1. First IVP ($y_1$):
$y_1(0) = A = 1$. $y_1'(x) = 2A \sinh(2x) + 2B \cosh(2x) \implies y_1'(0) = 2B = 0 \implies B = 0$. Thus:
2. Second IVP ($y_2$):
$y_2(0) = A = 0$. $y_2'(0) = 2B = 1 \implies B = \frac{1}{2}$. Thus:
Step 2: Superposition and Initial Slope Calculation Evaluate both solutions at the terminal point $x = 1$:
The target boundary condition is $y(1) = \beta = 3$. Set $y(1) = y_1(1) + c \, y_2(1) = 3$:
Evaluating numerically:
Since $y_1'(0) = 0$ and $y_2'(0) = 1$, the exact required shooting slope is:
Step 3: Verification The complete spatial solution is:
At $x = 0$: $y(0) = \cosh(0) - 0 = 1$ (matches left boundary). At $x = 1$: $y(1) = 3.762196 - 0.210153(3.626860) = 3.762196 - 0.762196 = 3.000000$ (matches right boundary exactly).
Consider the linear boundary value problem:
Discretize the problem using centered finite differences with $h = 0.25$ ($N = 4$, interior points $x_1=0.25, x_2=0.5, x_3=0.75$). 1. Formulate the explicit $3 \times 3$ tridiagonal linear system $A\vec{w} = \vec{b}$. 2. Solve the linear system using the Thomas algorithm (TDMA) to find $(w_1, w_2, w_3)$.
Step 1: Discretization and Matrix Formulation With $h = 0.25$:
Multiplying by $h^2 = \frac{1}{16} = 0.0625$:
Collecting coefficients of $w_{i-1}, w_i, w_{i+1}$:
Multiplying by $-1$:
With $h = 0.25$:
- $1 - h = 1 - 0.25 = 0.75$
- $2 + h^2 = 2 + 0.0625 = 2.0625$
- $1 + h = 1 + 0.25 = 1.25$
- $h^2 = 0.0625$
General difference equation for $i = 1, 2, 3$:
Boundary conditions: $w_0 = y(0) = 0$, $w_4 = y(1) = 1$.
- For $i = 1$ ($x_1 = 0.25$):
- For $i = 2$ ($x_2 = 0.50$):
- For $i = 3$ ($x_3 = 0.75$):
The $3 \times 3$ tridiagonal linear system is:
Step 2: TDMA (Thomas Algorithm) Solve
1. Forward Elimination:
- Row 1:
- Row 2:
- Row 3:
2. Backward Substitution:
- $w_3 = d_3^* = 0.801575$
- $w_2 = d_2^* - c_2' w_3 = -0.022968 - (-0.777385)(0.801575) = -0.022968 + 0.623133 = 0.600165$
- $w_1 = d_1^* - c_1' w_2 = -0.007576 - (-0.606061)(0.600165) = -0.007576 + 0.363736 = 0.356160$
Computed solution vector:
Consider the nonlinear two-point Dirichlet boundary value problem:
Let $y(x; s)$ denote the parameter-dependent solution of the initial value problem with initial slope $y'(a) = s$. 1. Prove that the sensitivity function $z(x; s) \equiv \frac{\partial y}{\partial s}(x; s)$ satisfies the linear second-order IVP:
- Formulate the exact Newton-Raphson shooting iteration $s^{(k+1)}$ for finding the boundary root $y(b; s) - \beta = 0$, proving that its local convergence rate is quadratic under standard regularity assumptions.
Part 1: Derivation of the Variational Sensitivity IVP
Let $y(x; s)$ be the solution of:
Assuming $f$ has continuous second partial derivatives, by Schwarz's theorem the mixed partial derivatives commute:
Define $z(x; s) \equiv \frac{\partial y}{\partial s}(x; s)$. Then:
Applying the multi-variable chain rule to the right-hand side:
Since $x$ is independent of $s$, $\frac{\partial x}{\partial s} = 0$. Interchanging derivatives in the last term:
Therefore:
This is a linear second-order differential equation in $z(x)$ whose variable coefficients depend on the trajectory $y(x; s)$.
Now determine the initial conditions for $z$ at $x = a$:
- $z(a) = \frac{\partial y}{\partial s}(a; s) = \frac{\partial}{\partial s}[\alpha] = 0$ (since $\alpha$ is a fixed constant independent of $s$).
- $z'(a) = \frac{\partial}{\partial x}\left( \frac{\partial y}{\partial s} \right)_{x=a} = \frac{\partial}{\partial s} \left( \frac{\partial y}{\partial x}(a; s) \right) = \frac{\partial}{\partial s}[s] = 1$.
This completes the derivation of the variational sensitivity IVP. $\blacksquare$
Part 2: Newton-Raphson Iteration and Proof of Quadratic Convergence
The target shooting condition at $x = b$ is:
The derivative of $F$ with respect to $s$ is:
Applying Newton-Raphson's method:
Proof of Local Quadratic Convergence:
Let $s^$ be the exact root such that $F(s^) = y(b; s^*) - \beta = 0$. Assume:
- $F'(s^) = z(b; s^) \ne 0$ (no bifurcation / non-singular Jacobian).
- $F''(s)$ is bounded in a neighborhood $U$ of $s^*$: $|F''(s)| \le M_2$.
Expanding $F(s^*)$ in a Taylor series about $s^{(k)}$:
From the Newton iteration:
Substituting this into the Taylor expansion:
Dividing by $F'(s^{(k)})$:
Taking absolute values:
This proves that the error at step $k+1$ is proportional to the square of the error at step $k$, establishing quadratic asymptotic convergence ($\mathcal{O}(|e_k|^2)$). $\blacksquare$