CE305 Numerical Methods for Civil Engineers 2020-2021 Fall
Handout #7 – Linear Eq. Systems (direct methods)
P1
For the simple truss shown in Figure 1,
y
determine the internal forces in all members P2 A
(FAB, FAC, FBC) and the reactions at supports B x
(R1, R2), and C (R3) by Gauss elimination and
4m
LU Decomposition methods for the following
load cases:
R2 B C
a. P1 = 30 kN , P2 = 0
b. P1 = 0 , P2 = 40 kN R1
8m 4m
R3
Figure 1 Simple truss sytem
Hint: Free body diagrams of the joints and corresponding equilibrium equations of the truss
(assuming all member forces as tensile) yielding 6x6 linear system are given below:
P1 FA B
B 1
P2 A R2 2
FB C
1 1
2 1
FAB FA C R1
2 1 2
∑ 𝐹𝑥 = 0 ⇒ − 𝐹 + 𝐹 + 𝑃2 = 0 … (1) ∑ 𝐹𝑥 = 0 ⇒ 𝐹𝐵𝐶 + 𝐹 + 𝑅2 = 0 … (3)
√5 𝐴𝐵 √2 𝐴𝐶 √5 𝐴𝐵
1 1 1
∑ 𝐹𝑦 = 0 ⇒ − 𝐹𝐴𝐵 − 𝐹𝐴𝐶 − 𝑃1 = 0 … (2) ∑ 𝐹𝑦 = 0 ⇒ 𝐹 + 𝑅1 = 0 … … … . . (4)
√5 √2 √5 𝐴𝐵
FAC
1
1 C
FBC
R3
1
∑ 𝐹𝑥 = 0 ⇒ − 𝐹𝐵𝐶 − 𝐹 = 0 … (5)
√2 𝐴𝐶
1
∑ 𝐹𝑦 = 0 ⇒ 𝐹 + 𝑅3 = 0 … … . . (6)
√2 𝐴𝐶
The equilibrium equations at nodes A, B and C can be written in the following matrix form:
−0.894427 0.707107 0 0 0 0 𝐹𝐴𝐵 −𝑃2
−0.447214 −0.707107 0 0 0 0 𝐹𝐴𝐶 𝑃1
0.894427 0 1 0 1 0 𝐹𝐵𝐶 = 0
0.447214 0 0 1 0 0 𝑅1 0
0 −0.707107 −1 0 0 0 𝑅2 0
[ 0 0.707107 0 0 0 1] { 𝑅3 } { 0 }
A x b
1
CE305 Numerical Methods for Civil Engineers 2020-2021 Fall
Handout #7 – Linear Eq. Systems (direct methods)
GAUSS ELIMINATION
PART A:
(1)
−𝟎. 𝟖𝟗𝟒𝟒𝟐𝟕 0.707107 0 0 0 0 0 (2) (1)
−0.447214 −0.707107 0 0 0 𝑟𝑜𝑤1(1)
0 30 𝑟𝑜𝑤2 (2) = 𝑟𝑜𝑤2 (1) − 0.5 × (1)
0.894427 0 1 0 1 0 0 𝑟𝑜𝑤3(2) = 𝑟𝑜𝑤3(1) + 𝑟𝑜𝑤1 (1)
0.447214 0 0 1 0 0 0 𝑟𝑜𝑤4 = 𝑟𝑜𝑤4 + 0.5 × 𝑟𝑜𝑤1
0 −0.707107 −1 0 0 0 0
[ 0 0.707107 0 0 0 1 0]
(2)
−0.894427 0.707107 0 0 0 0 0
0 −𝟏. 𝟎𝟔𝟎𝟔𝟔 0 0 0 0 30 (3) (2) (2)
0 0.707107 1 0 1 0 0 𝑟𝑜𝑤3(3) = 𝑟𝑜𝑤3(2) + 0.666667 × 𝑟𝑜𝑤2(2)
0 0.353553 0 1 0 0 0 𝑟𝑜𝑤4 = 𝑟𝑜𝑤4 + 0.333333 × 𝑟𝑜𝑤2( )
(3) (2) 2
0 −0.707107 −1 0 0 0 0 𝑟𝑜𝑤5 = 𝑟𝑜𝑤5 − 0.666667 × 𝑟𝑜𝑤2
(3) (2) (2)
[ 0 0.707107 0 0 0 1 0 ] 𝑟𝑜𝑤6 = 𝑟𝑜𝑤6 + 0.666667 × 𝑟𝑜𝑤2
(3)
−0.894427 0.707107 0 0 0 0 0
0 −1.06066 0 0 0 0 30
0 0 𝟏 0 1 0 20
0 0 0 1 0 0 10 𝑟𝑜𝑤5(4) = 𝑟𝑜𝑤5(3) + 𝑟𝑜𝑤3(3)
0 0 −1 0 0 0 −20
[ 0 0 0 0 0 1 20 ]
(4)
−0.894427 0.707107 0 0 0 0 0
0 −1.06066 0 0 0 0 30
0 0 1 0 1 0 20
0 0 0 1 0 0 10
0 0 0 0 1 0 0
[ 0 0 0 0 0 1 20 ]
Now that the coefficient matrix A has been reduced to an upper triangular form, the system
can be solved by backward substitution.
𝑅3 = 20 𝐹𝐴𝐵 −22.36
𝑅2 = 0 𝐹𝐴𝐶 −28.28
𝑅1 = 10 𝐹𝐵𝐶 20
=
𝐹𝐵𝐶 + 𝑅2 = 20 ⇒ 𝐹𝐵𝐶 = 20 𝑅1 10
−1.06066𝐹𝐴𝐶 = 30 ⇒ 𝐹𝐴𝐶 = −28.28 𝑅2 0
−0.894427𝐹𝐴𝐵 + 0.707107𝐹𝐴𝐶 = 0 { 𝑅3 } { 20 }
⇒ 𝐹𝐴𝐵 = −22.36
2
CE305 Numerical Methods for Civil Engineers 2020-2021 Fall
Handout #7 – Linear Eq. Systems (direct methods)
PART B:
−0.894427 0.707107 0 0 0 0 −40 𝐹𝐴𝐵 29.81
0 −1.06066 0 0 0 0 20 𝐹𝐴𝐶 −18.86
0 0 1 0 1 0 −26.6667 𝐹𝐵𝐶
= 13.33
0 0 0 1 0 0 −13.3333 𝑅1 −13.33
0 0 0 0 1 0 −40 𝑅2 −40
[ 0 0 0 0 0 1 13.3333 ] { 𝑅3 } { 13.33 }
LU DECOMPOSITION
Let us first decompose the coefficient matrix A into a lower and upper triangular matrix:
𝐴 = 𝐿𝑈
−0.894427 0.707107 0 0 0 0
−0.447214 −0.707107 0 0 0 0
0.894427 0 1 0 1 0
0.447214 0 0 1 0 0
0 −0.707107 −1 0 0 0
[ 0 0.707107 0 0 0 1]
1 0 0 0 0 0 𝑢11 𝑢12 𝑢13 𝑢14 𝑢15 𝑢16
𝑙21 1 0 0 0 0 0 𝑢22 𝑢23 𝑢24 𝑢25 𝑢26
𝑙 𝑙 1 0 0 0 0 0 𝑢33 𝑢34 𝑢35 𝑢36
= 31 32
𝑙41 𝑙42 𝑙43 1 0 0 0 0 0 𝑢44 𝑢45 𝑢46
𝑙51 𝑙52 𝑙53 𝑙54 1 0 0 0 0 0 𝑢55 𝑢56
[𝑙61 𝑙62 𝑙63 𝑙64 𝑙65 1] 0 [ 0 0 0 0 𝑢66 ]
1 × 𝑢11 = −0.894427 ⇒ 𝑢11 = −0.894427
1 × 𝑢12 + 0 × 𝑢22 = 0.707107 ⇒ 𝑢12 = −0.707107
𝑙21 × 𝑢11 + 1 × 0 = −0.447214 ⇒ 𝑙21 = 0.5
If the computations are carried out in a similar fashion, the following L and U matrices are
obtained:
1 0 0 0 0 0 −0.894427 0.707107 0 0 0 0
0.5 1 0 0 0 0 0 −1.06066 0 0 0 0
𝐿= −1 −0.666667 1 0 0 0 𝑈= 0 0 1 0 1 0
−0.5 −0.333333 0 1 0 0 0 0 0 1 0 0
0 0.666667 −1 0 1 0 0 0 0 0 1 0
[ 0 −0.666667 0 0 0 1] [ 0 0 0 0 0 1]
Now, the LU decomposition can be used to solve the given system of linear equations as
follows:
Ax = b LUx = b Ux = y , Ly = b
3
CE305 Numerical Methods for Civil Engineers 2020-2021 Fall
Handout #7 – Linear Eq. Systems (direct methods)
PART A:
Solve the linear system Ly = b ( b = 0 30 0 0 0 0 ) by forward substitution:
T
𝑦1 𝑦1 0
1 0 0 0 0 0 0 𝑦
0.5 1 0 0 0 0
𝑦 2 30 2 30
−1 −0.666667 1 0 0 0 𝑦3 = 0 𝑦3 20
−0.5 −0.333333 0 1 0 0 𝑦 4 0 𝑦4 = 10
0 0.666667 −1 0 1 0 𝑦5 0 𝑦5 0
[ 0 −0.666667 0 0 0 1] {𝑦 } { 0 }
6 { 𝑦6 } {20}
Now, solve the linear system Ux = y by backward substitution:
𝐹𝐴𝐵 −22.36
−0.894427 0.707107 0 0 0 0 𝐹𝐴𝐵 0 𝐹𝐴𝐶
0 −1.06066 0 0 0 0 𝐹𝐴𝐶 30 −28.28
0 0 1 0 1 0 𝐹𝐵𝐶 = 20 𝐹𝐵𝐶 20
=
0 0 0 1 0 0 𝑅1 10 𝑅1 10
0 0 0 0 1 0 𝑅2 0 𝑅2 0
[ 0 0 0 0 0 1] { 𝑅 } {20}
3 { 𝑅3 } { 20 }
PART B:
Solve the linear system Ly = b ( b = −40 0 0 0 0 0 ) by forward substitution:
T
𝑦1 𝑦1 −40
1 0 0 0 0 0 −40
0.5 1 0 0 0 0
𝑦 2 0 𝑦2 20
𝑦 𝑦 −26.67
−1 −0.666667 1 0 0 0
−0.5 −0.333333 0 1 0 0 𝑦4
3
= 0 3
𝑦4 = −13.33
0
0 0.666667 −1 0 1 0 𝑦5 0 𝑦5 −40
[ 0 −0.666667 0 0 0 1] {𝑦 } { 0 }
6 { 𝑦6 } { 13.33 }
Now, solve the linear system Ux = y by backward substitution:
𝐹𝐴𝐵 29.81
−0.894427 0.707107 0 0 0 0 𝐹𝐴𝐵 −40 𝐹𝐴𝐶
0 −1.06066 0 0 0 0 𝐹𝐴𝐶 20 −18.86
0 𝐹𝐵𝐶 = −26.67 𝐹𝐵𝐶
0 0 1 0 1 = 13.33
0 0 0 1 0 0 𝑅1 −13.33 𝑅1 −13.33
0 0 0 0 1 0 𝑅2 −40 𝑅2 −40
[ 0 0 0 0 0 1] { 𝑅 } { 13.33 }
3 { 𝑅3 } { 13.33 }