2
Problem 3.11 Use 5-digit arithmetic with chopping to determine the roots of the following equation with Eqs. (3.12) and (3.13) 3.12 3.13 x 2 − 5000.002x + 10 Compute percent relative errors for your results. Answer 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 %Problem 3.11 %x2 − 5000.002x + 10 a = chop(1,5); b = chop(-5000.002,5); c = chop(10,5); %Equation 3.12 x1 = chop((-b+sqrt(b^2- 4*a*c))/(2*a), 5) x2 = chop((-b-sqrt(b^2- 4*a*c))/(2*a), 5) %Equation 3.13 y1 = chop((-2*c)/(b+sqrt(b^2- 4*a*c)), 5) y2 = chop((-2*c)/(b- sqrt(b^2-4*a*c)), 5) %Percent error p_x1 = ((5000 - x1)/5000)

Problem 3

Embed Size (px)

DESCRIPTION

soal dan jawaban matkul komputasi

Citation preview

Problem 3.11Use 5-digit arithmetic with chopping to determine the roots ofthe following equation with Eqs. (3.12) and (3.13)3.123.13x2 5000.002x + 10Compute percent relative errors for your results.Answer1234567891011121314151617181920 %Problem 3.11 %x2 5000.002x + 10 a = chop(1,5); b = chop(-5000.002,5); c = chop(10,5); %Equation 3.12 x1 = chop((-b+sqrt(b^2-4*a*c))/(2*a), 5) x2 = chop((-b-sqrt(b^2-4*a*c))/(2*a), 5) %Equation 3.13 y1 = chop((-2*c)/(b+sqrt(b^2-4*a*c)), 5) y2 = chop((-2*c)/(b-sqrt(b^2-4*a*c)), 5) %Percent error p_x1 = ((5000 - x1)/5000) * 100 p_x2 = ((.002 - x1)/.002) * 100 p_y1 = ((5000 - y1)/5000) * 100 p_y2 = ((.002 - y1)/.002) * 100

x1 =5000x2 =0.0020y1 =5000y2 =0.0020p_x1 =0p_x2 =-2.5000e+08p_y1 =0p_y2 =-2.5000e+083.8 (a) Evaluate the polynomial y = x3 7x2 + 8x 0.35 PROBLEMS 77 at x = 1.37 . Use 3-digit arithmetic with chopping. Evaluate the percent relative error. (b) Repeat (a) but express y as y = ((x 7)x + 8)x 0.35 Evaluate the error and compare with part (a)

3.11 Use 5-digit arithmetic with chopping to determine the roots of the following equation with Eqs. (3.12) and (3.13) x2 5000.002x + 10 Compute percent relative errors for your results.