AE/ME 330 Spring 2013, Homework VI, Due Friday, April 19 1. Use 3rd and 6th degree Lagrange interpolation polynomials to approxi- mate the function f(x) = Sin (ex ?? 2) using equally spaced data on the interval 0 x 2. For each case, plot the exact function f(x), approximation to the function by the Lagrange polynomials (fappx(x)), and the error (f(x)??fappx(x)) on the given interval. Give the error values at x=0.1, 0.9, 1.5, and 1.9. 2.
AE/ME 330 Spring 2013, Homework VI, Due Friday, April 19 1. Use 3rd and 6th degree Lagrange interpolation polynomials to approxi- mate the function f(x) = Sin (ex ?? 2) using equally spaced data on the interval 0 x 2. For each case, plot the exact function f(x), approximation to the function by the Lagrange polynomials (fappx(x)), and the error (f(x)??fappx(x)) on the given interval. Give the error values at x=0.1, 0.9, 1.5, and 1.9. 2. Write a computer routine to approximate the function given in Ques- tion 1 using a natural cubic spline with eleven equally spaced data points on the interval 0 x 2. Plot the function, the cubic spline approximation (fappx(x)), and the error (f(x) ?? fappx(x)) on the given interval. Give the error values at x=0.1, 0.9, 1.5, and 1.9. 3. Derive the following central nite dierence formula df dxi = 1 12h (??fi+2 + 8fi+1 ?? 8fi??1 + fi??2) to approximate the rst derivative of the function at xi. Note that fi+2 = f(xi + 2h), fi+1 = f(xi + h), fi??1 = f(xi ?? h), and fi??2 = f(xi ?? 2h). Show that the order of this approximation is O(h4). (i) Use the above nite dierence formula to calculate the rst deriva- tive of the function given in Question 1 at xi = 0:9 with h = 10??k for k = 1; 2; 3:::::; 10. Calculate the absolute error for each case using the exact value of the derivative at the given point. Comment on the results you obtain. (ii) Now calculate the rst derivative of the function given in Question 1 at xi = 0:9 with h = 10??k for k = 1; 2; 3:::::; 10 using a rst-order accurate forward dierence approximation evaluated with fi+1 and fi. Calculate the absolute error for each case using the exact value of the derivative at the given point. Comment on the results you obtain. (Hint: You may look at absolute error vs. h in a log-log plot for part (i) and part (ii), which may help you to explain the results.) (OVER) 1
h/2 h x0 x1 x2 4. Using the non-uniform mesh spacing shown in the gure, derive (a) a second order accurate one-sided nite…





