参照的是导波光学_王建(清华大学)的公式(3-1-2、3-1-3),算的参数是这本书的图3-3的。
function []=PropagationConstantsMain()
clear;clc;close all
lambda0=1.55;%真空或空气中的入射波长,单位um
k0=2*pi/lambda0;
m=3;%导模阶数(需要人为指定)
n1=1.62;%芯区的折射率
n2=1.515;%衬底的折射率
n3=1;%包层的折射率
w=5;%芯区厚度,单位um
TEorTM='TE';%选定极化
beta0=linspace(k0*n2+1e-5,k0*n1-1e-5,500);%导模的传播常数范围(根据公式自动得出)%=================%
Fun=@(x)EigEq(x,k0,n1,n2,n3,m,w,TEorTM);
%=================%figure
y=arrayfun(Fun,beta0);
plot(beta0,y,'ro','MarkerSize',2)
hold on
plot(beta0,zeros(1,length(beta0)),'k--')
hold off
axis tight
xlabel('\beta')if strcmp(TEorTM,'TE')==1%TEtitle('TE')
elseif strcmp(TEorTM,'TM')==1%TMtitle('TM')
endop=fzero(Fun,[beta0(1),beta0(end)]);
disp([TEorTM,'极化下',num2str(m),'阶导模的传播常数为:',num2str(op),' (注意单位)'])endfunction [oup]=EigEq(beta,k0,n1,n2,n3,m,w,TEorTM)
%beta未知
%m是导模阶数
%w是膜(芯区)厚
k=((k0*n1)^2-beta^2)^(1/2);
P=(beta^2-(k0*n2)^2)^(1/2);
q=(beta^2-(k0*n3)^2)^(1/2);if strcmp(TEorTM,'TE')==1%TEoup=k*w-m*pi-atan(P/k)-atan(q/k);elseif strcmp(TEorTM,'TM')==1%TMoup=k*w-m*pi-atan(P/k*((n1/n2)^2))-atan(q/k*((n1/n3)^2));
endend
做了笔记的PDF图书:https://petmask.lanzoub.com/i9x3W13pnore
注意波导沿着光波传播方向(z向)是无限长的。
Slab waveguide的色散图的计算(未详细验证正确性)
function []=SlabWaveguideDispersionMain()
clear;clc;close all
c_const=299792458;%m/s
lambda0=linspace(0.9,2,1000);%真空或空气中的入射波长范围(人为指定),单位um
k0=2*pi./lambda0;%行数组
w0=c_const.*k0;%行数组
%m=3;%导模阶数(需要人为指定)
n1=2;%芯区的折射率
n2=1;%衬底的折射率
n3=1;%包层的折射率
w=0.75;%芯区厚度,单位um
TEorTM='TE';%选定极化%============%
figure%限定了导模的范围
plot(w0,n2.*k0,'k--')
hold on
plot(w0,n1.*k0,'k--')
hold on
%============%m0sto=zeros(length(k0),1);%列数组
m1sto=zeros(length(k0),1);%列数组
m2sto=zeros(length(k0),1);%列数组
m3sto=zeros(length(k0),1);%列数组
m4sto=zeros(length(k0),1);%列数组
k0=k0.';%列数组
parfor jj=1:length(k0)Mark=jj/length(k0)K0=k0(jj,1);beta0=linspace(K0*n2+1e-5,K0*n1-1e-5,500).';%导模的传播常数范围(根据公式自动得出)%=================%
m=0;
Fun=@(x)EigEq(x,K0,n1,n2,n3,m,w,TEorTM);
if sign(EigEq(beta0(1),K0,n1,n2,n3,m,w,TEorTM))==sign(EigEq(beta0(end),K0,n1,n2,n3,m,w,TEorTM))m0sto(jj,1)=0;elsem0sto(jj,1)=fzero(Fun,[beta0(1),beta0(end)]);
end
%=================%%=================%
m=1;
Fun=@(x)EigEq(x,K0,n1,n2,n3,m,w,TEorTM);
if sign(EigEq(beta0(1),K0,n1,n2,n3,m,w,TEorTM))==sign(EigEq(beta0(end),K0,n1,n2,n3,m,w,TEorTM))m1sto(jj,1)=0;elsem1sto(jj,1)=fzero(Fun,[beta0(1),beta0(end)]);
end
%=================%%=================%
m=2;
Fun=@(x)EigEq(x,K0,n1,n2,n3,m,w,TEorTM);
if sign(EigEq(beta0(1),K0,n1,n2,n3,m,w,TEorTM))==sign(EigEq(beta0(end),K0,n1,n2,n3,m,w,TEorTM))m2sto(jj,1)=0;elsem2sto(jj,1)=fzero(Fun,[beta0(1),beta0(end)]);
end
%=================%%=================%
m=3;
Fun=@(x)EigEq(x,K0,n1,n2,n3,m,w,TEorTM);
if sign(EigEq(beta0(1),K0,n1,n2,n3,m,w,TEorTM))==sign(EigEq(beta0(end),K0,n1,n2,n3,m,w,TEorTM))m3sto(jj,1)=0;elsem3sto(jj,1)=fzero(Fun,[beta0(1),beta0(end)]);
end
%=================%%=================%
m=4;
Fun=@(x)EigEq(x,K0,n1,n2,n3,m,w,TEorTM);
if sign(EigEq(beta0(1),K0,n1,n2,n3,m,w,TEorTM))==sign(EigEq(beta0(end),K0,n1,n2,n3,m,w,TEorTM))m4sto(jj,1)=0;elsem4sto(jj,1)=fzero(Fun,[beta0(1),beta0(end)]);
end
%=================%endM0=[w0.',m0sto];M0(M0(:,2)==0,:)=[];
M1=[w0.',m1sto];M1(M1(:,2)==0,:)=[];
M2=[w0.',m2sto];M2(M2(:,2)==0,:)=[];
M3=[w0.',m3sto];M3(M3(:,2)==0,:)=[];
M4=[w0.',m4sto];M4(M4(:,2)==0,:)=[];scatter(M0(:,1),M0(:,2),10,'ro');
hold on
scatter(M1(:,1),M1(:,2),10,'ko');
hold on
scatter(M2(:,1),M2(:,2),10,'bo');
hold on
scatter(M3(:,1),M3(:,2),10,'yo');
hold on
scatter(M4(:,1),M4(:,2),10,'kd');
hold off
legend('','','m0','m1','m2','m3','m4')if strcmp(TEorTM,'TE')==1%TEtitle('TE')
elseif strcmp(TEorTM,'TM')==1%TMtitle('TM')
end
xlabel('\omega_{0}')
ylabel('\beta')
axis tight
%disp([TEorTM,'极化下',num2str(m),'阶导模的传播常数为:',num2str(op),' (注意单位)'])%============%
figure%限定了导模的范围
plot(lambda0,n2.*k0,'k--')
hold on
plot(lambda0,n1.*k0,'k--')
hold on
%============%
M0=[lambda0.',m0sto];M0(M0(:,2)==0,:)=[];
M1=[lambda0.',m1sto];M1(M1(:,2)==0,:)=[];
M2=[lambda0.',m2sto];M2(M2(:,2)==0,:)=[];
M3=[lambda0.',m3sto];M3(M3(:,2)==0,:)=[];
M4=[lambda0.',m4sto];M4(M4(:,2)==0,:)=[];scatter(M0(:,1),M0(:,2),10,'ro');
hold on
scatter(M1(:,1),M1(:,2),10,'ko');
hold on
scatter(M2(:,1),M2(:,2),10,'bo');
hold on
scatter(M3(:,1),M3(:,2),10,'yo');
hold on
scatter(M4(:,1),M4(:,2),10,'kd');
hold off
legend('','','m0','m1','m2','m3','m4')if strcmp(TEorTM,'TE')==1%TEtitle('TE')
elseif strcmp(TEorTM,'TM')==1%TMtitle('TM')
end
xlabel('\lambda_{0}(um)')
ylabel('\beta')
axis tightendfunction [oup]=EigEq(beta,k0,n1,n2,n3,m,w,TEorTM)
%beta未知
%m是导模阶数
%w是膜(芯区)厚
k=((k0*n1)^2-beta^2)^(1/2);
P=(beta^2-(k0*n2)^2)^(1/2);
q=(beta^2-(k0*n3)^2)^(1/2);if strcmp(TEorTM,'TE')==1%TEoup=k*w-m*pi-atan(P/k)-atan(q/k);elseif strcmp(TEorTM,'TM')==1%TMoup=k*w-m*pi-atan(P/k*((n1/n2)^2))-atan(q/k*((n1/n3)^2));
endend
第一个代码加了算有效折射率的
function []=PropagationConstantsMain()
clear;clc;close all
lambda0=9.608016155617717;%真空或空气中的入射波长,单位um
k0=2*pi/lambda0;
m=0;%导模阶数(需要人为指定)
n1=3;%芯区的折射率
n2=1;%衬底的折射率
n3=1;%包层的折射率
w=0.27;%芯区厚度,单位um
TEorTM='TE';%选定极化
beta0=linspace(k0*n2+1e-5,k0*n1-1e-5,500);%导模的传播常数范围(根据公式自动得出)%=================%
Fun=@(x)EigEq(x,k0,n1,n2,n3,m,w,TEorTM);
%=================%figure
y=arrayfun(Fun,beta0);
plot(beta0,y,'ro','MarkerSize',2)
hold on
plot(beta0,zeros(1,length(beta0)),'k--')
hold off
axis tight
xlabel('\beta')if strcmp(TEorTM,'TE')==1%TEtitle('TE')
elseif strcmp(TEorTM,'TM')==1%TMtitle('TM')
endop=fzero(Fun,[beta0(1),beta0(end)]);
disp([TEorTM,'极化下',num2str(m),'阶导模的传播常数为:',num2str(op),' (注意单位)'])
disp([TEorTM,'极化下',num2str(m),'阶导模的有效折射率为:',num2str(op/k0)])endfunction [oup]=EigEq(beta,k0,n1,n2,n3,m,w,TEorTM)
%beta未知
%m是导模阶数
%w是膜(芯区)厚
k=((k0*n1)^2-beta^2)^(1/2);
P=(beta^2-(k0*n2)^2)^(1/2);
q=(beta^2-(k0*n3)^2)^(1/2);if strcmp(TEorTM,'TE')==1%TEoup=k*w-m*pi-atan(P/k)-atan(q/k);elseif strcmp(TEorTM,'TM')==1%TMoup=k*w-m*pi-atan(P/k*((n1/n2)^2))-atan(q/k*((n1/n3)^2));
endend