120 likes | 369 Views
IEG2012C Tutorial 9 Numerical Methods. William Li ACK: Chen Jieying. Outline. Basic concepts of numerical method Real number representation Round off Errors of numerical results Error propagation Fixed-point iteration method. Real number representation.
E N D
IEG2012C Tutorial 9Numerical Methods William Li ACK: Chen Jieying
Outline • Basic concepts of numerical method • Real number representation • Round off • Errors of numerical results • Error propagation • Fixed-point iteration method
Real number representation Significant digits: amount of the first nonzero digit from the left to the end. e.g. 1360 , 0.001360 : four significant digits 136 , 0.00136 : three significant digits • Fixed-point system, which represents all numbers with a fixed number of decimal places. • e.g. 1360 : zero decimal places 0.001360 : six decimal places 0.00136 : five decimal places • Floating-point system, which keeps the number of significant digits fixed(whereas the decimal point is “floating”). • e.g. 1.360* 103 , 1360, 0.01360*105 not 1.36* 103 , 0.0136*105
Round off • Chopping: simply discards all decimals from kth decimal on. • Round off (to k decimal plane): • chopping > (k+1) th decimal • case1: (k+1)th decimal < 5 → discard • Case 2: (k+1)th decimal > 5 → add 1 to kth decimal • Case 3: (k+1)th decimal = 5 → round kth decimal to the nearest even decimal • e.g. : • 3432550.34 rounded to the 5 significant digits. 3 4 3 2 55 0. 3 4=3.4326 * 107 5 significant digits
Error propagation • Theorem 1: • (a) In addition and subtraction, an error bound for the results is given by the sum of the error bounds for the terms. • Prove addition :
Error propagation • Theorem 1: • (b) In multiplication and division, a bound for the relative error of the results is given (approximately) by the sum of the relative errors of the given numbers. • Prove division:
Fixed-point iteration method • solve the equation f(x)=0 • Steps: • Step 1 : Transform f (x) = 0 into the form: x = g (x) • Step 2 : Choose an x0 and compute x1 = g(x0 ), x2 = g(x1) and in general xn+1 = g(xn ) • Step 3 : Stop the process if a stopping rule is satisfied, e.g. xn+1 - xn ≤ζ . .
Condition: Convergence: • Solution only include in area while Prove:
Excise: • Solve: f(x) = x2-5x+6 = 0, stopping rule:0.005 • Answer x1=2, x2=3. • Numerical method (a) g(x)=5-6/x g,(x) =6x-2 <1 => x>sqrt(6)>2 set x0 = 5: 5.0000 3.8000 3.4211 3.2462 3.1517 3.0962 3.0622 3.0406 3.0267 3.0176 3.0117 3.0078 3.0052 3.0034 3.0023 3.0015 3.0010 3.0007 3.0005 3.0003 (b) g(x)=x2/5+6/5 g,(x) =2/5*x <1 => x<5/2 set x0 = 1: 1.0000 1.4000 1.5920 1.7069 1.7827 1.8356 1.8739 1.9023 1.9237 1.9402 1.9528 1.9627 1.9705 1.9765 1.9813 1.9851 1.9882 1.9906 1.9925 1.9940 0.0039 0.0048
The End Thank You!