Homework 4

advertisement
MA 427: Homework 4
1.
Consider several finite difference approximations of the f ’(x) where f(x) = e2x at x = 2.
(a). Correctly, use the code fdapprox.m to illustrate the forward, backward and centered finite
difference approximations of this derivative.
Explain the numbers in the output table.
(b). Use the five-point rule #5
f ‘(x) ≈ (f(x-2h) – 8f(x-h) + 8f(x+h) – f(x+2h))/(12h)
and modify fdapprox.m to approximate the errors.
Note the order of the error.
(c). Use the three-point rule #7
f “(x) ≈ (f(x+h) – 2f(x) + f(x-h))/(h2)
to approximated the second derivative f “(2).
Note the order of the error.
2.
Consider Richardson’s extrapolation starting with the centered finite difference approximation
of the derivative for the function f(x) = e2x at x = 2
(a). By-hand compute N1(.2), N1(.1) and N1(.05) where N1(h) ≡ (f(x+h) – f(x-h))/(2h).
(b). By-hand compute N2(.2), N2(.1) where N2(h) ≡ (4N1(h/2) – N1(h))/3.
(c). By-hand compute N3(.2) where N3(h) ≡ (16N2(h/2) – N2(h))/15. Compare these approximations
with f ‘(2).
3.
Consider the Trapezoid and Simpson rules or numerical approximations of integrals.
(a). For Simpson’s rule use int() to compute and simplify for i= 0,1 and 2
x2
 l ( x)dx
i
x0
(b). Use intapprox.m to approximate
2
e
2x
dx .
0
Use both rules and compare the orders of convergence.
(c). Use intapprox.m to approximate
4
e
 x2
dx .
0
Use both rules and compare the results.
Download