Академический Документы
Профессиональный Документы
Культура Документы
DIFFERENTIATION
or
DIFFERENCE APPROXIMATION
f i f ( xi ) f i 1 f ( xi 1 ) f 'i f ' ( xi )
where xi x0 xi 1 x0 h
' f i 1 f i h ''
fi (h) where (h) f i
h 2
• The first derivative with backward
difference approximation is
approximated by using Taylor expansion
yield 2 3 4
' h '' h ''' h ''''
f i 1 f i hf i fi fi fi
2! 3! 4!
• Hence, the BDA is expressed, including
the truncation error effect, as
' f i f i 1 h ''
fi ( h ) ( h) f i
h where 2
The Central difference approximation
derived by subtracting the Taylor
expansion of f i 1 and f i 1
Hence, we have
2
' f i 1 f i 1 2 h
fi (h ) where (h 2 ) f i '''
2h 6
Conclusion:
• The truncation error of FDA and BDA is
proportional to h and the truncation error of
2
h
CDA is proportional to . Hence, when h is
decreased, the error of CDA decreases more
rapidly than in the other.
Question:
• Could we derive a more accurate difference
approximation ?
• How about the derivative of higher degree ?
• As obtained above, a difference
( p)
approximation for i f needs at least p+1
data points. If more data points are used, a
more accurate difference approximation may
be derived.
Example:
• Three-point forward difference approximation
2
' f i 2 4 f i 1 3 f i 2 2 h '''
fi ( h ) , ( h ) fi
2h 3
• Three-point backward difference
approximation
2
' 3 f i 4 f i 1 f i 2 h '''
fi ( h 2 ) , 2
( h ) fi
2h 3
• To derive the difference approximation for
the n-th derivative, we must to eliminate the
first until (n-1)-th derivative from the Taylor
expansions.
Example:
''
Obtain a difference approximation for i f
using f i , f i 1 , and f i 2 . After adding the
Taylor expansions of f i 1 and f i 2 we
have
'' f i 2 2 f i 1 f i '''
fi 2
( h ) , (h) hf i
h
• In a similar manner we can obtain the BDA
''
and CDA for f i as follows:
'' f i 2 f i 1 f i 2 '''
fi 2
(h) , ( h) hf i
h
Central Difference Approximation
'' f i 1 2 f i f i 1 2 2 1 2 ''''
fi 2
( h ) , ( h ) h f i
h 12
• Furthermore, by adding the number of points
we can derive a more accurate
approximation or higher order of derivation.
( p) c1 f1 c 2 f 2 c N f N
fi p
E
h
where Np (N ) N p 1 ( N 1)
E c1h fi c2 h fi
• c1 , c 2 , c3 , , c N , c1 and c2 are
the undetermined coefficients that to
determine.
Example:
'''
Derive the difference approximation for fi
by using f i , f i 1 , f i 2 , and f i 3 . By
Generic algorithm yields
'''ci f i ci 1 f i 1 ci 2 f i 2 ci 3 f i 3
fi 3
E
h
• By introducing the Taylor expansion
of f i 1 , f i 2 , and f i 3 into
equation above yields
''' f i 3 f i 1 3 f i 2 f i 3
fi 3
( h )
h
3 ''''
where (h) hf i
2
Application
A function table is given as follows:
x f
-0.1 4.157
0 4.020
Question: 0.2 4.441
' a1 f i 1 a2 f i a2 f i 2
fi E
h
introducing the Taylor expansions of f i 1
f iand
2 into equation above
yields
' 4 f i 1 3 f i f i 2
fi E
6h
Hence, we have