Scientific Computing

This module illustrates the Galerkin method for numerically solving
boundary value problems for ordinary differential equations. A general
boundary value problem (BVP) consists of an ordinary differential
*u*″ = *f*(*t*, *u*,
*u*′)*a*,
*b*]*u*(*a*) =
*α**u*(*b*) =
*β**Galerkin method* approximates the
solution to the BVP by a linear combination of basis functions
determined by requiring that the residual be orthogonal to each of the
homogeneous basis functions, i.e., those that vanish on the boundary,
and that the boundary conditions be satisfied. Let
*φ*_{1},*φ*_{n}*v*(*t*,
** x**) =

Integrating the left side by parts and using homogeneity, we can
replace *v*″(*t*, ** x**)

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*) = *α**u*(*b*) = *β**a*, *b*]*Initialize* to begin the process of
solving the BVP. A predetermined starting guess
*x*_{0} is used to initialize Broyden's method for
solving the system of equations, and the corresponding approximate
solution to the BVP, *v*(*t*, *x*_{0}),
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 *x*_{k}, the
corresponding approximate solution *v*(*t*,
*x*_{k}) is added to the graph, and the
Euclidean norm of the residual of the system of equations is printed.
The approximate solution curves are color coded according to their
residuals, so as the approximate solutions converge their colors change
from blue to red.

To compare approximate solutions obtained using different basis functions, numbers of elements, or quadrature rules, see the alternative Galerkin Method module.

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

**Developers:** Evan VanderZee and Michael Heath