# Halo

A magic place for coding

0%

## 追赶法求解矩阵

### 分解推导

$$\begin{bmatrix} b_1 & c_1 \ a_2 & b_2 & c_2 \ & \ddots & \ddots & \ddots & \ & & a_{n-1} & b_{n-1} & c_{n-1}\ & & & a_n & b_n \ \end{bmatrix} \begin{bmatrix} x_1 \ x_2 \ \vdots \ x_{n-1}\ x_n \ \end{bmatrix} = \begin{bmatrix} f_1 \ f_2 \ \vdots \ f_{n-1}\ f_n \ \end{bmatrix}$$，

① | $b_1$ | > | $c_1$ | > 0;
② | $b_i$ | ≥ | $a_i$ | + | $c_i$ |, $a_i$, $c_i$ ≠ 0, i = 2, 3, … , n-1;
③ | $b_n$ | > | $a_n$ | > 0.

$$\begin{bmatrix} b_1 & c_1 \ a_2 & b_2 & c_2 \ & \ddots & \ddots & \ddots & \ & & a_{n-1} & b_{n-1} & c_{n-1}\ & & & a_n & b_n \ \end{bmatrix} = \begin{bmatrix} α_1 \ r_2 & α_2 \ & \ddots & \ddots \ & & r_n & α_n\ \end{bmatrix} \begin{bmatrix} 1 & β1 \ & 1 & \ddots \ & & \ddots & β {n-1}\ & & & 1\ \end{bmatrix}$$

\left{ \begin{aligned} b_1 &=α_1,& c_1=α_1β1，\ a_i &=r_i,& b_i = r_iβ {i-1} + α_i, & i = 2,3,…,n,\ c_i & = α_iβ_i,& i = 2, 3,…,n-1 \end{aligned} \right.

$$α_i = b_i - a_iβ_i, i = 2,3,…,n;\ β_i = c_i / (b_i - a_iβ_i), i = 2,3,…,n-1.$$

### 追赶法公式

① **Ly = f
，求*y**; ②Ux = y*，求**x

（1）计算{$βi$}的递推公式
$$βi = c_1 / b_1,\ β_i = c_i / (b_i - a_iβ {i-1}), i = 2,3,…,n-1;$$
（2）解**Ly = f**
$$y_1 = f_1 / b_1,\ y_i = (f_i - a_iy {i-1}) / (b_i - a_iβ_{i-1}), i = 2,3,…,n;$$
（3）解**Ux = y**
$$x_n = y_n,\ x_i = y_i - βix{i+1}, i = n-1,n-2,…,2,1.$$

## 代码实现

#### 参考资料：

1.数值分析（第5版） 李庆扬，王能超，易大义

Welcome to my other publishing channels