The goal of Appendix A is to provide enough information so the reader can effective-
ly use some subroutines (functions) that implement commonly used numerical methods.
For detail about the methods readers may refer to any of a number of books on numerical
analysis; for example, one "oldy but goody" is Applied Numerical Methods, by Carnahan
et al. (1969). Numerical Recipes: The Art of Scientific Computing, by Press et al. (1992)
with versions that emphasize either Fortran, Pascal, C or Basic, provides detail on effec-
tively implementing these methods in computer codes. The order in which numerical
methods will be described in this appendix is (1) linear algebra, (2) numerical integration,
and (3) the solution of ordinary differential equations (ODEs).
If the derivative of the dependent variable y with respect to the independent variable x
is only a function of the independent variable, then the solution y = f(x) can be obtained
by direct integration. If dy/dx depends upon both y and x, then the methods for solv-
ing ODEs must be used. Sometimes it is possible to rearrange the form of the original
equation so only x appears on one side of the equal sign, and y on the other, i.e. separate
variables, and then integration will provide the solution. The same principles apply for
second derivatives etc. Since the methods for solving ODEs normally let dy/dx = f(x, y),
and this implies dy/dx may only be a function of x or y, the methods for solving
ODEs can be used to solve a problem for which numerical integration could be used.
However, the reverse is not true.
A.2 LINEAR ALGEBRA
A.2.1. GAUSSIAN ELIMINATION
The simplest method for solving a linear system of equations is Gaussian elimination;
in this method we multiply an equation, or row in the coefficient matrix, by a value so that
the first term in a resulting equation becomes zero, or is eliminated, when we subtr