第二部分插值法Chapter2Interpolation.ppt
《第二部分插值法Chapter2Interpolation.ppt》由会员分享,可在线阅读,更多相关《第二部分插值法Chapter2Interpolation.ppt(32页珍藏版)》请在三一文库上搜索。
1、第二章 插值法 /* Chapter 2 Interpolation */,当精确函数 y = f(x) 非常复杂或未知时,在一系列节点 x0 xn 处测得函数值 y0 = f(x0), yn = f(xn),由此构造一个简单易算的近似函数 g(x) f(x),满足条件g(xi) = f(xi) (i = 0, n)。这里的 g(x) 称为f(x) 的插值函数。最常用的插值函数是 ?,多项式,x,g(x) f(x),2.1 多项式插值 /* Polynomial Interpolation */,2.2 拉格朗日多项式 /* Lagrange Polynomial */,n = 1,可见 P1
2、(x) 是过 ( x0 , y0 ) 和 ( x1, y1 ) 两点的直线。,称为拉氏基函数 /* Lagrange Basis */, 满足条件 li(xj)=ij /* Kronecker Delta */,线性插值,n = 2,抛物线插值,多项式:,2.2 Lagrange Polynomial,2.2 Lagrange Polynomial,n 1,Lagrange Polynomial,与 有关,而与 无关,节点,f,证明:,反证:若不唯一,则除了Ln(x) 外还有另一 n 阶多项式 Pn(x) 满足 Pn(xi) = yi 。,考察 则 Qn 的阶数, n,而 Qn 有 个不同的根
3、,注:若不将多项式次数限制为 n ,则插值多项式不唯一。,例如 也是一个插值多项式,其中 可以是任意多项式。,2.2 Lagrange Polynomial, 插值余项 /* Remainder */,Rolles Theorem: 若 充分光滑, ,则 存在 使得 。,推广:若,使得,2.2 Lagrange Polynomial,Rn(x) 至少有 个根,n+1,(x)有 n+2 个不同的根 x0 xn x,注意这里是对 t 求导,2.2 Lagrange Polynomial,注: 通常不能确定 x , 而是估计 , x(a,b) 将 作为误差估计上限。,当 f(x) 为任一个次数 n
4、的多项式时, , 可知 ,即插值多项式对于次数 n 的多项式是精确的。,2.2 Lagrange Polynomial,注: 小的区间上插值有利于减少误差; 依靠增多插值节点不一定能减少误差; 多项式插值,外推误差可能要比内插误差大。,解:,n = 1,分别利用x0, x1 以及 x1, x2 计算,利用,这里,而,sin 50 = 0.7660444,外推 /* extrapolation */ 的实际误差 0.01001,利用,内插 /* interpolation */ 的实际误差 0.00596,内插通常优于外推。选择要计算的 x 所在的区间的端点,插值效果较好。,2.2 Lagran
5、ge Polynomial,n = 2,sin 50 = 0.7660444,2次插值的实际误差 0.00061,高次插值通常优于低次插值,但绝对不是次数越高就越好,2.2 Lagrange Polynomial,When you start writing the program, you will find how easy it is to calculate the Lagrange polynomial.,Oh yeah? What if I find the current interpolation not accurate enough?,Then you might want
6、 to take more interpolating points into account.,Right. Then all the Lagrange basis, li(x), will have to be re-calculated.,Excellent point ! We will come to discuss this problem next time.,2.3 牛顿插值 /* Newtons Interpolation */,Lagrange 插值虽然易算,但若要增加一个节点时,全部基函数 li(x) 都需重新算过。, 差商(亦称均差) /* divided differ
7、ence */,1阶差商 /* the 1st divided difference of f w.r.t. xi and xj */,2阶差商,2.3 Newtons Interpolation,(k+1)阶差商:,Warning: my head is exploding What is the point of this formula?,差商的值与 xi 的顺序无关!, 牛顿插值 /* Newtons Interpolation */, ,Nn(x)-牛顿插值多项式,Rn(x),ai =,f x0, , xi ,2.3 Newtons Interpolation,注: 由唯一性可知 N
8、n(x) Ln(x), 只是算法不同,故其余项也相同,即, 实际计算过程为,f (x0) f (x1) f (x2) f (xn1) f (xn),f x0, x1 f x1, x2 f xn1, xn,f x0, x1 , x2 f xn2, xn1, xn,f x0, , xn,f (xn+1) f xn, xn+1 f xn1, xn, xn+1 f x1, , xn+1 f x0, , xn+1,2.3 Newtons Interpolation,2.3 Newtons Interpolation,例4 (P32): 给出f (x)的函数表,求4次牛顿插值多项式,并由此计算f (0.5
9、96)的近似值。,N4(x)=0.41075+1.116(x-0.4)+0.28(x-0.4)(x-0.55)+0.19733(x-0.4)(x-0.55)(x-0.65) +0.03134 (x-0.4)(x-0.55)(x-0.65)(x-0.8),f(0.596)N4(0.596)=0.63192,R4(x)=fx,x0, xn (x-0.4)(x-0.55)(x-0.65)(x-0.8)(x-0.9),R4(0.596)=?, 差分形式等距节点公式 /* Formulae with Equal Spacing */,向前差分,向后差分,中心差分,其中,当节点等距分布时:,2.3 New
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 第二 部分 插值法 Chapter2Interpolation
链接地址:https://www.31doc.com/p-2560535.html