0% found this document useful (0 votes)
36 views33 pages

EEE212 Week2

This document discusses the propagation of errors in numerical calculations. It provides three examples: 1. Calculating the bounds of error when adding two numbers with uncertainties. 2. Finding the maximum possible error in calculating strain given uncertainties in force, height, and Young's modulus. 3. Demonstrating through error propagation that subtracting nearly equal numbers with uncertainties can create large relative errors. The document explains that Taylor series expansions can be used to approximate functions and propagate errors in calculations involving functions of multiple variables. It provides examples of deriving Maclaurin series for common functions like e^x, sin(x), and cos(x).

Uploaded by

melike
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views33 pages

EEE212 Week2

This document discusses the propagation of errors in numerical calculations. It provides three examples: 1. Calculating the bounds of error when adding two numbers with uncertainties. 2. Finding the maximum possible error in calculating strain given uncertainties in force, height, and Young's modulus. 3. Demonstrating through error propagation that subtracting nearly equal numbers with uncertainties can create large relative errors. The document explains that Taylor series expansions can be used to approximate functions and propagate errors in calculations involving functions of multiple variables. It provides examples of deriving Maclaurin series for common functions like e^x, sin(x), and cos(x).

Uploaded by

melike
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Propagation of Errors

In numerical methods, the calculations are not


made with exact numbers. How do these
inaccuracies propagate through the calculations?
Example 1:
Find the bounds for the propagation in adding two numbers. For example
if one is calculating X +Y where
X = 1.5 0.05
Y = 3.4 0.04
Solution
Maximum possible value of X = 1.55 and Y = 3.44

Maximum possible value of X + Y = 1.55 + 3.44 = 4.99

Minimum possible value of X = 1.45 and Y = 3.36.

Minimum possible value of X + Y = 1.45 + 3.36 = 4.81

Hence
4.81 ≤ X + Y ≤4.99.
Propagation of Errors In Formulas

If f is a function of several variables X 1 , X 2 , X 3 ,......., X n −1 , X n


then the maximum possible value of the error in f is

∂f ∂f ∂f ∂f
∆f ≈ ∆X 1 + ∆X 2 + ....... + ∆X n −1 + ∆X n
∂X 1 ∂X 2 ∂X n −1 ∂X n
Example 2:
The strain in an axial member of a square cross-
section is given by
F
∈= 2
h E
Given
F = 72 ± 0.9 N
h = 4 ± 0.1 mm
E = 70 ± 1.5 GPa

Find the maximum possible error in the measured


strain.
Example 2:
Solution
72
∈= −3 2
(4 × 10 ) (70 × 10 )
9

= 64.286 × 10 −6
= 64.286 µ

∂∈ ∂∈ ∂∈
∆ ∈= ∆F + ∆h + ∆E
∂F ∂h ∂E
Example 2:
∂∈ 1 ∂∈ 2F ∂∈ F
= 2 =− 3 =− 2 2
∂F h E ∂h hE ∂E h E
Thus
1 2F F
∆E = 2 ∆F + 3 ∆h + 2 2 ∆E
h E hE h E
1 2 × 72
= −3 2
× 0 .9 + −3 3
× 0.0001
(4 ×10 ) (70 ×10 )
9
(4 ×10 ) (70 ×10 )
9

72
+ × 1 .5 × 10 9

(4 ×10 −3 ) 2 (70 ×109 ) 2


= 5.3955µ
Hence
∈= (64.286 µ ± 5.3955µ )
Example 3:
Subtraction of numbers that are nearly equal can create unwanted
inaccuracies. Using the formula for error propagation, show that this is true.

Solution
Let
z = x− y
Then
∂z ∂z
∆z = ∆x + ∆y
∂x ∂y
= (1)∆x + (−1)∆y
= ∆x + ∆y
So the relative change is
∆z ∆x + ∆y
=
z x− y
Example 3:
For example if
x = 2 ± 0.001
y = 2.003 ± 0.001

∆z 0.001 + 0.001
=
z | 2 − 2.003 |
= 0.6667
= 66.67%
Taylor Theorem
Motivation
 We can easily compute expressions like:
3 10 2
2( x  4)
But, How do you compute 4.1, sin(0.6) ?

Can we use the definition


b
a
to compute sin(0.6)?
0.6
Is this a practical way?
Taylor Series
The Taylor series expansion of f ( x ) about a :
(2) ( 3)
f ( a ) f (a )
f (a )  f ' (a ) ( x  a )  ( x  a )2  ( x  a ) 3  ...
2! 3!
or

1 (k )
Taylor Series   k!
f (a ) ( x  a )k
k 0
If the series converge, we can write :

1 (k )
f ( x)  ∑ f (a ) ( x  a )k
k 0
k!
Maclaurin Series
 Maclaurin series is a special case of Taylor
series with the center of expansion a = 0.
The Maclaurin series expansion of f ( x ) :
( 2) ( 3)
' f ( 0 ) 2 f ( 0) 3
f ( 0 )  f ( 0) x  x  x  ...
2! 3!
If the series converge, we can write :

1 (k ) k
f ( x)  ∑ f ( 0) x
k 0
k!
Maclaurin Series – Example 1
Obtain Maclaurin series expansion of f ( x )  e x
f ( x)  e x f ( 0)  1
f ' ( x)  e x f ' ( 0)  1
f ( 2) ( x )  e x f ( 2 ) ( 0)  1
f (k ) ( x)  e x f ( k ) (0)  1 for k  1
∞ ∞ k 2 3
1 x x x
ex  ∑ f ( k ) ( 0) x k  ∑  1 x    ...
k 0
k! k 0
k! 2! 3!
The series converges for x  ∞.
Taylor Series
3

Example 1
2.5
exp(x)
1+x+0.5x 2
2

1+x

1.5

1
1

0.5

0
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Maclaurin Series – Example 2
Obtain Maclaurin series expansion of f ( x )  sin( x ) :
f ( x )  sin( x ) f ( 0)  0
f ' ( x )  cos( x ) f ' ( 0)  1
( 2) ( 2)
f ( x )   sin( x ) f ( 0)  0
f ( 3) ( x )   cos( x ) f ( 3) (0)  1

f ( k ) ( 0) k x3 x5 x7
sin( x )  ∑ x  x     ....
k 0
k! 3! 5! 7!
The series converges for x  ∞.
4

3
x

1 x-x 3/3!+x 5/5!

0 sin(x)

-1
x-x 3/3!

-2

-3

-4
-4 -3 -2 -1 0 1 2 3 4
Maclaurin Series – Example 3
Obtain Maclaurin series expansion of : f ( x)  cos( x)
f ( x )  cos( x ) f (0)  1
f ' ( x )   sin( x ) f ' ( 0)  0
f ( 2 ) ( x )   cos( x ) f ( 2 ) ( 0)  1
f ( 3) ( x )  sin( x ) f ( 3) (0)  0

f ( k ) ( 0) x 2
x 4
x 6
cos( x )  ∑ ( x ) k  1     ....
k 0
k! 2! 4! 6!
The series converges for x  ∞.
Maclaurin Series – Example 4
1
Obtain Maclaurin series expansion of f(x) 
1 x
1
f ( x)  f ( 0)  1
1 x
1
f ' ( x)  f ' ( 0)  1
1  x 2

(2) 2 ( 2)
f ( x)  f ( 0)  2
1  x 3

( 3) 6 ( 3)
f ( x)  f ( 0)  6
1  x  4

1
Maclaurin Series Expansion of :  1  x  x 2  x 3  ...
1 x
Series converges for | x |  1
Example 4 - Remarks

 Can we apply the series for x≥1??

 How many terms are needed to get a good


approximation???

These questions will be answered using


Taylor’s Theorem.
Taylor Series – Example 5
1
Obtain Taylor series expansion of f(x)  at a  1
x
1
f ( x)  f (1)  1
x
1
f ' ( x)  2 f ' (1)  1
x
2
f ( 2) ( x )  3 f ( 2 ) (1)  2
x
( 3) 6
f ( x)  4 f ( 3) (1)  6
x
Taylor Series Expansion (a  1) : 1  ( x  1)  ( x  1) 2  ( x  1)3  ...
Taylor Series – Example 6
Obtain Taylor series expansion of f(x)  ln( x ) at ( a  1)

1 ( 2) 1 ( 3) 2
f ( x )  ln( x ) , f ' ( x )  , f ( x )  2 , f ( x )  3
x x x
f (1)  0, f ' (1)  1, f ( 2 ) (1)  1 f ( 3) (1)  2

1 2 1
Taylor Series Expansion : ( x  1)  ( x  1)  ( x  1) 3  ...
2 3
Convergence of Taylor Series

 The Taylor series converges fast (few terms


are needed) when x is near the point of
expansion. If |x-a| is large then more terms
are needed to get a good approximation.
Taylor’s Theorem
If a function f ( x ) possesses derivatives of orders 1, 2, ..., ( n  1)
on an interval containing a and x then the value of f ( x ) is given by :

(n+1) terms Truncated


Taylor Series
n
f ( k ) (a )
f ( x)  ∑ ( x  a)k  Rn
k 0
k!
Remainder
where :
f ( n 1) ( )
Rn  ( x  a ) n 1 and  is between a and x.
( n  1)!
Taylor’s Theorem
We can apply Taylor' s theorem for :
1
f(x)  with the point of expansion a  0 if | x |  1.
1 x

If x  1, then the function and its


derivatives are not defined.
 Taylor Theorem is not applicable.
Error Term

To get an idea about the approximation error,


we can derive an upper bound on :
( n 1)
f ( )
Rn  ( x  a ) n 1
( n  1)!
for all values of  between a and x.
Error Term - Example
x
How large is the error if we replaced f ( x )  e by
the first 4 terms ( n  3) of its Taylor series expansion
at a  0 when x  0.2 ?
(n) x (n) 0.2
f ( x)  e f ( ) ≤ e for n ≥ 1
( n 1)
( )
f n 1
Rn  ( x  a)
( n  1)!
e 0.2
Rn  0.2 n 1  R3  8.14268E  05
( n  1)!
Alternative form of Taylor’s Theorem
Let f ( x ) have derivatives of orders 1, 2, ..., ( n  1)
on an interval containing x and x  h then :
n
f (k ) ( x) k
f ( x  h)   k!
h  Rn ( h  step size)
k 0

( n 1)
f ( ) n 1
Rn  h where  is between x and x  h
( n  1)!
Taylor’s Theorem – Alternative forms
n ( n 1)
f ( k ) (a ) f ( )
f ( x)   k
( x  a)  ( x  a ) n 1
k 0 k! ( n  1)!
where  is between a and x.

a  x, x  x  h

n
f ( k ) ( x ) k f ( n 1) ( ) n 1
f ( x  h)   h  h
k 0 k! ( n  1)!
where  is between x and x  h.
Mean Value Theorem
If f ( x ) is a continuous function on a closed interval [a , b]
and its derivative is defined on the open interval ( a , b)
then there exists ξ  ( a, b)
f(b)  f(a)
f ' (ξ ) 
ba
Proof : Use Taylor' s Theorem for n  0, x  a , x  h  b
f(b)  f(a)  f ' (ξ ) (b  a )
Alternating Series Theorem
Consider the alternating series :
S  a1  a2  a3  a4  
 a  a  a  a  The series converges
 1 2 3 4

If  and then  and
 lim a  0  S  S n  an 1
 n n 

S n : Partial sum (sum of the first n terms)


an 1 : First omitted term
Alternating Series – Example
1 1 1
sin(1) can be computed using : sin(1)  1     
3! 5! 7!
This is a convergent alternating series since :
a1  a2  a3  a4   and lim an  0
n 

Then :
 1 1
sin(1)  1   
 3!  5!
 1 1 1
sin(1)  1    
 3! 5!  7!
Example 7

Obtain the Taylor series expansion


2 x 1
of f ( x )  e at a  0.5 (the center of expansion)
How large can the error be when ( n  1) terms are used
to approximate e 2 x 1 with x  1 ?
Example 7 – Taylor Series
Obtain Taylor series expansion of f ( x )  e 2 x 1 , a  0.5
f ( x)  e 2 x 1 f (0.5)  e 2
f ' ( x)  2e 2 x 1 f ' (0.5)  2e 2
f ( 2) ( x)  4e 2 x 1 f ( 2) (0.5)  4e 2
f ( k ) ( x)  2 k e 2 x 1 f ( k ) (0.5)  2 k e 2
f ( k ) (0.5)

e 2 x1 ∑ ( x  0.5) k
k 0
k!
2 k
( x  0 .5) ( x  0 . 5)
 e 2  2e 2 ( x  0.5)  4e 2  ...  2 k e 2  ...
2! k!
Example 7 – Error Term
f ( k ) ( x)  2 k e 2 x 1
f ( n 1) ( )
Error  ( x  0.5) n 1
(n  1)!
(1  0.5) n 1
Error  2 n 1 e 2 1
(n  1)!
n 1
( 0. 5)
Error  2 n 1 max e 2 1
(n  1)!  [ 0.5,1]
e3
Error 
(n  1)!

You might also like