Home > Src > Basis_functions > plot_modal.m

plot_modal

PURPOSE ^

PLOT_MODAL plots 1D modal boundary-adapted polynomials

SYNOPSIS ^

function plot_modal

DESCRIPTION ^

 PLOT_MODAL  plots 1D modal boundary-adapted polynomials 
             Formula (2.3.31), pag. 82, CHQZ2,
             produces part of Fig. 2.12, pag. 83 CHQZ2

     plot_modal   % no input, no output

 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 function plot_modal
0002 % PLOT_MODAL  plots 1D modal boundary-adapted polynomials
0003 %             Formula (2.3.31), pag. 82, CHQZ2,
0004 %             produces part of Fig. 2.12, pag. 83 CHQZ2
0005 %
0006 %     plot_modal   % no input, no output
0007 %
0008 % Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang,
0009 %                    "Spectral Methods. Fundamentals in Single Domains"
0010 %                    Springer Verlag, Berlin Heidelberg New York, 2006.
0011 
0012 %   Written by Paola Gervasio
0013 %   $Date: 2007/04/01$
0014 
0015 %
0016 addpath ../Level_0
0017 lm1='0';
0018 l0='1'; l1='x'; 
0019 l2=pol_legendre(1,l1,l0);
0020 l3=pol_legendre(2,l2,l1);
0021 l4=pol_legendre(3,l3,l2);
0022 eta0='0.5*(1-x)'; 
0023 eta1='0.5*(1+x)';
0024 eta2=pol_modal(1,l2,l0);
0025 eta3=pol_modal(2,l3,l1);
0026 eta4=pol_modal(3,l4,l2);
0027 
0028 nx1=51;
0029 x=linspace(-1,1,nx1)';
0030 y=zeros(nx1,5);
0031 y(:,1)=eval(eta0); y(:,2)=eval(eta1); y(:,3)=eval(eta2); 
0032 y(:,4)=eval(eta3); y(:,5)=eval(eta4);
0033 
0034 for k=1:5
0035 fig=figure(...,
0036     'Name','1D Modal basis polynomial',...
0037     'Visible','on');
0038 plot([-1.1,1.1],[0,0],'k');
0039 hold on
0040 plot([-1.,1.],[0,0],'k+');
0041 plot(x,y(:,k),'k','LineWidth',3)
0042 set(gca,'DataAspectRatioMode','manual',...
0043 'DataAspectRatio',[1,1,1],...
0044 'XTickLabelMode','manual','XTickLabel',[],'XTick',[],...
0045 'YTickLabelMode','manual','YTickLabel',[],'YTick',[],...
0046 'color','none','xcolor',[1 1 1],'ycolor',[1 1 1],...
0047 'Box','off','FontName','Times','Fontsize',16)
0048 if mod(k,2)==1
0049 set(gca,'Ylimmode','manual','Ylim',[-.55,1.1])
0050 else
0051 set(gca,'Ylimmode','manual','Ylim',[-1.1,1.1])
0052 end
0053 h1=text(-1.2,-0.2,0.,'-1','FontName','Times','Fontsize',16);
0054 h2=text(.99,-0.2,0.,'1','FontName','Times','Fontsize',16);
0055 h3=text(.7,.7,0.,['E',num2str(k-1)],'FontName','Times','Fontsize',16);
0056 nomefile=['figure2-modal',num2str(k-1)];
0057 axis off
0058 
0059 end
0060 return

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