Presentation is loading. Please wait.

Presentation is loading. Please wait.

3. LAGRANGE INTERPOLATION METHOD

Similar presentations


Presentation on theme: "3. LAGRANGE INTERPOLATION METHOD"— Presentation transcript:

1 3. LAGRANGE INTERPOLATION METHOD
(LAGRANGE POLYNOMIAL): An alternate method of interpolation is to use polynomial fits to the available values to interpolate between those values. If there are N data values, a polynomial of degree N-1 can be found that will pass through all the points. The Lagrange polynomials provide a convenient alternative to solving the simultaneous equations that result from requiring the polynomials to pass through the data values. This is a particularly convenient way to interpolate among tabulated values with polynomials.

2 An advantage of Lagrange Interpolation is that the method does not need evenly spaced values in x. However, it is usually preferable to search for the nearest value in the table and then use the lowest-order interpolation consistent with the functional form of the data.

3 Example 3.1: x f(x) 3 2 60 4 90 10 120

4 clc;clear x=[0 2 4 10]; f=[3 60 90 120]; interp1(x,f,8,'spline')
1. Lagrange Interpolation with Matlab clc;clear x=[ ]; f=[ ]; interp1(x,f,8,'spline') 2. Lagrange Interpolation with Matlab (Reading data from a text file) clc;clear v=load ('c:\saha\data.txt') interp1(v(:,1),v(:,2),8,'spline') 0,3 2,60 4,90 10,120 data.txt


Download ppt "3. LAGRANGE INTERPOLATION METHOD"

Similar presentations


Ads by Google