{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 222 "This Maple Worksheet demo nstrates how to use simple Maple commands to obtain different decompos itions. There's just one command--LUDecomposition--which will be used as the work-horse to obtain the required decompositions." }}{PARA 0 " " 0 "" {TEXT -1 24 "Remember to always type " }{TEXT 256 20 "with(Line arAlgebra):" }{TEXT -1 85 " and hit enter; this loads the appropriate \+ library required for matrix manipulations." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 20 "with(LinearAlgebra):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 124 "There are many ways to enter a matrix. One can use the \+ matrix or array commands; I find the one used below very convenient." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "A:=<<2,1,0,0>|<1,2,1,0>|< 0,1,2,1>|<0,0,1,2>>;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'RTABL EG6%\")%e-#=-%'MATRIXG6#7&7&\"\"#\"\"\"\"\"!F07&F/F.F/F07&F0F/F.F/7&F0 F0F/F.%'MatrixG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 144 "To find the L U Decomposition of A, enter the line below. This also saves the lower -triangular matrix as L and the upper-triangular matrix as U." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "(L,U):=LUDecomposition(A, ou tput=['L','U']);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>6$%\"LG%\"UG6$-%' RTABLEG6%\")??R?-%'MATRIXG6#7&7&\"\"\"\"\"!F2F27&#F1\"\"#F1F2F27&F2#F5 \"\"$F1F27&F2F2#F8\"\"%F1%'MatrixG-F)6%\")3#Ht\"-F-6#7&7&F5F1F2F27&F2# F8F5F1F27&F2F2#F;F8F17&F2F2F2#\"\"&F;F<" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "Check Maple's work by multiplying L and U to see if we ge t A." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "L.U;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6%\")cXx<-%'MATRIXG6#7&7&\"\"#\"\"\"\"\" !F.7&F-F,F-F.7&F.F-F,F-7&F.F.F-F,%'MatrixG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 245 "To find the LDU Decomposition, we need to express U as a diagonal matrix times an upper-triangular matrix. The only command a t our disposal is LUDecomposition, so we take the transpose of U, do L UDecomposition and then take the transpose again." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 17 "UT:=Transpose(U);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#UTG-%'RTABLEG6%\")_o)p\"-%'MATRIXG6#7&7&\"\"#\"\"!F/ F/7&\"\"\"#\"\"$F.F/F/7&F/F1#\"\"%F3F/7&F/F/F1#\"\"&F6%'MatrixG" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "(Diag,L1):=LUDecomposition(U T, output=['U','L']);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>6$%%DiagG%#L 1G6$-%'RTABLEG6%\"))=Q%=-%'MATRIXG6#7&7&\"\"#\"\"!F2F27&F2#\"\"$F1F2F2 7&F2F2#\"\"%F5F27&F2F2F2#\"\"&F8%'MatrixG-F)6%\")G " 0 "" {MPLTEXT 1 0 18 "U1:=Transpose(L1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#U1G-%'RTABLEG6%\")/Q$)=-%'MATRIXG6#7&7&\"\"\"#F.\"\"#\"\"!F17 &F1F.#F0\"\"$F17&F1F1F.#F4\"\"%7&F1F1F1F.%'MatrixG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Check Maple's work again by multiplying." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "L.Diag.U1;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6%\")g`$3#-%'MATRIXG6#7&7&\"\"#\"\"\"\"\"! F.7&F-F,F-F.7&F.F-F,F-7&F.F.F-F,%'MatrixG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 163 "Of course, in this case, we didn't need to do all of thi s because A is symmetric, so U1 is just the transpose of L. But in ge neral, the above steps are necessary." }}{PARA 0 "" 0 "" {TEXT -1 104 "Since A is also positive definite--the pivots are all positive--we ca n find it's Cholesky Decomposition." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "C1:=LUDecomposition(A, method=Cholesky);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#C1G-%'RTABLEG6%\")+y(4#-%'MATRIXG6#7&7&*$\" \"##\"\"\"F/\"\"!F2F27&,$*&F/!\"\"F/F0F1,$*&F/F6\"\"'F0F1F2F27&F2,$*& \"\"$F6F9F0F1,$*(F/F1F=F6F=F0F1F27&F2F2,$*&F/F6F=F0F1,$*&F/F6\"\"&F0F1 %'MatrixG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "C2:=Transpose( C1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#C2G-%'RTABLEG6%\")K$yw\"-%' MATRIXG6#7&7&*$\"\"##\"\"\"F/,$*&F/!\"\"F/F0F1\"\"!F57&F5,$*&F/F4\"\"' F0F1,$*&\"\"$F4F9F0F1F57&F5F5,$*(F/F1F " 0 "" {MPLTEXT 1 0 6 "C1.C2;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6%\"(sS(G-%'MATRI XG6#7&7&\"\"#\"\"\"\"\"!F.7&F-F,F-F.7&F.F-F,F-7&F.F.F-F,%'MatrixG" }}} }{MARK "1 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }{RTABLE_HANDLES 18202584 20392020 17329208 17774556 16986852 18438188 18581728 18833804 20835360 20977800 17678332 2874072 } {RTABLE M7R0 I5RTABLE_SAVE/18202584X,%)anythingG6"6"[gl!"%!!!#1"%"%""#"""""!F)F(F'F(F)F)F(F' F(F)F)F(F'F& } {RTABLE M7R0 I5RTABLE_SAVE/20392020X,%)anythingG6#&%+triangularG6#%&lowerG6"[gl!")!!!#+"%"%" ""#F+""#""!F.F+#F-""$F.F+#F0""%F+F* } {RTABLE M7R0 I5RTABLE_SAVE/17329208X,%)anythingG6"6"[gl!"%!!!#1"%"%""#""!F(F("""#""$F'F(F(F( F)#""%F+F(F(F(F)#""&F-F& } {RTABLE M7R0 I5RTABLE_SAVE/17774556X,%)anythingG6"6"[gl!"%!!!#1"%"%""#"""""!F)F(F'F(F)F)F(F' F(F)F)F(F'F& } {RTABLE M7R0 I5RTABLE_SAVE/16986852X,%)anythingG6"6"[gl!"%!!!#1"%"%""#"""""!F)F)#""$F'F(F)F) F)#""%F+F(F)F)F)#""&F-F& } {RTABLE M7R0 I5RTABLE_SAVE/18438188X,%)anythingG6"6"[gl!"%!!!#1"%"%""#""!F(F(F(#""$F'F(F(F(F (#""%F*F(F(F(F(#""&F,F& } {RTABLE M7R0 I5RTABLE_SAVE/18581728X,%)anythingG6#&%+triangularG6#%&lowerG6"[gl!")!!!#+"%"%" ""#F+""#""!F.F+#F-""$F.F+#F0""%F+F* } {RTABLE M7R0 I5RTABLE_SAVE/18833804X,%)anythingG6#&%+triangularG6#%&upperG6"[gl!"&!!!#+"%"%" ""#F+""#F+""!#F-""$F+F.F.#F0""%F+F* } {RTABLE M7R0 I5RTABLE_SAVE/20835360X,%)anythingG6"6"[gl!"%!!!#1"%"%""#"""""!F)F(F'F(F)F)F(F' F(F)F)F(F'F& } {RTABLE M7R0 I5RTABLE_SAVE/20977800X,%)anythingG6#&%+triangularG6#%&lowerG6"[gl!")!!!#+"%"%* $""##"""F,,$F+F-""!F0,$*$""'F-F-,$F2#F.""$F0,$*$F6F-#F,F6,$F8F-,$*$""&F-F-F* } {RTABLE M7R0 I5RTABLE_SAVE/17678332X,%)anythingG6#&%+triangularG6#%&upperG6"[gl!"&!!!#+"%"%* $""##"""F,,$F+F-,$*$""'F-F-""!,$F1#F.""$,$*$F6F-#F,F6F3F3,$F8F-,$*$""&F-F-F* } {RTABLE M7R0 I4RTABLE_SAVE/2874072X,%)anythingG6"6"[gl!"%!!!#1"%"%""#"""""!F)F(F'F(F)F)F(F'F (F)F)F(F'F& }