2clear all; close all; clc;
3cols={[0.1216 0.2275 0.5765]} ; % a nice line color
6h1 = 2; % fractional thickness 1
7h2 = 1; % fractional thickness 2
10Nk0 = 1000; Nkz = 1000;
11k0 = linspace(0,8,Nk0);
12kz = linspace(-1,1,Nkz)*pi/(h1+h2);
18% dispersion equation (lengthy, general form)
19M11 = exp(-1i*k1*h1).*(cos(k2*h2)-0.5*1i*(k1./k2+k2./k1).*sin(k2*h2));
20M22 = exp(1i*k1*h1).*(cos(k2*h2)+0.5*1i*(k1./k2+k2./k1).*sin(k2*h2));
21f = bsxfun(@minus, cos(kz*(h1+h2)), (M11 +M22).
'/2);
24kza = real(acos(cos(k1*h1).*cos(k2*h2) - (n1^2+n2^2)/(2*n1*n2)*sin(k1*h1).*sin(k2*h2)));
25% nasty fix for visualization purposes - only care about real part above zero
26kza(abs(kza)<1e-9) = NaN;
31% visualize the "dispersion equation" magnitude - black where solutions exist
32pcolor(kz*(h1+h2),k0,-log(abs(f))); shading interp
36plot([0,0],minmax(k0),'-k
') % axis line
37% analytical solution of K as function of Omega
38plot(real(kza),k0,'--
','color
',cols{1},'linewidth
',3);
39plot(-real(kza),k0,'--
','color
',cols{1},'linewidth
',3);
42box on; set(gca,'Layer
','Top
')
43xlabel('\itk_xa
','Fontsize
',12)
44ylabel('\it\omega\ita/c
','Fontsize
',12)