数值分析(计算方法)期末复习知识点整理

发布时间:2023年12月29日

只针对自己复习用,有的知识不考的我就不写进来了。选择性参考:

如果有错误可以回复我,谢谢。因为我也是第一次学。只考计算题,因此无证明部分,能用·就行。

目录

1 误差

2 范数

3 差值

4 线性拟合-最小二乘法

5 线性方程组的数值解法

6 线性方程组的迭代解法

7 非线性方程的解法

8 数值微积分

9 常微分方程数值解


1 误差

绝对误差与绝对误差限

|e|=|x^*-x|\le \varepsilon,误差限的格式写成\frac{1}{2}\times 10^{-c},后面计算迭代以此判断是否达到终止条件。

相对误差和相对误差限同上,需要除以近似值或者精确值。

产生误差的原因:(1)原始误差(2)截断误差(3)舍入误差(4)模型误差

有效数字位数:当x的误差限为某以为的半个单位,则这一位到第一个非零位的位数称x的有效位数。

2 范数

对于向量

||X||_p\ =\ \left( \sum_{i=1}^n{|X_i|^p} \right) ^{\frac{1}{p}},1\le p\le +\infty

||X||_1=\sum_{i=1}^n{|x_i|}=|x_1|+|x_2|+|x_3|+\cdots +|x_n|

||X||_2\ =\ \sqrt{\sum_{i=1}^n{x_{i}^{2}}}=\sqrt{x_{1}^{2}+x_{2}^{2}+x_{3}^{2}+\cdots +x_{n}^{2}}

||X||_{\infty}=\underset{1\le i\le n}{\max}\left\{ |x_i| \right\} \ =\ \max \left\{ |x_1|,|x_2|,|x_3|,\cdots ,|x_n| \right\}

对于矩阵

||A||_1=\underset{1\le j\le n}{\max}\left\{ \sum_{i=1}^n{|a_{ij}|} \right\}列和范数(每一列分别求和,忽略符号,取最大值)

||A||_{\infty}=\underset{1\le i\le n}{\max}\left\{ \sum_{j=1}^n{|a_{ij}|} \right\}行和范数(每一行分别求和,忽略符号,取最大值)

||A||_2=\sqrt{\lambda _1},根号下的为矩阵A^{T}A矩阵的特征值,取取绝对值最大的那个。

谱半径

\rho \left( A \right) \ =\ \underset{i}{\max}\left\{ |\lambda _i| \right\},取取绝对值最大的那个特征值。A为矩阵。

3 插值

拉格朗日差值(Lagrange)

L_1\left( x \right) \ =\ \frac{\left( x-x_1 \right)}{\left( x_0-x_1 \right)}f\left( x_0 \right) +\frac{\left( x-x_0 \right)}{\left( x_1-x_0 \right)}f\left( x_1 \right)

L_2\left( x \right) \ =\ \frac{\left( x-x_1 \right)}{\left( x_0-x_1 \right)}\frac{\left( x-x_2 \right)}{\left( x_0-x_2 \right)}f\left( x_0 \right) +\frac{\left( x-x_0 \right)}{\left( x_1-x_0 \right)}\frac{\left( x-x_2 \right)}{\left( x_1-x_2 \right)}f\left( x_1 \right) +\frac{\left( x-x_0 \right)}{\left( x_2-x_0 \right)}\frac{\left( x-x_1 \right)}{\left( x_2-x_1 \right)}f\left( x_2 \right)

R_1=\frac{f^{''}\left( \xi \right)}{2!}\left( x-x_0 \right) \left( x-x_1 \right)

R_2=\frac{f^{'''}\left( \xi \right)}{3!}\left( x-x_0 \right) \left( x-x_1 \right) \left( x-x_2 \right)

对于n次插值

L_n\left( x \right) \ =\ \sum_{i=0}^n{l_i\left( x \right) f\left( x_i \right) ,l_i\left( x \right) =}\prod_{0\le j\le n,i\ne j}{\frac{\left( x-x_j \right)}{\left( x_i-x_j \right)}}

R_n\left( x \right) \ =\ \frac{f^{\left( n+1 \right)}\left( \xi \right)}{\left( n+1 \right) !}\left( x-x_0 \right) \cdots \left( x-x_n \right)

牛顿插值(Newton)

差商定义:

f\left[ x_0,x_1 \right] =\frac{f\left( x_1 \right) -f\left( x_0 \right)}{x_1-x_0}

f\left[ x_0,x_1,x_2 \right] =\frac{f\left[ x_1,x_2 \right] -f\left[ x_0,x_1 \right]}{x_2-x_0}

考试记得会画差商表

N_1\left( x \right) =f\left( x_0 \right) +\left( x-x_0 \right) f\left[ x_0,x_1 \right]

N_1\left( x \right) =f\left( x_0 \right) +\left( x-x_0 \right) f\left[ x_0,x_1 \right] +\left( x-x_0 \right) \left( x-x_1 \right) f\left[ x_0,x_1,x_2 \right]

R_n=f\left[ x,x_0,x_1,x_2,\cdots ,x_n \right] \prod_{i=0}^n{\left( x-x_i \right)}

差分:

向前向后:

\varDelta y_i=y_{i+1}-y_i

\nabla y_i=y_i-y_{i-1}

注意差分与差商的区别与联系

4 线性拟合-最小二乘法

线性拟合

解题步骤:

1.写出矛盾方程组,构建法方程A^TAx\ =\ A^Tb

写出那个解线性方程组的公式,用计算器算出来:

对于二阶(线性拟合)

\left( \begin{matrix} 1& \sum_{i=1}^n{x_i}\\ \sum_{i=1}^n{x_i}& \sum_{i=1}^n{x_{i}^{2}}\\ \end{matrix} \right) \left( \begin{array}{c} a\\ b\\ \end{array} \right) =\left( \begin{array}{c} \sum_{i=1}^n{y_i}\\ \sum_{i=1}^n{x_iy_i}\\ \end{array} \right)

三阶

\left( \begin{matrix} 1& \sum_{i=1}^n{x_i}& \sum_{i=1}^n{x_{i}^{2}}\\ \sum_{i=1}^n{x_i}& \sum_{i=1}^n{x_{i}^{2}}& \sum_{i=1}^n{x_{i}^{3}}\\ \sum_{i=1}^n{x_{i}^{2}}& \sum_{i=1}^n{x_{i}^{3}}& \sum_{i=1}^n{x_{i}^{4}}\\ \end{matrix} \right) \left( \begin{array}{c} a\\ b\\ c\\ \end{array} \right) =\left( \begin{array}{c} \sum_{i=1}^n{y_i}\\ \sum_{i=1}^n{x_iy_i}\\ \sum_{i=1}^n{x_{i}^{2}y_i}\\ \end{array} \right)

求解以上,可以使用平方根法,首先需要判断其顺序主子式都要大于0,(应为对称正定矩阵)如果不满足就用改进的平方根法求解。

5 线性方程组的数值解法

高斯(Gauss)/高斯列主元/高斯全主元(不解释)

高斯-若当求解(Gauss_Jordan):

矩阵分解:

A=LU(LU Factorization),L左下角,U右上角

DooLittle分解

\left( \begin{matrix} d& q& w& e\\ e& r& r& y\\ c& f& g& u\\ h& k& l& f\\ \end{matrix} \right) =\left( \begin{matrix} R& 0& 0& 0\\ R& R& 0& 0\\ R& R& R& 0\\ R& R& R& R\\ \end{matrix} \right) \left( \begin{matrix} 1& R& R& R\\ 0& 1& R& R\\ 0& 0& 1& R\\ 0& 0& 0& 1\\ \end{matrix} \right)

Crout分解?

\left( \begin{matrix} d& q& w& e\\ e& r& r& y\\ c& f& g& u\\ h& k& l& f\\ \end{matrix} \right) =\left( \begin{matrix} 1& 0& 0& 0\\ R& 1& 0& 0\\ R& R& 1& 0\\ R& R& R& 1\\ \end{matrix} \right) \left( \begin{matrix} R& R& R& R\\ 0& R& R& R\\ 0& 0& R& R\\ 0& 0& 0& R\\ \end{matrix} \right)

追赶法:三对角方程组,形如

\left( \begin{matrix} R& R& 0& 0\\ R& R& R& 0\\ 0& R& R& R\\ 0& 0& R& R\\ \end{matrix} \right)

求解Ly=f,Ux=y

Cholesky分解(乔列斯基)

平方根法,用于正定矩阵A=LL^T

1.先判断各阶的顺序主子式大于0;

2.A=LL转置,求解L

改进的平方根法,用于非正定矩阵A=LDL^T

6 线性方程组的迭代解法

简单迭代(Jacobi)

\left\{ \begin{array}{l} \begin{array}{c} x_{1}^{\left( k+1 \right)}\ =\frac{1}{a_{11}}\left( b_1-a_{12}x_{2}^{\left( k \right)}-\cdots -a_{1n}x_{n}^{\left( k \right)} \right)\\ x_{2}^{\left( k+1 \right)}\ =\frac{1}{a_{22}}\left( b_2-a_{21}x_{1}^{\left( k \right)}-\cdots -a_{2n}x_{n}^{\left( k \right)} \right)\\ \end{array}\\ \begin{array}{c} \vdots\\ x_{n}^{\left( k+1 \right)}\ =\frac{1}{a_{nn}}\left( b_n-a_{n1}x_{1}^{\left( k \right)}-\cdots -a_{n,n-1}x_{n-1}^{\left( k \right)} \right)\\ \end{array}\\ \end{array} \right.

Ax\ =\ \left( D+A-D \right) x\ =\ b

Dx\ =\ b\ +\ \left( D-A \right) x

X^{\left( k+1 \right)}=D^{-1}b+D^{-1}\left( D-A \right) X^{\left( k \right)}

g=D^{-1}b,R=D^{-1}\left( D-A \right)

高斯赛德尔迭代(Gauss-Seidel)

\left\{ \begin{array}{l} \begin{array}{c} x_{1}^{\left( k+1 \right)}\ =\frac{1}{a_{11}}\left( b_1-a_{12}x_{2}^{\left( k \right)}-\cdots -a_{1n}x_{n}^{\left( k \right)} \right)\\ x_{2}^{\left( k+1 \right)}\ =\frac{1}{a_{22}}\left( b_2-a_{21}x_{1}^{\left( k+1 \right)}-\cdots -a_{2n}x_{n}^{\left( k \right)} \right)\\ \end{array}\\ \begin{array}{c} \vdots\\ x_{n}^{\left( k+1 \right)}\ =\frac{1}{a_{nn}}\left( b_n-a_{n1}x_{1}^{\left( k+1 \right)}-\cdots -a_{n,n-1}x_{n-1}^{\left( k+1 \right)} \right)\\ \end{array}\\ \end{array} \right.

Ax=\left( D+L+U \right) x=b

\left( D+L \right) x+Ux=b

X^{\left( k+1 \right)}=-\left( D+L \right) ^{-1}UX^{\left( k \right)}+\left( D+L \right) ^{-1}b

看着迭代矩阵,计算其谱半径获取是否收敛

松弛迭代

\left\{ \begin{array}{l} \begin{array}{c} x_{1}^{\left( k+1 \right)}\ =\left( 1-\omega \right) x_{1}^{\left( k \right)}+\omega \frac{1}{a_{11}}\left( b_1-a_{12}x_{2}^{\left( k \right)}-\cdots -a_{1n}x_{n}^{\left( k \right)} \right)\\ x_{2}^{\left( k+1 \right)}\ =\left( 1-\omega \right) x_{2}^{\left( k \right)}+\frac{1}{a_{22}}\left( b_2-a_{21}x_{1}^{\left( k+1 \right)}-\cdots -a_{2n}x_{n}^{\left( k \right)} \right)\\ \end{array}\\ \begin{array}{c} \vdots\\ x_{n}^{\left( k+1 \right)}\ =\left( 1-\omega \right) x_{n}^{\left( k \right)}+\frac{1}{a_{nn}}\left( b_n-a_{n1}x_{1}^{\left( k+1 \right)}-\cdots -a_{n,n-1}x_{n-1}^{\left( k+1 \right)} \right)\\ \end{array}\\ \end{array} \right.

7 非线性方程的解法

二分法:计算次数:

在区间[a,b],\frac{b-a}{2^{k+1}}\le \varepsilon即可。

(暂时还没复习完,等复习完了补上)

8 数值微积分

矩形公式

\int_a^b{f\left( x \right) dx=\left( b-a \right) f\left( \frac{a+b}{2} \right)}(中)矩形公式

\int_a^b{f\left( x \right) dx=\left( b-a \right) f\left( b \right)}右矩形公式
\int_a^b{f\left( x \right) dx=\left( b-a \right) f\left( a \right)}左矩形公式

截断误差:R_n\left[ f \right] =\int_a^b{f\left( x \right) dx}-\sum_{i=1}^n{A_if\left( x_i \right)}

牛顿科特斯公式:A_i=\left( b-a \right) c_{i}^{\left( n \right)},c_{i}^{\left( n \right)}=c_{n-i}^{\left( n \right)},\sum_{i=1}^n{c_{i}^{\left( n \right)}=1}

I=\int_a^b{f\left( x \right) dx}\approx \left( b-a \right) \sum_{i=1}^n{c_{i}^{\left( n \right)}f\left( x_i \right)}

梯形公式:I=\int_a^b{f\left( x \right) dx}\approx \frac{\left( b-a \right)}{2}\left[ f\left( a \right) +f\left( b \right) \right]

辛普森-抛物公式:I=\int_a^b{f\left( x \right) dx}\approx \frac{b-a}{6}\left[ f\left( a \right) +4f\left( \frac{a+b}{2} \right) +f\left( b \right) \right]

龙贝格公式:待复习

9 常微分方程数值解

?欧拉公式基于数值微商:

y_{n+1}=y_n+hf\left( x_n,y\left( x_n \right) \right)

欧拉校正-预估公式:

\left\{ \begin{array}{l} \overset{-}{y_{n+1}}=y_n+f\left( x_n,y_n \right)\\ y_{n+1}=\frac{h}{2}\left[ f\left( x_n,y_n \right) +f\left( x_{n+1},\overset{-}{y}_{n+1} \right) \right]\\ \end{array} \right.

龙哥库塔2阶:??

\left\{ \begin{array}{c} y_{n+1}=y_n+hk_2\\ k_1=f\left( x_n,y_n \right)\\ k_2=f\left( x_{n+\frac{1}{2}},y_n+\frac{h}{2}k_1 \right)\\ \end{array} \right.

龙哥库塔3阶:

\left\{ \begin{array}{c} y_{n+1}=y_n+\frac{h}{6}\left( k_1+4k_2+k_3 \right)\\ k_1=f\left( x_n,y_n \right)\\ k_2=f\left( x_n+\frac{h}{2},y_n+\frac{h}{2}k_1 \right)\\ k_3=f\left( x_n+h,y_n+h\left( -k_1+2k_2 \right) \right)\\ \end{array} \right.

龙哥库塔4阶:

\left\{ \begin{array}{c} y_{n+1}=y_n+\frac{h}{6}\left( k_1+k_2+2k_3+k_4 \right)\\ k_1=f\left( x_n,y_n \right)\\ k_2=f\left( x_n+\frac{h}{2},y_n+\frac{h}{2}k_1 \right)\\ \begin{array}{c} k_3=f\left( x_n+\frac{h}{2},y_n+\frac{h}{2}k_2 \right)\\ k_4=f\left( x_n+h,y_n+hk_3 \right)\\ \end{array}\\ \end{array} \right.

学累了休息一下吧,吃碗美味的臊子面。元旦快乐!

文章来源:https://blog.csdn.net/weixin_46008839/article/details/135292150
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。