# Numerical Methods.  Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.  Several methods to obtain.

## Presentation on theme: "Numerical Methods.  Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.  Several methods to obtain."— Presentation transcript:

Numerical Methods

 Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.  Several methods to obtain such a polynomial include the direct method, Lagrangian interpolation method and Newton’s divided difference polynomial method.  Actually, when n becomes large, in many cases, one may get oscillatory behavior in the resulting polynomial.  This was shown by Runge when he interpolated data based on a simple function of on an interval of [–1, 1]. 2

 For example, take six equidistantly spaced points in [–1, 1] for the given function and find y’s at these points as given in Table 1. 3 x –1.00.038461 –0.60.1 –0.20.5 0.20.5 0.60.1 1.00.038461

 Now through these six points, one can pass a fifth order polynomial [where,-1 { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/13/4177967/slides/slide_4.jpg", "name": " Now through these six points, one can pass a fifth order polynomial [where,-1

5

6

 So what is the answer to using information from more data points, but at the same time keeping the function true to the data behavior?  The answer is in spline interpolation. The most common spline interpolations used are linear, quadratic, and cubic splines. 7

 Given (x0,y0), (x 1, y 1 ), (x 2, y 2 )......(x n,y n ), fit linear splines (Figure below) to the data. This simply involves forming the consecutive data through straight lines. So if the above data is given in an ascending order, the linear splines are given by y i =f(x i ) 8 (x 0, y 0 ) (x 1, y 1 ) (x 2, y 2 ) (x 3, y 3 ) x y

..... 9 Note the term in the above function are simply slopes between x i and x i+1 At the interior points of the data, the slope changes abruptly. This means that the first derivative is not continuous at these points So how do we improve on this? We can do so by using quadratic splines

 In these splines, a quadratic polynomial approximates the data between two consecutive data points.  Given, fit quadratic splines through the data. The splines are given by 10..... So how does one find the coefficients of these quadratic splines? There are such coefficients

 To find unknowns, one needs to set up equations and then simultaneously solve them. These equations are found as follows.  1. Each quadratic spline goes through two consecutive data points......  This condition gives 2n equations as there are n quadratic splines going through two consecutive data points 11

 2. The first derivatives of two quadratic splines are continuous at the interior points. For example, the derivative of the first spline is equal to that of the second spline at x=x 1, so at x=x 2  Similarly at other interior points...... 12

 Since there are (n-1) interior points, we have (n-1) such equations. So far, the total number of equations is (2n)+(n-1) = (3n-1) equations. We still then need one more equation.  We can assume that the first spline is linear, that is a 1 =0  This gives us 3n equations and 3n unknowns. These can be solved by a number of techniques used to solve simultaneous linear equations. 13

 The upward velocity of a rocket is given as a function of time as 14 (s) (m/s) 00 10227.04 15362.78 20517.35 22.5602.97 30901.67 a)Determine the value of the velocity at t = 16 seconds using quadratic splines. b) Using the quadratic splines as velocity functions, find the distance covered by the rocket from t=11 s to t=16 s. c) Using the quadratic splines as velocity functions, find the acceleration of the rocket at t=16 s.

 a) Since there are six data points, five quadratic splines pass through them. v(t)=a 1 t 2 +b 1 t+c 1 ; 0 { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/13/4177967/slides/slide_15.jpg", "name": " a) Since there are six data points, five quadratic splines pass through them.", "description": "v(t)=a 1 t 2 +b 1 t+c 1 ; 0

The fifteen number of equations are  c 1 =0..……. (1)  100a 1 +10b 1 +c 1 =227.04………. (2)  100a 2 +10b 2 +c 2 =227.04………. (3)  225a 2 +15b 2 +c 2 =362.78………. (4)  225a 3 +15b 3 +c 3 =362.78………. (5)  400a 3 +20b 3 +c 3 =517.35………. (6)  400a 4 +20b 4 +c 4 =517.35………. (7)  506a 4 +22.5b 4 +c 4 =602.97………. (8) 16  506a 5 +22.5b 5 +c 5 =602.97….(9)  900a 5 +30b 5 +c 5 =901.67 ….(10)  20a 1 +b 1 -20a 2 -b 2 =0 …..(11)  30a 2 +b 2 -30a 3 -b 3 =0.…...(12)  40a 3 +b 3 -40a 4 -b 4 =0.…...(13 )  45a 4 +b 4 -45a 5 -b 5 =0......(14)  a 1 =0....(15)

17

18 aiai bibi cici 1022.7040 20.88884.92888.88 3–0.135635.66–141.61 41.6048–33.956554.55 50.2088928.86–152.13

v(t)=22.704 t ; 0 { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/13/4177967/slides/slide_19.jpg", "name": "v(t)=22.704 t ; 0

Thanks 20

Download ppt "Numerical Methods.  Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.  Several methods to obtain."

Similar presentations