数值分析 周维祺
给定(x0,y0),…,(xn,yn)(x_0,y_0),\ldots,(x_n,y_n)(x0,y0),…,(xn,yn)
设f(x)f(x)f(x)是以上数据的nnn次插值多项式,并增加数据(xn+1,yn+1)(x_{n+1},y_{n+1})(xn+1,yn+1)
取g(x)=f(x)+yn+1−f(xn+1)(xn+1−x0)…(xn+1−xn)(x−x0)…(x−xn)g(x)=f(x)+\frac{y_{n+1}-f(x_{n+1})}{(x_{n+1}-x_0)\ldots(x_{n+1}-x_n)}(x-x_0)\ldots(x-x_n)g(x)=f(x)+(xn+1−x0)…(xn+1−xn)yn+1−f(xn+1)(x−x0)…(x−xn)
g(x)g(x)g(x)是(x0,y0),…,(xn+1,yn+1)(x_0,y_0),\ldots,(x_{n+1},y_{n+1})(x0,y0),…,(xn+1,yn+1)的插值多项式(思考:为什么)
令pk(x)=(x−x0)…(x−xk−1)p_k(x)=(x-x_0)\ldots(x-x_{k-1})pk(x)=(x−x0)…(x−xk−1)
牛顿插值多项式具有如下形式 fn(x)=a0+a1p1(x)+…+anpn(x)f_n(x)=a_0+a_1p_1(x)+\ldots+a_np_n(x)fn(x)=a0+a1p1(x)+…+anpn(x)
ak=(yk−fk−1(xk))/pk(xk)a_k=\left(y_k-f_{k-1}(x_k)\right)/p_k(x_k)ak=(yk−fk−1(xk))/pk(xk)
(思考:为什么)
给定(x0,y0),…,(xn,yn)(x_0,y_0),\ldots,(x_n,y_n)(x0,y0),…,(xn,yn),且x0<…<xnx_0<\ldots<x_nx0<…<xn
令f[xk]=ykf[x_k]=y_kf[xk]=yk
f[xj,…,xj+k]=f[xj+1,…,xj+k]−f[xj,…,xj+k−1]xj+k−xjf[x_j,\ldots,x_{j+k}]=\frac{f[x_{j+1},\ldots,x_{j+k}]-f[x_j,\ldots,x_{j+k-1}]}{x_{j+k}-x_j}f[xj,…,xj+k]=xj+k−xjf[xj+1,…,xj+k]−f[xj,…,xj+k−1]
递归计算
fn(x)=f[x0]+f[x0,x1]p1(x)+…+f[x0,…,xn]pn(x)f_n(x)=f[x_0]+f[x_0,x_1]p_1(x)+\ldots+f[x_0,\ldots,x_n]p_n(x) fn(x)=f[x0]+f[x0,x1]p1(x)+…+f[x0,…,xn]pn(x)
一般用如下三角形逐行计算: f[x0]f[x_0]f[x0] f[x1]\quad \quad\quad \quad f[x_1]f[x1] f[x2]\quad \quad \quad f[x_2]f[x2] f[x0,x1]f[x_0,x_1]f[x0,x1] f[x1,x2]\quad\quad \; f[x_1,x_2]f[x1,x2] f[x0,x1,x2]f[x_0,x_1,x_2]f[x0,x1,x2]
例如: f[x0,x1,x2]=(f[x1,x2]−f[x0,x1])/(x2−x0)f[x_0,x_1,x_2]=(f[x_1,x_2]-f[x_0,x_1])/(x_2-x_0)f[x0,x1,x2]=(f[x1,x2]−f[x0,x1])/(x2−x0)
本单元格的值=(上一行右侧的值减去正上方的值)/两端节点之差
x:0,1,2x: 0,1,2x:0,1,2 y:1,4,3y:1,4,3y:1,4,3
f[x0]=1f[x_0]=1f[x0]=1, f[x1]=4\quad f[x_1]=4f[x1]=4, f[x2]=3\quad f[x_2]=3f[x2]=3
f[x0,x1]=f[x1]−f[x0]x1−x0=3f[x_0,x_1]=\frac{f[x_1]-f[x_0]}{x_1-x_0}=3f[x0,x1]=x1−x0f[x1]−f[x0]=3, f[x1,x2]=f[x2]−f[x1]x2−x1=−1\quad f[x_1,x_2]=\frac{f[x_2]-f[x_1]}{x_2-x_1}=-1f[x1,x2]=x2−x1f[x2]−f[x1]=−1
f[x0,x1,x2]=f[x1,x2]−f[x0,x1]x2−x0=−2f[x_0,x_1,x_2]=\frac{f[x_1,x_2]-f[x_0,x_1]}{x_2-x_0}=-2f[x0,x1,x2]=x2−x0f[x1,x2]−f[x0,x1]=−2
现增加一条数据(3,4)(3,4)(3,4),即 x:0,1,2,3x: 0,1,2,3x:0,1,2,3 y:1,4,3,4y:1,4,3,4y:1,4,3,4 f[x0]=1f[x_0]=1f[x0]=1 f[x1]=4\quad \quad\quad \quad\quad f[x_1]=4f[x1]=4 f[x2]=3\quad \quad \quad f[x_2]=3f[x2]=3 f[x0,x1]=3f[x_0,x_1]=3f[x0,x1]=3 f[x1,x2]=−1\quad\quad\quad \; f[x_1,x_2]=-1f[x1,x2]=−1 f[x0,x1,x2]=−2f[x_0,x_1,x_2]=-2f[x0,x1,x2]=−2
求均差f[x0,x1,x2,x3]f[x_0,x_1,x_2,x_3]f[x0,x1,x2,x3],并写出对应的牛顿插值多项式
引入牛顿插值的动机
牛顿插值多项式与拉格朗日插值多项式相同
定义和公式
均差的计算(重点!)