1、插 值 法第第 二二 章章主讲教师:杨爱民http:/210.31.198.78/eol/jpk/course/welcome.jsp?courseId=1220问题的引入思考 1 问题的由来 问题的实质思考2提法的抽象 新概念的诞生 新概念的初识学习计算方法的建议学习计算方法的建议思考 3思考4准确理解概念特性(独有的性质)新算法研究 算法的警示思考 5思考6 算法的应用 算法的进一步研究思考 7思考8算法原理警示:A!B!C!能解决的专业问题联想与展望 学习建议学习建议 插值法的一般理论 Newton插值 Lagrange插值 分段低次插值 Hermite插值、样条插值13425插插值值法
2、法Lagrange插值插值NewtonNewton插值插值插插值值Hermite样条插值样条插值误差估计误差估计分段插值分段插值两点式两点式点斜式点斜式 等距节点等距节点 算算法法比比较较推广方法推广方法均差均差差分差分知知 识识 结结 构构 图图一般理论插值多项式 NewtonNewton 前插后插公式差商及其性质差商及其性质Newdon插值多项式的构造插值多项式的构造Newdon插值多项式余项插值多项式余项差分及其应用差分及其应用Newdon插值插值法的基本思路法的基本思路01101110,.,.,.,xxxxxfxxxfxxxfkkkkk 121020210,xxxxfxxfxxxf .
3、,0的一阶差商(亦称均差)的一阶差商(亦称均差).关于点关于点kxx)()()(,000为函数为函数称称kkkxfxxxfxfxxf-=可可以以不不相相邻邻)(1,kkxx牛顿插值法 差商及其性质 差商定义二阶差商:K阶差商:121020210,xxxxfxxfxxxf 1201010202xxxxffxxff .,.,1,0),(nixfxfii 的零阶差商。的零阶差商。关于关于称为称为iixxfxf)(特别地01101110,.,.,.,xxxxxfxxxfxxxfkkkkk 差商记号牛顿插值法 差商及其性质,)(100101xxfxxxfxfxfxfkk 差商具有线性差商具有线性)()(
4、)(2211xgkxgkxf 若若,.,.,.,1022101110kkkxxxgkxxxgkxxxf 则则牛顿插值法 差商及其性质差商可表示为函数值的线性组合差商可表示为函数值的线性组合 kijjxxxxxxxxxfkkjjxjjjjjxxf0)()()()(0110,01()()kjijjf xx 时,时,如:如:2 k121020,xxxxfxxf 1201010202xxxxxfxfxxxfxf )()()(120222101120100 xxxxxfxxxxxfxxxxxf )()()(231100 xfxfxf ,210 xxxf牛顿插值法 差商及其性质)()()(21012xxx
5、xxxx 2 1120201()()()()()()()xxxxxxxxxxxxx 001022 1011()()()xxxxx 110122 1111()()()xxxxx 220212 1211()()()xxxxx ,.)2,1,0()(11 kxkkk 观察与思考牛顿插值法 差商及其性质,012010 xxxfxxxxfxxfkkk 即即差商与所含节点的顺序无关差商与所含节点的顺序无关建议记忆0110110,.,.,.,xxxxxfxxfxxxfkkkk ,C)(,0baxfbaxxnn)(设节点设节点 !)(,)(10nfxxxfnn ),.,max,.,(min1010nnxxxx
6、xx )()!1()()(,.,)(1)1(110 xnxxxxxfxRnnnnnf !)(,.,)(10nxxxffnn 牛顿插值法 差商及其性质则则N阶差商和N阶导数密切相关!证明见后001(),()niniiif xf xxx ,00niinxxfxxf)!()(,0nfxxfnnnknkaxxfxPxfnkn,0,),()(0推论:若牛顿插值法 差商性质总结牛顿插值法Newdon插值法的基本思路建立Newdon插值公式的理由 具有规律性 又有承袭性 不具有承袭性每当增加一个节点时,不仅要增加求和的项数,而且以前的各项也必须重新计算.具有严格的规律性便于记忆优点 缺点).(.)()()(
7、:10102010 nnnxxxxaxxxxaxxaaxP构构造造多多项项式式是待定系数是待定系数其中其中.,210naaaa使其满足:使其满足:牛顿插值法Newdon插值法的基本思路),.2,1,0()(nkyxPkkn 通过节点通过节点?ka 思考题需要引入新的概念需要引入新的概念)()()()()(10102010 nnnxxxxaxxxxaxxaaxP),1,0()()(:nixfxPiiin 由由插插值值条条件件.,1001011xxfxxffa ,21012201010202xxxfxxaxxffxxff 牛顿插值法Newdon插值多项式的构造)()()(0110011011xxa
8、fxxaafxPn )(00000 xffaxPxxn 时,时,当当时,时,当当2xx )()()(12022021022xxxxaxxaafxPn 00 xfa 时,时,当当1xx 00 xfa ,101xxfa ,2102xxxfa ),1,0(nk 111021010,.,.,.,kkkkkkkxxxxxfxxxxfxxxfa)()()()()(10102010 nnnxxxxaxxxxaxxaaxN依次递推可得依次递推可得Newdon插值多项式的构造归纳归纳 构造多项式:Newdon插值多项式00100120101010110(),(),()(),.,()()(),.,()nnknnk
9、kNxf xf xxxxf xxxxxxxf xxxxxxxxxf x xxx 展开展开即为即为由插值多项式存在唯一性可知:)()(xLxNnn 拉拉格格朗朗日日牛牛顿顿)()(xRxRnn 拉拉格格朗朗日日牛牛顿顿)()!1()()(,.,)()(1)1(11011xnxxxxxfxaxRnnnnnnnf Newdon插值多项式的余项从而:),(,)()(,)(nnnnnnxxxxxfxxxxxxxxxfxR010100 牛顿插值余项由此可得差商的另一性质)!1()(,.,)1(10 nxxxxffnn!)(,.,)(10nxxxffnn 说明每增加一个结点,Newton 插值多项式只增加一
10、项,具有承袭性!00100120101011010(),(),()(),.,()()(),.,()nnnnkkkNxf xf xxxxf xxxxxxxf xxxxxxxxxf x xxx 观察与思考插 值 法N_L 插值多项式的比较说明每增加一个结点,Newton插值多项式只增加一项,具有承袭性!),.,(,.,)()(,.,)(,)(,)(11011011010102100100 nnknnnnxxxxxxfxxxxxxxxxfxxxxxxxfxxxxfxfxN 牛顿插值法一阶均差二阶均差三阶均差四阶均差kx)(kxf0 x1x2x3x4x5x0fx)(1xf)(2xf)(3xf)(4xf
11、)(5xf,10 xxf,21xxf,32xxf,43xxf,54xxf,210 xxxf,321xxxf,432xxxf,543xxxf,3210 xxxxf,4321xxxxf,5432xxxxf,43210 xxxxxf,54321xxxxxfNewdon插值的计算121011011,.,.,.,kkkkkkkkf xxxxf x xxaf x xxxx 例例2.4(1)完成差商表;(2)求出插值多项式;(3)求出插值;(4)估计误差;典型例题分析()fx(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,次牛顿插值多项式,并由此计算并由此计算 的近似值的近似值.0.
12、400.410750.550.578150.650.696750.800.888110.901.026521.051.25382ixif(5)给出直观解释。(1)完成差商表;(2)求出插值多项式;(3)求出插值;(4)估计误差;Newdon插值的例题一阶均差二阶均差三阶均差四阶均差五阶均差0.400.410750.550.578151.116000.650.696751.186000.280000.800.888111.275730.358930.1973330.901.026521.384100.433480.2129520.03123811.051.253821.515330.524930
13、.2286670.03142860.000380952ixif(5)给出直观解释。()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.例例 2.4)0.9-(x)0.8-(x)0.65-(x)0.55-(x)0.4-(x 20.00038095 )0.8-(x)0.65-(x)0.55-(x)0.4-x0.0312381()0.65-(x)0.55-(x)0.4-0.197333(x)0.55-(x)0.4-(x 0.28 )0.4-(x 1.116 0.41075N5 )x(Newdon插值的例题()f
14、x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.完成差商表一阶均差二阶均差三阶均差四阶均差五阶均差0.400.410750.550.578151.116000.650.696751.186000.280000.800.888111.275730.358930.1973330.901.026521.384100.433480.2129520.03123811.051.253821.515330.524930.2286670.03142860.000380952ixif例例 2.4Newdon插值的例题()f x(
15、0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.一阶均差二阶均差三阶均差四阶均差五阶均差0.400.410750.550.578151.116000.650.696751.186000.280000.800.888111.275730.358930.1973330.901.026521.384100.433480.2129520.03123811.051.253821.515330.524930.2286670.03142860.000380952ixif求出插值多项式 )0.9-(x)0.8-(x)0.65-(x
16、)0.55-(x)0.4-(x 20.00038095 )0.8-(x)0.65-(x)0.55-(x)0.4-x0.0312381()0.65-(x)0.55-(x)0.4-0.197333(x)0.55-(x)0.4-(x 0.28 )0.4-(x 1.116 0.41075N5 )x(例例 2.41 基函数基函数)40.0(x)55.0)(40.0(xx)65.0)(55.0)(40.0(xxx)80.0)(65.0)(55.0)(40.0(xxxx)90.0)(80.0()65.0)(55.0)(40.0(xxxxx23455N(x)0.00126575 0.990192 x 0.02
17、93776 x 0.123991 x 0.029981 x 0.000380952 xNewdon插值的例题()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.)0.9-(x)0.8-(x)0.65-(x)0.55-(x)0.4-(x 20.00038095 )0.8-(x)0.65-(x)0.55-(x)0.4-x0.0312381()0.65-(x)0.55-(x)0.4-0.197333(x)0.55-(x)0.4-(x 0.28 )0.4-(x 1.116 0.41075N5 )x(求出插值N(0.
18、596)=0.6319174965773844例例 2.423455N(x)0.00126575 0.990192 x 0.0293776 x 0.123991 x 0.029981 x 0.000380952 x例例 2.4Newdon插值的例题()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.估计误差N(0.596)=0.631917496577384423455N(x)0.00126575 0.990192 x 0.0293776 x 0.123991 x 0.029981 x 0.00038095
19、2 x505696(),.,(0.596)(0.596)2.6543610Rxf x xxM 拉拉格格朗朗日日牛牛顿顿)()!1()()(,.,)()(1)1(11011xnxxxxxfxaxRnnnnnnnf 例例2.4(1)完成差商表;(2)求出插值多项式;(3)求出插值;(4)估计误差;典型例题的求解实验()fx(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,次牛顿插值多项式,并由此计算并由此计算 的近似值的近似值.0.400.410750.550.578150.650.696750.800.888110.901.026521.051.25382ixif(5)几何
20、直观验证。完成差商表Clearx,k,yx0,x1,x2,x3,x4,x5=0.4,0.55,0.65,0.80,0.90,1.05;y0,y1,y2,y3,y4,y5=0.41075,0.57815,0.69675,0.88811,1.02652,1.25382;Tableyk,k,0,5/N;fi_,j_:=(yj-yi)/(xj-xi)Tablefi,i+1,i,0,4/N;fi_,j_,k_:=(fj,k-fi,j)/(xk-xi)Tablefi,i+1,i+2,i,0,3/N;fi_,j_,k_,l_:=(fj,k,l-fi,j,k)/(xl-xi)Tablefi,i+1,i+2,i
21、+3,i,0,2/N;fi_,j_,k_,l_,m_:=(fj,k,l,m-fi,j,k,l)/(xm-xi)Tablefi,i+1,i+2,i+3,i+4,i,0,1/N;fi_,j_,k_,l_,m_,p_:=(fj,k,l,m,p-fi,j,k,l,m)/(xm-xi)Tablefi,i+1,i+2,i+3,i+4,i+5,i,0,0/N;程序设计程序设计()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.例例 2.4典型例题的求解实验程序设计程序设计A=y0,y1,y2,y3,y4,y5,0,f0,
22、1,f1,2,f2,3,f3,4,f4,5,0,0,f0,1,2,f1,2,3,f2,3,4,f3,4,5,0,0,0,f0,1,2,3,f1,2,3,4,f2,3,4,5,0,0,0,0,f0,1,2,3,4,f1,2,3,4,5,0,0,0,0,0,f0,1,2,3,4,5;TransposeA/N;MatrixForm%0.41075 0 0 0 0 00.57815 1.116 0 0 0 00.69675 1.186 0.28 0 0 00.88811 1.27573 0.358933 0.197333 0 01.02652 1.3841 0.433467 0.212952 0.03
23、12381 01.25382 1.51533 0.524933 0.228667 0.0314286 0.000380952完成差商表()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.例例 2.4典型例题的求解实验程序设计程序设计0.41075 0 0 0 0 00.57815 1.116 0 0 0 00.69675 1.186 0.28 0 0 00.88811 1.27573 0.358933 0.197333 0 01.02652 1.3841 0.433467 0.212952 0.031238
24、1 01.25382 1.51533 0.524933 0.228667 0.0314286 0.000380952求出插值多项式a0=y0;a1=f0,1;a2=f0,1,2;a3=f0,1,2,3;a4=f0,1,2,3,4;a5=f0,1,2,3,4,5;NUx=a0+Sumak*Product(x-xm),m,0,k-1,k,1,5/NExpand%()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.例例 2.4 )0.9-(x)0.8-(x)0.65-(x)0.55-(x)0.4-(x 20.00
25、038095 )0.8-(x)0.65-(x)0.55-(x)0.4-x0.0312381()0.65-(x)0.55-(x)0.4-0.197333(x)0.55-(x)0.4-(x 0.28 )0.4-(x 1.116 0.41075N5 )x(23455N(x)0.00126575 0.990192 x 0.0293776 x 0.123991 x 0.029981 x 0.000380952 x典型例题的求解实验 求出插值657738440.63191749(0.596)N5 N%145/.x-0.596,20()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多
26、项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.例例 2.423455N(x)0.00126575 0.990192 x 0.0293776 x 0.123991 x 0.029981 x 0.000380952 x典型例题的求解实验 估计误差程序设计程序设计ClearA,g1,g2xx=0.40,0.55,0.65,0.80,0.90,1.05;yy=0.41075,0.57815,0.69675,0.88811,1.02652,1.25382;A=Tablexxk,yyk,k,1,6;g1=ListPlotA,Prolog-AbsolutePointSize15;Inter
27、polationA,InterpolationOrder-5g2=Plot%x,x,0.40,1.05Showg1,g2N%0.596,20923174550.63191749 插值原理计算的数值插值原理计算的数值910654362 .误误差差657738440.63191749(0.596)N5 牛顿插值数值牛顿插值数值()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.例例 2.4典型例题的求解实验ClearA,g1,g2xx=0.40,0.55,0.65,0.80,0.90,1.05;yy=0.410
28、75,0.57815,0.69675,0.88811,1.02652,1.25382;A=Tablexxk,yyk,k,1,6;g1=ListPlotA,Prolog-AbsolutePointSize15;InterpolationA,InterpolationOrder-5g2=Plot%x,x,0.40,1.05Showg1,g2程序设计程序设计几何直观验证()f x(0.596)f依照依照 的函数表,求的函数表,求5 次牛顿插值多项式,次牛顿插值多项式,并由此计算并由此计算 的近似值的近似值.例例 2.4典型例题的求解实验程序设计程序设计课后实验课题(1)完成差商表;(2)求出插值多项
29、式;(3)求出插值;(4)估计误差;(5)几何直观验证。ln,yx(0.00125)y已知已知012340.001,11,12,13,14,xxxxx求求4 次牛顿插值多项式,并由此计算次牛顿插值多项式,并由此计算 的近似值的近似值.实验课题实验课题借助mathematicax0,x1,x2,x3,x4=0.001,11,12,13,14;yk_:=LogxkTableyk,k,0,4/N;MatrixForm%fi_,j_:=(yj-yi)/(xj-xi)Tablefi,i+1,i,0,3/N;MatrixForm%fi_,j_,k_:=(fj,k-fi,j)/(xk-xi)Tablefi,
30、i+1,i+2,i,0,2/N;MatrixForm%fi_,j_,k_,l_:=(fj,k,l-fi,j,k)/(xl-xi)Tablefi,i+1,i+2,i+3,i,0,1/N;MatrixForm%fi_,j_,k_,l_,m_:=(fj,k,l,m-fi,j,k,l)/(xm-xi)Tablefi,i+1,i+2,i+3,i+4,i,0,0/N;MatrixForm%程序设计程序设计课后实验课题 完成差商表ClearAA=y0,y1,y2,y3,y4,0,f0,1,f1,2,f2,3,f3,4,0,0,f0,1,2,f1,2,3,f2,3,4,0,0,0,f0,1,2,3,f1,2,
31、3,4,0,0,0,0,f0,1,2,3,4;TransposeA/N;MatrixForm%-6.90776 0 0 0 02.3979 0.846045 0 0 02.48491 0.0870114 -0.0632581 0 02.56495 0.0800427 -0.00348433 0.00459833 02.63906 0.074108 -0.00296737 0.000172322 -0.000316166程序设计程序设计课后实验课题求出插值多项式a0=y0;a1=f0,1;a2=f0,1,2;a3=f0,1,2,3;a4=f0,1,2,3,4;Nx=a0+Sumak*Produc
32、t(x-xm),m,0,k-1,k,1,4/NExpand%13)-(x 12)-(x 11)-(x 0.001)-(x 60.00031616-12)-(x 11)-(x 0.001)-(x 0.00459833 11)-(x 0.001)-(x 0.0632581-0.001)-(x 0.846045 -6.90776(x)N4 4324x 60.00031616-x 0.0159806 x 0.305303-x 2.69171 -6.91045(x)N 程序设计程序设计课后实验课题 求出插值4324x 60.00031616-x 0.0159806 x 0.305303-x 2.6917
33、1 -6.91045(x)N 22967008-6.9070825(0.00125)N4 估计误差Clearx,xx,yy,y,g1,g2x=0.001,11,12,13,14;yx_:=Logxyy=y0.001,y11,y12,y13,y14;A=Tablexk,yyk,k,1,5;g1=ListPlotA,Prolog-AbsolutePointSize15;InterpolationA,InterpolationOrder-4g2=Plot%x,x,0,14Showg1,g2N%0.00125,20插值原理计算的数值插值原理计算的数值64()3.31654 10R x牛顿插值数值牛顿插值数值6.90708252296701误误 差差22967008-6.9070825(0.00125)N4 程序设计程序设计课后实验课题几何直观验证程序设计程序设计Newdon插值的通用程序设计基于基于Mathematica9.0插值节点坐标xx=*,*,*插值函数值yy=*,*,*