Linear Algebraic Equations
Linear Algebraic Equations
Linear Algebraic Equations
EQUATIONS
NUMERICAL ANALYSIS
Definition
• The general form of linear algebraic equations:
• The basic strategy is to multiply the equations by constants so that one of the
unknowns will be eliminated when the two equations are combined.
• Solving for x2 and substitute the result into an original equation to solve for x1:
Naive Gauss elimination
• Forward Elimination of Unknowns: The first phase is designed to reduce the
set of equations to an upper triangular system.
• Back Substitution: from the last equation, solve for xn first and then substitute
back into previous equations to get results of the remaining unknowns.
Example 2
Use Gauss elimination to solve:
3x1 − 0.1x2 − 0.2 x3 = 7.85
0.1x1 + 7 x2 − 0.3x3 = −19.3
0.3x − 0.2 x + 10 x3 = 71.4
1 2
SOLUTION
• The initial matrix representing coefficients in the equations is:
[A]{X} = {B}
[A] = [L][U]
where
[L]{D} = [B]
[U]{X} = [D]
LU decomposition
• Doolitte method:
u1 j = a1 j (1 j n)
l =
ai1
(2 i n)
i1 u11
i −1
where
u
ij
= aij − lik ukj (2 i j n)
k =1
1 j −1
lij = aij − lik ukj (2 j i n)
u jj k =1
LU decomposition
• Crout method:
li1 = ai1 (1 i n )
u a1 j
1j
= (2 j n)
l11
j −1
where
lij = aij − lik ukj (2 j i n)
k =1
1 i −1
uij = ij ik kj
a − l u (2 i j n)
lii k =1
Example 3
2 x1 + 2 x2 − 3x3 = 9
Use LU decomposition (Doolitte method) to solve: −4 x1 − 3x2 + 4 x3 = −15
2x + + 2 x3 =
1 x2 3
SOLUTION
• Decomposing [A] into [L] and [U]:
2 2 −3 1 0 0 2 2 −3
[ A] = [ L][U ] −4 −3 4 = −2 1 0 0 1 −2
2 1 2 1 −1 1 0 0 3
• Substituting back to obtain results:
1 0 0 9 9
[ L]{D} = {B} −2 1 0 {D} = −15 {D} = 3
1 −1 1 3 −3
2 2 −3 9 2
[U ]{ X } = {D} 0 1 −2 { X } = 3 { X } = 1
0 0 3 −3 −1
Cholesky decomposition
• A decomposition of a symmetric, positive-definite matrix into the product of a
lower triangular matrix (C) and its conjugate transpose (CT).
[A] = [C][CT]
• A matrix is positive-definite when all its sub-determinants are positive.
c11 = a11 (2 i n)
c ai1
i1
= (2 i n)
c11 0 0 c11
c 0
= 21 c22 ; where k −1
C
c
kk
= akk − ckj
2
(2 k n)
j =1
cn1 cn 2 cnn
1 k −1
cik = aik − cij c jk
(k + 1 i n)
ckk j =1
Example 4
x1 + x2 − x3 = 1
Use Cholesky decomposition to solve: x1 + 2 x2 = 2
− x + + 4 x3 = 3
1
SOLUTION 1 1 −1
1 1
• [A] is symmetric and positive-definite since: 1 0; = 1 0; 1 2 0 =20
1 2
1 1 −1 1 0 0 −1 0 4
A = 1 2 0 C = 1 1 0
−1 0 4 −1 1 2
• Substituting back to obtain results:
1 0 0 1 1
[C ]{D} = {B} 1 1 0 {D} = 2 {D} = 1
−1 1 3
2 3 2
1 1 −1 1 3
[C T ]{ X } = {D} 0 1 1 { X } = 1 { X } = −1 2
0 0 32
2 3 2