17.11.2012 Views

Numerical recipes

Numerical recipes

Numerical recipes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

856 Chapter 19. Partial Differential Equations<br />

(19.3.13). Called the alternating-direction implicit method (ADI), this embodies the<br />

powerful concept of operator splitting or time splitting, about which we will say<br />

more below. Here, the idea is to divide each timestep into two steps of size ∆t/2.<br />

In each substep, a different dimension is treated implicitly:<br />

u n+1/2<br />

j,l<br />

u n+1<br />

j,l<br />

= u n j,l<br />

= un+1/2<br />

j,l<br />

1<br />

+<br />

2 α<br />

�<br />

+ 1<br />

2 α<br />

δ 2 x un+1/2<br />

j,l<br />

�<br />

δ 2 x un+1/2<br />

j,l<br />

+ δ 2 y un j,l<br />

�<br />

+ δ 2 y un+1<br />

j,l<br />

�<br />

(19.3.16)<br />

The advantage of this method is that each substep requires only the solution of a<br />

simple tridiagonal system.<br />

Operator Splitting Methods Generally<br />

The basic idea of operator splitting, which is also called time splitting or the<br />

method of fractional steps, is this: Suppose you have an initial value equation of<br />

the form<br />

∂u<br />

∂t<br />

= Lu (19.3.17)<br />

where L is some operator. While L is not necessarily linear, suppose that it can at<br />

least be written as a linear sum of m pieces, which act additively on u,<br />

Lu = L1u + L2u + ···+ Lmu (19.3.18)<br />

Finally, suppose that for each of the pieces, you already know a differencing scheme<br />

for updating the variable u from timestep n to timestep n +1, valid if that piece<br />

of the operator were the only one on the right-hand side. We will write these<br />

updatings symbolically as<br />

u n+1 = U1(u n , ∆t)<br />

u n+1 = U2(u n , ∆t)<br />

···<br />

u n+1 = Um(u n , ∆t)<br />

(19.3.19)<br />

Now, one form of operator splitting would be to get from n to n +1by the<br />

following sequence of updatings:<br />

u n+(1/m) = U1(u n , ∆t)<br />

u n+(2/m) = U2(u n+(1/m) , ∆t)<br />

···<br />

u n+1 = Um(u n+(m−1)/m , ∆t)<br />

(19.3.20)<br />

Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)<br />

Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by <strong>Numerical</strong> Recipes Software.<br />

Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable<br />

files (including this one) to any server computer, is strictly prohibited. To order <strong>Numerical</strong> Recipes books or CDROMs, visit website<br />

http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!