# Systems of Equations

# The LU Factorization

解方程Ax=bAx = b,将AA分解为LULU,LULU分别为lower triangular , upper triangular

Ax=bLUx=b \begin{align} Ax &= b \\ LUx &= b \\ \end{align}

然后解方程

Lc=bUx=c \begin{align} Lc &= b \\ Ux &= c \end{align}

先计算出cc然后计算xx

LU 分解步骤

A=[215444131],P=[100010001],L=[100010001][215444131]exchange rows 1 and 2[444215131],[100010001]exchange rows 1 and 2[010100001],L have no change[215444131]subtract12×row 1 from row 2[444215131],[100010001]exchange rows 1 and 2[010100001],L have no change \begin{align} & A = \begin{bmatrix} 2 & 1 & 5 \\ 4 & 4 & -4 \\ 1 & 3 & 1 \end{bmatrix} ,P = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} ,L = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \\\\ & \begin{bmatrix} 2 & 1 & 5 \\ 4 & 4 & -4 \\ 1 & 3 & 1 \end{bmatrix} \overset{\text{exchange rows 1 and 2}}{\longrightarrow} \begin{bmatrix} 4 & 4 & -4 \\ 2 & 1 & 5 \\ 1 & 3 & 1 \end{bmatrix} , \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \overset{\text{exchange rows 1 and 2}}{\longrightarrow} \begin{bmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} ,\text{L have no change} \\\\ & \begin{bmatrix} 2 & 1 & 5 \\ 4 & 4 & -4 \\ 1 & 3 & 1 \end{bmatrix} \overset{subtract \frac{1}{2}\times \text{row 1 from row 2}}{\longrightarrow} \begin{bmatrix} 4 & 4 & -4 \\ 2 & 1 & 5 \\ 1 & 3 & 1 \end{bmatrix} , \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \overset{\text{exchange rows 1 and 2}}{\longrightarrow} \begin{bmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} ,\text{L have no change} \end {align}

# Iterative methods

# Jacobi Method

D denote the main diagonal of A, L denote the lower triangle of A (entries below the main diagonal), and U denote the upper triangle (entries above the main diagonal)

Ax=b(D+L+U)x=bDx=b(L+U)xx=D1(b(L+U)x) \begin{align} Ax &= b \\ (D+L+U)x &= b\\ Dx &= b-(L+U)x \\ x &= D^{-1}(b-(L+U)x) \end{align}

Example:

[1134]=LU=[1031][1107][1031][c1c2]=[32]c1=3,c2=7[1107][x1x2]=[37]x1=2,x2=1 \begin{align} & \begin{bmatrix} 1 & 1 \\ 3 & -4 \end{bmatrix} = LU = \begin{bmatrix} 1 & 0 \\ 3 & 1 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 0 & -7 \end{bmatrix} \\\\ & \begin{bmatrix} 1 & 0 \\ 3 & 1 \end{bmatrix} \begin{bmatrix} c_1 \\ c_2 \end{bmatrix} = \begin{bmatrix} 3 \\ 2 \end{bmatrix} \\\\ & c_1 = 3 , c_2 = -7 \\\\ & \begin{bmatrix} 1 & 1 \\ 0 & -7 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 3 \\ -7 \end{bmatrix} \\\\ & x_1 = 2 , x_2 = 1 \end{align}

# Methods for symmetric positive-definite matrices

n×nn\times n matrix AA is symmetric if AT=AA^T = A.The matrix A is positive-definite if xTAx>0x^TAx>0 for all vectors x0x\ne 0