Lecture 2
Click here to load reader
-
Upload
zjahangeer -
Category
Documents
-
view
217 -
download
0
description
Transcript of Lecture 2
-
NUMERICAL ANALYSIS
Lecture -2
Muhammad Rafiq
Assistant Professor University of Central Punjab
Lahore Pakistan
-
ERROR ANALYSIS
ERROR
The difference in exact and approximate values is error.
Suppose exact value of a number be = x
Approximate exact value of a number be = x
Error = x- x
Absolute error=|x- x|
Relative error=A.E/|x|
=|x- x|/|x|
Percentage relative error=R.E100%
-
ERROR IN ADDITION
Suppose exact value of a number be= x1
Suppose exact value of another number be= x2
Suppose approximate value of a number be= x1
Suppose approximate value of another number be= x2
Error in first number = e1=x1-x1
Error in first number=e2=x2-x2
Let Z be the sum of two numbers=Z=x1+x2
Let Z be the sum of approximate values=Z=x1 +x2
Error=ez=Z-Z
= (x1+x2) - (x1+x2)
-
= x1+x2- x1-x2
=(x1-x1)+(x2-x2)
ez=e1+e2
Absolute error=|ez|=|e1+e2||e1|+|e2|
And |ez||e1|+|e2|
ERROR IN SUBTRACTION
Suppose exact value of a number be= x1
Suppose exact value of another number be= x2
Suppose approximate value of a number be= x1
Suppose approximate value of another number be= x2
-
Error in first number = e1=x1-x1
Error in first number=e2=x2-x2
Let Z be the difference of two numbers=Z=x1-x2
Let Z be the difference of approximate values=Z=x1-x2
Error=ez=Z-Z
= (x1-x2 )- (x1-x2)
= x1-x2- x1+x2
=(x1-x1)-(x2-x2)
ez=e1-e2
Absolute error=|ez|=|e1-e2||e1|+|e2|
And |ez| |e1|+|e2|
-
Thus for n numbers eZ = e1 e2 e3 en
|ez| |e1|+|e2|+|e3|++|en|
Note:
If a number is approximated to n-decimal places, then absolute
error in it is given by
A.E 1/2 10-n
For Example =1.73 e=1/2 10-2
=1.7320 e=1/2 10-4
-
EXAMPLE 1
If numbers in 0.3062-0.25026+2.51342 are rounded. Estimate
the maximum absolute error and relative error. Find also the
range in which true answers lies.
Solution:
Let x1=0.3062 e1=1/210-4
x2=0.25026 e2=1/210-5
x3=2.51342 e3=1/210-5
Let Z=x1-x2+x3
=0.3062-0.25026+2.51342
= 2.56936
-
Absolute error 1/210-4+1/210-5+1/210-5
1/210-5(10+1+1)
1/210-5(12)
610-5
0.610-4
Maximum Absolute error=0.610-4
Relative error=A.E/|Z|
=0.610-4
/2.56936
=2.335210-5
The range in which true answer lies
Z-A.E Z Z+A.E
-
2.56936-0.610-4 Z 2.56936+0.610-4
2.56930 Z 2.56942.
(Correct to 3d.p)
EXAMPLE 2
The values of x1 and x2 are estimated as x1=4.57+e1 and
x2=8.84+e2 where |e1|
-
Exercise
Q # 1
If numbers in 5.2163+1.35202-1.41265+2.14169 are rounded.
Estimate the maximum absolute error and relative error. Find
also the range in which true answers lies.
Q # 2
If numbers in 3.123-2.5169+2.234-2.01267+2.1006 are
rounded. Estimate the maximum absolute error and relative
error. Find also the range in which true answers lies.