context-poly-s

# Exit 30 the 20 interpolating polynomial 10 0 10 20 30

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e form p(x) = ax 3 + bx 2 + cx + d. next page back print doc close 3 In later activities you will ﬁt polynomials to data sets in the least squares sense, where the objective is to ﬁnd a polynomial that passes near each data point but not necessarily through them. exit 30 The 20 Interpolating Polynomial 10 0 −10 −20 −30 −2 0 2 4 title page 6 Figure 3 The graph of a polynomial is a smooth curve. contents If you substitute each of the given points into the equation p(x) = ax 3 + bx 2 + cx + d and you will create a system of four equations in four unknowns a, b, c, and d. previous page a(−3)3 + b(−3)2 + c(−3) + d = 0 a(−2)3 + b(−2)2 + c(−2) + d = −3 a(0)3 + b(0)2 + c(0) + d = 3 next page (3) a(2)3 + b(2)2 + c(2) + d = −15 As you recall, the ﬁrst step in solving system 3 requires that you set up an augmented matrix for the system. back print doc close exit (−3)3 (−2)3 (0)3 (2)3 (−3)2 (−2)2 (0)2 (2)2 −3 1 0 −2 1 −3 01 3 2 1 −15 Simplify the augmented matrix. −27 9 −3 −8 4 −2 0 00 8 42 The Interpolating Polynomial 1 0 1 −3 1 3 1 −15 Next, enter the augmented matrix and use Matlab’s rref command to place the augmented matrix in reduced row echelon form. >> M=[-27 9 -3 1 0;-8 4 -2 1 -3;0 0 0 1 3;8 4 2 1 -15] M= -27 9 -3 1 0 -8 4 -2 1 -3 0 0 0 1 3 8 4 2 1 -15 >> R=rref(M) R= 1 0 0 0 -1 0 1 0 0 -3 0 0 1 0 1 0 0 0 1 3 It is clear from this last result that the solution of system 3 is a = −1, b = −3, c = 1, and d = 3. If you substitute these values in the general third degree polynomial, p(x) = ax 3 + bx 2 + cx + d, then the interpolating polynomial is title page contents previous page next page back print doc close exit p (x) = −x 3 − 3x 2 + x + 3. (4) It is essential that we check our solution. Remember, the interpolating polynomial must pass through each of the data points. If it doesn’t, then we do not have the correct answer. So, ﬁrst we will plot the original data as discrete points. Then we will plot the polynomial. If the polynomial passes through ea...
View Full Document

## This document was uploaded on 02/14/2014.

Ask a homework question - tutors are online