Documente Academic
Documente Profesional
Documente Cultură
Credits: 3-1-0-4
Tutorial -- 10
2
References:
Texts Books:
K. E. Atkinson, An Introduction to Numerical Analysis, 2nd Edition, John Wiley, 2008.
R. L. Burden and J. D. Faires, Numerical Analysis, 7th ed., Thomson Learning, 2001.
References:
M. T. Heath, Scientific Computing: An Introductory Survey, McGraw Hill, 2002.
S. D. Conte and Carl de Boor, Elementary Numerical Analysis, McGraw Hill, 1988.
A. Ralston and P. Rabinowitz, A First Course in Numerical Analysis, Dover Publications,
2001.
Brian Bradie, A friendly introduction to Numerical Analysis, Pearson Education, 2007.
3
Approximate Lecture Distributions:
Lecture -1 & 2: Introduction to Numerical Computing, Significant digits, Sensitivity and conditioning .
Lecture -5 - 9: Roots of Nonlinear Equations (Bisection Method, Newtons methods and its variants ,
Secant method, Fixed-point iteration method, etc. , order of convergence)
Lecture -10 & 16: Existence and uniqueness of interpolating polynomial, Lagrange polynomials, Cubic
spline, Least-Square approximations.
Lecture -17 & 27: System of Linear Equations: Direct Solution process (Gauss Elimination, Partial -
Pivoting, etc.), Iterative Solution process (Gauss-Seidel, SOR, QR decomposition, etc.),
Lecture -28 & 32: Numerical Differentiation and Integration: Forward, Backward and Central Difference,
Newton-Cotes integration formulae, Composite rules, Gaussian quadrature, etc.
Lecture -33 & 42: Initial and Boundary Value Problem (IVP & BVP): Taylor series method, Euler
methods, Runge-Kutta methods, etc., Finite difference methods and Shooting methods, etc.
Tutorials: Self Learning (SL); Implementation of studied methods, by hand calculations, through
computer programming. 4
Unit - 1 : Introduction to Numerical Computing
Numerical Computations:
The arrival of digital computers has, however, enhanced the speed and accuracy of
numerical computations.
Mathematical Methods
Numerical Computing
Computers
9
(1662)
(3000 BC.)
(1642)
10
Punched card loom by Jacquard(1801)
11
Difference Engine by Charles Babbage
(1822-1834)
12
13
Intel Pentium Processor
14
15
16
Computing Concepts
Processor
Chair Input Output Mr. Brown
Mr. Brown brought a chair
from the market
Office for his office
Market
DATA INFORMATION
Instructions
17
18
19
Number Systems and Computer Arithmetic
Binary 2 0, 1 10012
Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
4910
Octal 8 0, 1, 2, 3, 4, 5, 6, 7
438
Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
A, B, C, D, E, F 4C 216
101 5 5 5 101
110 6 6 6 110
111 7 7 7 111
1000 8 10 8 ---
1001 9 11 9 ---
1010 10 12 A ---
1011 11 13 B ---
1100 12 14 C ---
1101 13 15 D ---
1110 14 16 E ---
1111 15 17 F ---
22
Conversions:
Hexadecimal Decimal:
1A2C16 1 163 10 162 2 161 12 160 670010
172810 6 162 C 161 0 160 6C 016
Octal Decimal:
427.58 4 82 2 81 7 80 5 81 279.62510
427.510 6 82 5 81 3 80 4 81 653.48
Binary Decimal:
1010102 1 25 0 24 1 23 0 22 1 21 0 20 4210
18210 1 27 0 26 1 25 1 24 0 23 1 22
1 21 0 20 101101102 23
Fixed-point representation :
q
d p 1 d p 2 d p 3 ... d 1 d 0 .d 1 d 2 ... d q
2
i
d i 2 , d i {0,1}, p q n .
i p 1 10
0
Case 1: If q = 0 and n = p d p 1 d p 2 d p 3 ... d 1 d 0
2
i
di 2 .
i p 1 10
q i
Case 1: If p = 1 and n = q+1 d 0 .d 1 d 2 ... d q
2
di 2 .
i0 10
Examples: X 1100000000000000.2 4914210
15
Take n = 16, x 1.1000000000000002 1.510 4914210 2
Basic Representation x f 10 E.
31 30 24 23 0
7 bits 24 bits
1 bit
Normalized Representation
25 12 37,
12 25 13,
Integer Arithmetic
25 12 300,
25 12 2,
0.9996 103 0.9945 103 12 25 0.
0.0050 10 3 0.5000 105 ,
0.735 E 2 0.635 E 2
1.370 E 2 0.137 E 3,
0.200 E 2 0.400 E 2 Floating Point Arithmetic
0.080 E 4 0.800 E 3,
0.250 102 0.200 10 3
1.25 101 0.125 102.
26
Errors in Arithmetic :
24 127
2 126 0 2 126 (1 224 ) * 2127
(1 2 )*2
Positive Positive
Negative Negative Negative underflow positive overflow
overflow numbers underflow numbers
If we assume that the exponent can have maximum two digits, then the result
(a) shows overflow
(b) Shows underflow
27
Approximations and Errors in Computing
SIGNIFICANT DIGITS :
22
3.1415926535897932384626...
7
1 2
0.333333333333... 0.285714285714...
3 7
1
0.333 three significant digits
3
2
0.285714 six significant digits
7
28
Notion of Significant Digits :
When the decimal point is not written, trailing zeros are not considered.
Accuracy and Precision: o The number 57.396 is accurate to five significant digits.
o The number has a precision of 0.001 or 103. 29
INHERENT ERRORS :
0.110 0.00011001
Example: 0.410 0.01100110
Sum 0.01111111
0.25 0.125 0.0625 0.03125
0.015625 0.0078125 0.000390625
0.49609375( 0.5)
30
NUMERICAL ERRORS : Chopping
(i) Roundoff Errors
Symmetric rounding
i 0 i 0
Missing Human
information imperfection
xt yt xa ex ya ey xt yt xa ex ya ey
xa ya ex ey . xa ya ex ey .
Error bounds e x y ex ey
xt yt xa ex ya e y xa ya ya ex xa ey ex e y
e e
xa ya ya ex xa e y xa ya xa ya x y
xa ya
Total error e
xy
34
xt xa ex xa ya ya ex xa e y ex ey
yt ya e y ya2 ey2
xa ya ya ex xa ey
y 2
xa xa
ya ya
ex
xa
ey
ya
Total error e
x/ y
a
xa ex ey
ex / y
ya xa ya
Triangle inequality theorem
ex ey
exy xa ya
x ya
a
Errors introduced by the operations xa ya xa ya eo
xt yt xa ya ex ey eo
Total error ex y ex ey eo
35
Relative errors:
ex e y
er , x y
xa ya
Addition and Subtraction
xa ya
. er , x . er , y
xa ya xa ya
er , xy er , x er , y
Multiplication and division
er , x / y er , x er , y
Example:
Estimate the relative error in z = x-y when x = 0.1234 104 and y = 0.1232 104
as stored in a system with four-digit mantissa.
36
1
We Know, er , x 103 0.05%
ex e y 2
er , z
x y 1
er , y 103 0.05%
2
Then,
ex 0.1234 104 0.5 103 0.617
e y 0.1232 104 0.5 103 0.616
Therefore,
ex y ex ey 1.233
1.233 104
er , z 0.6165 61.65%
0.1234 0.1232
37
Process graph for u x y z u
x y z
er , u er , x y er , z r2
x y z x yz *
x y
er , x y er , x er , y r1 +
x y x y
z
x
y
In computing x y z x y z
38
Error Calculation for a Polynomial Function f(x)
Error in f ( x) e f f ( x) f ( xa ) ex f '
ex max f '
e f ex f ' xa
Similarly, e f ex f x xa , ya e y f y xa , ya
39
Example:
Estimate the error in evaluating f ( x, y ) x 2 y 2 for x 3.00 and y 4.00.
f x ( x, y ) 2 x and f y ( x, y ) 2 y
Therefore, e f 2 x ex 2 y e y
(2 3.00 2 4.00) 5 103 0.07
40
Error Analysis:
Absolute error y y f ( x) f ( x )
y f (x )
Exact
x
y
Calculated
x
Exact y f ( x)
x Results
Input Data
Sensitivity
of problem
Change in Numerical
Input data instability
Sensitivity of
numerical method
Induced error
y m1 x C1 ,
Consider the system of equations where m1 and m2 are nearly equal
y m2 x C2 ,
C1 C2 C1 C2
Solving, x ; y m1 C1
m2 m1 m2 m1
7.00 3.00
x 400, y 2.00 400 7.00 807,
2.01 2.00
7.00 3.00
x 800, y 2.00 800 7.00 1607.
2.005 2.00 43
Example: Compute the condition number for f ( x ) ( x 1) .
Here, 1
f ( x) ( x 1) 1/ 2
'
xf ' ( x) x ( x 1) 1/ 2
Condition number
f ( x) 2 ( x 1)1/ 2
x
2( x 1)
44