Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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:

1 Numerical Methods

2  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

3  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

4  Now through these six points, one can pass a fifth order polynomial [where,-1<x<1]  On plotting the fifth order polynomial (Figure in the next slide) and the original function, one can see that the two do not match well  One may consider choosing more points in the interval [– 1, 1] to get a better match, but it diverges even more (see Figure in other slide), where 20 equidistant points were chosen in the interval [–1, 1] to draw a 19th order polynomial 4

5 5

6 6

7  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

8  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 ..... 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

10  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

11  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

12  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

13  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

14  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.

15  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<t<10 v(t)=a 2 t 2 +b 2 t+c 2 ; 10<t<15 v(t)=a 3 t 2 +b 3 t+c 3 ; 15<t<20 v(t)=a 4 t 2 +b 4 t+c 4 ; 20<t<22.5 v(t)=a 5 t 2 +b 5 t+c 5 ; 22.5<t<30  The equations are found as follows  Each quadratic Spline passes through two consecutive data points and quadratic splines have continuous derivative at interior data points and finally assume a 1 =0 15

16 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 17

18 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

19 v(t)=22.704 t ; 0<t<10 v(t)=-08888 t 2 + 4.928 t + 88.88 ; 10<t<15 v(t)=-0.1356 t 2 +35.66 t - 141.61 ; 15<t<20 v(t)=1.6048 t 2 – 33.956 t + 554.55; 20<t<22.5 v(t)=0.20889 t 2 +28.86 t -152.13 ; 22.5<t<30 v(16)=394.24 m/s s(16)=1595.9 m a(16)= m/s 2 19

20 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


Ads by Google