Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Recall:InGausseliminationmethodtheforwardelimination
stepofcomprisesthebulkofthecomputationaleffort.
NumericalMethodsAppliedtoMechatronics
Dr.JorgeA.Olrtegui Yume,Ph.D.
Example:Forthesystem
LUFACTORIZATION
a11
a
21
a31
a12
a22
a32
a13 x1 b1
a23 x2 b2
a33 x3 b3
Ax b
PROBLEM:
Lecture No9
LUFactorization
LUFACTORIZATION
ToavoidthePROBLEM letsdo somematrixmanipulation
Ax b
canmodify
this eqn.to
give:
U x d
Assumeanlower
triangular matrix
existssuchthat
where:
L :
Lower triangular
LUFactorization
Ax b 0
u11 u12
where: 0 u22
0
0
u13 x1 d1
u23 x2 d 2
u33 x3 d 3
LUFACTORIZATION
LU x d Ax b
U :
Upper triangular
Inexplicit form
1 0
l
21 1
l31 l32
0 u11 u12
0 0 u22
1 0
0
u13 x1 1 0
u23 x2 l21 1
u33 x3 l31 l32
0 d1 a11
0 d 2 a21
1 d 3 a31
1 0
l
21 1
l31 l32
0
0
1
3
LU A
Ld b
LU x Ld Ax b
LU x d Ax b
1 0
L l21 1
l31 l32
Then:
LUFactorization
a12
a22
a32
a13 x1 b1
a23 x2 b2
a33 x3 b3
0 u11 u12
0 0 u22
1 0
0
u13 a11
u23 a21
u33 a31
1 0
l
21 1
l31 l32
0 d1 b1
0 d 2 b2
1 d 3 b3
a12
a22
a32
a13
a23
a33
LUFACTORIZATION
LU factorizationmethodsseparatethetime
consumingeliminationofthematrix[A]fromthe
manipulationsoftherighthandside[b].
Once[A]hasbeenfactored(ordecomposed),
multiplerighthandsidevectors[b]canbe
evaluatedinanefficientmanner.
LU A
Ld b
5
LU factorizationinvolves2steps:
Decompose[A]matrixintoa
productof[L]and[U].
LU A
Substitutiontosolvefor{x}
Forward(Findd)
Ld b
Backward(Findx)
U x d
U x d
LUFactorization
LUFACTORIZATION
GausseliminationcanbeimplementedusingLU factorization
Dr. Jorge A. Olortegui Yume, Ph.D.
LUFactorization
LUFACTORIZATION
Using MATLAB
Tosolve[A]{x}={b},firstdecompose[A]toget
[L][U]{x}={b}
Setupandsolve[L]{d}={b},where{d}canbefound
usingforward substitution.
Setupandsolve[U]{x}={d},where{x}canbefound
usingbackward substitution.
InMATLAB:
[L, U] = lu(A)
d = L\b
x = U\d
LUFactorization
LUFACTORIZATION
Example:Solve the following system using LU
decomposition inMATLAB.
LUFactorization
LUFACTORIZATION
LUFACTORIZATION
Cholesky Factorization
Example:
Oneofthemostpopulartechniquestosolvesymmetric
systems.
Basedon[A]=[U]T[U]
TherestoftheprocessissimilartoLU decomposition
andGausselimination,exceptonlyonematrix,[U],
needstobestored.
LUFactorization
LUFactorization
LUFACTORIZATION
Cholesky Factorization
10
LUFACTORIZATION
LUFACTORIZATION
Example:
LUFactorization
11
LUFactorization
12
LUFACTORIZATION
LUFACTORIZATION
MATLABleft division operator (\)
Using MATLAB
It examinesthesystemtoseewhichmethodwillmost
efficientlysolvetheproblem.
MATLABcanperformaCholesky factorizationwiththe
builtinchol command:
U = chol(A)
LUFactorization
13
LUFACTORIZATION
THEEIGENVALUEPROBLEM
LUFactorization
15
Includestrying:
bandedsolvers
backandforwardsubstitutions
Cholesky factorizationforsymmetricsystems.
Ifthesedonotworkandthesystemissquare,Gauss
eliminationwithpartialpivotingisused.
LUFactorization
14
LUFACTORIZATION
THEEIGENVALUEPROBLEM
LUFactorization
16
LUFACTORIZATION
Example:Aboxweighing 13Mg
contains apiece ofequipment
andis held by three cranes
whose cablesareconnected at
ringDasshown.Determinethe
tensions incablesDA,DB,DC
LUFACTORIZATION
Solucin
1. By hand
2. Numerically
(Note:Solve with LU
factorization using GaussPartial
pivoting andverify with lu
and/)
LUFactorization
17
LUFACTORIZATION
Example:Perform the analysis ofthe vibrational properties for the
free,undamped 3degree offreedom system.That is:
1. determinethe equations ofmotion,naturalfrequencies,
normalmode shapes andresponseby hand
2. Write amatlab program to calculate the naturalfrequencies
3. Write amatlab program to calculate the mode shapes
4. Verify using eigmatlab function
m=1kg
k=100N/m
LUFactorization
LUFactorization
18
LUFACTORIZATION
Example:Determinethecurrentin eachbranchofthecircuitshown
Forthedatainthenextslide
19
LUFactorization
20
Solution:
LUFACTORIZATION
k
(Index)
Ek
(Volts)
rk
( )
Rk
( )
12
0.1
25
10
0.5
40
16
12
0.5
20
24
0.2
20
LUFactorization
21