Numerical Analysis PDF
Numerical Analysis PDF
Numerical Analysis PDF
Error Analysis
Error propagation numerical stability Error estimation Error cancellation Condition numbers
13.002
Lecture 1
Difference Equation w(x,t) Discrete Model Linear System of Equations x System of Equations
xn m
n
w(x,t)
Eigenvalue Problems
Non-trivial Solutions
Root finding
Arithmetic Operations
Number Representation
Absolute Error Shift mantissa of largest number Relative Error Result has exponent of largest number Absolute Error Relative Error Unbounded
Relative Error
13.002 Numerical Methods for Engineers
Bounded
Lecture 1
Recursion
a=26; n=10; MATLAB script g=1; sqr.m sq(1)=g; for i=2:n sq(i)= 0.5*(sq(i-1) + a/sq(i-1)); end hold off plot([0 n],[sqrt(a) sqrt(a)],'b') hold on plot(sq,'r') plot(a./sq,'r-.') plot((sq-sqrt(a))/sqrt(a),'g') grid on
Recursion Algorithm
13.002
Lecture 1
Horners Scheme
General order n
>> horner p =
Recurrence relation
>>
55
13.002
Lecture 1
Result of small, but significant term destroyed by subsequent addition and subtraction of almost equal, large numbers. Remedy: Change order of additions
13.002
Lecture 1
recur.m
>> recur b = 1; c = 1; x = 0.5; dig=2 i res = 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 0.4634 0.2432 0.1226 0.0614 0.0306 0.0153 0.0076 0.0037 0.0018 0.0009 0.0004 0.0002 0.0001 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 0.4634 0.7065 0.8291 0.8905 0.9212 0.9364 0.9440 0.9478 0.9496 0.9505 0.9509 0.9511 0.9512 0.9512 0.9512 0.9512 0.9512 0.9512 0.9512 0.9512 0.5000 0.2000 0.1000 0.1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5000 0.7000 0.8000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 0.9000 delta Sum delta(approx) Sum(approx)
13.002
Lecture 1