A.Kaw矩阵代数初步学习笔记 7. LU Decomposition
“矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授。
PDF格式学习笔记下载(Academia.edu)
第7章课程讲义下载(PDF)
Summary
- For a nonsingular matrix [A] on which one can always write it as [A]=[L][U] where [L] is a lower triangular matrix, [U] is a upper triangular matrix.
- Note that not all matrices have LU decomposition, such as [0220]. [0220]=[10a1][bc0d]⇒{b=0ab=2 which is contradiction.
- If one is solving a set of equations [A][X]=[B] then LUX=B ⇒L−1LUX=L−1B ⇒UX=L−1B=Y then we have {LY=BUX=Y So we can solve the first equation for [Y]by using forward substitution and then use the second equation to calculate the solution vector [X] by back substitution.
- For instance, solve the following set of equations: [12321−4152]⋅[xyz]=[14−817] Applying LU decomposition on the coefficient matrix,
- Firstly write down an identity matrix (the same size as the coefficient matrix) on the left and the coefficient matrix on the right. L←[100010001][12321−4152]→U
- Then applying elementary row operation on the right while simultaneously updating successive columns of the matrix on the left. For example, if we are doing R1+mR2 on the right then we will do C2−mC1 on the left. That is, we will keep the equivalent of the product. [100010001][12321−4152] ⇒{R2−2R1C1+2C2[100210001][1230−3−10152] ⇒{R3−R1C1+C3[100210101][1230−3−1003−1] ⇒{R3+R2C2−C3[1002101−11][1230−3−1000−11] Thus far, the right matrix is an upper triangular matrix (i.e. U) and the left one is a lower triangular matrix (i.e. L).
- Solving [L][Y]=[B], that is [1002101−11]⋅Y=[14−817]⇒Y=[14−36−33]
- Solving [U][X]=[Y], that is [1230−3−1000−11]⋅[xyz]=[14−36−33] ⇒{x=1y=2z=3
Selected Problems
1. Find the [L] and [U] matrices of the following matrix [25547571612.51222]
Solution: [100010001][25547571612.51222] ⇒{R2−3R1R3−12R1C1+3C2C1+12C3[1003101201][25540−8409.520] ⇒{R3+1916R2C2−1916C3[10031012−19161][25540−8400994] That is, L=[10031012−19161], U=[25540−8400994].
2. Using LU decomposition to solve: {4x1+x2−x3=−25x1+x2+2x3=46x1+x2+x3=6
Solution: [100010001][41−1512611] ⇒{R2−54R1R3−32R1C1+54C2C1+32C3[10054103201][41−10−141340−1252] ⇒{R3−2R2C2+2C3[10054103221][41−10−1413400−4] That is, L=[10054103221], U=[41−10−1413400−4]. Then we solve [L][Y]=[B], [10054103221]⋅Y=[−246]⇒Y=[−2132−4] Finally, we solve [U][X]=[Y], [41−10−1413400−4]⋅X=[−2132−4]⇒X=[3−131] Thus the solution is {x1=3x2=−13x3=1
3. Find the inverse of [A]=[3412−7−1815]
Solution:
To find the inverse of a matrix, actually it is to solve a set of equations: {AX1=[1,0,0]TAX2=[0,1,0]TAX3=[0,0,1]T Firstly, we will find the [L] and [U]. [100010001][3412−7−1815] ⇒{R2−23R1R3−83R1C1+23C2C1+83C3[10023108301][3410−293−530−29373] ⇒{R3−R2C2+C3[10023108311][3410−293−53004] That is, L=[10023108311], U=[3410−293−53004]. Then we solve [L][Y]=[I], note that there are three columns of [Y]: LY1=[10023108311]⋅Y1=[100]⇒Y1=[1,−23,−2]T LY2=[10023108311]⋅Y2=[010]⇒Y2=[0,1,−1]T LY3=[10023108311]⋅Y3=[001]⇒Y3=[0,0,1]T Finally we can solve [X] by [U][X]=[Y]: UX1=Y1⇒[3410−293−53004]⋅X1=[1−23−2]⇒X1=[1758,958,−12]T UX2=Y2⇒[3410−293−53004]⋅X2=[01−1]⇒X2=[19116,−7116,−14]T UX3=Y3⇒[3410−293−53004]⋅X3=[001]⇒X3=[−3116,−5116,14]T Thus the inverse of the original matrix is [A]−1=[175819116−3116958−7116−5116−12−1414]
作者:赵胤
出处:http://www.cnblogs.com/zhaoyin/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(三):用.NET IoT库
· 【非技术】说说2024年我都干了些啥