Week 4 Lecture Slides PDF
Week 4 Lecture Slides PDF
Week 4 Lecture Slides PDF
equations
1 3 5
! = 3 2 4 Symmetric matrix #-. = #.-
5 4 6
#$$ 0 0
! = 0 #%% 0 Diagonal matrix
0 0 #&&
Mathematical Background
1 0 0
! = 0 1 0 Identity matrix
0 0 1
%&& 0 0
! = %'& %'' 0 Lower triangular matrix
%(& %(' %((
Mathematical Background
! + # = %&' + (&' Addition of two matrices
! + # = # + [!] Commutative
( ! + # ) + - = [!] + ( # + - ) Associative
# $ [!] = # ( $ ! ) Associative
# $ + ! = # $ + # [!] Distributive
"#
1 )** −)#*
[!] = Matrix inversion
)## )** − )#* )*# −)*# )##
! " = $
0.3 0.52 1
! = 0.5 1 1.9 = −0.0022
0.1 0.3 0.5
Example
Now, we can calculate !" , !# and !$
+ + +
!%% #% + !%& #& + ⋯ + !%( #( = *%+
++ ++
!&& #& + ⋯ + !&( #( = *&++
…
((-") ((-")
!(( #( = *(
Back substitution
Now that we have eliminated the unknowns, we begin back
substituting by starting from the last equation.
("$%)
("$%) ("$%) )"
!"" '" = )" '" = ("$%)
!""
10.012 !) = 70.0843
System reduced to upper triangular form
3"# − 0.1"( − 0.2"* = 7.85
7.00333"( − 0.293333"* = −19.5617
10.012 "* = 70.0843
23 = 4
25 = −5. 6
27 = 3
Pitfalls of elimination methods
Division by zero. The primary reason we called the previous
method “naïve” Gaussian is that during the elimination and back-
substituting, it is possible that a division by zero occur.
! {* + − - }= / + − 0
1 2 = [4]
1 6 = {7}
Steps in LU decomposition
Example
Solve the same set of equations, as in previous example, with an
LU decomposition based on the Gauss elimination.
0.1
!"# = = 0.03333
3
1 0 0
0.3 ) = 0.03333 1 0
!-# = = 0.1
3 0.1 −0.02713 1
−0.19
!-" = = −0.02713
7.00333
Example
Recall the system of equations can be written as
3 −0.1 −0.2 () 7.85
0.1 7 −0.3 (* = −19.3
0.3 −0.2 10 (+ 71.4
1 0 0 6) 7.85
0.03333 1 0 6* = −19.3
0.1 −0.02713 1 6+ 71.4 7. 89
2 = −:;. 9<:7
7=. =8>?
Example
Now that we have ! , we can write " # − ! = 0
56 8
# = 57 = −7. 9
58 :. ;;;;8
Matrix inversion
Recall matrix inverse ["]$% " "$% = ["]$% " = '
3 −0.1 −0.2 62 1
( ) = {$} 0 7.00333 −0.293333 63 = −0.03333
0 0 10.012 64 −0.1009
0.33249 0 0
This gives us the first
[7]82 = −0.00518 0 0
column of [7]82
−0.01008 0 0
Example: step 2
0 1 0 0 12 0
["] $ = 1 0.03333 1 0 13 = 1
0 0.1 −0.02713 1 14 0
3 −0.1 −0.2 62 12
( ) = {$} 0 7.00333 −0.293333 63 = 13
0 0 10.012 64 14
0.33249 0.004944 0
This gives us the second
[7]82 = −0.00518 0.142903 0
column of [7]82
−0.01008 0.00271 0
Example: step 3
0 1 0 0 12 0
["] $ = 0 0.03333 1 0 13 = 0
1 0.1 −0.02713 1 14 1
3 −0.1 −0.2 62 12
( ) = {$} 0 7.00333 −0.293333 63 = 13
0 0 10.012 64 14