数值分析-第五章插值与拟合_第1页
数值分析-第五章插值与拟合_第2页
数值分析-第五章插值与拟合_第3页
数值分析-第五章插值与拟合_第4页
数值分析-第五章插值与拟合_第5页
已阅读5页,还剩63页未读 继续免费阅读

下载本文档

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

文档简介

作用:由物理量离散的分布近似得到其连续的变化规律本章主要内、拉格朗日插值方、插值方、埃尔米特插值方、曲线拟问题背景插值的基本概定义:已知定义于区间[ab]上的实值函数fx)在n1个 i异节点{x [a, iyif(xi i0,1,,ax0x1xnP(x)P(xi)yi i0,1,, 作为函数y=f(x)的近似,称这样的问题为插值问题系式(5-1)的P(x)为f(x)的插值函数,f(x)为值函数[a,b]为插值区间xi}为插值节点,(5-1)式为插值条件代数代数插值:插值函数P(x)

有理插值:插值函数P(x)为有理分式函数三角插值:插值函数P(x)为三角函数P(x)fyP(x)fyf(yP(P(x)aaxax2 axn,a 0i P(xi)yif(xi i0,1, ,P(x0)

a1x0a2x2 anxny0P(x1)a0

axax2

axn P(x)

a ax2 axn

(xixj)定理5-1:满足插值条件(5-1)的不超过n次的插值多注:nf(xn+1 Rn(x)f(x) Rn(xi)f(xi)P(xi) i定理5.2f(x)

x0,x1,,[a,b]上n

次可微,则对任意x[a,b],x有关的af(n1)()Rn(x)f(x)pn(x)(n1)!n1(x) 其中

(x)(xx)(x

(xx

x) 当x=xi(i=0,1,…,n)时,Rn(xi)=f(xi)-Pn(xi)=0,xxi(i0,1,n)时g(t)f(t)Pn(t)

n1

n1反复对g’(t),g’’(t),…,g(n)(t)用罗尔定理,得到g’’(t)至少有个n零点,g’’(t)至少有个n-1零点,…,g(n+1)(t)至少有一个零点,即至少存在一点(a,b), 使得g(n1)()0.显然与所给的x有关

g(n1)(t)f(n1)(t)f(x)Pn(x)(nn1(x)f(x)

Pn(x)

f(n1)((n n1

(a,b)且与x有关拉格朗日(Lagrange)插一、线性插值(n给定两个点(x0,y0)和(x1y1),且x0 ≠x1,构造一次多项式L1(x),使其满足条件:L1(x0)=y0, yy0(xx0 ( y0 x0

L(x)y

x

xx010101

x0

x1xL1(x)l0(x)y0l1(x)0 l(x)x 0

l(x)x x0

x1并称l0x),l1x)是x0x1的插值基函数l(x)

j

(i,j j注意li(xj 1l1l(01(n使L2x)满足L2(x0)y0 L2(x1) L2(x2)类似的,所要寻求的多项式L2x)L2(x)y0l0(x)y1l1(x)y2l2(这里lix)称为二次插值基函数,只与x0x1x2l(x)1,j (i,j0,1, jl(x) (xx1)(xx2)0 (xx)(xx0 l(x)(xx0)(xx2) l(x) (xx0)(x (xx)(xx (xx)(xx 下面我们以l0x)为例来确定出:l0(xl1(xl2(x)由条件l0(x1) l0(x2)

x1,l0(x)

l0(x)Axx1xx2l0(x01,可1AxxxxA1

x0x1x0x2从而

(xx1)(xx2(x0x1)(x0x2(xx0)(xl(x)

l(x)

(xx0)(x1 1

x2

(x2x0)(x2设x0,x1,…,xn是[a,b]上的n+1l(x)

(xx0)(x (xxi1)(xxi1) (xxn

(5-i (i

)(

(xixi1)((xixi1)(xixi1)(xixn

li(x)是一个nji(xixj

i0li(xj)ij0

i与节点有关,而与f

称为n次Lagrange插令nLn(x)l0(x)y0l1(x)y1ln(x)ynli(x)i0

(5-LLn(xi)yiin1(x)(xx0)(x

(xxn)(xxi)(xxi)(xxj d

jin1(x)(xxj)(xxi

(xxjdx ll(x)n1(x)i(xx)i(xi

jn1(xi)(xixjl(xl(x)(xx0)(x(xxi1)(xxi1)(xxni(xx)(xxi0i1(xi)(xi)(xxin注意 i这是因为 li(xj) 当in(1)n,则插值多项式不唯一n例如P(x)Ln(x)q(x)(xxi 也是一个插i多项式,其中q(x)可以是任意多项式拉格朗日插值多项式结构对称,形式简单Rn(x)f(x)Ln(x)(n1)!n1(n测试xii+1,i0,1,2,3,4,5.l2(x)的图像 1

1

10

l(x)(x1)(x2)(x4)(x5)(x 例 已知函数f(x)的如下函数值 23yif(xi 1f(x的二次Lagrange插值多项式L2(x),并利用L2计算出f 解l(x)(x2)(x

1(x2)(x0l1(x)l2(x)

(x1)(x(x1)(x(31)(3

(x1)(x1(x1)(x2L2(x)l0xy0 l21(x2)(x3)1(x1)(x3)11(x1)(x2)21x25x6x24x31

3x2x23x1

3

f(1.5)

L(1.5)

3 例2

sin1,sin ,sin2 2sinx的1次、2次Lagrangesin50并估计误差。sin50n= 分别利用x0,x1以及x1,xn=

500

518

x,x

L(x)x/41x/62 /6/ /4/2sin500L5

118这 f(x)sinx,

(2)()sin,

3 f 0.01319R(5)1/*extrapolation*的实际误差x,x利 sin500.00538~518/*interpolation*sin50=n=L(n=

(x

)(x

)

(x

)(x

)

(x

)(x

) ()(

()(

2()( 2sin50

L(5)

3R(x)cos(x)(x)(x) 1cos3 3 0.00044R5218二

sin50=嘿5.3插时,全部基函数li(x)都需重新算过。Ln(x改写成x0)2(xx0)(xx1)a?n(xx0)...(xxn1)的形式,希望每加一个节f(x)n+1个互异节点x}n处的函数值fx f[x,f[x,x]f(x)f(xijijx(i xxijijf[xf[x,x,x] f[x,x]f[x,x x(ijikkff[x,x,...,x]f[x0,x1,...,xk1]f[x1,x2,...,xk01kx0kf(xk-1f(xk此外补充定义,fx0为零阶差商xxi的顺序ff[x,x,...,x]n f(x ni0(xix0 (xixi1)(xixi1(xixn即即f[x0,...,xn]nf(xiin (x其中n1xxxiinn1(xi)(xixjjjn证明:n=

f[x,x]f(x0)f(x1) f(x0) f(x x0

x0

x1n= f[x,x,x]f[x0,x1]f[x1,x2

x0f[x,x,x] f[x0,x1]f[x1,x2

x0x2

f(x1)

f(x2) f(x0)

f(x1)( x)x

x x

1

0 f(x0 (x0x1)(x

f( (x1x0)(x1

f(x2(x2x0)(x2差商具有对称性,即差商具有对称性,即f[x0x1xi的顺序无关xn]f[f[x0,x1,...,xnf(n)(n!(a,n阶差商n阶导数性质证三、插值多项

设x0x1xnn+1个互异节点,x[a,b且xxiNn.1f(x)f(x0)(xx0)f[x,12f[x,x0]f[x0,x1](xx1)f[x,x0,23f[x,x0,x1]f[x0,x1,x2](xx2)f[x,x0,x1,x23………f[x,x0,...,xn1]f[x0,...,xn](xxn)f[x,x0,...,xnff(x)f(x0)f[x0,x1](xx0)f[x0,x1,x2](xx0)(xx1)f[x0,...,xn](xx0)...(xxn1)f[x,x0,...,xn](xx0)...(xxn1)(xxnRn

f(x)Nn(x)Rn(x)Rn(x)f[x,x0,x1,,xn](xx0)(xx1)(xxnf[x,x0,x1,,xn]n1

Rn(xi)f[xi,x1,,xn]n1(xi)

Nn(xi)f(xi i由插值多项式的唯一性可知NnxLnx),aif[x0,x1,x2,...,xi i0,1,2,...,f(n1)(f[x,x0,...,xn]n1(x) n1(x)(n f[x0,...,xn]

f(n)(n

(x)N(x)f[x,x,..., k k(xx)(xx)(xx Nk(xf[x0x1xk1xx0xx1xxk) f f f

f[x0,f[x1,…

f[x0,x1,…

f … f

f[xn1,

f[xn2,xn1,

f[x0,…,xn+1f

f[xn, f[xn1,xn,

f[x1,…, f[x0,…, 已知f(0)=2,f(1)=-3,f(2)=-6,f(3)=11,求f(x)的3次插值解 f

一阶均 二阶均321 35

三阶均

633211163

21733

1013

f[0,1]5,f[0,1,2]1,f[0,1,2,3]3,N3(x)2

x(x1)3x(x1)(x 3x38x2例5:yfx)12345yi=f14786写出4次插值多项式解:xif(xi12345

N4(x)13(x1)0(x1)(x147863310236114786331023611(x1)(x2)(x3)(x4)N(x)1x49x383x233x 例 f(2)

f(1)f(2)

f(0)f(3)30,求f(x)关于上述节点组的插值多项式N(x)解 f

一阶均 二阶均 三阶均

251 53

32010311910

075972

111 112 11

230193

1193

3 f[2,1]3, f[2,1,0]1,f[2,1,0,1]0,N(x)

3x2(x1)xx26xxiaih(i0,..., hban

fif(xi

fifi1

称为在点xi处的i f(i

fi

向后差分

fi

称为在点xi处的mi f(mi

fi

性质 kf[x0,x1 ,xk

] 0 (k1,2, ,n)k!hk xkx0kh, k0,1,2,...,k

f[x,x]f1

设kj时结论成立当k=j+1

f[

,

,

]f[x0,

,xj]f[x0xj

,xj1]f[

,

,

]f[x0,

,xj]f[x0xj

,xj1] j j k1(j1)hj!hj j!hj k j1k(j1)!hj1

hm(m0(),(x,x),0nf(n)(xkx0kh,fkf(xk),k0,1,2,...,f[x,x

mx]

f[x0,

f(m)(, ], ]m1m

mNn(x)f(x0)f[x0,x1](xx0)...f[x0,...,xn](xx0)...(x向前插值公当插值点x位于插值区间左端点x0 xx0 0tff[x0,x1,x]kk k!hkN(x)

xx0 (xx0)(xx1)2 (xx0)(xn!hn(xxn

2!h2

0n0xxk(x0th)(x0kh)(tk)h

k N(xth) 0 (ti) k!hkk1 i nkf0

0t(t

(tkk kCkt(Ckt(tt(tkk!

Ckkt0kt0(tf(n1)(t

Rn[f]

(n

hn1t(ttf(n1)( t向后插值公当插值点xxn令xxn 1tNn(x)f(xn)f[xn,xn1](xxn)...f[xn,...,x0](xxn)...(xff[xk,xk1,x1,x0]kkkxxni(t

k N(xth)f n (t kk1 i k

nt(t

k!nf

Rn[f]

f(n1)((n

hn1t(t(t(tt

f(n1)(注:注:xx0xn例4ysinx)yi=f(xi分别利用前插和后插公式计算sin(0.42351)的近似值精确值精确值 精确值0.08521 txx20.423510.6 5.4埃尔米特插不仅要求函数值重合,而且要求若干阶导数(xi)f(xi(xi)f(xi(xi)f(xi

问题:已知函数fx在互异节点

i

f(x

f(x) i

,2n+1的多项式H2n1(x) 满足如下的2n+2个条H2n1(xi)f(xiH

(x)f(

i0,1,2, ,) 2n1 设满足前述2n+2个条件的插值多项式为 H2n1(x)f(xi)i(x)f(xi)i(x)ix),i(x)

xj)(x)

(x)

ii

,i,j0,1,,ix)和ix)i(x和i(x)均为2n+1次多项式,且有n个二重x0

,xi1,xi1

,令x)(axb)l2x) (xixi1(xixi1)(xixi1(xixni

(xx0)(x (xxi1)(xxi1) (xxn(xix0)(xi(x)al2(x)(axb)l2( l2i(x)2l(x)ll2i(x)2l(x)l(ii

i(xi)ai2(aixibi)li(xi)

nnkk

n1k0xi

1ai

12xik(x(xi)(xi)(xx(x)(x)n(xx

xiil(x)i

(x

)(x (

)(

iiiiii nn

xi

(x

xi1)(x

(x

x(x)[1(x)[12(xx)iikkn x]l(x), i0,1,2i,ik(x)i,j,ij

c

(x)(x)(xx)l2(i H2n1(x)f(xi)i(x)f(xi)i( n ii(x)[12(xiiki

xi

]l2((x)(xx)l2(

i0,1,2,,

(2n

(x)f(x)

(2n

如n=1时,埃尔米特插值多项式H3(x) xxxx xxxxH(x)f(x)12 1f(x)12 0 x x x x 1 1 0 0xx xx f(x)(xx) 1f(x)(xx) H9(H9(x)yyf(x)yH9(x)

例1yfx)

i(i0,1,

012f(xi123f(xi-01 H5(x)f(xi)i(x)f(xi)i(i i2(x)[12(xx) ]l2(x)i ikki

xixk (x)(xx)l2

i0,1,(x)[12(x 0 0 1(13x)(x1)2(x2)2(x)[12(x

1x2(x

1 1 (x)[12(x

2 2 1(73x)x2(x4(x)(x0)l2(x)1x(x1)2(x (x)(x1)l2(x)(x1)x2(x (x)(x2)l2(x)1(x2)x2(x H5(x)f(xi)i(x)f(xi)i(i i1x25x25x31x41442二、导数值不完全的Hermite f(x)y,i 和f'(x)

H3

)

,i

和Hx f(x)y,i f'(x)y' f''(x) H(x)y

(x)y

H'(x)y'

H''(x)

f i 第1步:由3个函数值f0,f1,f2,构造二次插值多项式P2(x)N2(x)f(x0)f[x0,x1](xx0)f[x0,x1,x2](xx0)(x02xx(x1)x2 H3(x)N2(x)(xx0)(xx1)(xx2其中λ为待定常量.显然有H3(xi)=f(xi),i=0,1,2.H'(x)f'(x) H'(x)2x1(3x

来确定6x

H'(x

温馨提示

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

评论

0/150

提交评论