Page 241 - Excel for Scientists and Engineers: Numerical Methods
P. 241
218 EXCEL NUMERICAL METHODS
and although writing the differential equation, such as the above, may be simple,
solving the problem is not. By "solving," we mean that we want to be able to
calculate the value of y for any value of x. Some differential equations, such as
10-1, are solvable by symbolic integration (the integrated equation is In y = -kt +
const), but many others may not be amenable to solution by the "pencil-and-
paper" approach. Numerical methods, however, can always be employed to
find the value of the function at various values oft. Although we haven't found
an expression for the function F(x, y), but simply obtained a table of y values as a
function of x, the process is often referred to as "integration."
You may remember from your freshman calculus class that when an
expression is integrated, an arbitrary constant of integration is always part of the
solution. For example, when equation 10- 1 is integrated, the result is In y = -kt +
In yo, or yt = yoe-". A similar situation pertains when numerical methods are
employed: to solve the problem, one or more values of the dependent variable
and/or its derivative must be known at specific values of the independent
variable. If these are given at the zero value of the independent variable, the
problem is said to be an initial-value problem; if they are given at some other
values of the independent variable, the problem is a boundary-value problem.
This chapter deals with initial-value problems, while the following chapter deals
with boundary-value problems.
Solving a Single
First-Order Differential Equation
This section describes methods for solving first-order differential equations
with initial conditions (the order of a differential equation is determined by the
order of the highest derivative in the equation). Two methods will be described:
Euler's method and the Runge-Kutta method. Eulerk method is simple in
concept, but not of sufficient accuracy to be useful; it is included here because it
illustrates the basic method of calculation and can be modified to yield methods
of higher accuracy. The Runge-Kutta method, of which there are several
variants, is the usual method of choice. A third method, the predictor-corrector
method, will be described later in this chapter.
Euler's Method
Let us use in our first calculation an example of equation 10- 1 : the first-order
kinetic process A + B with initial concentration CO = 0.2000 molL and rate
constant k = 5 x s-'. We'll simulate the change in concentration of the
species A vs. time over the interval from t = 0 to t = 600 seconds, in increments
of 20 seconds.