# 插值

（重定向自內插法

1. ${\displaystyle x_{1}=1}$${\displaystyle y_{1}=2}$
2. ${\displaystyle x_{2}=2}$${\displaystyle y_{2}=3}$
3. ${\displaystyle x_{3}=4}$${\displaystyle y_{3}=6}$

${\displaystyle x=3}$时的y值。

## 定义

${\displaystyle f(x)}$为定义在区间${\displaystyle [a,b]}$上的函数。${\displaystyle x_{1},x_{2},x_{3}...x_{n}}$${\displaystyle [a,b]}$上n个互不相同的点，${\displaystyle G}$为给定的某一函数类。若${\displaystyle G}$上有函数${\displaystyle g(x)}$满足：

 ${\displaystyle g(x_{i})=f(x_{i}),k=1,2,...n}$


## 示例

 ${\displaystyle x}$ ${\displaystyle f(x)}$ 0 0 1 0 . 8415 2 0 . 9093 3 0 . 1411 4 −0 . 7568 5 −0 . 9589 6 −0 . 2794

## 方法

### 线性插值

${\displaystyle y=y_{a}+\left(y_{b}-y_{a}\right){\frac {x-x_{a}}{x_{b}-x_{a}}}{\text{ 在 點 }}\left(x,y\right)}$

${\displaystyle {\frac {y-y_{a}}{y_{b}-y_{a}}}={\frac {x-x_{a}}{x_{b}-x_{a}}}}$

${\displaystyle {\frac {y-y_{a}}{x-x_{a}}}={\frac {y_{b}-y_{a}}{x_{b}-x_{a}}}}$

${\displaystyle |f(x)-g(x)|\leq C(x_{b}-x_{a})^{2}\quad {\text{where}}\quad C={\frac {1}{8}}\max _{r\in [x_{a},x_{b}]}|g''(r)|.}$

### 多项式插值

${\displaystyle f(x)=-0.0001521x^{6}-0.003130x^{5}+0.07321x^{4}-0.3577x^{3}+0.2255x^{2}+0.9038x.}$

### 样条曲线插值

${\displaystyle f(x)={\begin{cases}-0.1522x^{3}+0.9937x,&{\text{if }}x\in [0,1],\\-0.01258x^{3}-0.4189x^{2}+1.4126x-0.1396,&{\text{if }}x\in [1,2],\\0.1403x^{3}-1.3359x^{2}+3.2467x-1.3623,&{\text{if }}x\in [2,3],\\0.1579x^{3}-1.4945x^{2}+3.7225x-1.8381,&{\text{if }}x\in [3,4],\\0.05375x^{3}-0.2450x^{2}-1.2756x+4.8259,&{\text{if }}x\in [4,5],\\-0.1871x^{3}+3.3673x^{2}-19.3370x+34.9282,&{\text{if }}x\in [5,6].\end{cases}}}$

## 参考文献

1. ^ 《数学手册》编写组，《数学手册》，高等教育出版社，1979年