






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























Topic: Direct Method
Email: [email protected]
What is Interpolation? Let us suppose we are given with data (x 0 , y 0 ), (x 1 , y 1 ), …… (xn, yn), then we are asked to find the value of ‘y’ at a value of ‘x’ that is not given in the data. So, we need to do the interpolation in the data. ( x 1 , y 1 ) ( x 2 , y 2 ) ( x 0 , y 0 ) ( xn , yn ) ( x 3 , y 3 )
Interpolation
Interpolation
Modeling Choices
1 2 1 2 1 1 ( ) ( ) ( ) ( ) x x x x y x y x y x y x For first and second point we write two equations : y ( x ) c m x Here m is the slope and c is the y-intercept of line. 2 2 1 1 ( ) ( ) y x c m x y x c m x Subtracting we get the slope m and intercept c as Consider a linear interpolate as: 2 1 ( 2 ) ( 1 ) x x y x y x m 1 2 1 2 1 1 ( ) ( ) ( ) x x x y x y x c y x Then final equation is : Linear Interpolation
Quadratic Interpolation Suppose we take three data points [ x 0 , y 0 ], [ x 1 , y 1 ], [ x 2 , y 2 ], Then put points in a polynomial : y(x) = a 0 + a 1 x + a 2 x^2 y(x 0 ) = y 0 = a 0 + a 1 x 0 + a 2 x 02 + a 3 x 03 y(x 1 ) = y 1 = a 0 + a 1 x 1 + a 2 x 12 + a 3 x 13 y(x 2 ) = y 2 = a 0 + a 1 x 2 + a 2 x 22 + a 3 x 23
Linear Interpolation 0 2 1 2 1 1
( ) ( ) x x x x y x y x y x y x
Example 1: How would you approach estimating the density at 17 o C for the data using linear interpolation? The equation of straight line that passes through two points (x 1 , y 1 ) and (x 2 , y 2 ) The two known points are following: x 1 = 15 , y 1 = 999.1 and x 2 = 20 , y 2 = 998. Temperature ( C ) Density ( kg/m^3 ) 0 999. 5 1000. 10 999. 15 999. 20 998. 0 999.
Linear Interpolation The equation of straight line that passes through two points (x 1 , y 1 ) and (x 2 , y 2 ) forms linear interpolation. This changes for intervals as shown in figure. Example 1 (continued) :
t v(t) s m/s 0 0 10 227. 15 362. 20 517. 22.5 602. 30 901. Table 1: Fig. Velocity vs. time data for the rocket. Example 4 : The upward velocity of a rocket is given as a function of time in Table 1. Find the velocity at t=16 seconds using the direct method for linear interpolation.
Examples on linear interpolation (continued)
v 15 a 0 a 1 15 362. 78 20 20 517. 35 0 1 v a a Solving the above two equations gives, 1 30. 913
2 0 1 2
20 20 20 517. 35 15 15 15 362. 78 10 10 10 227. 04 2 0 1 2 2 0 1 2 2 0 1 2 v a a a v a a a v a a a Solving the above three equations or the matrix form will give the answer
2 1 0 a a a AX B Example 3 :
First steps without pivoting are: Row2 = Row2 - Row Row3 = Row3 – Row Next steps without pivoting are: Row1 = Row1 - (2)Row Row3 = Row3 – (2)Row
2 1 0
2 1 0 a a a
2 1 0 a a a AX B Example 3 :