context-poly-s

# context-poly-s - The Interpolating Polynomial Math 45...

This preview shows pages 1–5. Sign up to view the full content.

The Interpolating Polynomial Math 45 — Linear Algebra David Arnold [email protected] Abstract A polynomial that passes through a given set of data points is called an interpolating polynomial . In this exercise you will use Matlab to find the interpolating polynomial (if one exists) for a variety of different data sets. The Vandermonde matrix is introduced as an efficient means of entering the augmented matrix. Prequisites: Solving linear systems with Matlab’s rref command. next page close exit

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Table of Contents Polynomials in Matlab Evaluating a Polynomial in Matlab Plotting in Matlab Plotting Polynomials in Matlab The Interpolating Polynomial The Vandermonde Matrix Homework The Interpolating Polynomial title page contents previous page next page back print doc close exit
Polynomials in Matlab The equation p(x) = a n x n + a n - 1 x n - 1 + · · · + a 1 x + a 0 (1) is called a polynomial in x . The terms of this polynomial are arranged in descending powers of x while the terms of the polynomial p(x) = a 0 + a 1 x + · · · + a n - 1 x n - 1 + a n x n (2) are arranged in ascending powers of x . The a i ’s are called the coefficients of the polynomial and are usually real or complex numbers. The degree of the polynomial in ( 2 ) is n , the highest available power of x . For example, p(x) = x 6 - 2 x 4 - x 3 +2 x 2 +5 x - 8 is a polynomial that is arranged in descending powers of x . The coefficients of the polynomial are 1, 0, - 2, - 1, 2, 5, and - 8. In this case, there is an understood term of 0 x 5 . However, Matlab doesn’t “understand” that a term is missing unless you explicitly tell it so. The degree of the polynomial is 6. A polynomial in Matlab is represented by a vector of its coefficients. Matlab assumes that you have arranged the polynomial in descending powers of x . For example, the vector p=[5 2 -3 1] represents the polynomial p(x) = 5 x 3 +2 x 2 - 3 x +1, while the vector q=[ 2 0 0 -4 -3] represents the polynomial q(x) = 2 x 2 +0 x 3 +0 x 2 - 4 x - 3, or, more simply, q(x) = 2 x 4 - 4 x - 3. Note that your must use zeros to denote the missing terms of the polynomial. Some polynomials and their Matlab representations are displayed in Table 1 . Note well the use of zeros as placeholders. Evaluating a Polynomial in Matlab Matlab has a number of useful routines for working with polynomials. 1 . One particularly useful 1 Use Matlab’s help facility to examine the help files for roots and poly . Although these routines will not be used in this The Interpolating Polynomial title page contents previous page next page back print doc close exit

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
p(x) = x 3 - x 2 - 1 p=[1 -1 0 -1] q(x) = x 4 - x 2 - x q=[1 0 -1 -1 0] r(x) = x 4 - 2 x 2 r=[1 0 -2 0 0] Table 1 Matlab represents polynomials with vectors. routine is polyval . Enter the following command at the Matlab prompt to generate the resulting help file.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern