Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate.

Similar presentations


Presentation on theme: "Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate."— Presentation transcript:

1 Numerical Analysis CC413 Propagation of Errors

2 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate through the calculations?

3 Source of errors Rounding Truncation Inherent Mistakes

4 Underflow and Overflow Numbers occurring in calculations that have a magnitude less than 2 - 1023.(1+2 -52 ) result in underflow and are generally set to zero. Numbers greater than 2 1024.(2-2 -52 ) result in overflow.

5 Significant Figures Number of significant figures indicates precision. Significant digits of a number are those that can be used with confidence, e.g., the number of certain digits plus one estimated digit. 53,800How many significant figures? 5.38 x 10 4 3 5.380 x 10 4 4 5.3800 x 10 4 5

6 Significant Figures Zeros are sometimes used to locate the decimal point not significant figures. 0.000017534 0.00017534 0.0017534 N = 3.141592653589793232 then N = 0.14159265358979232 x 10 +1 t= 4 N = 0.1415 x 10 +1

7 Error Definitions Numerical error - use of approximations to represent exact mathematical operations and quantities true value = approximation + error Error = true value - approximation Error = |N – n| Absolut error Relative error = error / true value R.E. = |N-n|/|N| = |N-n|/|n|

8 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.

9 Example 2: The strain in an axial member of a square cross-section is given by Given Find the maximum possible error in the measured strain.

10 http://numericalmethods.eng.usf.edu10 Example 2: Solution

11 Example Consider a problem where the true answer is 7.91712. If you report the value as 7.92, answer the following questions. 1.What is the true error? 2.What is the relative error?

12 Example Determine the absolute and relative errors when approximating p by p ∗ when

13 Solution This example shows that the same relative error, 0.3333×10 −1, occurs for widely varying absolute errors. the absolute error can be misleading and the relative error more meaningful, because the relative error takes into consideration the size of the value.

14 Error Definitions cont. Round off error – Symmetric rounding originate from the fact that computers retain only a fixed number of significant figures: y = 0.73248261 to be 0.7325 Error = y-round(y) = 0.00001739 and relative error = error /y = - 0.000024

15 Error Definitions cont. Truncation errors – Chopping errors that result from using an approximation in place of an exact mathematical procedure: y = 0.73248261 to be 0.7324 Error = 0.0008261 and relative error = 0.00011

16 Example Determine the five-digit (a) chopping and (b) rounding values of the irrational number π. Solution The number π has an infinite decimal expansion of the form π = 3.14159265.... Written in normalized decimal form, we have π = 0.314159265... × 10. (a) The floating-point form of π using five-digit chopping is f l(π) = 0.31415 × 10 = 3.1415. (b) The sixth digit of the decimal expansion of π is a 9, so the floating-point form of π using five-digit rounding is f l(π) = (0.31415 + 0.00001) × 10 = 3.1416.

17 Example Suppose that x = 57 and y = 13. Use five-digit chopping for calculating x + y, x − y, x × y, and x ÷ y. Solution: Note that 

18 Solution (Cont.)

19 Use absolute value. Computations are repeated until stopping criterion is satisfied. If the following criterion is met you can be sure that the result is correct to at least n significant figures. Pre-specified % tolerance based on the knowledge of your solution

20 20 Round-off Errors (Error Bounds Analysis) Round down Round up fl(z) is the rounded value of z

21 21 Chopping Errors (Error Bounds Analysis) Suppose the mantissa can only support n digits. Suppose ß = 10 (base 10), what are the values of a i such that the errors are the largest? Thus the absolute and relative chopping errors are

22 22 Chopping Errors (Error Bounds Analysis)

23 23 Round-off Errors (Error Bounds Analysis) Absolute error of fl(z) When rounding down Similarly, when rounding up i.e., when

24 24 Round-off Errors (Error Bounds Analysis) Relative error of fl(z)

25 25 Summary of Error Bounds Analysis β base n # of significant digits or # of digits in the mantissa Regardless of chopping or round-off is used to round the numbers, the absolute errors may increase as the numbers grow in magnitude but the relative errors are bounded by the same magnitude. Chopping ErrorsRound-off errors Absolute Relative

26 Numerical Stability Rounding errors may accumulate and propagate unstably in a bad algorithm. Can be proven that for Gaussian elimination the accumulated error is bounded

27 Ill-conditioned problem If small error in data input produce large error in solution When |f’(x)| is large 1.0 x +3.5 y = 8 2.1 x + 7.0 y = 16.1 Sol is (1.0, 2.0) if Changed to 2.12x + 7.0 y = 16.1 Sol is (0.8333, 2.048)

28 28 Ill-conditioned system of equations A small deviation in the entries of A matrix, causes a large deviation in the solution.  

29 29 Machine Epsilon Relative chopping error Relative round-off error eps is known as the machine epsilon – the smallest number such that 1 + eps > 1 epsilon = 1; while (1 + epsilon > 1) epsilon = epsilon / 2; epsilon = epsilon * 2; Algorithm to compute machine epsilon

30 30 Exercise Discuss to what extent (a + b)c = ac + bc is violated in machine arithmetic.

31 Error Propagation Let x fl refer to the floating point representation of the real number x. Since computer has fixed word length, there is a difference between x and x fl (round-off error) and we would like to estimate the error in the calculation of f(x) : Both x and f(x) are unknown. If x fl is close to x, then we can use first order Taylor expansion and compute: Result: If f’(x fl ) and  x are known, then we can estimate the error using this formula


Download ppt "Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate."

Similar presentations


Ads by Google