Home > Src > Eigenvalues_1d > fig4_14.m

fig4_14

PURPOSE ^

FIG4_14 Script to produce Fig 4.14, pag. 206 CHQZ2

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 FIG4_14  Script to produce Fig 4.14,  pag. 206 CHQZ2

 Legendre collocation first-derivative eigenvalues and spectral condition
 number.

 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 % FIG4_14  Script to produce Fig 4.14,  pag. 206 CHQZ2
0002 %
0003 % Legendre collocation first-derivative eigenvalues and spectral condition
0004 % number.
0005 %
0006 % Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang,
0007 %                    "Spectral Methods. Fundamentals in Single Domains"
0008 %                    Springer Verlag, Berlin Heidelberg New York, 2006.
0009 
0010 %   Written by Paola Gervasio
0011 %   $Date: 2007/04/01$
0012 
0013 
0014 N=(8:8:64);
0015     nu=1;
0016 % left
0017 dmin0=[];dmax0=[]; k20=[];
0018 dmin1=[];dmax1=[]; k21=[];
0019 dmin2=[];dmax2=[]; k22=[];
0020 for nx=N
0021     pbl=0;
0022     [d,A]=lgl_eig(nx,nu,pbl);
0023     d=abs(d);
0024     dmin0=[dmin0;min(d)];
0025     dmax0=[dmax0;max(d)];
0026     k20=[k20;cond(A)];
0027     pbl=1;
0028     [d,A]=lgl_eig(nx,nu,pbl);
0029     d=abs(d);
0030     dmin1=[dmin1;min(d)];
0031     dmax1=[dmax1;max(d)];
0032     k21=[k21;cond(A)];
0033     pbl=2;
0034     [d,A]=lgl_eig(nx,nu,pbl);
0035     d=abs(d);
0036     dmin2=[dmin2;min(d)];
0037     dmax2=[dmax2;max(d)];
0038     k22=[k22;cond(A)];
0039 end
0040 fig=figure(...,
0041     'Name','Fig. 4.14 left',...
0042     'Visible','on')
0043 loglog(N,dmin0,'k-o',N,dmax0,'k-+')
0044 hold on
0045 loglog(N,dmin1,'k->',N,dmax1,'k-s')
0046 loglog(N,dmin2,'k-*',N,dmax2,'k-d')
0047 set(gca,'Xlimmode','manual','Xlim',[4,130],...
0048     'Ylimmode','manual','Ylim',[1.e-2,1.e6],...
0049     'Xgrid','on','XminorGrid','off','Ygrid','on','YminorGrid','off',...
0050 'LineWidth',1,...
0051 'FontName','Times','Fontsize',16,'FontWeight','normal')
0052 
0053 fig=figure(...,
0054     'Name','Fig. 4.14 right',...
0055     'Visible','on')
0056 loglog(N,k20,'k-o')
0057 hold on
0058 loglog(N,k21,'k->')
0059 loglog(N,k22,'k-*')
0060 set(gca,'Xlimmode','manual','Xlim',[4,130],...
0061     'Ylimmode','manual','Ylim',[10,1.e5],...
0062     'Xgrid','on','XminorGrid','off','Ygrid','on','YminorGrid','off',...
0063 'LineWidth',1,...
0064 'FontName','Times','Fontsize',16,'FontWeight','normal')

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