C01.03 Truncation Errors & Taylor Series
C01.03 Truncation Errors & Taylor Series
C01.03 Truncation Errors & Taylor Series
Chapter 01
Dr Baljit Singh
Faculty of Mechanical Engineering
Universiti Teknologi MARA (UiTM)
Office: T1-A18-1C
Adapted from : Ramlan Kasiran
Learning outcome
Recognizing that truncation errors occur when exact
mathematical formulations are represented by approximations.
Knowing how to use the Taylor series to estimate truncation
errors.
Understanding how to write forward, backward, and centered
finite-difference approximations of the first and second
derivatives.
Recognizing that efforts to minimize truncation errors can
sometimes increase round off errors.
Ice braking
Truncation error
Truncation errors : error that result from using an approximation
in place of an exact mathematical procedure.
Example
Math model:
dv
c
g v
dt
m
Analytical solution:
gm
v(t)
1 e(c/m)t
c
dv v v(ti 1) v(ti )
dt t
ti 1 ti
Taylor Series give insight into the truncation errors for the numerical
method!
WHY?
Taylor series
Build Taylor series term by term!
zero order approximation, only true if xi+1
and xi are very close to each other.
f(xi 1) f(xi )
first order approximation, in form of a
straight line
Rn
f
( ) (n1)
h
or R n O(hn1)
(n 1)!
dv v v(ti 1) - v(ti )
dt t
ti 1 - ti
Expand using TSE...
v''(ti )
v'''(ti ) 3
v(ti 1) v(ti ) v'(ti )h
h
h ...Rn
2!
3!
Truncate after first order term,..
Rearrange:
v'(ti )
v(ti 1) - v(ti ) R1
h
h
Truncatio
n
error
f (2)( ) (2)
R1
h
(2)!
R1 f (2)( ) (2)
Truncationerror,
h
h (2)(h)
Truncationerror O(h)
Numerical Differentiation
The first order Taylor series can be used to calculate approximations to
derivatives:
Given:
Then:
f(xi 1) f(xi )
O(h)
h
Numerical Differentiation
Type of finite divided difference approximations
[Depending the points used]
Forward:
f ' (xi )
f(xi 1) f(xi )
O(h)
h
f ' (xi )
f(xi ) f(xi 1)
O(h)
h
f ' (xi )
f(xi 1) f(xi 1)
O(h2 )
2h
Backward:
Centered:
Next lecture:
Solving non-linear equation
End
Class dismissed