250 likes | 341 Views
Chapter 2 Errors in Numerical Methods and Their Impacts. Objectives. Know the difference between accuracy&precision Understand round-off error Understand approximation error and know how to apply. Content. Introduction Errors Round-off errors Approximate errror Total errors
E N D
Chapter 2 Errors in Numerical Methods and Their Impacts
Objectives • Know the difference between accuracy&precision • Understand round-off error • Understand approximation error and know how to apply
Content • Introduction • Errors • Round-off errors • Approximate errror • Total errors • Conclusion
Introduction • Why we need to know ? • Computers are great tools, however, without fundamental understanding of engineering problems, they will be useless.
Errors • We ask for numerical methods since we cannot get exact solution !! • Numerical methods only provide approximate results, not exact ones. • So how we confident our results obtained from • numerical methods ???? • See in next slide how can we cope this with?
Errors(cont’d) • Accuracy. How close is a computed or measured value to the true value • Precision (or reproducibility). How close is a computed or measured value to previously computed or measured values. • Inaccuracy(or bias). A systematic deviation from the actual value. • Imprecision(or uncertainty or variance). Magnitude of scatter.
Errors (cont’d) • 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,800 How many significant figures? • 5.38 x 1043 • 5.380 x 1044 • 5.380 x 1045 • Zeros are sometimes used to locate the decimal point not significant figures. • 0.00001753 4 • 0.0001753 4 • 0.001753 4
Errors (cont’d) Error Definitions True Value = Approximation + Error Et = True value – Approximation (+/-) MATLAB Example True error
Errors (cont’d) What u can see is we can’t estimate the true error for all cases !! (why ?)So we use the following error definition instead. Approximation error …
Errors (cont’d) Apply approximation error to numerical approach (iterative) (+ / -) Meaning that the result is correct at least n significant figures Define criteria :- Compute until
Errors (cont’d) DIY: MATLAB (Parachutist problem) From your previous assignment, compare the approximation errors at t = 1,2,..,12 seconds for two cases, Δt = 0.5 and 0.1 respectively. Crticize why the approximation errors from these two cases are different !!
Round-off … • Why round-off errors occur ? • 1) There are numbers that can’t be expressed by a fixed number of significant figures • 2) Base-2 number can’t precisely represent base-10 number (completely). • 3) Fraction number in computer is represent using a floating point form, e.g. Integer part exponent mantissa Base of the number system used where
Round-off … (cont’d) How floating numbers ‘re stored in a computer ?? Integer part exponent mantissa Base of the number system used 11 bits 52 bits
Round-off … (cont’d) How floating numbers ‘re stored in a computer (base-2 number) ??
Round-off … (cont’d) Examples: 156.78 0.15678x103 Suppose only 4 decimal places to be stored 0.1567x103 Rounding/Chopping 0.1568x103 Now u can see how the round-off error occurs due to the limited room for mantissa !!!!
Round-off … (cont’d) Examples: MATLAB Double precision case Type format long a=0.1+0.2-0.3 what you expect Now try more example: learn round(0.5) Type round(0.75*0.3/0.01) what you expect
Approxi … Example: To get the cos(x) for small x: If x=0.5 cos(0.5) =1-0.125+0.0026041-0.0000127+ … =0.877582 From the supporting theory, for this series, the error is no greater than the first omitted term.
Approxi … Using Taylor’s series approximation
Approxi … Example: f(x) = -0.1x4-0.15x3-0.5x2-0.25x+1.2 (estimate this function at x = 1 with h = 1, given that x(0)=1.2) Try to derive your own and also write a program to show for number of order n =1,2,3,…,5
Approxi … U can use Taylor series to avoid the round off errors For example: try to calculate ex-1 at x = 0 X
Total … There is a trade-off
Others… Blunders Human mistakes Model errors Incomplete mathematical model Data uncertainty Bias, variance from measurements