CE2407B Lecture 2 PDF
CE2407B Lecture 2 PDF
Lecture Notes 2
Gaussian Elimination
Lecture 2 PG1
• There are three grades of
grain: top, medium and low.
• Three sheaves of top-grade,
two sheaves of medium-grade
and one sheaf of low-grade
are 39 Dous.
• Two sheaves of top-grade,
three sheaves of medium-
grade and one sheaf of low-
grade are 34 Dous.
• One sheaf of top-grade, two
sheaves of medium-grade
and three sheaves of low-
Liu Hui (225–295)
grade are 26 Dous.
• How many Dous does one
sheaf of top-grade, medium-
grade and low-grade grain
yield respectively? Lecture 2 PG2
Lecture 2 PG3
Displacement of joints
a of crane
Lecture 2 PG4
CE2407 Engineering and Uncertainty Analysis
Lecture Notes 2
Gaussian Elimination
Lecture 2 PG5
Lecture 2- Systems of Linear Equation
. . . .
Sn = . . . .
. . . .
. . . .
a x
n1 1 + an 2 x2 + ....... + ann xn = bn ( En )
Three operations are permitted on a system of equations (Sn)
(λEi) (Ei) Equation Ei can be multiplied by any
nonzero constant λ, with the resulting
equation used in place of Ei.
3 x1 + 2 x2 = 18. E1
S2 =
- x1 + 2 x2 = 2 E2
x2
E1
Solution x1=4, x2=3
E2
x1
Lecture 2 PG8
Operations of Systems of Equations
4 x1 + 3 x2 − x3 = −5.7 E1
S3 = 5 x1 + x2 + 3 x3 = 2.8 E2
x − x + 2 x = 3.8 E3
1 2 3
Lecture 2 PG9
Gaussian Elimination Method
5 1 3 x = 2.8 1 2 3 E3
2
1 − 1 2 x3 3.8
A X b
Lecture 2 PG10
Gaussian Elimination Method
Lecture 2 PG11
Gaussian Elimination Method
4 3 − 1 − 5.7 E1
SO….
Aˆ = [ A, b] = 5 1
3 2.8 E2
1 − 1 2 3.8 E3
Notice the choice of constant used
What can you say? (Do the Envelope Thing)
4 3 −1 − 5.7 E1
5
E2 − E1 → E2
4 0 − 2.75 4.25 9.925 E2
1
E3 − E1 → E3 0 − 1.75 2.25 5.225 E3
4
4 3 −1 − 5.7 E1
-1.75 0 − 2.75 4.25 9.925 E2
E3 − E 2 → E3 0 0 − 0.4545 − 1.0909 E3
-2 .75
Lecture 2 PG12
Gaussian Elimination Method
The final matrix can now be transformed into its corresponding linear system:
4 x1 + 3 x2 − x3 = −5.7 E1
S3 = − 2.75 x2 + 4.25 x3 = 9.925 E2
− 0.4545 x3 = −1.0909 E3
− 1.0909
x3 = = 2 .4
− 0.4545
9.925 − 4.25(2.4 )
x2 = = 0 .1
− 2.75
General form:
a11 a12 ..... a1i ..... a1n a1,n +1 E1
Make 1 element zero
a21 a22 ..... a2i ..... a2 n a2,n +1 E2
Aˆ = [ A, b] =
a j1
Ej − E1 → E j a j1 a j 2 ..... a ji ..... a jn a j ,n +1 E j
a11
=
for j 2,3,..., n an1 an 2 ..... ani ..... ann an ,n +1 En
In this operation aii is called the pivot element. In performing the Gaussian
Elimination the pivot elements aii are assumed nonzero.
•If for some i, aii = 0, then a search is performed to find the smallest integer p
with i ≤ p ≤ n such that api ≠ 0, then we perform Ep ↔ Ei.
•In English it means: Just find the nearest row (below) where the pivot
element is not zero!
Lecture 2 PG15
Gaussian Elimination Method- Potential Pitfall
So, check if the diagonal contains any zero element. If any one of the diagonals
is zero, then do a swap with the next nearest line down.
E.g. 4 3 − 1 1 − 5.7 E1
ˆ 0 0 3 2 2.8 E2 a22 = 0
A= i =2 i≤ p≤n
0 − 1 2 − 9 3.8 E3
Smallest integer p=3
0 7 2 8 1.2 E4 a32 ≠ 0
If we perform E3 ↔ E2.then we get:
4 3 − 1 1 − 5.7 E1
ˆ 0 −1 2 − 9 3.8 E2
A=
0 0 3 2 2.8 E3
0 7 2 8 1.2 E4
Gaussian Elimination can now continue on Â.
Lecture 2 PG16
Gaussian Elimination Method- General Form Recap
Backward substitution can now be performed. Solving the nth equation for xn
gives bottom-most equation…
a11 x1 + a12 x2 + ....... + a1,n −1 xn −1 + a1n xn = a1,n +1 ( E1 )
From En an ,n +1 a22 x2 + ....... + a2,n −1 xn −1 + a2 n xn = a2,n +1 ( E2 )
xn =
. . . . .
ann
Sn = . . . . .
. . . . .
From En-1 an −1,n −1 xn −1 + an −1,n xn . = an −1,n +1 ( En −1 )
an −1,n +1 − an −1,n xn ann xn = an,n +1 ( En )
xn −1 =
an −1,n −1
Sum up all the products
of ax ahead of xi
ai ,n +1 − ∑ j =i +1 aij x j
From Ei n
xi =
aii
Lecture 2 PG18
Gaussian Elimination Method- Worked Example 2
x1 + 3 x2 -2x 3 + x4 = −1 E1
S 4 2 x1 -2x2 + x 3 -2 x 4
= = 1 E2
x1 + x2 − 3 x3 + x4 = 6 E3
3x1 − x2 + 2x3 − x4 = 3 E4
1 3 -2 1 -1 E1
ˆA = 2 -2 1 -2 1 E2
1 1 -3 1 6 E3
3 -1 2 -1 3 E4
Lecture 2 PG19
Gaussian Elimination Method- Worked Example
1 3 − 2 1 − 1
2 − 2 1 − 2 1
1 1 − 3 1 6
3 − 1 2 − 1 3
1 3 − 2 1 − 1
E2-(2/1)xE1 0 − 8 5 −4 3
E3-1xE1 0 -2 -1 0 7
E4-3xE1 0 − 10 8 -4 6
1 3 − 2 1 − 1
−
0 -8 5 4 3
E3-(-2/-8)E2 0 0 -2.25 1 6.25
E4-(-10/-8)E2 0 0 1.75 1 2.25
Lecture 2 PG20
Gaussian Elimination Method- Worked Example
1 3 − 2 1 − 1
− 4
0 -8 5 3
0 0 -2.25 1 6.25
E4-(1.75/-2.25)E3 0 0 0 1.778 7.111
-1
1 3 -2 1 x1
−8 x2 3
0 5 -4
=
0 0 -2.25 1 x3 6.25
0
0 0 x4 7.111
1.778
Lecture 2 PG22
Displacement of joints
a of crane
Lecture 2 PG23
If it is a set/system of linear equations
If
(meaning can be express using linear
equations only, we can use GE to solve)
4 20
B K = Structure stiffness matrix
EI = 20,000
2EI, 2EA X = Joint displacement vector
6 EA = 200,000 P = Joint load vector
A EI, EA
EI, EA
4 D
8 10 6
Lecture 2 PG24
Gaussian Elimination Method- Exercise
x1 − 2 x2 − x3 + 3 x4 = 4
2 x1 + x 2 + x3 − 4 x4 = 3
3 x1 − x 2 −2 x 3 +2 x4 = 6
x1 + 3 x2 − x3 + x4 = 8
Answers:
x1 = 4, x2 = 2, x3 = 5, x4 = 3
Lecture 2 PG25
Lecture 2 PG26