Displacement of The Each Member in The Given Truss Solved by SOR Method
Displacement of The Each Member in The Given Truss Solved by SOR Method
Problem Title
Displacement of the Each Member in the Given Truss Solved by SOR Method
1. Problem Statement
By SOR method, the displacement or the deformation of each bar will be solved using the given 10 x10
matrix with tolerable error of 1 x 10-5.
Same step with part 1and part 2 of final examination, the first step is to analyze the truss and then
substitute all given to the 10 x 10 matrix. The difference of SOR from Gauss-Seidel is that, in SOR there is a
relaxation factor (𝜔). If 𝜔 is equal to one, the result will be the same as Gauss-Seidel. In this problem I used
𝜔=1.1, to have successive over relaxation.
The matrix after substitution and the equations of X1 to X10 as said in Final Examination Part 1
8 0 −4 0 0 0 −2 2√3 0 0
0
0 12 0 0 0 0 2√3 −6 0 0 −4𝑥10−3
−4 0 12 0 −4 0 −2 −2√3 −2 2√3 0
0 0 0 12 0 0 −2√3 −6 2√3 −6 −4𝑥10−3
0 0 −4 0 8 0 0 0 −2 −2√3 0
−3
0 0 0 0 0 12 0 0 −2√3 −6 −4𝑥10
−2 2√3 −2 −2√3 0 0 12 0 −4 0 0
−4𝑥10−3
2√3 −6 −2√3 −6 0 0 0 12 0 0
0
0 0 −2 2√3 −2 −2√3 −4 0 12 0 [−4𝑥10−3 ]
[ 0 0 2√3 −2√3 −2√3 −6 0 0 0 12 ]
Formula for SOR in general is : 𝑥𝑛𝑒𝑤 = 𝜔(𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 𝑓𝑟𝑜𝑚 𝑔𝑎𝑢𝑠𝑠 − 𝑠𝑒𝑖𝑑𝑒𝑙 ) + (1 − 𝜔)(𝑥𝑜𝑙𝑑 )
Iteration x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
0 0 0 0 0 0 0 0 0 0 0
1 0.8 -1.20037 -1.2 -1.20037 -0.8 -1.20037 -1.2 -1.20037 1.2 -1.20037
2 1.21825 -1.47 -2.22667 -2.24174 -2.36175 -2.24162 -2.0067 -1.88 2.0067 -2.1147
3 1.30E-03 -1.92E-03 -1.37E-04 -3.05E-03 -8.67E-04 -1.25E-03 -1.86E-05 -3.22E-03 3.40E-04 -2.04E-03
21 1.05E-03 -1.62E-03 -1.36E-04 -2.58E-03 -7.66E-04 -1.15E-03 -5.46E-05 -2.69E-03 2.32E-04 -1.80E-03
22 1.20E-03 -1.80E-03 -1.39E-04 -2.87E-03 -8.36E-04 -1.22E-03 -3.62E-05 -3.02E-03 2.95E-04 -1.95E-03
23 1.40E-03 -2.03E-03 -1.30E-04 -3.19E-03 -8.82E-04 -1.28E-03 4.13E-06 -3.38E-03 3.85E-04 -2.11E-03
The results are:
𝑋1 = 1.40025725 𝑥 10−3 𝑖𝑛
𝑋2 = −2.02501510 𝑥 10−3 𝑖𝑛
𝑋3 = −1.29609943 𝑥 10−4 𝑖𝑛
𝑋4 = −3.18818583 𝑥 10−3 𝑖𝑛
𝑋5 = −8.81979696 𝑥 10−4 𝑖𝑛 Almost the same value in part 2 of exam
𝑋6 = −1.27692279 𝑥 10−3 𝑖𝑛
𝑋7 = 4.12810386 𝑥 10−6 𝑖𝑛
𝑋8 = −3.38163254 𝑥 10−3 𝑖𝑛
𝑋9 = 3.84525257 𝑥 10−4 𝑖𝑛
−3
𝑋10 = −2.10936116 𝑥 10 𝑖𝑛
3. Problems Encountered
Before trying to code in Pycharm IDE, I tried it first in excel, but the value goes bigger and bigger, and
it is impossible to have a bigger deformation in each member of a truss like it. So I tried the code of Gauss-
Seidel and make it as reference. I only add the formula of SOR method and set the relaxation factor to 1.1.
4. Reference
-The Math Guy. (2017, November 27). Numerical Methods for Linear Systems - SOR [Video].
5. Appendix
print("-----Displacement of the Each Member in the Given Truss Solved by SOR Method-----")
import numpy as np
import math
print("----------------------------Input Value--------------------------------")
E = E*10**6
step = 0
Φ = initial_guess[:]
residual = np.linalg.norm(np.matmul(A, Φ) - b)
for i in range(A.shape[0]):
sigma = 0
for j in range(A.shape[1]):
if j != i:
residual = np.linalg.norm(np.matmul(A, Φ) - b)
step += 1
return Φ
residual_convergence = 1e-5
print("Values of a matrix")
initial_guess = np.zeros(10)
print(Φ)