Home > K25104 > PDEs > amp_fac_script_1.m

amp_fac_script_1

PURPOSE ^

Usage example for amp_fac

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Usage example for amp_fac
 related to Exercise 8.2

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Usage example for amp_fac
0002 % related to Exercise 8.2
0003 
0004 syms mu;
0005 alpha = [0; 0; 1; 0; 0];
0006 beta = [-mu*(1-6*mu)/12; 2/3*mu*(2-3*mu); (2-5*mu+6*mu^2)/2; 2/3*mu*(2-3*mu); -mu*(1-6*mu)/12];
0007 r = 2;
0008 s = 2;
0009 [ H ] = abs(amp_fac( alpha, beta,r,s ));
0010 figure;
0011 x = -pi:0.1:pi;
0012 H = matlabFunction(H);
0013 Hphi =@(phi) H(0.7,phi);
0014 y = Hphi(x);
0015 plot(x,y);
0016 ax = gca;
0017 ax.XTick = [-pi -pi/2 0 pi/2 pi];
0018 ax.XTickLabel = {'-\pi','-\pi/2','0','\pi/2','\pi'};
0019 hold on;
0020 
0021 Hphi =@(phi) H(2/3,phi);
0022 y = Hphi(x);
0023 plot(x,y);
0024 
0025 Hphi =@(phi) H(0.6,phi);
0026 y = Hphi(x);
0027 plot(x,y);
0028 
0029 legend('\mu = 0.7','\mu =2/3', '\mu = 0.6');
0030 title('modulus of amplification factor');
0031 line([-4 4],[1 1],'Color','k','LineStyle',':');
0032 
0033 mu = 0:0.01:1;
0034 m = length(mu);
0035 mx = zeros(1,m);
0036 for j=1:length(mu)
0037     Hphi =@(phi) H(mu(j),phi);
0038     mx(j) = max(Hphi(x));
0039 end
0040 figure;
0041 plot(mu,mx);
0042 ax = gca;
0043 ax.XTick = [0,0.1,0.2,0.3,0.4,0.5,0.6,2/3,0.8,0.9,1];
0044 ax.XTickLabel = {'0','0.1','0.2','0.3','0.4','0.5','0.6','2/3','0.8','0.9','1'};
0045 xlabel('\mu');
0046 title('maximum modulus of amplification factor');
0047 line([2/3 2/3],[0.5 4],'Color','k','LineStyle',':');

Generated on Mon 18-Jan-2016 10:25:49 by m2html © 2005