You are on page 1of 7

A

Numerical
Techniques

App. A

Numerical Techniques

-+ 2-b

dx
2
- 2ax.t.b
ax:+bx+c

for b2 = 4oc

(A- 10)

where p and q are the roots of the equation.

(A- 12)
C

A.2 Equal-Area Graphical Differentiation


There are many ways of differentiating numerical and graphical data. We shall
confine our discussions to the technique of equal-area differentiation. In the
procedure delineated here, we want to find the derivative of with respect to x.
I. Tabulate the (T,, x i ) observations as shown in Table A-1.
2. For each intenla], calculate hx, = x, - x,-, and Ay, = y, - y

This method finds


use in Chapter 5 .

,-,.

See. A.2

1011

Equal-Area GaphiEal DHerentiation

3. Calculate Ay,lAxn as an estimate of the average slope in an interval


to X n .
4. Plot these values as a histogram versus x i . The value between xt and
x 3 , for example, is ( y 3 kz)l(.r3- ~ 2 ) Refer
.
to Figure A-1.

Figure A-1 Equal-area differentiation.

5. Next draw in the smooth cusve that best approximates the area under
the histogram. That is, attempt in each interval to balance areas such
as those labeled A and B, but when this approximation is not possibIe,
baIance out over several intervals (as for the areas labeled C and D).
From our definitions of Ax and Ay we know that
Y"-YI =

'
1

Ax,

(A- 13)

i=2

The equal-area method attempts to estimate dyldx so that


See CD-ROM,

Appendix A, for

worked example

that is, so that the area under A y l h x is the same as &at under dyldx,
everywhm possible.
6. Read estimates of dyr'dr from this curve at the data points x, , x,, .. .
and complete the table.

Unkr

An example illustrating the technique is given in L c CD-ROM. Appendix A.


Differentiation is. at best, less accurate than integration. This method also
clearly indicates bad data and allows for compensation of such data. Differentiation is only valid, however, when the data are presumed to differentiate
smoothly, as in rate-data analysis and the interpretation of transient diffusion
data.

1012

Numerical Techniques

App. A

A.3 Solutions to Differential Equations


First-Order Ordinary Differential Equation

A.3.A

d
Links

See www.ucbac.uk/Mathematr'cs/geomath/EevcI2/deqpt/de8
htmI and CD-ROM

Appendix K.

2+ m y =,df)
II).

Using integrating factor = exp fdt

the solution is

dt

y=e

Exampb A-I

(A- 15)

+ K,e

(A- 16)

Integrating Factor for Series Reactions


-k,t

*+k$=k,e
d!

%'

Integrating factor = exp


k r

dye)

py= klI:k2y=-e

fk2 -11b
kl e

d!

kl

k
k,

-kt!

k2 - 4
r=O

(kz-kl)r
l

- k*

+li;

-k21

+K,e

y=o

A.3.B

Coupled Differential Equations

Techniques to soIve coupled first order linear ODES such as

are given in Appendix K in the CD-ROM.

Numerical Evaluation of Integrals

Sec. A.4

A.3.C Second-Order Ordinary Differsntial Equation


Methods of solving differential equations of the type
(A- 17)

can be found in such tests as Applied Diflerential Equations by M.R. Spiegel


(Upper Saddle River, N.J.: Prentice Hall, 1958, Chapter 4; a great book even
though it's old) or in Diferentinl Equations by F. Ayres (New Yosk: Schaum
Outline Series, McGraw-Hill, 1952). One method of solution is to determine
the characteristic roots of

which are
M

The solution to the differential equation is


type are required

, =A,

+B , e t f i . ~

(A- 38)

where A! and B, are arbitrary constants of integration. It can be verified that


Equation (A- 18) can be arranged in the form
= A sinhfix

+ ~cosh,@x

(A- 19)

Equation (A-19) is the more useful form of the solution when it comes to evaluating the constants -4 and B because sinh(0) .= 0 and cosh (0) = 1 .O.

A.4 Numerical Evaluation of Integrals


I n this section, we discuss techniques for numerically evaluating integrals for

solving first-order differentia1 equations.


1. Trapezoidal rule (two-point) (Figure A-2). This method i s one of the

sirnpIest and most approximate, as it uses the integrand evaluated at


the limits of integration to evaluate the integrat:

when h = X I

- Xo.

1014

Numerical Techniques

App. A

2. Simpson S one-third rule (three-pint) (Figure A-3). A more accurate


evaluation of the integral can be found with the application of Simp
son's rule:

where

Methods to solve

in Chapters 2,4, 8,
and

-E
-

jbxtnnna
in Chapter 13

I
I

h&hYt

xo

xo

Xl

X,
X

X2

Figure A-3 Simpson's three-point rule


illustration.

Figure A-2 Trapezoidal rule iltustration.

3. Simpson 's three-eighths mIe (four-point) (Figem A-4). An improved


version of Simpson's one-third rule can be made by applying Simpson's three-eighths rule:
x3

1%

[ f N o ) + 3f (Xi 1+ 3f (Xz1 +f(X3) I

where

x,-x,

h=-

Figure A-4

XI

= Xo + h

X2 = Xo -I-2h

Simpson's four-point rule illusbation.

4. Five-point qwdratuw formula.

(A-22)

Sec. A.5

Software Packages

where

5. For N

+ 1 points, where (N13) is an integer,

where h =

6. Wr N

x,-x,,
N

+ 1 points, where N is even,

where
These formulas are useful in illustrating how the reaction engineering
integrals and coupled ODES (ordinary differential equation(s)) can be solved
and also when there is an ODE solver power failure or some other malfunction.

A.5 Software Packages


LInks

Instructions on how to use Polymath, MATLAB, FEMLAB, and Aspen can be


found on h e CD-ROM.
For the ordinary differential equation solver (ODE solver), contact:
PoIymath

CACHE Corporation
P.O.Box 7939
Austin, Texas 78713-7379
Web site: w~w.pnlj~mathsofrware.comfogIer
MATLAB
The Math Works, Inc.
20 Nonh Main Street, Suite 250
Sherbom, Massachusetts 01770

Aspen Technology, Inc.


10 Canal Park
Cambridge, Massachusetts
02141 -2201
Email: info @aspentech.corn
W e b site: /hrw~:aspenrech.com

FErvlLAB
COMSOL, Inc.
8 New England Executive Park. Suite 3 10
Burlington. Massachusetts 01803
Tel: 78 1-273-3322; Fax: 7 8 1-273-6603
Email: info@comsol.com
Web site: MWW cor~~snl.com

A critique: of some of these software packages (and others) can be found in


Chenr. Eng. Educ., XXV (Winter) 54 (199 1).

You might also like