Loading...
Loading...
Numerical Analysis · Axiom Academy
The gold standard for smooth interpolation A cubic spline S(x) through points (x₀, y₀), ..., (xₙ, yₙ) is a piecewise cubic polynomial that is: Cubic on each subinterval [xᵢ, xᵢ₊₁] Passes through all data points: S(xᵢ) = yᵢ Has continuous first and second derivatives: S ∈ C² The result is a beautifully smooth curve that passes exactly through each point! For n+1 points, we have n cubic pieces, each with 4 coefficients. Total unknowns: 4n coefficients Interpolation: each of the n pieces must pass through both of its endpoints 2n First derivative continuity at the interior nodes n-1 Second derivative continuity at the interior nodes n-1 n pieces × 4 coefficients = 4n unknowns Interpolation (both ends of each piece): 2n conditions First derivative continuity at interior nodes: n-1 conditions Second derivative continuity at interior nodes: n-1 conditions Total: 2n + (n-1) + (n-1) = 4n - 2 conditions That leaves 4n - (4n - 2) = 2 degrees of freedom. We need exactly 2 more conditions to pin the spline down uniquely — these are the boundary conditions. We need 2 extra conditions to uniquely determine the spline. Common choices: The spline has zero curvature at the endpoints Minimizes total bending energy ∫[S''(x)]² dx S'(x₀) = f'(x₀) and S'(xₙ) = f'(xₙ) Specify the slopes at the endpoints Better approximation if derivatives are known S'''(x₁⁻) = S'''(x₁⁺) and S'''(xₙ₋₁⁻) = S'''(xₙ₋₁⁺) Third derivative continuous at second and second-to-last points
This is the written version of the interactive lesson above. See the full Numerical Analysis course.