📄 pml_fullvector_leaky_mode.m
字号:
% This example illustrates how to use perfectly matched layers
% at the edges of the computation window. The waveguide
% considered here is the same as in 'basic_fullvector.m', with
% the exception that we have added a substrate layer that has
% the same refractive index of the core. The modesolver
% computes a complex propagation constant that includes the
% propagation loss associated with radiation into the
% substrate.
%
% Note that the perfectly-matched layer is constructed using
% the stretchmesh routine, with a complex stretching factor
% (i.e., complex coordinate stretching.)
% Refractive indices:
ns = 3.44; % Substrate
n1 = 3.34; % Lower cladding
n2 = 3.44; % Core
n3 = 1.00; % Upper cladding (air)
% Layer heights:
hs = 4.0; % Substrate
h1 = 1.1; % Lower cladding
h2 = 1.3; % Core thickness
h3 = 0.5; % Upper cladding
rh = 1.1; % Ridge height
rw = 1.0; % Ridge half-width
side = 1.5; % Space on side
dx = 0.0125; % grid size (horizontal)
dy = 0.020; % grid size (vertical)
lambda = 1.55; % vacuum wavelength
nmodes = 1; % number of modes to compute
boundary = '000A'; % boundary condition
fprintf (1,'generating index mesh...\n');
[x,y,xc,yc,nx,ny,eps] = waveguidemesh([ns,n1,n2,n3],[hs,h1,h2,h3], ...
rh,rw,side,dx,dy);
% Complex coordinate stretching
[x,y,xc,yc,dx,dy] = stretchmesh(x,y,[0,100,20,0],1+j*2);
% NOTE: when analyzing leaky modes, it is important that you
% provide a good guess, usually by solving the mode of an
% equivalent non-leaky structure first.
guessTE = 3.38864;
fprintf (1,'solving for eigenmodes (TE) ... '); t = cputime;
[Hx,Hy,neffTE] = wgmodes (lambda, guessTE, nmodes, dx, dy, eps, ...
boundary);
fprintf (1,'done (cputime = %7.3f)\n', cputime-t);
fprintf(1,'Real[nte] = %7.5f\n',real(neffTE));
fprintf(1,'Imag[nte] = %7.5e\n',imag(neffTE));
alpha = -2000*imag(neffTE)*2*pi/lambda; % cm^-1
dBpercm = 10*alpha/log(10);
fprintf(1,'Attenuation = %7.5f dB/cm\n',dBpercm);
subplot(121);
contourmode(x,y,real(Hx),1,3,45,'Hx (TE mode)');
v = xlim;
line(v,[hs,hs]);
line(v,[h1+hs,h1+hs]);
line([v(1),rw,rw,v(2)],[h1+h2+hs,h1+h2+hs,h1+h2-rh+hs,h1+h2-rh+hs]);
subplot(122);
contourmode(x,y,real(Hy),1,3,45,'Hy (TE mode)');
v = xlim;
line(v,[hs,hs]);
line(v,[h1+hs,h1+hs]);
line([v(1),rw,rw,v(2)],[h1+h2+hs,h1+h2+hs,h1+h2-rh+hs,h1+h2-rh+hs]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -