Applied Numerical Methods (SME 3023) : Yahya Ahmed Ahmed Alduqri
Applied Numerical Methods (SME 3023) : Yahya Ahmed Ahmed Alduqri
Applied Numerical Methods (SME 3023) : Yahya Ahmed Ahmed Alduqri
(SME 3023)
PROJECT 1
01 September 2010(MONEDAY)
(Signature)
____________________________________
DR.KAHAR OSMAN
SME 3023 Project 1
An accelerometer measures acceleration and then data can be used to obtain velocity and
displacement. Suppose a vehicle starts from rest at time t = 0 and its measured acceleration is
given in the following table:
Time(s) 0 1 2 3 4 5 6 7 8 9 10
Acceleration 0 2 4 7 11 17 24 32 41 48 51
(m/s2)
You can integrate the data to obtain velocities and displacements. Choose a suitable numerical
method and justify your choice. Then:
a) estimate the velocity at times t = 1, 2, 3, ...10 s.
b) estimate the distance travelled by the vehicle at 10 s.
c) estimate the distance at times t = 1, 2, 3, ... 10 s.
d) estimate the acceleration at 0.5, 1.5, 5.5 and 8.5 s. You can use computer program to aid your
work.
Once you have completed this part, do the followings:
a) From the displacements data, find its derivatives to obtain velocities and second derivatives to
obtain accelerations. Choose a suitable numerical method and justify your choice.
b) Compare your answers to part one. Comments on the accuracy and reliability of your answers.
Hand in a short report containing title page, table of contents, results, discussions and conclusions.
Detail explanation is needed if you use any software/program. Please submit the softcopy as well
or show the samples of calculations. Please organise your data properly.
1.1 Results
1.2 Acceleration equation.
1.2.1 Numerical Method
- Polynomial regression method to find an equation for the acceleration based on the given data.
- polynomial regression method
time(se accelerati
c) on (m/ s2)
0 0
1 2
2 4
3 7
4 11
5 17
6 24
7 32
8 41
9 48
10 51
n 11 m 2
−¿¿ −¿¿
Xi 5 Yi 21.5454
5
∑ Xi 55 ∑ Yi 237
∑ X i2 385 ∑ Y i2 8665
∑ X i3 3025 ∑ Xi . Yi 1798
∑ X i4 25333 ∑ X i2 .Yi 14726
∑ X i5 220825 ∑ X i3 .Yi 126196
∑ X i6 1978405 ∑ X i4 . Yi 1114874
∑ X i7 18080425
∑ X i8 16773133
3
n a 0+ ∑ Xi a1 + ∑ X i 2 a2 + ∑ X i 3 a3 +∑ X i 4 a4 =∑ Yi
∑ Xi a0 + ∑ X i2 a1 + ∑ X i3 a2+ ∑ X i4 a3 + ∑ X i5 a4 =∑ Xi . Yi
∑ X i2 a0 +∑ X i3 a1 +∑ X i4 a2 +∑ X i5 a3 +∑ X i6 a4 =∑ X i2 . Yi
∑ X i3 a0 + ∑ X i4 a 1+ ∑ X i5 a2 + ∑ X i6 a3 + ∑ X i7 a4 =∑ X i3 . Yi
∑ X i4 a 0+∑ X i5 a 1+∑ X i6 a2 +∑ X i7 a3 +∑ X i8 a4 =∑ X i4 .Yi
11 a 0+55 a 1+385 a 2+ 3025 a3+ 25333 a4 =237
55 a0 +385 a1 +3025 a 2+25333 a 3+ 220825a 4=1798
385 a0 +3025 a1 +25333 a 2+220825 a 3+1978405 a 4=14726
3025 a0 +25333 a1 +220825 a 2+1978405 a3 +18080425 a 4=126196
25333 a0 +220825 a1 +1978405 a2 +18080425 a3 +167731333 a 4=1114874
1 0 0 36 648 -1.05595
0 1 0 -57.2 -894 2.064568
0 0 1 15 175 0.350816
0 0 0 6177.6 123552 -380.4
0 0 0 123552 2512224 -8340
1 0 0 0 -72 1.160833
0 1 0 0 250 -1.45765
0 0 1 0 -125 1.274476
0 0 0 1 20 -0.06158
0 0 0 0 41184 -732
1 0 0 0 0 -0.11889
0 1 0 0 0 2.985823
0 0 1 0 0 -0.94726
0 0 0 1 0 0.293898
0 0 0 0 1 -0.01777
a 0=−0.11888
a 1=2.98582
a 2=−0.94726
a 3=0.293901
a 4=−0.01777
Y(t) = -0.01777x4 + 0.2939x3 - 0.94726x2 + 2.98582x - 0.11888
2
x(sec m ¿¿ ( yi−a 0−a1 Xi−a2 X i 2−a 3 X i3−a 4 X i4 )
) y
( )
s2
0 0 464.2066 0.014132454
1 2 422.1157 0.038341948
2 4 382.0248 0.01705845
3 7 343.9339 0.036405785
4 11 307.843
0.005071719
S ( yx )=¿ 0.277941
5 17 273.7521 0.057554409 R2=¿ 0.999802
6 24 241.6612 0.021719685 R=¿ 0.999901
7 32 211.5702 0.258463442
8 41 183.4793 0.027412763
9 48 157.3884 0.095914709
10 51 133.2975 0.045933062
∑ 237 3121.273 0.618008427
So the polynomial equation of the acceleration would be:
∫ dv=∫ a ( t ) d (t )
vi ti
v ( t )−0=− ( 0.017774
5 ) t +(
5 0.2938979
4 ) t −(
4 0.947261
3 ) t +(
2.9858232
3
2 )t −( 0.118887 ) t
2
n 11 m 2
−¿¿ −¿¿
Xi 5 Yi 62.77273
∑ Xi 55 ∑ Yi 690.5
∑ X i2 385 ∑ Y i2 95658.25
∑ X i3 3025 ∑ Xi . Yi 5672
∑ X i4 25333 ∑ X i2 .Yi 48880
∑ X i5 220825 ∑ X i3 .Yi 434525
∑ X i6 1978405 ∑ X i4 . Yi 3948214
∑ X i7 18080425
∑ X i8 167731333
n a 0+ ∑ Xi a1 + ∑ X i 2 a2 + ∑ X i 3 a3 +∑ X i 4 a4 =∑ Yi
∑ Xi a0 + ∑ X i2 a1 + ∑ X i3 a2+ ∑ X i4 a3 + ∑ X i5 a4 =∑ Xi . Yi
∑ X i2 a0 +∑ X i3 a1 +∑ X i4 a2 +∑ X i5 a3 +∑ X i6 a4 =∑ X i2 . Yi
∑ X i3 a0 + ∑ X i4 a 1+ ∑ X i5 a2 + ∑ X i6 a3 + ∑ X i7 a4 =∑ X i3 . Yi
∑ X i4 a 0+∑ X i5 a 1+∑ X i6 a2 +∑ X i7 a3 +∑ X i8 a4 =∑ X i4 .Yi
11 a 0+55 a 1+385 a 2+ 3025 a3+ 25333 a4 =690.5
55 a0 +385 a1 +3025 a 2+25333 a 3+ 220825a 4=5672
385 a0 +3025 a1 +25333 a 2+220825 a 3+1978405 a 4=48880
3025 a0 +25333 a1 +220825 a 2+1978405 a3 +18080425 a 4=434525
25333 a0 +220825 a1 +1978405 a2 +18080425 a3 +167731333 a 4=3948214
1 0 0 36 648 5.898601
0 1 0 -57.2 -894 -9.16422
0 0 1 15 175 2.934149
0 0 0 6177.6 123552 905.4
0 0 0 123552 2512224 17538
1 0 0 0 -72 0.622378
0 1 0 0 250 -0.78089
0 0 1 0 -125 0.735723
0 0 0 1 20 0.146562
0 0 0 0 41184 -570
1 0 0 0 0 -0.37413
0 1 0 0 0 2.679196
0 0 1 0 0 -0.99432
0 0 0 1 0 0.423368
0 0 0 0 1 -0.01384
a 0=¿-0.37413
a 1=¿2.679196
a 2=−0.99432
a 3=0.423368
a 4=−0.01384
0 0 3940.415 0.139973
1 1 3815.87 0.518795
2 4 3693.324 0.029751
3 9.5 3572.779 0.226125
250
150
100
50
0
0 2 4 6 8 10 12
-50
1.4 Distance integration based on velocity data.
1.4.1 analytical integration
v(t) = −0.01384 t4+0.423368t3−0.99432t2 +2.679196t -0.37413
sf tf
∫ ds=∫ v ( t ) d (t)
si ti
s ( t ) −0=− ( 0.01384
5 )t +( 0.423368
5
4 ) t −( 0.99432
3 ) t +( 2.679196
4
2 )t −( 0.37413 ) t
3 2
t (s ) s(m)
0 0
1 0.737102
2 3.563508
3 9.88569
4 22.98601
5 47.69055
6 90.03697
7 156.9423
8 255.871
9 394.5022
10 580.3985
- Polynomial regression method to find an equation for the distance based on the
integration of the velocity equation.
t (s ) s(m)
0 0
1 0.5
2 3
3 9.75
4 23.75
5 49.25
6 92
7 159
8 258.25
9 398
10 584.75
n 11 m 2
−¿¿
Xi 5 Yi−¿¿ 143.4773
∑ Xi 55 ∑ Yi 1578.25
∑ X i2 385 ∑ Y i2 603868.6
∑ X i3 3025 ∑ Xi . Yi 13537.5
∑ X i4 25333 ∑ X i2 .Yi 120055.5
∑ X i5 220825 ∑ X i3 .Yi 1089489
∑ X i6 1978405 ∑ X i4 . Yi 10055261
∑ X i7 18080425
∑ X i8 167731333
2 3 4
n a 0+ ∑ Xi a1 + ∑ X i a2 + ∑ X i a3 +∑ X i a4 =∑ Yi
∑ Xi a0 +∑ X i2 a1 +∑ X i3 a2+∑ X i4 a3 +∑ X i5 a4 =∑ Xi . Yi
∑ X i2 a0 + ∑ X i3 a1 +∑ X i4 a2 + ∑ X i5 a3 +∑ X i6 a4 =∑ X i2 . Yi
∑ X i3 a0 +∑ X i4 a 1+∑ X i5 a2 +∑ X i6 a3 +∑ X i7 a4 =∑ X i3 . Yi
∑ X i4 a 0+ ∑ X i5 a 1+ ∑ X i6 a2 + ∑ X i7 a3 + ∑ X i8 a4 =∑ X i4 .Yi
11a 0+55 a 1+385 a 2+ 3025 a3+ 25333 a4 =1578.25
55 a0 +385 a1 +3025 a 2+25333 a 3+ 220825a 4=13537.5
385 a0 +3025 a1 +25333 a 2+220825 a 3+1978405 a 4=120055.5
3025 a0 +25333 a1 +220825 a 2+1978405 a3 +18080425 a 4=1089489
25333 a0 +220825 a1 +1978405 a2 +18080425 a3 +167731333 a 4=10055261
1 0 0 36 648 32.88287
0 1 0 -57.2 -894 -46.0393
0 0 1 15 175 9.736888
0 0 0 6177.6 123552 6184.5
0 0 0 123552 2512224 125367
1 0 0 0 -72 -3.15734
0 1 0 0 250 11.22455
0 0 1 0 -125 -5.27987
0 0 0 1 20 1.001117
0 0 0 0 41184 1677
1 0 0 0 0 -0.22552
0 1 0 0 0 1.044629
0 0 1 0 0 -0.1899
0 0 0 1 0 0.186723
0 0 0 0 1 0.04072
a 0=¿-0.22552
a 1=1.044629
a 2=−0.1899
a 3=0.186723
a 4=0.04072
2
x(sec m ¿¿ ( yi−a 0−a1 Xi−a2 X i2−a 3 X i 3−a 4 X i4 )
) y
( )
s2
0 0 20585.73 0.050859
1 0.5 20299.77 0.127201
2 3 20015.82 0.062221
3 9.75 19733.86 0.044475
t (s ) m
v( )
s
0 -0.22552
1 0.856652
2 3.249442
3 9.539108
4 23.28919
5 49.0405
6 92.31114
7 159.5965
8 258.3692
9 397.0792
10 585.1538
700
600
f(x) = 0 x⁵ + 0.04 x⁴ + 0.19 x³ − 0.19 x² + 1.04 x − 0.23
R² = 1
500
400
300
200
100
0
0 2 4 6 8 10 12
-100
∫ ds=∫ v ( t ) d (t)
si ti
48310.0
− 863324.0 23499.0 23499.0
1473.0
−t )d ( t)= ( 5 )
01( )5+ ( 4 )
01( − )4 ( 3 ) (
01( 3)+
2 )
01 2
31473.0
( −) 01( =) ¿
583.766m
Or
s(t) = 0.04072 t4+0.186723t3−0.1899x2 +1.044629t -0.22552
s(10) = 0.04072 104+0.186723103−0.1899102 +1.04462910 -0.22552=585.15377 m
d)
- a(t) = -0.01777t4 + 0.2939t3 - 0.94726t2 + 2.98582t - 0.11888
t(sec) a(m/ s2)
0.5 1.172841875
1.5 3.130466875
5.5 20.28546688
8.5 44.55188188
Sample calculation
- a(0.5)= -0.01777(0.5)4 + 0.2939(0.5)3 - 0.94726(0.5)2 + 2.98582(0.5)- 0.11888=1.172841875
- a(8.5)= -0.01777(8.5)4 + 0.2939(8.5)3 - 0.94726(8.5)2 + 2.98582(8.5)- 0.11888=44.55188188
ds
v ( t )= =¿
dt
v ( t )=0.16288 t 3+ 0.560169t 2−0.3798 t+ 1.044629
t (s ) m
v( )
s
0 1.044629
1 1.387878
2 3.828745
3 9.34451
4 18.91245
3
5 33.50985
4
6 54.11399
3
7 81.70215
8 117.2516
1
9 161.7396
4
10 216.1435
3
' 3.249442−(−0.22552)
f ( X i )= =1.737481
2(1)
At t=2 (0 to 2)
' 9.539108−(0.856652)
f ( X i )= =4.341228
2(1)
At t=3
' 23.28919−(3.249442 )
f ( X i )= =10.01987
2(1)
- Polynomial regression method to find an equation for the velocity based on the
derivative of the distance equation.
t (s ) m
v( )
s
0 0
1 1.737481
2 4.341228
3 10.01987
4 19.7507
5 34.51098
6 55.278
7 83.02903
8 118.7414
9 163.3923
10 208.0432
n 11 m 2
Xi−¿¿ 5 Yi−¿¿ 63.53128991
∑ Xi 55∑ Yi 698.844189
2 2
∑ X i ∑
385 Y i 95731.37473
3
∑ Xi 3025 ∑ Xi . Yi 5705.802357
4 2
∑ Xi 25333 ∑ X i .Yi 48985.04329
5 3
∑ Xi 220825 ∑ X i .Yi 434255.7099
6 4
∑ Xi 1978405 ∑ X i . Yi 3937314.992
7
∑ Xi 18080425
8
∑ Xi 167731333
11 a 0+55 a 1+385 a 2+ 3025 a3+ 25333 a4 =698.844189
55 a0 +385 a1 +3025 a 2+25333 a 3+ 220825a 4=5705.802357
385 a0 +3025 a1 +25333 a 2+220825 a 3+1978405 a 4=48985.04329
3025 a0 +25333 a1 +220825 a 2+1978405 a3 +18080425 a 4=434255.7099
25333 a0 +220825 a1 +1978405 a2 +18080425 a3 +167731333 a 4=3937314.992
-Solving using Gauss-Jordan Method
11 55 385 3025 25333 698.8442
55 385 3025 25333 220825 5705.802
385 3025 25333 220825 1978405 48985.04
3025 25333 220825 1978405 18080425 434255.7
25333 220825 1978405 18080425 1.68E+08 3937315
1 0 0 36 648 5.13218
0 1 0 -57.2 -894 -7.97959
0 0 1 15 175 2.808488
0 0 0 6177.6 123552 693.5645
0 0 0 123552 2512224 13068.69
1 0 0 0 -72 1.090428
0 1 0 0 250 -1.5577
0 0 1 0 -125 1.124425
0 0 0 1 20 0.112271
0 0 0 0 41184 -802.602
1 0 0 0 0 -0.31272
0 1 0 0 0 3.314349
0 0 1 0 0 -1.3116
0 0 0 1 0 0.502035
0 0 0 0 1 -0.01949
a 0=−0.31272
a 1=3.314349
a 2=−1.3116
a 3=0.502035
a 4=−0.01949
Y(t) = -0.01949x4+0.502035x3-1.3116x2+3.314349 x -0.31272
2
x(sec m ¿¿ ( yi−a 0−a1 Xi−a2 X i 2−a 3 X i3−a 4 X i4 )
) y( )
s
0 0 4036.225 0.188547008
1 1.737481 3910.162 1.087012675
2 4.341228 3786.1 1.321575562
3 10.01987 3664.037 0.083136496
4
19.7507
3543.974 0.20161896
S ( yx )=¿ 1.036942
5 34.51098 3425.912 0.26110056 R2=¿ 0.999772
6 55.278 3309.849 0.012811976 R=¿ 0.999886
7 83.02903 3195.787 0.798388713
8 118.7414 3083.724 0.576512193
9 163.3923 2973.662 3.61326874
10 208.0432 2865.599 0.458017633
∑ 698.84419 37795.03 8.601990515
So the polynomial equation of the velocity would be:
v(t) = -0.01949t4+0.502035t3-1.3116t2+3.314349t-0.31272
150
100
50
0
0 2 4 6 8 10 12
-50
1.7 acceleration based on differentiation of velocity.
1.6.1 Analytical differentiation.
v(t) = -0.01949t4+0.502035t3-1.3116t2+3.314349t-0.31272
dv
a ( t )= =¿
dt
v ( t )=−0.07796 t 3 +1.506105t 2−2.6232 t+3.314349
t (s ) m
a( 2)
s
0 3.314349
1 2.119294
2 3.468689
3 6.894774
4 11.92979
5 18.10597
6 24.95557
7 32.01081
8 38.80395
9 44.86721
10 49.73285
At t=2
'' 39.539108−2 ( 3.249442) +(0.856652)
f ( X i )= 2
=3.896876
1
At t=3
-Polynomial regression method to find an equation for the accleration based on the
derivative of the velocity equation.
v(t) = 2.05E-08t4+0.153036t3+0.746562t2-1.51323t +2.4343
ds
v ( t )= =¿
dt
a ( t )=8.2E-08 t 3+ 0.459108t 2 +1.493124 t−1.51323
t (s ) m
a( 2)
s
0 0
1 1.310618
2 3.896876
3 7.460414
4 12.00123
5 17.51933
6 24.01471
7 31.48737
8 39.9373
9 49.36452
10 48.95927
n 11 m 2
−¿¿ −¿¿
Xi 5 Yi 21.45014865
∑ Xi 55 ∑ Yi 235.9516352
∑ X i2 385 ∑ Y i2 8520.531961
∑ X i3 3025 ∑ Xi . Yi 1784.958784
∑ X i4 25333 ∑ X i2 .Yi 14571.89551
∑ X i5 220825 ∑ X i3 .Yi 124573.1569
∑ X i6 1978405 ∑ X i4 . Yi 1098470.558
∑ X i7 18080425
∑ X i8 167731333
11 a 0+55 a 1+385 a 2+ 3025 a3+ 25333 a4 =¿235.9516352
55 a0 +385 a1 +3025 a 2+25333 a 3+ 220825a 4=¿1784.958784
385 a0 +3025 a1 +25333 a 2+220825 a 3+1978405 a 4=¿ 14571.89551
3025 a0 +25333 a1 +220825 a 2+1978405 a3 +18080425 a 4=¿ 124573.1569
25333 a0 +220825 a1 +1978405 a2 +18080425 a3 +167731333 a 4=¿1098470.558
- Solving using Gauss-Jordan Method
11 55 385 3025 25333 235.9516
55 385 3025 25333 220825 1784.959
385 3025 25333 220825 1978405 14571.9
3025 25333 220825 1978405 18080425 124573.2
25333 220825 1978405 18080425 1.68E+08 1098471
1 0 0 36 648 -1.48585
0 1 0 -57.2 -894 2.45308
0 0 1 15 175 0.304874
0 0 0 6177.6 123552 -399.892
0 0 0 123552 2512224 -8754.66
1 0 0 0 -72 0.844519
0 1 0 0 250 -1.24962
0 0 1 0 -125 1.275863
0 0 0 1 20 -0.06473
0 0 0 0 41184 -756.82
1 0 0 0 0 -0.47859
0 1 0 0 0 3.344513
0 0 1 0 0 -1.02121
0 0 0 1 0 0.302798
0 0 0 0 1 -0.01838
a 0=−0.47859
a 1=3.344513
a 2=−1.02121
a 3=0.302798
a 4=−0.01838
Y(x) = -0.01838 x4+0.302798 x3-1.02121 x2+3.344513 x-0.47859
2
x(sec m ¿¿ ( yi−a 0−a1 Xi−a2 X i 2−a 3 X i3−a 4 X i4 )
) y
s ( )
0 0 460.1089 0.229048388
1 1.310618 418.2086 0.669963531
2 3.896876 378.3083 0.127466137
3 7.460414 340.408 0.167763149
4 12.00123 304.5077 0.588804537 Sy/x 1.122824
5 17.51933 270.6074 0.196563656 R^2 0.996732
6 24.01471 238.7071 0.155319539 R 0.998365
7 31.48737 208.8068 1.289757706
8 39.9373 180.9065 0.534170957
9 49.36452 155.0062 5.345071187
10 48.95927 131.1059 0.781938385
∑ 235.9516 3086.681 10.08586717
So the polynomial equation of the acceleration would be:
a(x) = -0.01838 t4+0.302798 t3-1.02121 t2+3.344513 t-0.47859
t (s ) m
a( 2)
s
0 -0.47859
1 2.129131
2 4.2539
3 7.050825
4 11.23389
5 17.07598
6 24.40882
7 32.62305
8 40.66817
9 47.05258
10 49.84354
60
50
f(x) = − 0.02 x⁴ + 0.3 x³ − 1.02 x² + 3.34 x − 0.48
40 R² = 1
30
20
10
0
0 2 4 6 8 10 12
-10
1.8 ERRORs
1.7.1 Acceleration
time(sec) a((m/ s2) a((m/ s2) a((m/ s2) E% E%
Integration Differentiation
Analytical Integratio Differentiation
n
0 0 -0.11888 -0.47859 - -
1 2 2.19581 2.129131 9.7905 6.45655
2 4 4.1306 4.2539 3.265 6.3475
3 7 6.80917 7.050825 2.726143 0.726071
4 11 10.92872 11.23389 0.648 2.126273
5 17 16.75997 17.07598 1.411941 0.446941
6 24 24.14716 24.40882 0.613167 1.703417
7 32 32.50805 32.62305 1.587656 1.947031
8 41 40.83392 40.66817 0.405073 0.809341
9 48 47.68957 47.05258 0.646729 1.973792
10 51 51.21332 49.84354 0.418275 2.267569
60
50
40
30
20
10
0
0 2 4 6 8 10 12
-10
1.7.2 Velocity
time(sec) v((m/ s) v((m/ s) v((m/ s) E% E%
Analytical Integration Differentiation Integratio Differentiation
n
0 0 -0.37413 -0.31272 - -
1 1.128191 1.720274 2.172574 52.48074 92.57147
2 4.269681 4.172486 4.774018 2.2764 11.81205
3 9.64181 9.024474 9.802182 6.402698 1.663298
4 18.37215 17.98605 19.09988 2.10155 3.961028
5 32.07194 32.43485 34.04215 1.13155 6.143096
6 52.4095 53.41637 55.53629 1.921159 5.966082
7 80.68364 81.64395 84.02184 1.190217 4.137391
8 117.3971 117.4987 119.4706 0.086544 1.766187
9 161.8301 161.0297 161.3864 0.494593 0.274148
10 211.6134 211.9538 208.8058 0.160859 1.326773
250
200
150
100
50
0
0 2 4 6 8 10 12
-50
1.7.3 Distance
time(sec) s((m) s((m) E%
Analytical Integration Integration
0 0 -0.22552 -
1 0.737102 0.856652 16.21892
2 3.563508 3.249442 8.813394
3 9.88569 9.539108 3.505896
4 22.98601 23.28919 1.318976
5 47.69055 49.0405 2.830645
6 90.03697 92.31114 2.525818
7 156.9423 159.5965 1.691195
8 255.871 258.3692 0.976351
9 394.5022 397.0792 0.653228
10 580.3985 585.1538 0.819316
700
600
500
400
300
200
100
0
0 2 4 6 8 10 12
-100
2.0 Discussion