Uploaded by renzo.bdr

Del Rosario Module 2 Exercise

advertisement
RENZ LUI B. DEL ROSARIO
Master of Science in Mechanical Engineering
2023390123
Module 2 Exercise
Actual Integral and Derivative Values for Reference
Given:
P(x) =
Actual Integral:
e
I
=
√2π
Given:
P(x)dx
P(x) =
.
x1 = -2
x2 = 1.6
I
I
e
√2π
x = 0.75
e
dx
√2π
= 𝟎. 𝟗𝟐𝟐𝟒𝟓
=
Actual Derivative:
1
−xe .
D
=
e . (2)(−0.5x) =
√2π
√2π
−0.75e . ( . )
D
=
√2π
D
= −𝟎. 𝟐𝟐𝟓𝟖𝟓
1. Multiple Application Trapezoidal Rule
x
P(x)
-2
-1.1
-0.2
0.7
1.6
0.05399
0.21785
0.39104
0.31225
0.11092
Given:
P(x) =
Solution:
b − a
1.6 − (-2)
h=
=
= 0.9
n
4
e
√2π
x1 = a = -2
x2 = b = 1.6
n=4
I=
x
P(x)
-2
-1.55
-1.1
-0.65
-0.2
0.25
0.7
1.15
1.6
0.05399
0.12001
0.21785
0.32297
0.39104
0.38667
0.31225
0.20594
0.11092
Given:
P(x) =
Trapezoidal Rule (n = 4)
Coefficient, c
c*P(x)
1
0.05399
2
0.43570
2
0.78208
2
0.62450
1
0.11092
ΣP(xi) = 2.00719
h ΣP(xi ) 0.9 (2.00719)
=
= 0.90324
2
2
Trapezoidal Rule (n = 8)
Coefficient, c
c*P(x)
1
0.05399
2
0.24002
2
0.43570
2
0.64594
2
0.78208
2
0.77334
2
0.62450
2
0.41188
1
0.11092
ΣP(xi) = 4.07837
Solution:
b − a
1.6 − (-2)
h=
=
= 0.45
n
8
e
√2π
x1 = a = -2
x2 = b = 1.6
n=8
I=
x
P(x)
-2
-1.7
-1.4
-1.1
-0.8
-0.5
-0.2
0.1
0.4
0.7
1
1.3
1.6
0.05399
0.09405
0.14973
0.21785
0.28969
0.35207
0.39104
0.39695
0.36827
0.31225
0.24197
0.17137
0.11092
h ΣP(xi ) 0.45 (4.07837)
=
= 0.91763
2
2
Trapezoidal Rule (n = 12)
Coefficient, c
c*P(x)
1
0.05399
2
0.18810
2
0.29946
2
0.43570
2
0.57938
2
0.70414
2
0.78208
2
0.79390
2
0.73654
2
0.62450
2
0.48394
2
0.34274
1
0.11092
ΣP(xi) = 6.13539
Given:
P(x) =
Solution:
b − a
1.6 − (-2)
h=
=
= 0.3
n
12
e
√2π
x1 = a = -2
x2 = b = 1.6
n = 12
I=
x
P(x)
-2
-1.775
-1.55
-1.325
-1.1
-0.875
-0.65
-0.425
-0.2
0.025
0.25
0.475
0.7
0.925
1.15
1.375
1.6
0.05399
0.08256
0.12001
0.16584
0.21785
0.27205
0.32297
0.36449
0.39104
0.39882
0.38667
0.35638
0.31225
0.26008
0.20594
0.15501
0.11092
Given:
P(x) =
h ΣP(xi ) 0.3 (6.13539)
=
= 0.92031
2
2
Trapezoidal Rule (n = 16)
Coefficient, c
c*P(x)
1
0.05399
2
0.16512
2
0.24002
2
0.33168
2
0.43570
2
0.54410
2
0.64594
2
0.72898
2
0.78208
2
0.79764
2
0.77334
2
0.71276
2
0.62450
2
0.52016
2
0.41188
2
0.31002
1
0.11092
ΣP(xi) = 8.18883
Solution:
b − a
1.6 − (-2)
h=
=
= 0.225
n
16
e
√2π
x1 = a = -2
x2 = b = 1.6
n = 16
I=
h ΣP(xi ) 0.225 (8.18883)
=
= 0.92124
2
2
2. Multiple Application Simpson’s 1/3 Rule
x
P(x)
-2
-1.1
-0.2
0.7
1.6
0.05399
0.21785
0.39104
0.31225
0.11092
Given:
P(x) =
Solution:
b − a
1.6 − (-2)
h=
=
= 0.9
n
4
e
√2π
x1 = a = -2
x2 = b = 1.6
n=4
Given:
P(x) =
e
√2π
x1 = a = -2
x2 = b = 1.6
n=8
Simpson’s 1/3 Rule (n = 4)
Coefficient, c
c*P(x)
1
0.05399
4
0.87140
2
0.78208
4
1.24900
1
0.11092
ΣP(xi) = 3.06739
I=
x
P(x)
-2
-1.55
-1.1
-0.65
-0.2
0.25
0.7
1.15
1.6
0.05399
0.12001
0.21785
0.32297
0.39104
0.38667
0.31225
0.20594
0.11092
h ΣP(xi ) 0.9 (3.06739)
=
= 0.92022
3
3
Simpson’s 1/3 Rule (n = 8)
Coefficient, c
c*P(x)
1
0.05399
4
0.48004
2
0.43570
4
1.29188
2
0.78208
4
1.54668
2
0.62450
4
0.82376
1
0.11092
ΣP(xi) = 6.14955
Solution:
b − a
1.6 − (-2)
h=
=
= 0.45
n
8
I=
h ΣP(xi ) 0.45 (6.14955)
=
= 0.92243
3
3
x
P(x)
-2
-1.7
-1.4
-1.1
-0.8
-0.5
-0.2
0.1
0.4
0.7
1
1.3
1.6
0.05399
0.09405
0.14973
0.21785
0.28969
0.35207
0.39104
0.39695
0.36827
0.31225
0.24197
0.17137
0.11092
Given:
P(x) =
Solution:
b − a
1.6 − (-2)
h=
=
= 0.3
n
12
e
√2π
x1 = a = -2
x2 = b = 1.6
n = 12
I=
x
P(x)
-2
-1.775
-1.55
-1.325
-1.1
-0.875
-0.65
-0.425
-0.2
0.025
0.25
0.475
0.7
0.925
1.15
1.375
1.6
0.05399
0.08256
0.12001
0.16584
0.21785
0.27205
0.32297
0.36449
0.39104
0.39882
0.38667
0.35638
0.31225
0.26008
0.20594
0.15501
0.11092
Given:
P(x) =
Simpson’s 1/3 Rule (n = 12)
Coefficient, c
c*P(x)
1
0.05399
4
0.37620
2
0.29946
4
0.87140
2
0.57938
4
1.40828
2
0.78208
4
1.58780
2
0.73654
4
1.24900
2
0.48394
4
0.68548
1
0.11092
ΣP(xi) = 9.22447
h ΣP(xi ) 0.3 (9.22447)
=
= 0.92245
3
3
Simpson’s 1/3 Rule (n = 16)
Coefficient, c
c*P(x)
1
0.05399
4
0.33024
2
0.24002
4
0.66336
2
0.43570
4
1.08820
2
0.64594
4
1.45796
2
0.78208
4
1.59528
2
0.77334
4
1.42552
2
0.62450
4
1.04032
2
0.41188
4
0.62004
1
0.11092
ΣP(xi) = 12.29929
Solution:
b − a
1.6 − (-2)
h=
=
= 0.225
n
16
e
√2π
x1 = a = -2
x2 = b = 1.6
n = 16
I=
h ΣP(xi ) 0.225 (12.29929)
=
= 0.92245
3
3
3. Multiple Application Simpson’s 3/8 Rule
Given:
P(x) =
e
√2π
x1 = a = -2
x2 = b = 1.6
n=6
x
P(x)
-2
-1.4
-0.8
-0.2
0.4
1
1.6
0.05399
0.14973
0.28969
0.39104
0.36827
0.24197
0.11092
Simpson’s 3/8 Rule (n = 6)
Coefficient, c
c*P(x)
1
0.05399
3
0.44919
3
0.86907
2
0.78208
3
1.10481
3
0.72591
1
0.11092
ΣP(xi) = 4.09597
Solution:
b − a
1.6 − (-2)
h=
=
= 0.6
n
6
I=
3h ΣP(xi ) 3 (0.6) (4.09597)
=
= 0.92159
8
8
x
P(x)
-2
-1.6
-1.2
-0.8
-0.4
0
0.4
0.8
1.2
1.6
0.05399
0.11092
0.19419
0.28969
0.36827
0.39894
0.36827
0.28969
0.19419
0.11092
Given:
P(x) =
Solution:
b − a
1.6 − (-2)
h=
=
= 0.4
n
9
e
√2π
x1 = a = -2
x2 = b = 1.6
n=9
I=
x
P(x)
-2
-1.7
-1.4
-1.1
-0.8
-0.5
-0.2
0.1
0.4
0.7
1
1.3
1.6
0.05399
0.09405
0.14973
0.21785
0.28969
0.35207
0.39104
0.39695
0.36827
0.31225
0.24197
0.17137
0.11092
Given:
P(x) =
P(x) =
e
e
√2π
x1 = a = -2
x2 = b = 1.6
n = 15
3h ΣP(xi ) 3 (0.4) (6.14943)
=
= 0.92241
8
8
Simpson’s 3/8 Rule (n = 12)
Coefficient, c
c*P(x)
1
0.05399
3
0.28215
3
0.44919
2
0.43570
3
0.86907
3
1.05621
2
0.78208
3
1.19085
3
1.10481
2
0.62450
3
0.72591
3
0.51411
1
0.11092
ΣP(xi) = 8.19949
Solution:
b − a
1.6 − (-2)
h=
=
= 0.3
n
12
√2π
x1 = a = -2
x2 = b = 1.6
n = 12
Given:
Simpson’s 3/8 Rule (n = 9)
Coefficient, c
c*P(x)
1
0.05399
3
0.33276
3
0.58257
2
0.57938
3
1.10481
3
1.19682
2
0.73654
3
0.86907
3
0.58257
1
0.11092
ΣP(xi) = 6.14943
I=
x
P(x)
-2
-1.76
-1.52
-1.28
-1.04
-0.8
-0.56
-0.32
-0.08
0.16
0.4
0.64
0.88
1.12
1.36
1.6
0.05399
0.08478
0.12566
0.17585
0.23230
0.28969
0.34105
0.37903
0.39767
0.39387
0.36827
0.32506
0.27086
0.21307
0.15822
0.11092
3h ΣP(xi ) 3 (0.3) (8.19949)
=
= 0.92244
8
8
Simpson’s 3/8 Rule (n = 15)
Coefficient, c
c*P(x)
1
0.05399
3
0.25434
3
0.37698
2
0.35170
3
0.69690
3
0.86907
2
0.68210
3
1.13709
3
1.19301
2
0.78774
3
1.10481
3
0.97518
2
0.54172
3
0.63921
3
0.47466
1
0.11092
ΣP(xi) = 10.24942
Solution:
b − a
1.6 − (-2)
h=
=
= 0.24
n
15
I=
3h ΣP(xi ) 3 (0.24) (10.24942)
=
= 0.92245
8
8
4. Multiple Application Boole’s Rule
x
P(x)
-2
-1.1
-0.2
0.7
1.6
0.05399
0.21785
0.39104
0.31225
0.11092
Given:
P(x) =
Solution:
b − a
1.6 − (-2)
h=
=
= 0.9
n
4
e
√2π
x1 = a = -2
x2 = b = 1.6
n=4
I=
x
P(x)
-2
-1.55
-1.1
-0.65
-0.2
0.25
0.7
1.15
1.6
0.05399
0.12001
0.21785
0.32297
0.39104
0.38667
0.31225
0.20594
0.11092
Given:
P(x) =
e
Boole’s Rule (n = 8)
Coefficient, c
7
32
12
32
14
32
12
32
7
I=
x
P(x)
-2
-1.7
-1.4
-1.1
-0.8
-0.5
-0.2
0.1
0.4
0.7
1
1.3
1.6
0.05399
0.09405
0.14973
0.21785
0.28969
0.35207
0.39104
0.39695
0.36827
0.31225
0.24197
0.17137
0.11092
Given:
e
Boole’s Rule (n = 12)
Coefficient, c
7
32
12
32
14
32
12
32
14
32
12
32
7
I=
x
P(x)
-2
-1.775
-1.55
-1.325
-1.1
-0.875
-0.65
-0.425
0.05399
0.08256
0.12001
0.16584
0.21785
0.27205
0.32297
0.36449
c*P(x)
0.37793
3.84032
2.6142
10.33504
5.47456
12.37344
3.747
6.59008
0.77644
ΣP(xi) = 46.12901
2h ΣP(xi ) 2 (0.45) (46.12901)
=
= 0.92258
45
45
Solution:
b − a
1.6 − (-2)
h=
=
= 0.3
n
12
√2π
x1 = a = -2
x2 = b = 1.6
n = 12
c*P(x)
0.37793
6.97120
4.69248
9.99200
0.77644
ΣP(xi) = 22.81005
2h ΣP(xi ) 2 (0.9) (22.81005)
=
= 0.91240
45
45
Solution:
b − a
1.6 − (-2)
h=
=
= 0.45
n
8
√2π
x1 = a = -2
x2 = b = 1.6
n=8
P(x) =
Boole’s Rule (n = 4)
Coefficient, c
7
32
12
32
7
c*P(x)
0.37793
3.00960
1.79676
6.97120
4.05566
11.26624
4.69248
12.70240
5.15578
9.99200
2.90364
5.48384
0.77644
ΣP(xi) = 69.18397
2h ΣP(xi ) 2 (0.3) (69.18397)
=
= 0.92245
45
45
Boole’s Rule (n = 16)
Coefficient, c
7
32
12
32
14
32
12
32
c*P(x)
0.37793
2.64192
1.44012
5.30688
3.04990
8.70560
3.87564
11.66368
-0.2
0.025
0.25
0.475
0.7
0.925
1.15
1.375
1.6
0.39104
0.39882
0.38667
0.35638
0.31225
0.26008
0.20594
0.15501
0.11092
14
32
12
32
14
32
12
32
7
Given:
P(x) =
5.47456
12.76224
4.64004
11.40416
4.37150
8.32256
2.47128
4.96032
0.77644
ΣP(xi) = 92.24477
Solution:
b − a
1.6 − (-2)
h=
=
= 0.225
n
16
e
√2π
x1 = a = -2
x2 = b = 1.6
n = 16
I=
2h ΣP(xi ) 2 (0.225) (92.24477)
=
= 0.92245
45
45
5. Romberg Integration
x
P(x)
-2
1.6
0.05399
0.11092
Trapezoidal Rule (n = 1)
Coefficient, c
c*P(x)
1
0.05399
1
0.11092
ΣP(xi) = 0.16491
Given:
P(x) =
Solution:
b − a
1.6 − (-2)
h=
=
= 3.6
n
1
e
√2π
x1 = a = -2
x2 = b = 1.6
n=1
I=
x
P(x)
-2
-0.2
1.6
0.05399
0.39104
0.11092
Trapezoidal Rule (n = 2)
Coefficient, c
c*P(x)
1
0.05399
2
0.78208
1
0.11092
ΣP(xi) = 0.94699
Given:
P(x) =
h ΣP(xi ) 3.6 (0.16491)
=
= 0.29684
2
2
Solution:
b − a
1.6 − (-2)
h=
=
= 1.8
n
2
e
√2π
x1 = a = -2
x2 = b = 1.6
n=2
I=
n
h
I(h)
16
8
4
2
1
0.225
0.45
0.9
1.8
3.6
I(h5) = 0.92124
I(h4) = 0.91763
I(h3) = 0.90324
I(h2) = 0.85229
I(h1) = 0.29684
h ΣP(xi ) 1.8 (0.94699)
=
= 0.85229
2
2
O(h4)
k=2
I(h45) = 0.92244
I(h34) = 0.92243
I(h23) = 0.92022
I(h12) = 1.03744
Solutions for k = 2:
O(h6)
k=3
I(h345) = 0.92244
I(h234) = 0.92275
I(h123) = 0.90347
O(h8)
k=4
I(h2345) = 0.92242
I(h1234) = 0.92404
O(h10)
k=5
I(h12345) = 0.92237
Solutions for k = 3:
I(h ) = I(h ) +
I(h ) − I(h )
0.92124 − 0.91763
= 0.92124 +
= 𝟎. 𝟗𝟐𝟐𝟒𝟒
2 −1
2 −1
I(h
) = I(h ) +
I(h ) − I(h )
0.92244 − 0.92243
= 0.92244 +
= 𝟎. 𝟗𝟐𝟐𝟒𝟒
2 −1
2 −1
I(h ) = I(h ) +
I(h ) − I(h )
0.91763 − 0.90324
= 0.91763 +
= 𝟎. 𝟗𝟐𝟐𝟒𝟑
2 −1
2 −1
I(h
) = I(h ) +
I(h ) − I(h )
0.92243 − 0.92022
= 0.92243 +
= 𝟎. 𝟗𝟐𝟐𝟕𝟓
2 −1
2 −1
I(h ) = I(h ) +
I(h ) − I(h )
0.90324 − 0.85229
= 0.90324 +
= 𝟎. 𝟗𝟐𝟎𝟐𝟐
2 −1
2 −1
I(h
) = I(h ) +
I(h ) − I(h )
0.92022 − 1.03744
= 0.92022 +
= 𝟎. 𝟗𝟎𝟑𝟒𝟕
2 −1
2 −1
I(h ) = I(h ) +
I(h ) − I(h )
0.85229 − 0.29684
= 0.85229 +
= 𝟏. 𝟎𝟑𝟕𝟒𝟒
2 −1
2 −1
Solutions for k = 4:
I(h
) = I(h
)+
I(h
Solution for k = 5:
) − I(h
2 −1
)
= 0.92244 +
0.92244 − 0.92275
= 𝟎. 𝟗𝟐𝟐𝟒𝟐
2 −1
I(h
) = I(h
)+
I(h
) − I(h
2 −1
)
= 0.92242 +
0.92242 − 0.92404
= 𝟎. 𝟗𝟐𝟐𝟑𝟕
2 −1
I(h
) = I(h
I(h
)+
) − I(h
2 −1
)
= 0.92275 +
0.92275 − 0.90347
= 𝟎. 𝟗𝟐𝟒𝟎𝟒
2 −1
6. Truncation Errors
A. Multiple Application Trapezoidal Rule
Avg. f(2)
-0.07929
-0.07929
-0.07929
-0.07929
n
4
8
12
16
Ea
0.01927
0.00482
0.00214
0.00120
I(h)
0.90324
0.91763
0.92031
0.92124
Solution:
f(x) =
e
Avg. f
( )
√2π
f (x) =
1
√2π
f (x) =
1
√2π
.
e
(2)(−0.5x) =
.
x(e
√2π
)(2)(−0.5x) + e
.
(x − 1)e .
√2π
1.6 − (−2)
.
dx
= −0.07929
for n = 4:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.07929)
E =
=
= 𝟎. 𝟎𝟏𝟗𝟐𝟕
12n
12(4)
.
−xe
∫ f (x)dx ∫
=
=
b−a
I(a) = I(h) + Ea
0.92251
0.92245
0.92245
0.92244
(1) =
(x − 1)e
.
√2π
for n = 8:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.07929)
E =
=
= 𝟎. 𝟎𝟎𝟒𝟖𝟐
12n
12(8)
for n = 12:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.07929)
E =
=
= 𝟎. 𝟎𝟎𝟐𝟏𝟒
12n
12(12)
for n = 16:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.07929)
E =
=
= 𝟎. 𝟎𝟎𝟏𝟐𝟎
12n
12(16)
B. Multiple Application Simpson’s 1/3 Rule
Avg. f(4)
-0.0083
-0.0083
-0.0083
-0.0083
n
4
8
12
16
Solution:
(x − 1)e
f (x) =
√2π
f (x) =
f (x) =
f
(x) =
f
(x) =
Ea
0.00011
0.00001
0
0
.
Avg. f
1
e . (2x) + (x − 1) e
√2π
(3x − x )e .
.
(2)(−0.5x)
√2π
1
I(h)
0.92022
0.92243
0.92245
0.92245
.
e
(3 − 3x ) + (3x − x ) e
√2π
(3 − 6x + x )e .
.
(2)(−0.5x)
√2π
( )
∫ f (x)dx ∫
=
=
b−a
.
(3 − 6x + x )e
√2π
1.6 − (−2)
I(a) = I(h) + Ea
0.92033
0.92244
0.92245
0.92245
.
dx
= −0.00830
for n = 4:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.00830)
E =
=
= 𝟎. 𝟎𝟎𝟎𝟏𝟏
180n
180(4)
for n = 8:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.00830)
E =
=
= 𝟎. 𝟎𝟎𝟎𝟎𝟏
180n
180(8)
for n = 12:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.00830)
E =
=
=𝟎
180n
180(12)
for n = 16:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.00830)
E =
=
=𝟎
180n
180(16)
C. Multiple Application Simpson’s 3/8 Rule
n
6
9
12
15
Avg. f(4)
-0.0083
-0.0083
-0.0083
-0.0083
Ea
0.00005
0.00001
0
0
I(h)
0.92159
0.92241
0.92244
0.92245
I(a) = I(h) + Ea
0.92164
0.92242
0.92244
0.92245
Solution:
(3 − 6x + x )e
f (x) =
√2π
∫ f (x)dx ∫
Avg. f ( ) =
=
b−a
.
(3 − 6x + x )e
√2π
1.6 − (−2)
.
.
dx
= −0.00830
for n = 6:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.00830)
E =
=
= 𝟎. 𝟎𝟎𝟎𝟎𝟓
80n
80(6)
for n = 9:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.00830)
E =
=
= 𝟎. 𝟎𝟎𝟎𝟎𝟏
80n
80(9)
for n = 12:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.00830)
E =
=
=𝟎
80n
80(12)
for n = 15:
−(b − a) Avg. f ( ) −[1.6 − (−2)] (−0.00830)
E =
=
=𝟎
80n
80(15)
D. Multiple Application Boole’s Rule
Avg. f(6)
0.46943
0.46943
0.46943
0.46943
n
4
8
12
16
Solution:
(3 − 6x + x )e
f (x) =
√2π
f
(x) =
f
(x) =
f
(x) =
f
(x) =
Ea
-0.00190
-0.00003
0
0
.
Avg. f ( ) =
(3 − 6x + x ) e .
√2π
(−15x + 10x − x )e .
(2)(−0.5x) + e
.
(−12x + 4x )
e
.
(x)dx
.
=
.
(−15 + 45x − 15x + x )e
√2π
1.6 − (−2)
.
dx
for n = 8:
−2(b − a) Avg. f ( ) −2[1.6 − (−2)] (0.46943)
E =
=
= −𝟎. 𝟎𝟎𝟎𝟎𝟑
945n
945(8)
(−15 + 30x − 5x )
+ (−15x + 10x − x )(e
(−15 + 45x − 15x + x )e .
∫
I(a) = I(h) + Ea
0.91050
0.92255
0.92245
0.92245
for n = 4:
−2(b − a) Avg. f ( ) −2[1.6 − (−2)] (0.46943)
E =
=
= −𝟎. 𝟎𝟎𝟏𝟗𝟎
945n
945(4)
√2π
1
∫ f
b−a
Avg. f ( ) = 0.46943
1
√2π
I(h)
0.91240
0.92258
0.92245
0.92245
)(2)(−0.5x)
for n = 12:
−2(b − a) Avg. f ( ) −2[1.6 − (−2)] (0.46943)
E =
=
=𝟎
945n
945(12)
√2π
for n = 16:
−2(b − a) Avg. f ( ) −2[1.6 − (−2)] (0.46943)
E =
=
=𝟎
945n
945(16)
7. Numerical Differentiation
A. Forward Finite Divided Difference with Richardson’s Extrapolation
h
xi
xi+h
xi+2h
f(xi)
f(xi+h)
f(xi+2h)
Truncated
0.125
0.0625
0.03125
0.75
0.75
0.75
0.875
0.8125
0.78125
1
0.875
0.8125
0.30114
0.30114
0.30114
0.27205
0.28679
0.29402
0.24197
0.27205
0.28679
-0.23272
-0.22960
-0.22784
h
0.03125
0.0625
0.125
Given:
f(x) =
e
√2π
x = 0.75
h = 0.125
h = 0.0625
D(h)
D(h3) = -0.22784
D(h2) = -0.22960
D(h1) = -0.23272
k=2
D(h23) = -0.22725
D(h12) = -0.22856
More
Accurate
-0.22876
-0.22648
-0.22608
k=3
D(h123) = -0.22706
Solutions using the truncated formula:
Solutions using the more accurate formula:
for h1 = 0.125:
f(x ) − f(x )
f (x ) =
h
0.27205 − 0.30114
f (x ) =
= −𝟎. 𝟐𝟑𝟐𝟕𝟐
0.125
for h1 = 0.125:
) + 4f(x ) − 3f(x )
−f(x
f (x ) =
2h
−0.24197 + 4(0.27205) − 3(0.30114)
f (x ) =
= −𝟎. 𝟐𝟐𝟖𝟕𝟔
2(0.125)
h = 0.03125
for h2 = 0.0625:
f(x ) − f(x )
f (x ) =
h
0.28679 − 0.30114
f (x ) =
= −𝟎. 𝟐𝟐𝟗𝟔𝟎
0.0625
for h2 = 0.0625:
) + 4f(x ) − 3f(x )
−f(x
f (x ) =
2h
−0.27205 + 4(0.28679) − 3(0.30114)
f (x ) =
= −𝟎. 𝟐𝟐𝟔𝟒𝟖
2(0.0625)
for h3 = 0.03125:
f(x ) − f(x )
f (x ) =
h
0.29402 − 0.30114
f (x ) =
= −𝟎. 𝟐𝟐𝟕𝟖𝟒
0.03125
for h3 = 0.03125:
) + 4f(x ) − 3f(x )
−f(x
f (x ) =
2h
−0.28679 + 4(0.29402) − 3(0.30114)
f (x ) =
= −𝟎. 𝟐𝟐𝟔𝟎𝟖
2(0.03125)
Solutions using Richardson’s extrapolation:
for k = 2:
D(h ) = D(h ) +
D(h ) − D(h )
−0.22784 − (−0.22960)
= −0.22784 +
= −𝟎. 𝟐𝟐𝟕𝟐𝟓
2 −1
2 −1
D(h ) = D(h ) +
D(h ) − D(h )
−0.22960 − (−0.23272)
= −0.22960 +
= −𝟎. 𝟐𝟐𝟖𝟓𝟔
2 −1
2 −1
for k = 3:
D(h
) = D(h ) +
D(h ) − D(h )
−0.22725 − (−0.22856)
= −0.22725 +
= −𝟎. 𝟐𝟐𝟕𝟎𝟔
2 −1
2 −1
B. Backward Finite Divided Difference with Richardson’s Extrapolation
h
xi
xi-h
xi-2h
f(xi)
f(xi-h)
f(xi-2h)
Truncated
0.125
0.0625
0.03125
0.75
0.75
0.75
0.625
0.6875
0.71875
0.5
0.625
0.6875
0.30114
0.30114
0.30114
0.32816
0.31497
0.30813
0.35207
0.32816
0.31497
-0.21616
-0.22128
-0.22368
h
0.03125
0.0625
0.125
Given:
f(x) =
e
√2π
x = 0.75
h = 0.125
h = 0.0625
h = 0.03125
D(h)
D(h3) = -0.22368
D(h2) = -0.22128
D(h1) = -0.21616
k=2
D(h23) = -0.22448
D(h12) = -0.22299
k=3
D(h123) = -0.22469
Solutions using the truncated formula:
Solutions using the more accurate formula:
for h1 = 0.125:
f(x ) − f(x )
f (x ) =
h
0.30114 − 0.32816
f (x ) =
= −𝟎. 𝟐𝟏𝟔𝟏𝟔
0.125
for h1 = 0.125:
)
3f(x ) − 4f(x ) + f(x
f (x ) =
2h
3(0.30114) − 4(0.32816) + 0.35207
f (x ) =
= −𝟎. 𝟐𝟐𝟖𝟔𝟎
2(0.125)
for h2 = 0.0625:
f(x ) − f(x )
f (x ) =
h
0.30114 − 0.31497
f (x ) =
= −𝟎. 𝟐𝟐𝟏𝟐𝟖
0.0625
for h2 = 0.0625:
)
3f(x ) − 4f(x ) + f(x
f (x ) =
2h
3(0.30114) − 4(0.31497) + 0.32816
f (x ) =
= −𝟎. 𝟐𝟐𝟔𝟒𝟎
2(0.0625)
for h3 = 0.03125:
f(x ) − f(x )
f (x ) =
h
0.30114 − 0.30813
f (x ) =
= −𝟎. 𝟐𝟐𝟑𝟔𝟖
0.03125
for h3 = 0.03125:
)
3f(x ) − 4f(x ) + f(x
f (x ) =
2h
3(0.30114) − 4(0.30813) + 0.31497
f (x ) =
= −𝟎. 𝟐𝟐𝟔𝟎𝟖
2(0.03125)
Solutions using Richardson’s extrapolation:
for k = 2:
D(h ) = D(h ) +
D(h ) − D(h )
−0.22368 − (−0.22128)
= −0.22368 +
= −𝟎. 𝟐𝟐𝟒𝟒𝟖
2 −1
2 −1
D(h ) = D(h ) +
D(h ) − D(h )
−0.22128 − (−0.21616)
= −0.22128 +
= −𝟎. 𝟐𝟐𝟐𝟗𝟗
2 −1
2 −1
for k = 3:
D(h
) = D(h ) +
D(h ) − D(h )
−0.22448 − (−0.22299)
= −0.22448 +
= −𝟎. 𝟐𝟐𝟒𝟔𝟗
2 −1
2 −1
More
Accurate
-0.22860
-0.22640
-0.22608
C. Centered Finite Divided Difference with Richardson’s Extrapolation
h
xi
xi+2h
xi+h
xi-h
xi-2h
f(xi+2h)
f(xi+h)
f(xi-h)
f(xi-2h)
Truncated
0.125
0.0625
0.03125
0.75
0.75
0.75
1
0.875
0.8125
0.875
0.8125
0.78125
0.625
0.6875
0.71875
0.5
0.625
0.6875
0.24197
0.27205
0.28679
0.27205
0.28679
0.29402
0.32816
0.31497
0.30813
0.35207
0.32816
0.31497
-0.22444
-0.22544
-0.22576
h
0.03125
0.0625
0.125
Given:
f(x) =
e
√2π
x = 0.75
h = 0.125
h = 0.0625
h = 0.03125
D(h)
D(h3) = -0.22576
D(h2) = -0.22544
D(h1) = -0.22444
k=2
D(h23) = -0.22587
D(h12) = -0.22577
k=3
D(h123) = -0.22588
Solutions using the truncated formula:
Solutions using the more accurate formula:
for h1 = 0.125:
f(x ) − f(x )
f (x ) =
h
0.27205 − 0.32816
f (x ) =
= −𝟎. 𝟐𝟐𝟒𝟒𝟒
0.125
for h1 = 0.125:
) + 8f(x
−f(x
f (x ) =
for h2 = 0.0625:
f(x ) − f(x )
f (x ) =
h
0.28679 − 0.31497
f (x ) =
= −𝟎. 𝟐𝟐𝟓𝟒𝟒
0.0625
for h2 = 0.0625:
) + 8f(x
−f(x
f (x ) =
for h3 = 0.03125:
f(x ) − f(x )
f (x ) =
h
0.29402 − 0.30813
(x
)
f
=
= −𝟎. 𝟐𝟐𝟓𝟕𝟔
0.03125
) − 8f(x ) + f(x
)
12h
−0.24197 + 8(0.27205) − 8(0.32816) + 0.35207
f (x ) =
= −𝟎. 𝟐𝟐𝟓𝟖𝟓
12(0.125)
) − 8f(x ) + f(x
)
12h
−0.27205 + 8(0.28679) − 8(0.31497) + 0.32816
f (x ) =
= −𝟎. 𝟐𝟐𝟓𝟕𝟕
12(0.0625)
for h3 = 0.03125:
) + 8f(x
−f(x
f (x ) =
) − 8f(x ) + f(x
)
12h
−0.28679 + 8(0.29402) − 8(0.30813) + 0.31497
f (x ) =
= −𝟎. 𝟐𝟐𝟓𝟖𝟕
12(0.03125)
Solutions using Richardson’s extrapolation:
for k = 2:
D(h ) = D(h ) +
D(h ) − D(h )
−0.22576 − (−0.22544)
= −0.22576 +
= −𝟎. 𝟐𝟐𝟓𝟖𝟕
2 −1
2 −1
D(h ) = D(h ) +
D(h ) − D(h )
−0.22544 − (−0.22444)
= −0.22544 +
= −𝟎. 𝟐𝟐𝟓𝟕𝟕
2 −1
2 −1
for k = 3:
D(h
) = D(h ) +
More
Accurate
-0.22585
-0.22577
-0.22587
D(h ) − D(h )
−0.22587 − (−0.22577)
= −0.22587 +
= −𝟎. 𝟐𝟐𝟓𝟖𝟖
2 −1
2 −1
Download