Numerical Analysis/Vandermonde example: Difference between revisions

From testwiki
Jump to navigation Jump to search
 
(No difference)

Latest revision as of 10:58, 23 October 2019

We'll find the interpolating polynomial passing through the three points (1,6), (2,2), (4,12), using the Vandermonde matrix.

For our polynomial, we'll take (1,6)=(x0,y0), (2,2)=(x1,y1), and (4,12)=(x2,y2).

Since we have 3 points, we can expect degree 2 polynomial.

So define our interpolating polynomial as:

p(x)=a2x2+a1x+a0.

So, to find the coefficients of our polynomial, we solve the system p(xi)=yi, i{0,1,2}.

(x02x01x12x11x22x21)*(a2a1a0)=(y0y1y2)

In order to solve the system, we will use an augmented matrix based on the Vandermonde matrix, and solve for the coefficients using Gaussian elimination. Substituting in our x and y values, our augmented matrix is:

(1211622212424112)

Then, using Gaussian elimination,

(11164212164112)(11160232601215108)(11160232600348)(110100202200116)(10010101100116)

Our coefficients are a2=1, a1=11, and a0=16. So, the interpolating polynomial is

p(x)=x2+11x16.

Adding a point

Now we add a point, (3,10)=(x3,y3), to our data set and find a new interpolation polynomial with this method.

Since we have 4 points, we will have degree 3 polynomial.

Thus our polynomial is p(x)=a3x3+a2x2+a1x+a0,

and we get the coefficients by solving the system p(xi)=yi.

Constructing our augmented matrix as before and using Gaussian elimination, we get:

(131211623222124342411233323110)(1111604675004860633960182426152)(11116046750001221204003111273)

(111160467500012212040001422)(1110820460566001201644000188)(11005504002560010137000188)

(100090100640010137000188)

Therefore, our polynomial is:

p(x)=9x364x2+137x88.