正在加载图片...
860 Chapter 19.Partial Differential Equations If f(y =IA)=fi,then we get An from the inverse formula 1 L-1 πnl An= sinh (nJ/L) (19.4.14) l=1 The complete solution to the problem is u ujl uf (19.4.15) By adding appropriate terms of the form(19.4.12),we can handle inhomogeneous 81 terms on any boundary surface. A much simpler procedure for handling inhomogeneous terms is to note that whenever boundary terms appear on the left-hand side of(19.0.6),they can be taken over to the right-hand side since they are known.The effective source term is ICAL therefore pit plus a contribution from the boundary terms.To implement this idea formally,write the solution as u=u'+uB (19.4.16) 9 where u'=0 on the boundary,while uB vanishes everywhere except on the boundary.There it takes on the given boundary value.In the above example,the only nonzero values of u would be u明=f无 (19.4.17) The model equation (19.0.3)becomes V2=-72uB+p (19.4.18) or,in finite-difference form, 4+1,1+-1l++1+叫-1-4.1= -(明1l+u月l+u+1+u唱-1-4u)+△2p (19.4.19) 容室 Nume 10621 All the uB terms in equation(19.4.19)vanish except when the equation is evaluated at j=J-1,where +-21+-141+4-1,1-1-4d-11=-f+△2p1-1l((19.4.20) Thus the problem is now equivalent to the case of zero boundary conditions,except that one row of the source term is modified by the replacement △2pJ-1,l→△2pJ-1,l-fh (19.4.21) The case of Neumann boundary conditions Vu =0 is handled by the cosine expansion (12.3.17): L erjm。πln (19.4.22) m=0n=0860 Chapter 19. Partial Differential Equations 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). If f(y = l∆) ≡ fl, then we get An from the inverse formula An = 1 sinh (πnJ/L) L −1 l=1 fl sin πnl L (19.4.14) The complete solution to the problem is u = ujl + uH jl (19.4.15) By adding appropriate terms of the form (19.4.12), we can handle inhomogeneous terms on any boundary surface. A much simpler procedure for handling inhomogeneous terms is to note that whenever boundary terms appear on the left-hand side of (19.0.6), they can be taken over to the right-hand side since they are known. The effective source term is therefore ρjl plus a contribution from the boundary terms. To implement this idea formally, write the solution as u = u + uB (19.4.16) where u = 0 on the boundary, while uB vanishes everywhere except on the boundary. There it takes on the given boundary value. In the above example, the only nonzero values of uB would be uB J,l = fl (19.4.17) The model equation (19.0.3) becomes ∇2u = −∇2uB + ρ (19.4.18) or, in finite-difference form, u j+1,l + u j−1,l + u j,l+1 + u j,l−1 − 4u j,l = − (uB j+1,l + uB j−1,l + uB j,l+1 + uB j,l−1 − 4uB j,l)+∆2ρj,l (19.4.19) All the uB terms in equation (19.4.19) vanish except when the equation is evaluated at j = J − 1, where u J,l + u J−2,l + u J−1,l+1 + u J−1,l−1 − 4u J−1,l = −fl + ∆2ρJ−1,l (19.4.20) Thus the problem is now equivalent to the case of zero boundary conditions, except that one row of the source term is modified by the replacement ∆2ρJ−1,l → ∆2ρJ−1,l − fl (19.4.21) The case of Neumann boundary conditions ∇u = 0 is handled by the cosine expansion (12.3.17): ujl = 2 J 2 L  J m=0  L n=0 umn cos πjm J cos πln L (19.4.22)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有