Interactive Educational Modules in
Scientific Computing

Collocation Method for Boundary Value Problems

This module illustrates the collocation method for numerically solving boundary value problems for ordinary differential equations. A general boundary value problem (BVP) consists of an ordinary differential equation (ODE) with side conditions specified at more than one point. This module illustrates the solution of second-order scalar ODEs of the form u″ = f(t, u, u′) on an interval [a, b] with boundary conditions u(a) = α and u(b) = β. The collocation method approximates the solution to the BVP by a linear combination of basis functions determined by requiring that the ODE be satisfied at each of a discrete set of mesh points within [a, b], and that the boundary conditions be satisfied. Denote the fixed mesh points by ti, i = 1,…,n, where t1 = a, and tn = b. Denote the basis functions by φi, i = 1,…,n. Let v(t, x) denote a linear combination of basis functions φi with coefficients xi. The collocation method seeks a solution x to the system of equations v(t1, x) = α, v(tn, x) = β, v″(ti, x) = f(ti, v(ti, x), v′(ti, x)) for i = 2,…,n − 1. Note that the basis functions must be twice differentiable.

The user begins by selecting from the menu provided an ODE and a specific solution to be sought (if there is more than one). Boundary values u(a) = α and u(b) = β are indicated by black dots on the graph. Next the user chooses either polynomials (Chebyshev polynomials in this module) or cubic B-splines as the set of basis functions. The user also chooses the number and distribution of mesh points. If the cubic spline basis is used, the selected distribution determines the set of knots defining the B-splines as well as the set of collocation points.

After the parameters for collocation have been specified, the user next clicks Initialize to begin the process of solving the BVP. A predetermined starting guess x0 is used to initialize Broyden's method for solving the system of equations, and the corresponding approximate solution to the BVP, v(t, x0), is drawn in blue. The user then clicks Iterate repeatedly to execute successive iterations of Broyden's method to solve the system of equations. For each iterate xk, the corresponding function v(t, xk) is added to the graph, and the Euclidean norm of the residual is printed. The approximate solution curves are color coded according to their residuals, so as the solutions converge their colors change from blue to red.

To compare approximate solutions obtained using different basis functions or different numbers or distribution of collocation points, see the alternative Collocation Method module.

Reference: Michael T. Heath, Scientific Computing, An Introductory Survey, 2nd edition, McGraw-Hill, New York, 2002. See Section 10.5.

Developers: Evan VanderZee and Michael Heath