正在加载图片...
19.3 Initial Value Problems in Multidimensions 855 The expression for 2 can be manipulated into the form p-1-(in kA+sin k) (19.3.8) -4(cosk△-cos△)2-(oy sin k△-a红sink△2 The last two terms are negative,and so the stability requirement 2<1 becomes 1 三 2-(a2+a)≥0 (19.3.9) or △t≤ △ (19.3.10) √2(2+)/2 ICAL This is an example of the general result for the N-dimensional Courant condition:If is the maximum propagation velocity in the problem,then RECIPES △t≤ (19.3.11) 9 VNu 众入 ress. is the Courant condition. Diffusion Equation in Multidimensions Let us consider the two-dimensional diffusion equation, IENTIFIC Ou 乎u 6 =D x2+ 02 (19.3.12) ot An explicit method,such as FTCS,can be generalized from the one-dimensional case in the obvious way.However,we have seen that diffusive problems are usually best treated implicitly.Suppose we try to implement the Crank-Nicolson scheme in Recipes Numerical 105211 two dimensions.This would give us 43106 =+(吗+叫+叫+叫) (19.3.13) E喜 Here DAt 42 △≡△x=△y (19.3.14) 2.三u吲+1,1-2u.+u-1,1 (19.3.15) and similarly forThis is certainly a viable scheme;the problem arises in solving the coupled linear equations.Whereas in one space dimension the system was tridiagonal,that is no longer true,though the matrix is still very sparse.One possibility is to use a suitable sparse matrix technique(see $2.7 and $19.0). Another possibility,which we generally prefer,is a slightly different way of generalizing the Crank-Nicolson algorithm.It is still second-order accurate in time and space,and unconditionally stable,but the equations are easier to solve than19.3 Initial Value Problems in Multidimensions 855 Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machine￾readable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). The expression for |ξ| 2 can be manipulated into the form |ξ| 2 = 1 − (sin2 kx∆ + sin2 ky∆)  1 2 − (α2 x + α2 y)  − 1 4 (cos kx∆ − cos ky∆)2 − (αy sin kx∆ − αx sin ky∆)2 (19.3.8) The last two terms are negative, and so the stability requirement |ξ| 2 ≤ 1 becomes 1 2 − (α2 x + α2 y) ≥ 0 (19.3.9) or ∆t ≤ ∆ √ 2(v2 x + v2 y)1/2 (19.3.10) This is an example of the general result for the N-dimensional Courant condition: If |v| is the maximum propagation velocity in the problem, then ∆t ≤ ∆ √ N|v| (19.3.11) is the Courant condition. Diffusion Equation in Multidimensions Let us consider the two-dimensional diffusion equation, ∂u ∂t = D ∂2u ∂x2 + ∂2u ∂y2  (19.3.12) An explicit method, such as FTCS, can be generalized from the one-dimensional case in the obvious way. However, we have seen that diffusive problems are usually best treated implicitly. Suppose we try to implement the Crank-Nicolson scheme in two dimensions. This would give us un+1 j,l = un j,l + 1 2 α  δ2 xun+1 j,l + δ2 xun j,l + δ2 yun+1 j,l + δ2 yun j,l (19.3.13) Here α ≡ D∆t ∆2 ∆ ≡ ∆x = ∆y (19.3.14) δ2 xun j,l ≡ un j+1,l − 2un j,l + un j−1,l (19.3.15) and similarly for δ2 yun j,l. This is certainly a viable scheme; the problem arises in solving the coupled linear equations. Whereas in one space dimension the system was tridiagonal, that is no longer true, though the matrix is still very sparse. One possibility is to use a suitable sparse matrix technique (see §2.7 and §19.0). Another possibility, which we generally prefer, is a slightly different way of generalizing the Crank-Nicolson algorithm. It is still second-order accurate in time and space, and unconditionally stable, but the equations are easier to solve than
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有