File tree Expand file tree Collapse file tree 5 files changed +75
-17
lines changed
Expand file tree Collapse file tree 5 files changed +75
-17
lines changed Original file line number Diff line number Diff line change 44
55### 一阶两点公式
66
7- ::: tip 给定两个等距节点,求节点处的一阶导数
8- :::
7+ 给定两个等距节点,求节点处的一阶导数:
98
109$$
1110f'(x_0)\approx \frac{f(x_1)-f(x_0)}{h}
1716
1817## 一阶三点公式
1918
20- ::: tip 给定三个等距节点,求节点处的一阶导数
21- :::
19+ 给定三个等距节点,求节点处的一阶导数:
2220
2321$$
2422f'(x_0)\approx \frac{-3f(x_0)+4f(x_1)-f(x_2)}{2h}
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ JGS 迭代法的改进之处在于,它在每次迭代中每解一个方程,
5757
5858 > [ !WARNING] 注意
5959 > 此处的 $L$ 和 $U$ 与 [ 矩阵的 LU 分解] ( ../4%20矩阵的%20LU%20分解/index.html ) 中的 $L$ 和 $U$ 不同!
60- > :::
6160
6261- 常数向量 $\boldsymbol{b}$:
6362 $$
Original file line number Diff line number Diff line change 1+ # Lagrange 插值
2+
3+ ## 插值函数
4+
5+ ** Lagrange 插值函数** :
6+
7+ $$ L(x)=y_0l_0(x)+y_1l_1(x)+y_2l_2(x)+\cdots+y_il_i(x)+\cdots+y_nl_n(x) $$
8+
9+ ** 其插值基函数** :
10+
11+ $$ l_i(x)=\prod_{j=0,j\neq i}^n\frac{x-x_j}{x_i-x_j} $$
12+
13+ ::: info 例题及其解析
14+
15+ > [ !INFO] 例
16+ > 已知 $f(0)=0$,$f(1)=1$,$f(4)=2$,建立 Lagrange 二次插值多项式,求 $f(2)$ 的近似值。
17+
18+ Lagrange 二次插值多项式:
19+
20+ $$ L_2(x)=f(0)l_0(x)+f(1)l_1(x)+f(4)l_2(x) $$
21+
22+ 其中,
23+
24+ $$ l_0(x)=\frac{x-x_1}{x_0-x_1}\cdot \frac{x-x_2}{x_0-x_2} $$
25+
26+ $$ l_1(x)=\frac{x-x_0}{x_1-x_0}\cdot \frac{x-x_2}{x_1-x_2} $$
27+
28+ $$ l_2(x)=\frac{x-x_0}{x_2-x_0}\cdot \frac{x-x_1}{x_2-x_1} $$
29+
30+ 代入整理化简:
31+
32+ $$ L_2(x)=-\frac{1}{6}x^2+\frac{7}{6}x $$
33+
34+ 所以
35+
36+ $$ f(2)\approx L_2(2)=1.6667 $$
37+ :::
38+
39+ ::: danger 注意
40+ 给定 $n+1$ 个互异节点,其不超过 $n$ 次的插值多项式** 存在且唯一** (无论哪种插值方法)。
41+ :::
42+
43+ ## 插值余项(误差)
44+
45+ $$ R_n(x)=f(x)-L(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\omega_{n+1}(x) $$
46+
47+ 其中,$f(x)$ 为原函数,
48+
49+ $L(x)$ 为 $[ a,b] $ 上 $f(x)$ 的 $n$ 次插值多项式函数,
50+
51+ $\xi$ 为 $[ a,b] $ 上的某个数,
52+
53+ $\omega_ {n+1}(x)=(x-x_0)(x-x_1)\cdots(x-x_n)$ 为 $n+1$ 次多项式。
54+
55+ ## 性质
56+
57+ 1 . 若这 $n$ 个插值节点** 符合一个不超过 $n$ 次的多项式** ,则 Lagrange 插值多项式 $L(x)$ ** 就是这个多项式本身** 。
58+ 2 . Lagrange 基函数具有** 单位分解特性** ,即:
59+ 对 $[ x_0,x_n] $ 间任一点 $x$,有 $\sum_ {i=1}^{n}l_i(x)=1$。
Original file line number Diff line number Diff line change 2929写为 $A\boldsymbol{x}=\boldsymbol{b}$ 形式:
3030
3131$$
32- \begin{bmatrix}
32+ \underset{A}{\ begin{bmatrix}
3333 1 & 19 & 19^2\\
3434 1 & 25 & 25^2\\
3535 1 & 31 & 31^2\\
3636 1 & 38 & 38^2\\
3737 1 & 44 & 44^2
38- \end{bmatrix}
39- \begin{bmatrix}
38+ \end{bmatrix}}
39+ \underset{\boldsymbol{x}}{\ begin{bmatrix}
4040 a_1\\
4141 a_2\\
4242 a_3
43- \end{bmatrix} =
44- \begin{bmatrix}
43+ \end{bmatrix}} =
44+ \underset{\boldsymbol{b}}{\ begin{bmatrix}
4545 19.0\\
4646 32.3\\
4747 49.0\\
4848 73.3\\
4949 97.8
50- \end{bmatrix}
50+ \end{bmatrix}}
5151$$
5252
5353称这个无解的方程组为** 矛盾方程组** 。
6161即
6262
6363$$
64- \begin{bmatrix}
64+ \underset{A^TA}{\ begin{bmatrix}
6565 5 & 157 & 5327\\
6666 157 & 5327 & 192331\\
6767 5327 & 192331 & 7277699
68- \end{bmatrix}
69- \begin{bmatrix}
68+ \end{bmatrix}}
69+ \underset{\boldsymbol{x}}{\ begin{bmatrix}
7070 a_1\\
7171 a_2\\
7272 a_3
73- \end{bmatrix} =
74- \begin{bmatrix}
73+ \end{bmatrix}} =
74+ \underset{\boldsymbol{A^Tb}}{\ begin{bmatrix}
7575 271.4\\
7676 9776.1\\
7777 369321.5
78- \end{bmatrix}
78+ \end{bmatrix}}
7979$$
8080
8181解出这个正规方程组的解 $\boldsymbol{x}=\begin{bmatrix} a_1\\ a_2\\ a_3 \end{bmatrix}$,即为答案。
Original file line number Diff line number Diff line change 2222
2323### 6 [ JGS 迭代法] ( 6%20JGS%20迭代法/index.html )
2424
25+ ### 7 [ Lagrange 插值] ( 7%20Lagrange%20插值/index.html )
26+
2527### 9 [ 曲线最小二乘拟合] ( 9%20曲线最小二乘拟合/index.html )
2628
2729### 10 [ 数值微分] ( 10%20数值微分/index.html )
You can’t perform that action at this time.
0 commit comments