Sei sulla pagina 1di 6

LUFACTORIZATION

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:

b modified in the process


for a different b

Lecture No9

process needs to be repeated

Mechatronics Engineering School


NacionalUniversity ofTrujillo

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

Dr. Jorge A. Olortegui Yume, Ph.D.

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:

Dr. Jorge A. Olortegui Yume, Ph.D.

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

Dr. Jorge A. Olortegui Yume, Ph.D.

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

Dr. Jorge A. Olortegui Yume, Ph.D.

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFACTORIZATION
Example:Solve the following system using LU
decomposition inMATLAB.

LUFactorization

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFACTORIZATION

LUFACTORIZATION
Cholesky Factorization

Example:

Oneofthemostpopulartechniquestosolvesymmetric
systems.
Basedon[A]=[U]T[U]
TherestoftheprocessissimilartoLU decomposition
andGausselimination,exceptonlyonematrix,[U],
needstobestored.

LUFactorization

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFactorization

LUFACTORIZATION
Cholesky Factorization

10

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFACTORIZATION
LUFACTORIZATION
Example:

Homework:Write ageneralpurpose Matlabprogram for


Chloesky factorzation methdod

LUFactorization

11

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFactorization

12

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFACTORIZATION

LUFACTORIZATION
MATLABleft division operator (\)

Using MATLAB

It examinesthesystemtoseewhichmethodwillmost
efficientlysolvetheproblem.
MATLABcanperformaCholesky factorizationwiththe
builtinchol command:
U = chol(A)

LUFactorization

13

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFACTORIZATION
THEEIGENVALUEPROBLEM

LUFactorization

15

Dr. Jorge A. Olortegui Yume, Ph.D.

Includestrying:
bandedsolvers
backandforwardsubstitutions
Cholesky factorizationforsymmetricsystems.
Ifthesedonotworkandthesystemissquare,Gauss
eliminationwithpartialpivotingisused.
LUFactorization

14

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFACTORIZATION
THEEIGENVALUEPROBLEM

LUFactorization

16

Dr. Jorge A. Olortegui Yume, Ph.D.

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

Dr. Jorge A. Olortegui Yume, Ph.D.

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

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFACTORIZATION

Example:Determinethecurrentin eachbranchofthecircuitshown

Forthedatainthenextslide
19

Dr. Jorge A. Olortegui Yume, Ph.D.

LUFactorization

20

Dr. Jorge A. Olortegui Yume, Ph.D.

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

Dr. Jorge A. Olortegui Yume, Ph.D.

Potrebbero piacerti anche