se301_14(c)al-amer20031 se031numerical methods topic 6 numerical differentiation dr. samir al-amer (...
Post on 19-Dec-2015
216 views
TRANSCRIPT
SE301_14 (c)AL-AMER2003 1
SE031Numerical MethodsTopic 6
Numerical Differentiation
Dr. Samir Al-Amer ( Term 053)
Modified by Dr. Baroudi(072)Read chapter 23.1 and 23.2
SE301_14 (c)AL-AMER2003 2
Numerical Differentiation First order derivatives High order derivatives Richardson Extrapolation Examples
SE301_14 (c)AL-AMER2003 3
MotivationHow do you evaluate the
derivative of a tabulated function.
How do we determine the velocity and acceleration from tabulated measurements.
Time(second)
Displacement
(meters)
0 30.1
5 48.2
10 50.0
15 40.2
SE301_14 (c)AL-AMER2003 4
Recall
nn
nn
h
hEh
hCEthatsuchCfiniterealhOE
hOhxfhxf
hxfxfhxf
TheoremTaylor
h
xfhxf
dx
df
similar to rateat zero gapproachin isorder of is E
, )(
)(!3
)(
!2
)()(')()(
:
)()(lim
43)3(2)2(
0
SE301_14 (c)AL-AMER2003 5
Three formula
them?judge wedo How better? is methodWhich
2
)()()(DifferenceCentral
)()()(DifferenceBackward
)()()(DifferenceForward
h
hxfhxf
dx
xdf
h
hxfxf
dx
xdf
h
xfhxf
dx
xdf
SE301_14 (c)AL-AMER2003 6
Forward Difference formula
)()()(
)('
)()()()('
)()(')()( :DifferenceBackward
_______________________________________________________
)()()(
)('
)()()()('
)()(')()(DifferenceForward
2
2
2
2
hOh
hxfxfxf
hOhxfxfhxf
hOhxfxfhxf
hOh
xfhxfxf
hOxfhxfhxf
hOhxfxfhxf
SE301_14 (c)AL-AMER2003 7
Central Difference formula
)(2
)()()('
...!3
)(2)('2)()(
...!4
)(
!3
)(
!2
)()(')()(
...!4
)(
!3
)(
!2
)()(')()(
DifferenceCentral
2
3)3(
4)4(3)3(2)2(
4)4(3)3(2)2(
hOh
hxfhxfxf
hxfhxfhxfhxf
hxfhxfhxfhxfxfhxf
hxfhxfhxfhxfxfhxf
SE301_14 (c)AL-AMER2003 8
The Three formula (revisited)
answer better give toexpected is formula difference Central
accurcyin comparable are formulas difference backward andForward
)(2
)()()(DifferenceCentral
)()()()(
DifferenceBackward
)()()()(
DifferenceForward
2hOh
hxfhxf
dx
xdf
hOh
hxfxf
dx
xdf
hOh
xfhxf
dx
xdf
SE301_14 (c)AL-AMER2003 9
Higher Order Formulas
12
)(
)()()(2)(
)(
...!4
)(2
!2
)(2)(2)()(
...!4
)(
!3
)(
!2
)()(')()(
...!4
)(
!3
)(
!2
)()(')()(
2)4(
22
)2(
4)4(2)2(
4)4(3)3(2)2(
4)4(3)3(2)2(
hfError
hOh
hxfxfhxfxf
hxfhxfxfhxfhxf
hxfhxfhxfhxfxfhxf
hxfhxfhxfhxfxfhxf
SE301_14 (c)AL-AMER2003 10
High Accuracy Differentiation Formulas (1) High-accuracy divided-difference formulas can be generated
by including additional terms from the Taylor series expansion.
Consider the forward finite-divided difference
)(2
)(3)(4)()(
)(2
)()(2)()()()(
)()()(2)(
)(
)(2
)()()()(
2
)()()()(
212
22
121
212
21
21
hOh
xfxfxfxf
hOhh
xfxfxf
h
xfxfxf
hOh
xfxfxfxf
hOhxf
h
xfxfxf
hxf
hxfxfxf
iiii
iiiiii
iiii
iiii
iiii
SE301_14 (c)AL-AMER2003 11
High Accuracy Differentiation Formulas (2) Consider the backward finite-divided difference
Consider the central finite-divided difference
)(2
)(3)(4)()(
)()()(
)(
212
1
hOh
xfxfxfxf
hOh
xfxfxf
iiii
iii
)(12
)()(8)(8)()(
)(2
)()()(
42112
211
hOh
xfxfxfxfxf
hOh
xfxfxf
iiiii
iii
SE301_14 (c)AL-AMER2003 12
Example
Central and Backward Forward, :caseeach for error true theFind
.250 of size step a and difference-divided finitite using 50At
2.125.05.015.01.0
of derivativefirst theEstimate234
.h.x
xxxxf(x)
SE301_14 (c)AL-AMER2003 13
Other Higher Order Formulas
ordererror obtain theand themprove toTheoremTaylor usecan You
possible. also are)...(),(for formulasOther
)2()(4)(6)(4)2()(
2
)2()(2)(2)2()(
)()(2)()(
)3()2(
4)4(
3)3(
2)2(
xfxf
h
hxfhxfxfhxfhxfxf
h
hxfhxfhxfhxfxf
h
hxfxfhxfxf
SE301_14 (c)AL-AMER2003 14
Richardson Extrapolation
xfaa
hahahah
hxfhxfxf
xfh
xfh
h
hxfhxfxf v
and on depend ,..., Constants
...2
)()()('
...)(!5
)(!32
)()()('
DifferenceCentral
42
66
44
22
4'''
2
SE301_14 (c)AL-AMER2003 15
Richardson Extrapolation
4
66
44
6
6
4
4
2
2
66
44
22
)2
(4)(3
1)('
get werearrange, and 3-by divide
...16
15
4
3)('3)
2(4)(
...222
)(')2
(
...)(')(
2
)()()(
define ,)(
hOh
hxf
hahaxfh
h
ha
ha
haxf
h
hahahaxfh
h
hxfhxfh
fixedxandxfHold
SE301_14 (c)AL-AMER2003 16
Richardson Extrapolation Table
)1,1()1,(14
1)1,(),(
2)0,(:
mnDmnDmnDmnD
others
hnDColumnFirst
m
n
SE301_14 (c)AL-AMER2003 17
Richardson Extrapolation TableD(0,0)=Φ(h)
D(1,0)=Φ(h/2) D(1,1)
D(2,0)=Φ(h/4) D(2,1) D(2,2)
D(3,0)=Φ(h/8) D(3,1) D(3,2) D(3,3)
SE301_14 (c)AL-AMER2003 18
Example
.derivative theof
estimate theas D(2,2)Obtain 0.1,h
ion with Extrapolat Richardson Use
.6.0at x
of derivative y thenumericall Evaluatecos
(x)xf(x)
SE301_14 (c)AL-AMER2003 19
ExampleFirst Column
1.091150.05
f(0.575)-)625.f(0(0.025)
1.089880.1
f(0.55)-)65.f(0(0.05)
1.084830.2
f(0.5)-7).f(0(0.1)
2h
h)-f(x-h)f(x(h)
SE301_14 (c)AL-AMER2003 20
ExampleRichardson Table
1.09148111214
11222
1.09146010214
10212
1.09114000114
10111
11114
11
09115.1D(2,1) 0.10988,D(1,0) , 08483.1)0,0(
2
),D(),D(),D(),D(
),D(),D(),D(),D(
),D(),D(),D(),D(
),m-D(n)D(n,m-)D(n,m-D(n,m)
D
m
SE301_14 (c)AL-AMER2003 21
ExampleRichardson Table
1.08483
1.08988 1.09114
1.09115 1.09146 1.09148
This is the best estimate of the derivative of the function
All entries of the Richardson table are estimates of the derivative of the function. The first column are estimates using the central difference formula with different h.