Home > Src > Level_0 > chebyshev_pol.m

chebyshev_pol

PURPOSE ^

CHEBYSHEV_POL plots Chebyshev polynomials for n=0,...,4

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 CHEBYSHEV_POL  plots Chebyshev polynomials for n=0,...,4

 Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang,
                    "Spectral Methods. Fundamentals in Single Domains"
                    Springer Verlag, Berlin Heidelberg New York, 2006.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % CHEBYSHEV_POL  plots Chebyshev polynomials for n=0,...,4
0002 %
0003 % Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang,
0004 %                    "Spectral Methods. Fundamentals in Single Domains"
0005 %                    Springer Verlag, Berlin Heidelberg New York, 2006.
0006 
0007 %   Written by Paola Gervasio
0008 %   $Date: 2007/04/01$
0009 
0010 nx=100;
0011 x=linspace(-1,1,nx);
0012 x=x';
0013 
0014 pc=zeros(nx,5);
0015 % Chebyshev
0016 for n=1:4
0017 [pj] = jacobi_eval(x,n,-0.5,-0.5) ;
0018 pc(:,n)=pj(:,1)*2^(2*n)*(prod(1:n))^2/prod(1:2*n);
0019 end
0020 
0021 figure(1);
0022 clf
0023 set(gca,'Fontname','Times','Fontsize',16);
0024 plot(x,pc(:,1),'k',x,pc(:,2),'k--','Linewidth',1);
0025 hold on
0026 plot(x,pc(:,3),'k-.','Linewidth',1);
0027 plot(x,pc(:,4),'k:','Linewidth',2);
0028 plot(x,ones(nx,1),'k--','Linewidth',1);
0029 xlabel('x','Fontname','Times','Fontsize',16);
0030 set(gca,'PlotBoxAspectRatio',[3 2 1],...
0031     'Ylimmode','manual','Ylim',[-1.2,1.2],...
0032    'Xtickmode','manual','Xtick',[-1,-0.5,0,0.5,1],...
0033     'Xgrid','on','Xminorgrid','off',...
0034     'Ygrid','on','Yminorgrid','off',...
0035     'Fontname','Times','Fontsize',16);

Generated on Fri 21-Sep-2007 10:07:00 by m2html © 2003