矩阵的因子分解3-LU分解和LDU分解
矩阵的因子分解3-LU分解和LDU分解
求法归纳
- 初始化 U U U 和 L L L
- 按列依次化为阶梯形
- 得到结果
例 对 U = ( 2 1 − 5 1 1 − 3 0 − 6 0 2 − 1 2 1 4 − 7 6 ) U = \begin{pmatrix}2 & 1 & -5 & 1 \\1 & -3 & 0 & -6 \\0 & 2 & -1 & 2 \\1 & 4 & -7 & 6 \end{pmatrix} U= 21011−324−50−1−71−626 进行LU和LDU分解
1. 初始化 U U U 和 L L L
U = ( 2 1 − 5 1 1 − 3 0 − 6 0 2 − 1 2 1 4 − 7 6 ) L = ( 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ) U = \begin{pmatrix} 2 & 1 & -5 & 1 \\ 1 & -3 & 0 & -6 \\ 0 & 2 & -1 & 2 \\ 1 & 4 & -7 & 6 \end{pmatrix} L = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} U= 21011−324−50−1−71−626 L= 1000010000100001
处理第一列
- 更新 U U U:第一列化为阶梯形
- 更新
L
L
L:主元
U
11
=
2
U_{11} = 2
U11=2,计算乘数:
L 21 = 1 2 , L 31 = 0 2 = 0 , L 41 = 1 2 L_{21} = \frac{1}{2}, \quad L_{31} = \frac{0}{2} = 0, \quad L_{41} = \frac{1}{2} L21=21,L31=20=0,L41=21
→ ( 2 1 − 5 1 0 − 7 2 5 2 − 13 2 0 2 − 1 2 0 7 2 − 9 2 11 2 ) L = ( 1 0 0 0 1 2 1 0 0 0 0 1 0 1 2 0 0 1 ) \rightarrow \begin{pmatrix} 2 & 1 & -5 & 1 \\ 0 & -\frac{7}{2} & \frac{5}{2} & -\frac{13}{2} \\ 0 & 2 & -1 & 2 \\ 0 & \frac{7}{2} & -\frac{9}{2} & \frac{11}{2} \\ \end{pmatrix} L = \begin{pmatrix} 1 & 0 & 0 & 0 \\ \frac{1}{2} & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ \frac{1}{2} & 0 & 0 & 1 \end{pmatrix} → 20001−27227−525−1−291−2132211 L= 121021010000100001
处理第二列
- 更新 U U U:第二列化为阶梯形
- 更新
L
L
L:主元
U
22
=
−
7
2
U_{22} = -\frac{7}{2}
U22=−27,计算乘数:
L 23 = − 4 7 , L 24 = − 1 L_{23} = -\frac{4}{7}, \quad L_{24} = -1 L23=−74,L24=−1
→ ( 2 1 − 5 1 0 − 7 2 5 2 − 13 2 0 0 3 7 − 12 7 0 0 − 2 − 1 ) L = ( 1 0 0 0 1 2 1 0 0 0 − 4 7 1 0 1 2 − 1 0 1 ) \rightarrow \begin{pmatrix} 2 & 1 & -5 & 1 \\ 0 & -\frac{7}{2} & \frac{5}{2} & -\frac{13}{2} \\ 0 & 0 & \frac{3}{7} & -\frac{12}{7} \\ 0 & 0 & -2 & -1 \end{pmatrix} L = \begin{pmatrix} 1 & 0 & 0 & 0 \\ \frac{1}{2} & 1 & 0 & 0 \\ 0 & -\frac{4}{7} & 1 & 0 \\ \frac{1}{2} & -1 & 0 & 1 \end{pmatrix} → 20001−2700−52573−21−213−712−1 L= 12102101−74−100100001
处理第三列
- 更新 U U U:第三列化为阶梯形
- 更新
L
L
L:主元
U
33
=
3
7
U_{33} = \frac{3}{7}
U33=73,计算乘数:
L 34 = − 14 3 L_{34} = -\frac{14}{3} L34=−314
→ ( 2 1 − 5 1 0 − 7 2 5 2 − 13 2 0 0 3 7 − 12 7 0 0 0 − 9 ) L = ( 1 0 0 0 1 2 1 0 0 0 − 4 7 1 0 1 2 − 1 − 14 3 1 ) \rightarrow \begin{pmatrix} 2 & 1 & -5 & 1 \\ 0 & -\frac{7}{2} & \frac{5}{2} & -\frac{13}{2} \\ 0 & 0 & \frac{3}{7} & -\frac{12}{7} \\ 0 & 0 & 0 & -9 \end{pmatrix} L = \begin{pmatrix} 1 & 0 & 0 & 0 \\ \frac{1}{2} & 1 & 0 & 0 \\ 0 & -\frac{4}{7} & 1 & 0 \\ \frac{1}{2} & -1 & -\frac{14}{3} & 1 \end{pmatrix} → 20001−2700−5257301−213−712−9 L= 12102101−74−1001−3140001
结果
L
=
(
1
0
0
0
1
2
1
0
0
0
−
4
7
1
0
1
2
−
1
−
14
3
1
)
U
=
(
2
1
−
5
1
0
−
7
2
5
2
−
13
2
0
0
3
7
−
12
7
0
0
0
−
9
)
L = \begin{pmatrix} 1 & 0 & 0 & 0 \\ \frac{1}{2} & 1 & 0 & 0 \\ 0 & -\frac{4}{7} & 1 & 0 \\ \frac{1}{2} & -1 & -\frac{14}{3} & 1 \end{pmatrix} U=\begin{pmatrix} 2 & 1 & -5 & 1 \\ 0 & -\frac{7}{2} & \frac{5}{2} & -\frac{13}{2} \\ 0 & 0 & \frac{3}{7} & -\frac{12}{7} \\ 0 & 0 & 0 & -9 \end{pmatrix}
L=
12102101−74−1001−3140001
U=
20001−2700−5257301−213−712−9
A
=
L
U
=
(
1
0
0
0
1
2
1
0
0
0
−
4
7
1
0
1
2
−
1
−
14
3
1
)
(
2
1
−
5
1
0
−
7
2
5
2
−
13
2
0
0
3
7
−
12
7
0
0
0
−
9
)
A=LU=\begin{pmatrix} 1 & 0 & 0 & 0 \\ \frac{1}{2} & 1 & 0 & 0 \\ 0 & -\frac{4}{7} & 1 & 0 \\ \frac{1}{2} & -1 & -\frac{14}{3} & 1 \end{pmatrix} \begin{pmatrix} 2 & 1 & -5 & 1 \\ 0 & -\frac{7}{2} & \frac{5}{2} & -\frac{13}{2} \\ 0 & 0 & \frac{3}{7} & -\frac{12}{7} \\ 0 & 0 & 0 & -9 \end{pmatrix}
A=LU=
12102101−74−1001−3140001
20001−2700−5257301−213−712−9
L = ( 1 0 0 0 1 2 1 0 0 0 − 4 7 1 0 1 2 − 1 − 14 3 1 ) , D = ( 2 0 0 0 0 − 7 2 0 0 0 0 3 7 0 0 0 0 − 9 ) , U ′ = ( 1 1 2 − 5 2 1 2 0 1 − 5 7 13 7 0 0 1 − 4 0 0 0 1 ) L = \begin{pmatrix} 1 & 0 & 0 & 0 \\ \frac{1}{2} & 1 & 0 & 0 \\ 0 & -\frac{4}{7} & 1 & 0 \\ \frac{1}{2} & -1 & -\frac{14}{3} & 1 \end{pmatrix}, \quad D = \begin{pmatrix} 2 & 0 & 0 & 0 \\ 0 & -\frac{7}{2} & 0 & 0 \\ 0 & 0 & \frac{3}{7} & 0 \\ 0 & 0 & 0 & -9 \end{pmatrix}, \quad \\ U' = \begin{pmatrix} 1 & \frac{1}{2} & -\frac{5}{2} & \frac{1}{2} \\ 0 & 1 & -\frac{5}{7} & \frac{13}{7} \\ 0 & 0 & 1 & -4 \\ 0 & 0 & 0 & 1 \end{pmatrix} L= 12102101−74−1001−3140001 ,D= 20000−270000730000−9 ,U′= 100021100−25−751021713−41
A = L D U ′ A=LDU' A=LDU′