📄 nonuniform_mesh_semivectorial.m
字号:
% This example shows how to use the stretchmesh function to
% expand the size of the computation window at the edges
% without increasing the number of gridpoints.
% Refractive indices:
n1 = 3.34; % Lower cladding
n2 = 3.44; % Core
n3 = 1.00; % Upper cladding (air)
% Layer heights:
h1 = 0.5; % Lower cladding
h2 = 1.3; % Core thickness
h3 = 0.5; % Upper cladding
rh = 1.1; % Ridge height
rw = 1.0; % Ridge half-width
side = 0.5; % Space on side
dx = 0.00625; % grid size (horizontal)
dy = 0.00625; % grid size (vertical)
lambda = 1.55; % vacuum wavelength
nmodes = 1; % number of modes to compute
boundary = '000S'; % boundary condition
fprintf (1,'generating index mesh...\n');
[x,y,xc,yc,nx,ny,eps] = waveguidemesh([n1,n2,n3],[h1,h2,h3], ...
rh,rw,side,dx,dy);
% stretch bottom cladding by a factor of 4, side region by a
% factor of 3.
[x,y,xc,yc,dx,dy] = stretchmesh(x,y,[0,80,80,0],[1,4,3,1]);
fprintf (1,'solving for eigenmodes (TE) ... '); t = cputime;
[ExTE,neffTE] = svmodes (lambda, n2, nmodes, dx, dy, eps, ...
boundary, 'EX');
fprintf (1,'done (cputime = %7.3f)\n', cputime-t);
fprintf(1,'neff(TE) = %7.5f\n',neffTE);
fprintf (1,'solving for eigenmodes (TM) ... '); t = cputime;
[EyTM,neffTM] = svmodes (lambda, n2, nmodes, dx, dy, eps, ...
boundary, 'EY');
fprintf (1,'done (cputime = %7.3f)\n', cputime-t);
fprintf(1,'neff(TM) = %7.5f\n',neffTM);
subplot(121);
contourmode(xc,yc,ExTE,1,3,45,'Ex (TE mode)');
v = xlim;
line(v,[h1,h1]);
line([v(1),rw,rw,v(2)],[h1+h2,h1+h2,h1+h2-rh,h1+h2-rh]);
subplot(122);
contourmode(xc,yc,EyTM,1,3,45,'Ey (TM mode)');
line(v,[h1,h1]);
line([v(1),rw,rw,v(2)],[h1+h2,h1+h2,h1+h2-rh,h1+h2-rh]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -