E7_lecture23_F08_Interpolation_MKF - DENSITY OF WATER...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: DENSITY OF WATER Temperature, ºC Density, g/cm3 1.0000 0.9970 0.9881 0.9747 0.9579 Polynomial Interpolation 0 25 50 75 100 FUNCTION EVALUATION f(x) y6 y5 y3 y1 0 x1 x2 x3 x4 x5 x6 x LINEAR INTERPOLATION f(x) (xi+1,yi+1) • (xi,yi) • (x,y) • 0 x interpolation y yi1  yi x  x i  yi x i1  x i PIECEWISE LINEAR INTERPOLATION f(x) y6 y5 y3 y1 0 x1 x2 x3 x4 x5 x6 x PIECEWISE LINEAR INTERPOLATION load xydata; plot(x,y,'o') hold on n = 10; % number of points between nodes for i = 1:length(x)-1 xplot = linspace(x(i),x(i+1),n); yplot = ( (y(i+1)-y(i))/(x(i+1)-x(i)) )… (y(i+1) *(xplot-x(i))+y(i); plot(xplot,yplot,'r') hold on end hold off INTERPOLATION linear quadratic y = a0 + a1x y = a0 + a1x + a2x2 y = a0 + a1x +…+ anxn 2 points 3 points MATLAB FUNCTIONS YI = interp1(X,Y,Xi) interp1(X YI = interp1(X,Y,Xi,'linear') YI = interp1(X,Y,Xi,'cubic') YI = interp1(X,Y,Xi,'spline') PP = spline(X,Y) n-th order spline n+1 points y = a0 + a1x + a2x2 + a3x3 4 points and 2 slopes ...
View Full Document

This note was uploaded on 11/01/2009 for the course ENGLISH 7 taught by Professor Sengupta during the Spring '09 term at University of California, Berkeley.

Page1 / 2

E7_lecture23_F08_Interpolation_MKF - DENSITY OF WATER...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online