Trunction error
Trunction error
1
Background
f ( n1) ( ) n1
Rn h
(n 1)!
4
Ex. Taylor Approximation of a Polynomial
5
Ex. 4.1 Taylor Approximation of a Polynomial
7
Taylor series expansion
8
Ex. 4.2
9
Ex.4.1x
Find the truncation error in approximating the function
y2 ( x) ln(1 x)
(a) y1 ( x) x
1 2
(b) y2 ( x) x x
2
1 2 1 3
(c) y3 ( x) x x x
2 3
1 2 1 3 1 4
(d) y3 ( x) x x x x
2 3 4
over the range 0 x 1
10
Ex.4.1x (Solution)
11
Ex.4.1x (Solution)
2 3
Te 0.405465108 0.416666667 0.011201559
1 1 1
(d) y4 (0.5) (0.5) (0.5) (0.5) (0.5) 4 0.401041667
2 3
2 3 4
Te 0.405465108 0.401041667 0.004423441
12
Truncation error
0.8
y(x)
0.6
Te1
Te2
0.4 Te3
Te4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2
-0.2
-0.4
13
Error Propagation
The purpose of this section is to study how error in numbers
can propagate through mathematical functions.
Assuming ~ x is an approximation of x, we would like to assess
the effect of the discrepancy between x and ~ x on the value
of the function.
We estimate f ( ~
x ) f ( x) f ( ~
x)
f ( ~
x ) f ( ~
x ) (x ~
x)
where
f ( ~
x ) f ( ~
x ) (x ~
x ) an estimate of the error of the function
~
x x~
x an estimate of the error of x
15
Graphical depiction of the first-order error propagation
16
Error Propagation in a function of a single variable
f ( ~
x ) 3(2.5) 2 (0.01) 0.1875
f (2.5) 15.625
~
We predict for x = 2.5
f (2.5) 15.625 0.1875
17
Function of more than one variable
~ ~ ~ f ~ f ~ f ~
f ( x1 , x2 ,..., xn ) x1 x2 ... xn
x1 x2 xn
18
Total Numerical Error
19
20
Gross error
21
Formulation Errors
22
Data uncertainty
23