Professional Documents
Culture Documents
University of Benghazi
Faculty of Engineering
Civil Engineering Department
Submitted to:
Prof. Salem Alsanusi
07, Nov, 2022
Prepared by:
Bashir A. El-Saadawi
CE 501 Numerical Analysis
Q1) Fit the following data using the following approach
1) straight line
2) power
3) exponential
x 2 7 8 12 9
y 8 5 4 3 2
● Solution:
1) straight line
𝑦 𝑎 𝑎 𝑥
𝑛 ∑𝑥 𝑦 ∑𝑥 ∑𝑦
𝑎
𝑛 ∑𝑥 ∑𝑥
∑𝑥 ∑𝑦 ∑𝑥 ∑𝑥 𝑦
𝑎
𝑛 ∑𝑥 ∑𝑥
x y 𝑥𝑦 x2
2 8 16 4
7 5 35 49
8 4 32 64
12 3 36 144
9 2 18 81
𝑥 𝑦 𝑥𝑦 𝑥
38 22 137 342
5 137 38 22
𝑎 0.5677
5 342 38
342 22 38 137
𝑎 8.7143
5 342 38
𝑦 8.7143 0.5677𝑥
1
CE 501 Numerical Analysis
2) power
𝑦 𝛼 𝑥
𝑙𝑜𝑔 𝑦 𝑙𝑜𝑔 𝛼 𝛽2 𝑙𝑜𝑔 𝑥
𝑦 𝛼 𝑥
.
𝑦 12.816𝑥
2
CE 501 Numerical Analysis
3) exponential
𝑦 𝛼 𝑒
ln 𝑦 ln 𝛼 𝛽 𝑥 ln 𝑒
ln 𝑦 ln 𝛼 𝛽𝑥
𝑌 𝑎 𝑎 𝑥
𝑛 ∑ 𝑥 ln 𝑦 ∑ 𝑥 ∑ ln 𝑦
𝑎
𝑛 ∑𝑥 ∑𝑥
∑𝑥 ∑ ln 𝑦 ∑ 𝑥 ∑ 𝑥 ln 𝑦
𝑎
𝑛 ∑𝑥 ∑𝑥
x y ln y x2 x ln y
2 8 2.079442 4 4.158883
7 5 1.609438 49 11.26607
8 4 1.386294 64 11.09035
12 3 1.098612 144 13.18335
9 2 0.693147 81 6.238325
𝑥 𝑦 ln 𝑦 𝑥 𝑥 ln 𝑦
5 45.93698 38 6.866933
𝑎 0.118
5 342 38
342 6.866933 38 45.93698
𝑎 2.26649
5 342 38
𝛽 𝑎 0.118
.
ln 𝛼 𝑎 𝛼 𝑒 𝑒 9.6455
.
𝑦 9.6455 𝑒
3
CE 501 Numerical Analysis
Staight Line
9
8
y = -0.5677x + 8.7143
7
5
y
0
0 2 4 6 8 10 12 14
x
Power
9
7
y = 12.816x-0.626
6
5
y
0
0 2 4 6 8 10 12 14
x
4
CE 501 Numerical Analysis
exponential
9
8
y = 9.6455e-0.118x
7
5
y
0
0 2 4 6 8 10 12 14
x
The sum of the squares of the errors between the measured y and the y calculated Explained in
the following table
𝑒 𝑦 𝑦 2
As shown, we can estimate the best fit from the exponential approach.
5