Professional Documents
Culture Documents
warning off
epsa=13;
epsb=1;
a=1.0;
R=0.2*a;
a1=a;
b1=2*pi/a;
n=24;
NumberofPW=49;
count=1;
G=(-n:n).*b1;
r=(-n:n);
N=98;
m=20;
eps1=[epsb*ones((N-m)/2,1);epsa*ones(m,1);epsb*ones((N-m)/2,1)];
eps20=(fftshift(fft(eps1)./N));
for x=1:NumberofPW,
for y=x:NumberofPW,
b=r(x)-r(y)+(2*n+1)+1;
eps2(x,y)=eps20(b);
eps2(y,x)=eps2(x,y);
end
end
k0=-pi/a:2*pi/a/30:pi/a;
eps2=inv(eps2);
counter=1;
for ii=1:length(k0),
k=k0(ii);
M=abs((k+G')*(k+G)).*(eps2);
E=sort(abs(eig(M)));
freq(:,counter)=sqrt(abs(E(1:10))).*a./2./pi;
counter=counter+1;
end
tmpx=1:length(k0);
plot(tmpx,freq,'linewidth',2)
xlabel('wave vector')
ylabel('wa/2\pic')
grid on
axis([1 31 0 1])
FINAL PLANE WAVE METHOD
% Clean up workspace
clear all
%close all
% PhC parameters
d1 = 400e-9;
d2 = 600e-9;
d = d1 + d2;
n1 = 1.5;
n2 = 1;
kz = linspace(0,2*pi/d,100);
c = 3e8;
% Decomposition constants
for kk = 1:length(kz)
M =zeros(2*N+1,2*N+1);
for nn = (-N):N
for pp = (-N):N
if ((pp-nn)==0)
Fn=0;
end
end
end
end
clf
%subplot(2,2,i);
plot(kz*d,real(sqrt(w2)*d),'linewidth',2)
hold on
axis tight
set(gca,'FontSize',14)
xlabel('k_zd','FontSize',14)
ylabel('\omega d/c','FontSize',14)
ylim([0,2*pi])
Band gap for w= 2.966, w=3.525
K=0
close all
clear all
% EM constants
% PhC constants
d1 = 4/10;
d2 = 6/10;
d = d1 + d2;
n1 =1.5;
n2 = 1;
% Light constants
w = linspace(-2*pi,2*pi, 500);
D1 = w.*n1 * d1;
D2 = w.*n2 * d2;
kz = linspace(-2*pi,2*pi,500);
for ll = 1:length(kz)
LHS = cos(kz(ll)*d);
end
plot(real(acos(RHS)),w*d/c,'linewidth',2);
axis tight ,
xlabel('k_zd')
ylabel('\omega d/c')
xlim([0 6])
Transmittance
% Input conditions
eps1 = 11.9;
eps2 = 5.8;
b1 = 1028; % Thickness
b2 = 1472;
b12 = 1250;
nm = 10^(-9);
c = 3*10^8;
P = 2; % Period
l = 10000:21000; % wavelength
w = 2*pi*c./(l*nm);
w0 = 2*pi*c/(lam0*nm);
n1 = sqrt(eps1);
n2 = sqrt(eps2);
n= [n1, n2];
% Thickness array
b = zeros(1,N*P);
for i = 1:2:N*P
b(i) = b1;
end
for i = 2:2:N*P
b(i) = b2;
end
k=2*pi./l;
% Fresnel coefficients
r=zeros(1, N*P+1);
t=zeros(1, N*P+1);
for i=1:1:N*P+1
r(i)=(nArray(i)-nArray(i+1))/(nArray(i)+nArray(i+1));
t(i)=2*nArray(i)/(nArray(i)+nArray(i+1));
end
M=zeros(2,2,N*P+1);
F=zeros(2,2,length(l),N*P);
for i=1:1:N*P+1
M(1,1,i)=1/t(i);
M(1,2,i)=r(i)/t(i);
M(2,1,i)=r(i)/t(i);
M(2,2,i)=1/t(i);
end
for i=1:1:N*P
for j=1:length(l)
F(1,1,j,i)=exp(1i*nArray(i+1)*k(j)*b(i));
F(1,2,j,i)=0;
F(2,1,j,i)=0;
F(2,2,j,i)=exp(-1i*nArray(i+1)*k(j)*b(i));
end
end
% Full matrix
T=zeros(2,2,length(l));
for j=1:length(l)
T(:,:,j)=M(:,:,1);
for i=1:1:N*P
T(:,:,j)=T(:,:,j)*F(:,:,j,i)*M(:,:,i+1);
end
end
M=zeros(length(l));
for j=1:length(l)
end
figure(1)
plot(w/w0,M(:,1),'k','linewidth',1.5);
grid on;
yticks([0,0.25,0.5,0.75,1]);
hold on;