You are on page 1of 13

Numerical Analysis

Lecture 3
Types of Error
Truncation Error: the notation of truncation refers to errors
introduce when a more complicated mathematical expression is
replaces by a more elementary formula. This terminology
originates from the technique of replacing a complicated
function with a truncated Taylor series. For example
x2 x4 x6 x8 x 2n
e  1 x 
2
   ...   ...
2! 3! 4! n!

might be replaced with just the five terms

x4 x6 x8
1 x 
2
 
2! 3! 4!
Types of Error (cont.)
Round-off: A computer’s representation of real number is limited to
the fixed number of mantissa. True values are some times not stored
exactly by a computer’s representation. This cause what we are called
round-off error .

Rounding and Chopping:

 Rounding: Replace the number by the nearest machine number


 Chopping: Throw all extra digits

Example: Suppose the true value is 3.1435, therefore


Chopped representation for three digit is 3.143 and
Rounded representation for three digit also is 3.144
Significant Digits
The number Ĵ is said to approximate Ј to d significant digits if d is the
largest nonnegative integer for which
J  Jˆ 101 d

J 2

Examples

a) If Ј =3.141592 and Ĵ=3.14, then | Ј –Ĵ|/ |Ј|=.000507<10^-2/2. therefore Ĵ


approximates Ј to three significant digits.

b) If Ј =1,000,000 and Ĵ=999,996, then | Ј –Ĵ|/ |Ј|=.000004 < 10^-5/2. therefore


Ĵ approximates Ј to six significant digits.

c) If Ј =0.000012 and Ĵ=0.000009, then | Ј –Ĵ|/ |Ј|=.25 < 10^-0/2. therefore Ĵ


approximates Ј to one significant digits.
Convergence Notation
Speed of Convergence
Definition : assume that Pn n 1 converges to P and set En  P  Pn for n  0.

If two positive constants A  0 and R  0 exist and


P  Pn 1 En 1 R
lim R
 lim R
 A,  En 1  A En
n 
P  Pn n 
En
then the sequence is said to converge to P with order of convergence R. The
number A is called asymptotic error constant. The cases R  1,2 are given special
consideration
if R  1, the convergence of Pn n 1 is called linear.

if R  2, the convergence of Pn n 1 is called quadratic



Comparison of the speed of
convergence
Relation between
Method Root multiplicity
successive error term
1
Bisection - En 1  En
2
False Position - En 1  A En
1.618
Secant simple En 1  A En

Secant multiple En 1  A En
2
Newton-Raphson simple En 1  A En

Newton-Raphson multiple En 1  A En
1.8
Muller - En 1  A En
Speed of convergence
 We can compare different methods in terms of
their convergence rate.
 Quadratic convergence is faster than linear
convergence.
 A method with convergence order q converges
faster than a method with convergence order p if
q>p.
 A Method of convergence order p>1 are said to
have super linear convergence.
Stopping Criteria
Method of finding the zero’s of nonlinear function f(x) can be
stopped when either following condition satisfied:

1) Number of iterations exceeds the maximum allowed number


(nmax).
2) Absolute error of the root is less than a pre-specified value (δa).
3) Relative error of the root is less than a pre-specified value (δr).
4) The absolute value of f(x) is less than a pre-specified value (ε).
Exercises
1) Use false position method compute c0, c1, c2, and c3 for the
following functions:
e x  2  x  0,  2.4,1.6;
cos( x )  1  x  0, 0.8,1.6;
ln( x )  5  x  0, 3.2,4.0;
x 2  10 x  23  0, [6.0,6.8].

2) What will happen if the bisection method is used with the


function f(x)=1/(x-2) and
a) the interval is [3,7]?
b) the interval is [1,7]?
Exercises
3) Show that the formula below is algebraically equivalent to false
position formula
an f (bn )  bn f (an )
cn 
f (bn )  f (an )

4) Find the point on the parabola y=x^2 that is closest to the point
(3,1) accurate to 10 decimal places.
5) Find the point on the graph y=sin(x-sin(x)) that is closest to the
point (2.1,0.5) accurate to 10 decimal places.
6) Find the value of x at which the minimum vertical distance
between graphs of f(x)=x^2+2 and g(x)=(x/5)-sin(x) occurs
accurate to 10 decimal places.
Find the point on the graph y=sin(x-sin(x)) that is
closest to the point (2.1,0.5) accurate to 4 decimal
places.
Solution
d  ( x  2.1) 2  ( y  0.5) 2
d  ( x  2.1) 2  (sin( x  sin( x))  0.5) 2
To find the value of x min that yield minimum distance,
d/x at x min must equal zero.
Let f(x)  d/x.
Now the problem is to find the roots of f(x)
( x  2.1)  (sin( x  sin( x))  0.5)(cos( x  sin( x))(1  cos( x))
f(x) 
( x  2.1) 2  (sin( x  sin( x))  0.5) 2
Solution (cont.)

To yield accuracy of n decimal


places, f(x) at the estimated y
n
root must be less 10
than

d f(x)
Solution (cont.)

You might also like