À̸§°Ë»ö

::: SHIN, Byeong-Chun's Board


97 510 Åë°èÄ«¿îÅÍ º¸±â   ȸ¿ø °¡ÀÔ È¸¿ø ·Î±×ÀÎ °ü¸®ÀÚ Á¢¼Ó --+
Name   SBC
Subject   Chebyshev interpolation for functions
% cheb_interp_.m
% need cheb_mat.m

function  main(f,a,b,deg)

f = fcnchk(f); % make f as a function
xx = linspace(a,b,10*deg+1);
pxx = f(xx);  % original function to find
% polynomial interpolation with equispaced data
xe = linspace(a,b,deg+1);
ye = f(xe);
pe = polyfit(xe,ye,deg);
pex = polyval(pe,xx);
% Chebyshev polynomial interpolation with Chebyshev Gauss points
[D,xg,we] = cheb_mat(deg+1,1);  
    % D = Diff matrix, xg = gauss points in [-1,1], we = weights
xg = a + (b-a)*(xg+1)/2;  % gauss points in [a,b]
yg = f(xg);
pg = polyfit(xg,yg,deg);
pgx = polyval(pg,xx);

%plot(xe,ye,'o',xx,pxx,'b-',xx,pex,'m-.')
%pause
%plot(xg,yg,'o',xx,pxx,'b-',xx,pgx,'m-')
%pause
plot(xe,ye,'m*',xg,yg,'ro',xx,pxx,'b-',xx,pex,'m-',xx,pgx,'r-')
title('Interpolations : Magenta(equispace), Red(Cheby Gauss pts) ')

°Ô½Ã¹°À» À̸ÞÀÏ·Î º¸³»±â ÇÁ¸°Æ®Ãâ·ÂÀ» À§ÇÑ È­¸éº¸±â
DATE: 2011.11.08 - 14:19


 ÀÌÀü±Û ¼öÄ¡Çؼ®Æ¯°­ ¼ºÀû
 ´ÙÀ½±Û ¼öÄ¡Çؼ® ¹× ½Ç½À ¼ºÀû
±Û³²±â±â»èÁ¦Çϱâ¼öÁ¤Çϱâ´äº¯´Þ±âÀüü ¸ñ·Ï º¸±â