2函数的插值

更新时间:2023-09-16 18:31:01 阅读量: 高中教育 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

第二章 插值(第1页/共9页)

第二章 函数的插值

1.下列函数表(表18)中的数字都是有效数字。

(1)通过ctgx的函数表,进行插值,求ctg(0.0015),并估计误差; 解:先作差分表:

xctgx0.0011000.000?500.0010.0020.0030.0040.005499.999?166.667333.332?83.333249.999?50.001199.99833.33283.334?50.002333.334?250199.998

取 x1?0.001,h?0.001,x?0.0015?x1?ph,p?0.5,则由表初公式有:

p(0.0015)?1000?500.001?0.5?333.334?p(p?1)(p?2)(p?3)4!?684.89533281?199.998?又由:(ctgx)(5)p((p?1)p(p?1)(p?2)?250?2!3!

??120sin?6x?120sin?4x?16sin2x,所以误差为:

f(5)(?)ctg(0.0015)?p4(0.0015)?p(p?1)(p?2)(p?3)(p?4)h5?3281.25

5!(2)通过sinx和cosx的函数表进行插值,求ctg(0.0015),并估计误差。 解:先作sinx和cosx差分表:

同样由表初公式和截断误差分析知:

sin(0.0015)=0.0015+e1; cos(0.0015)=0.999998719+e2 其中:e1?11?3.28125?h5?0.3?10?11,e2??3.28125?h5?0.3?10?11,于是: 5!5!第二章 插值(第2页/共9页)

ctg(0.0015)=?e2cos(0.0015)0.999998719?e20.999998719???sin(0.0015)0.0015?e10.0015?e10.0015?e1

e20.9999987190.999998719e1??0.00150.00150.00150.0015?e1e20.999998719e1??666.666?E0.00150.00150.0015?e1?666.6658125?其中:E?0.2?10?3?10?5?0.5?10?3(3)比较(1)、(2)的结果。

由于ctg(0.0015)= 666.6661667,显然用(2)式计算的结果精度高,并具有6位有效数字。

2.给定f(x)的函数值如表19所示,用3种途径求3次插值多项式。

解:(1)用牛顿方法。先作差商表:

01.451.126666666?0.09762641870.7947368421 ?0.01210156351.53.143.44.65?0.15882352946.84.11所以:

?0.1799170512N3(x)?1.45?1.126666666(x?0)?0.0976264187x(x?1.5)?0.0121015635x(x?1.5)(x?3.4)

(2)用Lagrange 方法

(x?1.5)(x?3.4)(x?6.8)x(x?3.4)(x?6.8)?1.45??3.14(?1.5)(?3.4)(?6.8)1.5(1.5?3.4)(1.5?6.8)

x(x?1.5)(x?6.8)x(x?1.5)(x?3.4)??4.65??4.113.4(3.4?1.5)(3.4?6.8)6.8(6.8?1.5)(6.8?3.4)p3(x)?化简得:p3(x)??0.0121015635x3?0.0383287583x2?1.211388323x?1.45 (3)用内维尔方法

x?1.5x?0?1.45??3.14?1.126666666x?1.45

0?1.51.5?0x?3.4x?1.5p2,3(x)??3.14??4.65?0.7947368421x?1.947894736

1.5?3.43.4?1.5x?6.8x?3.4p3,4(x)??4.65??4.11??0.1588235294x?5.19

3.4?6.86.8?3.4p1,2(x)?第二章 插值(第3页/共9页)

x?3.4x?0?p1,2(x)??p2,3(x)0?3.43.4?0x?6.8x?1.5再由:p2,3,4(x)??p2,3(x)??p3,4(x)

1.5?6.86.8?1.5x?6.8x?0p1,2,3,4(x)??p1,2,3(x)??p2,3,4(x)0?6.86.8?0p1,2,3(x)?得:p3(x)??0.0121015635x3?0.0383287583x2?1.211388323x?1.45 3.给定f(x)的函数值如表20所示,求f(27)??

解:先作差商表:

1417

68.7?1.56764.?1.42944.?1.22539.18.118?10?3 0.0001533135即:

0.01133f(x)?p3(x)?68.7?1.567?(x?14)?8.118?10?3(x?14)(x?17)?0.000153(x?14)(x?17)(x?31)

故:f(27)?p3(27)?49.3047222 用Neville方法得:

x

4.求33,利用f(x)?3,取节点x?0,x?1,x??1作插值,并估计截断误差。 解:先作差商表:

011234/32/3

?11/3第二章 插值(第4页/共9页)

所以,f(x)?p2(x)?1?2x?2141x(x?1)。故:33?p2()??1.518518518 3327f(3)(?)x(x?1)(x?1),?1???1 其截断误差:R2(x)?f(x)?p2(x)?3!3?(ln3)31?1?x3由于f???(x)?3(ln3),所以R2(x)??????1?0.1964??0.2

3!3?3?2

5.证明:在两个节点:x1,x2?x1?h上作线性插值,当x?(x1,x2)时,余项为

h2R?maxf??(x)

x81?x?x2证:因为

R?f(x)?p1(x)??hmaxf??(x),x81?x?x22f??(?)1(x?x1)(x?x2)?maxf??(x)max(x?x1)(x?x2)x1?x?x22!2x1?x?x2

x1?x2x1?x2h2其中:max(x?x1)(x?x2)?( ?x1)(?x2)?x1?x?x22246.若h是小量,则f(x?h),f(x),f(x?h)三个函数值应怎样线性组合,才能得到较好的

f??(x)的近似值。

f??(x)2f???(x)3f(4)(?1)4h?h?h,x?h??1?x, 解:由于f(x?h)?f(x)?f?(x)h?2!3!4!f??(x)2f???(x)3f(4)(?2)4f(x?h)?f(x)?f?(x)h?h?h?h,x??2?x?h,

2!3!4!f(4)(?2)?f(4)(?1)4h , 所以:f(x?h)?f(x?h)?2f(x)?f??(x)h?4!2f(4)(?2)?f(4)(?1)2f(x?h)?f(x?h)?2f(x)?f??(x)?h。 即:24!h第二章 插值(第5页/共9页)

7.证明

df(x1,x2,?,xn,x)?f(x1,x2,?,xn,x,x)。 dxi??证:设 limyi?x,则

f(x1,x2,?,xn,yi)?f(x1,x2,?,xn,x)df(x1,x2,?,xn,x)?limi??dxyi?x ?limf(x1,x2,?,xn,yi,x)?f(x1,x2,?,xn,x,x)i??8.f(x)=lnx, 节点为x=0.4,0.5,0.7和0.8,求3次插值多项式P3(x),并估计余项。

解 作差商表

故 P3(x)=-0.91629+2.231436(x-0.4)-1.83025(x-0.4)(x-0.5)+1.683559(x-0.4)(x-0.5)(x-0.7)

因f(4)(x)??6x?4, 故余项为:

R(x)?lnx?P3(x)?f(0.4,0.5,0.7,0.8,x)(x?0.4)(x?0.5)(x?0.7)(x?0.8)??1(x?0.4)(x?0.5)(x?0.7)(x?0.8),4??4?在0.4,0.5,0.7,0.8和x之间

11.用拉格朗日途径导出如下f(x)的2n?1次埃尔米特插值H2n?1(x),满足:

?H2n?1(xi)?f(xi),H2n?1(xi)?f?(xi),i?1,2,?n。

并估计余项。

解:先构造次数不高于2n?1的多项式Hi,2n?1(x)满足下列2n个条件:

Hi,2n?1(xj)?0,j?1,2,?,n???H?(x)????1,i?j,j?1,2,?,n

?ij?i,2n?1j?0,i?j?满足上述条件的2n?1的多项式Hi,2n?1(x)可以写成:

Hi,2n?1(x)?A(x?xi)(x?x1)2?(x?xi?1)2(x?xi?1)2?(x?xn)2

其中A为待定系数,再由条件Hi?,2n?1(xi)?1得:

A?1 22222(xi?x1)(xi?x2)?(xi?xi?1)(xi?xi?1)?(xi?xn)(x?xi)(x?x1)2?(x?xi?1)2(x?xi?1)2?(x?xn)2即:Hi,2n?1(x)? 22222(xi?x1)(xi?x2)?(xi?xi?1)(xi?xi?1)?(xi?xn)

第二章 插值(第6页/共9页)

再构造次数不高于2n?1的多项式hi,2n?1(x)满足下列2n个条件:

??1,i?j,j?1,2,?,n?hi,2n?1(xj)??ij???, ?0,i?j?hi?,2n?1(xj)?0,j?1,2,?,n?(x?x1)2?(x?xi?1)2(x?xi?1)2?(x?xn)2令:hi,2n?1(x)?(ax?b) 22222(xi?x1)(xi?x2)?(xi?xi?1)(xi?xi?1)?(xi?xn)它满足上述条件中除hi?,2n?1(xi)?0,hi,2n?1(xi)?1外的所有其他条件,于是再由

hi,2n?1(xi)?axi?b?1,?(x?x1)?(x?xi?1)(x?xi?1)?(x?xn)?hi?,2n?1(xi)?a?(axi?b)?2222??(xi?x1)?(xi?xi?1)(xi?xi?1)?(xi?xn)?n2?a???0x?xj?1ijj?i2222?x?xi

n22所以a???,b?1?axi?1???xi,于是:

x?xx?xj?1ij?1ijjj?ij?in??n(x?x1)2?(x?xi?1)2(x?xi?1)2?(x?xn)21?? hi,2n?1(x)?1?2(xi?x)?2222??(xi?x1)?(xi?xi?1)(xi?xi?1)?(xi?xn)j?1xi?xj??j?i??于是所求的埃尔米特插值多项式为

nnH2n?1(x)??hi,2n?1(x)f(xi)??Hi,2n?1(x)f?(xi)

i?1i?1其余项为:

f(x)?H2n?1(x)?f(x1,x1,x2,x2,?,xn,xn,x)?(x?xi)2i?1n?f(?)(x?xi)2?(2n)!i?1n(2n)

13.找一个5次Hermite多项式H5(x),满足

(j)H5(xi)?f(j)(xi),i?1,2;j?0,1,2.

并估计余项。

解:由差商表:(略)

第二章 插值(第7页/共9页)

f??(x1)(x?x1)2?2!??f?(x2)?3f(x1,x2)?2f?(x1)?12f(x1)(x2?x1)?(x?x1)3(x?x2)3(x2?x1)????6f(x1,x2)?3f?(x1)?3f?(x2)?1322(f(x1)?f(x2))(x2?x1)?(x?x)(x?x)12(x2?x1)4H5(x)?f(x1)?f?(x1)(x?x1)?其余项为:

f(x1,x2)?f?(x1)?1f??(x1)(x2?x1)2(x?x1)32(x2?x1)f(6)(?)2f(x)?H5(x)?f(x1,x1,x1,x2,x2,x2,x)(x?x1)(x?x2)?(x?xi)3 ?(6)!i?133?A1????A2?mm14.证明(34)式成立,即证明 det????(yj?yi)ji

???1?i?j?s?A??s?证明:因为:Ai(k)?1l1(x1(,ik))?(i)l1(x1(,ik),x2?0,k)?????(i)?0l1(x1(,ik),?,xm)i,k???ln(x1(,ik))?(i)(i)?ln(x1,k,x2,k)??

???(i)(i)?ln(x1,k,?,xmi,k)???ln(x1(,ik))??(i)?ln(x2,k)?,故

????(i)?ln(xmi,k)???1l1(x1(,ik))?(i)?1l1(x21,k)???(i)(i)?(x?x)?l,km,k?1?m?l?mi(i)?1l1(xm)i,k??A1(k)??A1??(k)????A?1?A?det?2??limdet?2??limsk??k???(i)?????(x??l,k?A??A(k)?i?11?m?l?mi?s??s??1l1(x1(,1k))?(1)?1l1(x2,k)????(1)?1l1(xm)1,kdet??(i)???xm),k?1l1(x1(,sk))?????1l(x(s))1ms,k?mjmi????????ln(x1(,1k))??(1)ln(x2,k)????(1)ln(xm1k)????

ln(x1(,sk))????(s)ln(xm)?s,k??limk??1?i?j?sm?1l?1?(j)(i)??(xm,k?xl,k)?mjmi1?i?j?s?(yj?yi)

17.解:因为y?J0(x),若x??(y)是贝塞尔函数的反函数,为求y?J0(x)的零点,只需求???(0),下面用插值方法计算?(0),先作差商表:

第二章 插值(第8页/共9页)

yx??(y)?0.096804937002.6?2.065212044?0.04838377640.00250768320.0555397844于是根:

2.5?1.9649662392.4?1.8856503462.31.009396260.7632137735?1.615956602

?*?p3(0)?2.6?2.065212044?(0?0.096804937)?1.00939626(0?0.096804937)(0?0.0483837764)?1.615956602(0?0.096804937)(0?0.0483837764)(0?0.0025076832)?2.404824021或

?*?p2(0)?2.5?1.964966239(0?0.0483837764)?0.7632137735(0?0.0483837764)(0?0.0025076832)

?2.40483491118.证明 当n=1时,?1?{t1|0?t1?1},所以

?1?f?(t0x0?t1x1)dt1??f?(x0?t1(x1?x0))dt1?011?f(x1)?f(x0)??f(x0,x1)

x1?x0当n=2时,?2??(t1,t2)|0?t1,t2,t1?t2?1?,所以

f??(t???20x0?t1x1?t2x2)dt1dt2??dt1?011?t10f??(x0?t1(x1?x0)?t2(x2?x0))dt2??dt10111?tf?(x0?t1(x1?x0)?t2(x2?x0))01x2?x01?x2?x0???f?((1?t)x011

2?t1x1)?f?((1?t1)x0?t1x1)?dt11?f(x2,x1)?f(x0,x1)??f(x0,x1,x2)x2?x0假设当n=m-1时命题成立,则当n=m时:

第二章 插值(第9页/共9页)

f?????m(m)(t0x0?t1x1???tmxm)dt1dt2?dtm?????dt1?dtm?1?m?1??1?(t1?t2??tm?1)0f(m)(x0?t1(x1?x0)???tm(xm?x0))dtm?

?1xm?x0(m?1)?[f((1?(t1?t2??tm?1))xm?t1x1???tm?1xm?1)????m?1?f(m?1)(x0?t1(x1?x0)???tm?1(xm?1?x0))]dt1dt2?dtm?1?1?f(xm,x1,?xm?1)?f(x0,x1,?,xm?1)??f(x0,x1,?,xm)xm?x0补充思考题:

一、填空题

1.若f(x)= x - x +1,则 (1)f(0,0,0,1)= ; (2)f(0,0,0,0,1)= ; (3)f(1,2,3,4,5,6)= 。

3

2.设x i为等矩节点,f(x1)=1, f(x2)=4, f(x3)=9, f(x 4)=16,则? f(x1)= 。 3.设x1, x2,…, xn+1是n+1个不同的节点,则差商与导数的关系是f(x1, x2,…, xn+1)= 。

4.设x1, x2,…, xn+1是n+1个不同的节点,则f(x)= f(x1)+ f(x1, x2)(x- x1)+…+ f(x1, x2,…,

4

2

xn+1)?(x?xi) + 。

i?1n5.设f(x)为首项系数为1的n次多项式,x1, x2,…, xn+1是n+1个不同的节点,则f(x1, x2,…, xn+1)= 。

2

6.已知f(x)= x -1,若q1 (x), q2 (x), q3 (x)是以x1, x2, x3为插值节点的拉格朗日基本插值多项式,即qi(x)??(x?xj?1j?ii3(x?xj)j),i?1,2,3,要使f(x)= c1q1 (x)+ c2 q2 (x) + c3 q3 (x)成立,则

c1= ,c2= ,c3= 。

7.设f(x)足够光滑,则用过(x1, f(x1)),(x2, f(x2))的直线l(x)逼近f(x),其截断误差为: R(x)= f(x)-l(x) 。

8.设f(x)足够光滑,H(x)是满足条件H(x1)= f(x1), H′(x)= f′(x1),H(x2)= f(x2),H′(x2)= f′(x2)的三次埃米特(Hermite)插值多项式,则其插值余项为:

R(x)= f(x)-H(x) 。

二、判断题

1.f(x)在节点x1, x2,…, xk+1上的k阶差商与节点x1, x2,…, xk+1的次序无关。

2.设f(x)为次数不高于n的多项式,x1, x2,…, xn+1是n+1个互不相同的节点,若经过数据点(x1, f(x1)),( x2, f(x2)),…, (x n+1, f(xn+1))构造拉格朗日插值多项式p(x),则p(x)与f(x)相等。 3.经过数据点(x1, f(x1)),( x2, f(x2)),…, (x n+1, f(xn+1))所作的n次拉格朗日插值多项式与牛顿插值多项式恒相等,且余项(即插值的截断误差)也相等。

本文来源:https://www.bwwdw.com/article/bxxh.html

Top