Home > Src > Level_0 > jacobi_pol.m

jacobi_pol

PURPOSE ^

JACOBI_POL Script for plotting some Jacobi polynomials for n=4

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 JACOBI_POL  Script for plotting some Jacobi polynomials for n=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 % JACOBI_POL  Script for plotting some Jacobi polynomials for n=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 n=4;
0014 
0015 % Jacobi alpha=beta=0 (Legendre)
0016 [pj] = jacobi_eval(x,n,0,0) ;
0017 pl=pj(:,1);
0018 
0019 % Jacobi alpha=beta=-0.5 (Chebyshev)
0020 [pj] = jacobi_eval(x,n,-0.5,-0.5) ;
0021 pc=pj(:,1)*2^(2*n)*(prod(1:n))^2/prod(1:2*n);
0022 
0023 % Gegenbauer nu=-3/4;
0024 nu=-3/4;
0025 [pj] = jacobi_eval(x,n,nu-0.5,nu-0.5) ;
0026 pg1=pj(:,1)*gamma(nu+0.5)*gamma(2*nu+n)/(gamma(nu+n+0.5)*gamma(2*nu));
0027 
0028 
0029 % Gegenbauer nu=0;
0030 nu=0;
0031 [pj] = jacobi_eval(x,n,nu-0.5,nu-0.5) ;
0032 pg2=pj(:,1)*gamma(nu+0.5)*gamma(2*nu+n)/(gamma(nu+n+0.5)*prod(1:2*nu));
0033 
0034 
0035 
0036 figure(1);
0037 clf
0038 set(gca,'Fontname','Times','Fontsize',16);
0039 plot(x,pl,'k',x,pc,'k--','Linewidth',1);
0040 hold on
0041 plot(x,pg1,'k-.','Linewidth',1);
0042 plot(x,pg2,'k:','Linewidth',2);
0043 xlabel('x','Fontname','Times','Fontsize',16);
0044 l=legend('Legendre','Chebyshev','Gegenbauer, \nu =-3/4',...
0045     'Gegenbauer, \nu =0');
0046 set(gca,'PlotBoxAspectRatio',[3 2 1],...
0047     'Ylimmode','manual','Ylim',[-1.2,1.2],...
0048    'Xtickmode','manual','Xtick',[-1,-0.5,0,0.5,1],...
0049     'Xgrid','on','Xminorgrid','off',...
0050     'Ygrid','on','Yminorgrid','off',...
0051     'Fontname','Times','Fontsize',16);
0052 set(l,'Position',[0.364,0.15,0.309,0.279]);

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