有限差分方法基础.ppt_第1页
有限差分方法基础.ppt_第2页
有限差分方法基础.ppt_第3页
有限差分方法基础.ppt_第4页
有限差分方法基础.ppt_第5页
已阅读5页,还剩82页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1,材料计算机数值模拟讲义 The Finite Difference Calculus,2,1、 Introduction to Numerical Methods 2 、the Taylor Series 3 、Difference Calculus,3,The Purpose and Power of Numerical Methods as well as their Limitations,Numerical Methods are a class of methods for Solving a wide variety of Mathematical Problems: the Electronic Computers have been in widespread use since the middle 1950s; Numerical Methods actually predate electronic computers by many years; Numerical Methods came of age with the introduction of the Electronic Computer.,4,The Combination of Numerical Methods and digital computers has created a tool of immense power in Mathematical Analyses: the Numerical Methods are capable of handling the nonlinearities, complex geometries, and large systems of coupled equations which are necessary for the accurate simulation of many real physical situations; Numerical Methods have displaced classical mathematical analysis in many industrial and research applications; Numerical Methods are so easy and iexpensive to employ and are often available as prepackaged Programs.,5,There are many problems which are still impossible (in some cases we should say “impractical”) to solve using Numerical Methods : for some of these problems no accurate and complete mathemetical model has yet been found; Other problems are simply so enourmous that their solution is beyond practical limits in terms of current computer technology; Of course, the entire question of practicality is strongly dependent upon how much one is willing to spend .,6,To study Numerical Methods : No complex physical situation can be exactly simulated by a mathematical model; No numerical method is completely trouble-free in all situation; No numerical method is completely error-free; No numerical method is optimal for all situation.,7,Computer languages to Numerical Methods : “high level” computer language such as FORTRAN, ALGOL, or BASIC; Compiler to convert “high level” language to machine code; By far the most widely used algebraic language for scientific purpose is FORTRAN. Now, some language such as MATLAB,8,The Verification Problem to Numerical Analysis: One of the most vita and yet difficult tasks which must be carried out in obtaining a numerical solution to any problem is to verify that the computer program and the final solution are correct; The verification procedure can actually be more expensive and time consuming than obtaining the final desire answer; The process of verification for a general program or library subprogram, which would be employed by many users to solve a wide variety of problems, would be similar but necessarily even more extensive and painstaking,9,The need to get involved : Numerical Methods cannot be read about, they must be used in order to be understood; Personal experience that the best test of whether one understands a method is not to carry out a hand calculation but to write a computer program; It is remarkable how hazy concepts can become clear under the resulting pressure to be completely precise and unambiguous.,10,The Taylor Series,The Taylor Series is the foundation of Mathematical Problems: If the value of a function can be expressed in a region of closed to by the infinite power series,11,The Taylor Series,The Taylor Series is the foundation of Mathematical Problems: for,12,The Taylor Series,The error in the Taylor Series for when the series is truncated after the term containing is not greater than accurate to,13,The Finite Difference Calculus,Forward and Backward Differences: Consider a function which is analytic in the neighborhood of a point We find by expanding in a Taylor Series about,14,We shall employ the subscript notation:,Using this notation, then,We define the first forward difference of at ,15,The expression for may now be written as,The term is called a first forward difference approximation of error order to,16,We now use the Taylor Series expression of about to determine,17,Using this notation, then,We define the first backward difference of at ,18,The expression for may now be written as,The term is called a first backward difference approximation of error order to,19,We will proceed to find approximations to higher order derivative: Use the Taylor Series expression for,20,Using the notation, then,We define the second forward difference of at ,21,The expression for may now be written as,The term is called a second forward difference approximation of error order to,22,We will proceed to find approximations to higher order derivative: Use the Taylor Series expression for,23,Using the notation, then,We define the second forward difference of at ,24,The expression for may now be written as,The term is called a second backward difference approximation of error order to,25,The procedures for higher forward and backward differences and for approximating higher order derivatives. Any forward and backward difference may be obtained starting from the first forward and backward differences by using the following recurrence formulas:,26,Forward and backward differences for expressions for higher order derivatives of any order are given by,Note that each one of these expressions for the derivatives is of .,27,Forward and backward differences for expressions for higher order derivatives,It may be convenient memory aid to note that the coefficients of the forward difference expressions for nth derivative starting from i and proceeding forward are given by the coefficients of in order.,28,the coefficients for the forward difference expressions for nth derivative starting from i and proceeding backward are given by the coefficients of in order.,29,The difference expressions for derivatives which we have thus far obtained are of . More accurate expressions may be found by simply taking more terms in the Taylor series expression. Consider the series for,Higher order Accurate forward & backward difference expressions,As before, solving for yields,30,As before, solving for , we have a forward difference expression complete with its error term,Substituting expression into expression , we obtain,31,Collecting terms,or in subscript notation,Note that the expression is exact for a parabola since the error involves only third and higher derivatives.,32,Forward and backward difference expressions of for higher derivatives can be obtained by simply replacing the first error term in the difference expressions by an approximation.,33,34,35,36,Subtracting the backward expansion from the forward expansion, we note that the terms involving even powers of h, such as , cancel, yielding,Central differences,Consider again the analytic function, the forward and backward Taylor series expansions about x are respectively,37,Solving for ,Employing subscript notation,This difference representation, called a central difference representation, is accurate to,38,An expression of for is readily obtainable by adding the two equations,Solving for to yield,39,The central difference expressions of for derivatives up to the fourth order are tabulated as follows,40,An convenient memory aid for this central difference expressions of in terms of ordinary forward and backward differences is given by,41,The central difference expressions of for derivatives up to the fourth order are tabulated as follows,42,Errors calculation,43,第一节 差分原理及逼近误差/非均匀步长,图2-1 非均匀步长差分,H is not a const.,一阶向后差商,一阶中心差商,44,第一节 差分原理及逼近误差/非均匀步长(2/3),图1-2 均匀和非均匀网格实例1,45,第一节 差分原理及逼近误差/非均匀步长(3/3),图1-3 均匀和非均匀网格实例2,46,第二节 差分方程、截断误差和相容性/差分方程(1/3),差分相应于微分,差商相应于导数。差分和差商是用有限形式表示的,而微分和导数则是以极限形式表示的。如果将微分方程中的导数用相应的差商近似代替,就可得到有限形式的差分方程。现以对流方程为例,列出对应的差分方程。,(2-1),47,图2-1 差分网格,第二节 差分方程、截断误差和相容性/差分方程(2/3),48,若时间导数用一阶向前差商近似代替,即,空间导数用一阶中心差商近似代替,即,则在,点的对流方程就可近似地写作,(2-2),(2-3),(2-4),第二节 差分方程、截断误差和相容性/差分方程(3/3),49,第二节 差分方程、截断误差和相容性/截断误差(1/6),按照前面关于逼近误差的分析知道,用时间向前差商代替时间导数时的误差为 ,用空间中心差商代替空间导数时的误差为,,因而对流方程与对应的差分方程之间也存在一个误差,它是,这也可由Taylor展开得到。因为,(2-5),(2-6),50,第二节 差分方程、截断误差和相容性/截断误差(2/6),一个与时间相关的物理问题,应用微分方程表示时,还必须给定初始条件,从而形成一个完整的初值问题。对流方程的初值问题为,这里,为某已知函数。同样,差分方程也必须有初始条件:,初始条件是一种定解条件。如果是初边值问题,定解条件中还应有适当的边界条件。差分方程和其定解条件一起, 称为相应微分方程定解问题的差分格式。,(2-7),(2-8),51,第二节 差分方程、截断误差和相容性/截断误差(3/6),FTCS格式,(2-9),FTFS格式,(2-10),(2-11),FTBS格式,52,第二节 差分方程、截断误差和相容性/截断误差(5/6),(a) FTCS (b)FTFS (c)FTBS 图2-2 差分格式,53,第二节 差分方程、截断误差和相容性/截断误差(6/6),FTCS格式的截断误差为,FTFS和FTBS格式的截断误差为,(2-12),(2-13),3种格式对,都有一阶精度。,54,第二节 差分方程、截断误差和相容性/相容性(1/3),一般说来,若微分方程为,其中D是微分算子,f是已知函数,而对应的差分方程为,其中,是差分算子,则截断误差为,这里,为定义域上某一足够光滑的函数,当然也可以取微分方程的解 。,(2-14),(2-15),(2-16),如果当,、,时,差分方程的截断误差的某种范数,也趋近于零,即,则表明从截断误差的角度来看,此差分方程是能用来逼近微分方程的,通常称这样的差分方程和相应的微分方程相容(一致)。 如果当,、,时,截断误差的范数不趋于零,则称为不相容(不一致),这样的差分方程不能用来逼近微分方程。,(2-17),55,第二节 差分方程、截断误差和相容性/相容性(2/3),若微分问题的定解条件为,其中B是微分算子,g是已知函数,而对应的差分问题的定解条件为,其中,是差分算子,则截断误差为,(2-18),(2-19),(2-20),56,第二节 差分方程、截断误差和相容性/相容性(3/3),只有方程相容,定解条件也相容,即,和,整个问题才相容。,(2-21),无条件相容 条件相容,以上3种格式都属于一阶精度、二层、相容、显式格式。,57,第三节 收敛性与稳定性/收敛性(1/6),,也是微分问题定解区域上的一固定点,设差分格式在此点,的解为 , 相应的微分问题的解为,,二者之差为,称为离散化误差。如果当,时,离散化误差的某种范数,趋近于零,即,则说明此差分格式是收敛的,即此差分格式的解收敛于相应微分问题的解, 否则不收敛。与相容性类似,收敛又分为有条件收敛和无条件收敛。,(3-1),、,(3-2),58,第三节 收敛性与稳定性/收敛性(3/6),相容性不一定能保证收敛性,那么对于一定的差分格式,其解能否收敛到相应微分问题的解?答案是差分格式的解 收敛于微分问题的解是可能的。至于某给定格式是否收敛,则要按具体问题予以证明。下面以一个差分格式为例, 讨论其收敛性: 微分问题,的FTBS格式为,在某结点(xi , tn)微分问题的解为,,差分格式的解为,,则离散化误差为,(3-6),(3-5),(3-4),59,第三节 收敛性与稳定性/收敛性(4/6),按照截断误差的分析知道,以FTBS格式中的第一个方程减去上式得,或写成,,则,式中,表示在第n层所有结点上,的最大值。,(3-7),(3-8),(3-9),(3-10),60,第三节 收敛性与稳定性/收敛性(5/6),由上式知,对一切i有,故有,于是,综合得,(3-11),(3-13),(3-12),(3-14),61,第三节 收敛性与稳定性/收敛性(6/6),由于初始条件给定函数,的初值,初始离散化误差,。并且,是一有限量,因而,可见本问题FTBS格式的离散化误差与截断误差具有相同的量级。最后得到,这样就证明了,当,时,本问题的RTBS格式收敛。这种离散化误差的最大绝对值趋于零的 收敛情况称为一致收敛。,(3-15),(3-16),此例介绍了一种证明差分格式收敛的方法,同时表明了相容性与收敛性的关系:相容性是收敛性的必要条件, 但不一定是充分条件,还可能要求其他条件,如本例就是要求,62,第三节 收敛性与稳定性/稳定性(1/8),首先介绍一下差分格式的依赖区间、决定区域和影响区域。还是以初值问题,(3-17),(a) FTCS (b) FTFS (c) FTB

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论