This preview shows page 1. Sign up to view the full content.
Unformatted text preview: MATH 446 / OR 481 SAUER SPRING 2010 Project 5 Approximating Functions by Polynomial Interpolation You will use Newtons divided differences to build an interpolating polynomial that approximates the function f ( x ) = sin e cos4 x . Since the function is periodic with period / 2 , it would be sufficient to approximate it on its fundamental domain [0 ,/ 2] . 1. First, lets try using the slightly larger domain [0 , 2] . Use the Matlab command x0=2 * (0:(n-1))/(n-1); to define n equally-spaced base points in the interval [0 , 2] . Take y0 values from the func- tion f ( x ) at these x0 coordinates, using correct values from Matlabs library functions. Then the Matlab m-files nest.m and newtdd.m can be used to find the degree n- 1 interpolating polynomial P n- 1 ( x ) that passes through the n points. Plot the actual f ( x ) versus P n- 1 ( x ) on [0 , 2] for n = 10 . Use a grid size of . 01 or smaller to make the plot. In- clude the interpolating points, plotted as circles. In a separate figure, plot the interpolationclude the interpolating points, plotted as circles....
View Full Document
This note was uploaded on 10/27/2010 for the course MATH 446 taught by Professor Staff during the Spring '08 term at George Mason.
- Spring '08