iiijjijiilxlbx11nnnnnnaaaaaaaaaA212222111211bAxni,,3,22.3分段插值法§华长生制作2例.]5,5[,11)(2xxxf设函数ninhihxnni,,1,0,10,51]5,5[个节点等份取将插值多项式次的作试就Lagrangenxfn)(10,8,6,4,2并作图比较.解:211)(iiixxfy插值多项式次作LagrangennjnjiiijijnxxxxxxL002)()(11)(10,8,6,4,2n2.3.1高次插值的评述华长生制作3-5-4-3-2-1012345-1.5-1-0.500.511.52-5-4-3-2-1012345-1.5-1-0.500.511.52-5-4-3-2-1012345-1.5-1-0.500.511.52-5-4-3-2-1012345-1.5-1-0.500.511.52-5-4-3-2-1012345-1.5-1-0.500.511.52-5-4-3-2-1012345-1.5-1-0.500.511.52n=2n=4n=6n=8n=10f(x)=1/(1+x2)-5-4-3-2-1012345-1.5-1-0.500.511.52n=2n=4n=6n=8n=10f(x)=1/(1+x2)不同次数的Lagrange插值多项式的比较图Runge现象华长生制作4结果表明,并不是插值多项式的次数越高,插值效果越好,精度也不一定是随次数的提高而升高,这种现象在上个世纪初由Runge发现,故称为Runge现象.华长生制作5从上节可知,如果插值多项式的次数过高,可能产生Runge现象,因此,在构造插值多项式时常采用分段插值的方法。一、分段线性Lagrange插值,ix设插值节点为niyi,,1,0,函数值为],[,,11kkkkxxxx形成一个插值区间任取两个相邻的节点构造Lagrange线性插值1,,2,1,0,1nixxhiiiiihhmax1.分段线性插值的构造2.3.2分段插值法§华长生制作6)()()(11)(1xlyxlyxLkkkkk11kkkkxxxxykkkkxxxxy111,,1,0nk)(1xLnnnxxxxLxxxxLxxxxL1)1(121)1(110)0(1)()()(显然)(1ixLniyi,,1,0,--------(1)--------(2)我们称由(1)(2)式构成的插值多项式为分段线性Lagrange插值多项式)(1xL华长生制作7-4-3-2-101234-1-0.8-0.6-0.4-0.200.20.40.60.81-4-3-2-101234-1-0.8-0.6-0.4-0.200.20.40.60.81-4-3-2-101234-1-0.8-0.6-0.4-0.200.20.40.60.81-4-3-2-101234-1-0.8-0.6-0.4-0.200.20.40.60.81-4-3-2-101234-1-0.8-0.6-0.4-0.200.20.40.60.81的图象分段线性插值)(1xLy的一条折线实际上是连接点niyxkk,,1,0,),(也称折线插值,如右图曲线的光滑性较差在节点处有尖点但如果增加节点的数量减小步长,会改善插值效果)(lim10xLh)(xf上连续在若],[)(baxf因此则华长生制作8)()!1()(1)1(xnfnn由第二节定理1可知,n次Lagrange插值多项式的余项为)()()(xPxfxRnn的余项为那么分段线性插值)(1xL)()()(11xLxfxR)()()(1xLxfk))((2)(1kkxxxxf有关与且xxxxkk],,[,1|)(|1xR|))((|max|)(|max211kkkbxabxaxxxxxf224121hM2281hM2.分段线性插值的误差估计华长生制作9二、分段二次Lagrange插值分段线性插值的光滑性较差,且精度不高因此,当节点较多时,可根据情况构造分段二次插值,ix设插值节点为niyi,,1,0,函数值为1111n,,,[,]kkkkkxxxxx若为偶数,取相邻节点以为插值区间构造Lagrange二次插值)()()()(1111)(2xlyxlyxlyxLkkkkkkk1,,2,1nk1,,2,1,0,1nixxhiiiiihhmax1.分段二次插值的构造华长生制作10))(())((11111kkkkkkkxxxxxxxxy1,,2,1nk)()(2xLk))(())((1111kkkkkkkxxxxxxxxy))(())((11111kkkkkkkxxxxxxxxy上式称为分段二次Lagrange插值华长生制作11)()!1()(1)1(xnfnn)()()(xPxfxRnn的余项为那么分段二次插值)(2xL)()()(22xLxfxR)()()(2xLxfk))()((6)(11kkkxxxxxxf有关与且xxxxkk],,[,11|)(|2xR|))()((|max|)(|max611111kkkkxxxbxaxxxxxxxfkk3393261hM33273hM2.分段二次插值的误差估计由于华长生制作12()0.36,0.42,0.75,0.98,1.1(fxx求在处的近似值用分段线性)18885.187335.069675.057815.041075.030163.005.180.065.055.040.030.0543210iiyxi在各节点处的数据为设)(xf例:)()(1xLk11kkkkxxxxykkkkxxxxy11解:分段线性Lagrange插值的公式为1,,1,0nk华长生制作13)36.0()0(1L4.03.04.036.030163.03.04.03.036.041075.036711.0)42.0()1(1L55.04.055.042.041075.04.055.04.042.057815.043307.0)75.0()3(1L81448.0)98.0()4(1L10051.1)1.1()4(1L05.18.005.11.187335.08.005.18.01.118885.125195.1)36.0(f)42.0(f)75.0(f)98.0(f)1.1(f同理华长生制作14分段低次Lagrange插值的特点计算较容易可以解决Runge现象但插值多项式分段插值曲线在节点处会出现尖点插值多项式在节点处不可导华长生制作15三、Newton插值公式的使用由于高次插值多项式的Runge现象,Newton插值公式一般也采用分段低次插值)(1xN)](,[1kkkkxxxxff1,,1,0nk分段线性Newton插值(1))(2xN))(](,,[)](,[1211kkkkkkkkkxxxxxxxfxxxxff(2)2,,1,0nk)(1xR)(!2)(2xf)(],,[221xxxxfkkk1kkxxx1kkxxxNewton分段二次插值华长生制作16)(3xN23212)(],,,[)(kkjjkkkkxxxxxxfxN(3)Newton分段三次插值1kkxxx3,,1,0nk)(3xR)(],,,[441xxxxfkkk)(2xR)(],,,[3321xxxxxfkkkk)(!3)(3xf余项为余项为)(!4)(4)4(xf华长生制作17(5))(1thxRk2)(f)1(2tthtfkkf)(1thxNk插值余项为10t22kf)1(tt分段线性Newton向前(差分)插值1,,1,0nk)(0thxRn!3)()3(f)2)(1(3ttth)(2thxNk(6)tfkkf)1(22ttfk10t2,,1,0nk!33kf)2)(1(ttt分段二次Newton向前(差分)插值华长生制作18次插值多项式则使用在误差范围内很接近差分商阶差如果mm),()(1)(0thxRn!3)()3(f)2)(1(3ttth)(2thxNktfkkf)1(22ttfk!33kf)2)(1(ttt(7)01t1,nnk分段二次Newton向后(差分)插值在实际应用中,究竟使用几次插值多项式呢?华长生制作19Newton插值法的优点是计算较简单,尤其是增加节点时,计算只要增加一项,这点是Lagrange插值无法比的.但是Newton插值仍然没有改变Lagrange插值的插值曲线在节点处有尖点,不光滑,插值多项式在节点处不可导等缺点华长生制作20四、分段两点三次Hermite插值niyxbaxfii,,1,0,],[)(上的函数值为上的节点在设函数niyxii,,1,0,上的导数值为在节点1,,1,0,,1nkxxkk对任意两个相邻的节点可构造两点三次Hermite插值多项式)()()()()()(11)(0)(11)(0)(3xyxyxyxyxHkkkkkkkkk],[1kkxxx1,,1,0nk插值基函数为Hermitexxxxkkkk)(),(),(),()(1)(0)(1)(0华长生制作21)()(0xk)()(1xk)()(0xk)()(1xk1121kkkxxxx21kkkxxxxkxx211kkkxxxx21kkkxxxx1kxxkkkxxxx121211kkkxxxx其中我们称1,,1,0,)()()(33nkxHxHk为分段三次Hermite插值多项式,其余项为])()(!4)([max)(max)(212)4(10)(3103kknkknkxxxxfxRxR212104)()(max!4kknkxxxxM华长生制作22例2.数值为在节点处的函数值及导设函数211)(xxf比较几种插值.我们分别用分段二次、三次Lagrange插值和分段两点三次Hermite插值作比较解:212104)()(max!4kknkxxxxM)(3xR即华长生制作23f(x)0.800000.307690.137930.075470.04160H3(x)0.812500.307500.137500.075370.04159x0.51.52.53.54.8R3(x)=f(x)-H3(x)-0.012500000000000.000192307692310.000431034482760.000099725794870.00001047427455L2(x)0.875000.325000.125000.072060.04087L3(x)0.800000.325000.133820.074430.04269