用平面波展开法(PWEM)计算光子晶体条状超原胞的投影能带

本文主要是介绍用平面波展开法(PWEM)计算光子晶体条状超原胞的投影能带,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

和前面体光子晶体一样,代码也是从Photonic Crystals Physics and Practical Modeling (Igor A. Sukhoivanov, Igor V. Guryev 这本书上扒下来的(page 197)

这个代码同样用的数值法算的相对介电函数的傅里叶系数

书上的原始代码似乎有些问题,它的结果和FEM的结果符合得不是很好

在这里插入图片描述
原始代码为:

function PhC_waveguide
%The program for the computation of the dispersion
%characteristic of the PhC waveguide based upon 2D
%PhC with square latice. Parameters of the structure
%are defined by the PhC period, elements radius, and
%by the permittivities of elements and background
%material. In contrast to pure PhC, the waveguide is
%also defined by the number or the elements in
%direction transversal to radiation propagation as
%well as by the number of elements missed to form
%the defect.
%Main part of the program is implemented as a
%function because it should be run two times, namely,
%for the structure with and without defect. At first
%run, the function computes the defect eigen-states
%and at the first run it compute the continuum of
%states of the PhC.
%Input parameters: PhC period, radius of an
%element, permittivities, number of elements in
%transversal direction, defect size
%Output data: The dispersion diagram of the
%2D PhC waveguide.
clear ;close all
%The variable a defines the period of the structure.
%It influences on results in case of the frequency
%normalization.
a=1e-6;%晶格常数
%The variable r contains elements radius. Here it is
%defined as a part of the period.
r=0.4*a;%圆柱半径
%The variable eps1 contains the information about
%the relative background material permittivity.
eps1=9;%背景的相对介电常数
%The variable eps2 contains the information about
%permittivity of the elements composing PhC. In our
%case permittivities are set to form the structure
%perforated membrane
eps2=1;%柱子的相对介电常数
%Variable numElem defines the number of PhC elements
%in direction transversal to radiation propagation
numElem=7;%条状超原胞大小
%Number of holes missed
numDef=1;%缺陷大小
%Setting transversal wave vector to a single value
kx=0;
%Callint the function to copmpute the defect
%eigen-states. With this, we obtain the eigen-states
%of the linear defect
PWE(a, r, eps1, eps2, numElem, numDef, kx, "b", 1);
numElem=1;%条状超原胞大小
numDef=0;%缺陷大小
%Setting transversal wave vector to a range of
%values within Brillouin zone
kx=0:(pi/a)/200:pi/a;%设定的值要在布里渊区内
%Callint the function to copmpute the eigen-states
%of bulk PhC. This action fills the area of the
%continuum of states giving the possibility to
%analize the dispersion diagramPWE(a, r, eps1, eps2, numElem, numDef, kx, 'r', 3);function PWE(a, r, eps1, eps2, numElem,...numDefect, kx_param, color, linewidth)
%The function implements the PWE method for 2D PhC
%The inputs are structure geometry and parameters,
%the number of transversal elements of the waveguide,
%the number of holed missed to form the defect and
%the transversal wave vectors set
%Computation precision parameters are set inside the
%function
%The variable precis defines the number of k-vector
%points between high symmetry points
precis=29;%高对称点间布里渊区的离散点数%The variable nG defines the number of plane waves.
%Since the number of plane waves cannot be
%arbitrary value and should be zero-symmetric, the
%total number of plane waves may be determined
%as (nG*2-1)^2
nG=8;%定义了平面波的数量
%The variable precisStruct defines contains the
%number of nodes of discretization mesh inside in
%unit cell
%discretization mesh elements.
precisStruct=30;%定义了单位原胞内离散网格的节点数
%The following loop carries out the definition
%of the unit cell. The definition is being
%made in discreet form by setting values of inversed
%dielectric function to mesh nodes.
for n=0:numElem-1nx=1;for countX=-a/2:a/precisStruct:a/2ny=1;for countY=-a/2:a/precisStruct:a/2%Following condition allows to define the circle%with of radius rif((sqrt(countX^2+countY^2)<r)&&(n>=numDefect))%Setting the value of the inversed dielectric%function to the mesh nodestruct(nx+precisStruct*n,ny)=1/eps2;%Saving the node coordinatexSet(nx+precisStruct*n)=countX+a*n;ySet(ny)=countY;elsestruct(nx+precisStruct*n,ny)=1/eps1;xSet(nx+precisStruct*n)=countX+a*n;ySet(ny)=countY;endny=ny+1;endnx=nx+1;end
end
%The computation of the area of the mesh cell. It is
%necessary for further computation of the Fourier
%expansion coefficients.
dS=(a/precisStruct)^2;
%Forming 2D arrays of nods coordinates
[xMesh, yMesh]=meshgrid(xSet(1:length(xSet)),...ySet(1:length(ySet)));
%Transforming values of inversed dielectric function
%for the convenience of further computation
structMesh=(struct(1:length(xSet),1:length(ySet))*...dS/((max(xSet)-min(xSet))*(max(ySet)-min(ySet))))';
b1=[2*pi/a 0]./numElem;
b2=[0 2*pi/a];%Defining the k-path within the Brilluoin zone. The
%k-path includes all high symmetry points and precis
%points between them
kx0(1:precis+1)=zeros(1,precis+1);
ky(1:precis+1)=0:b2(2)/2/precis:b2(2)/2;
%After the following loop, the variable numG will
%contain real number of plane waves used in the
%Fourier expansion
numG=1;
for Gx=-nG*numElem:nG*numElem%Gx  Gy都是整数for Gy=-nG:nGG(numG,1:2)=Gx.*b1+Gy.*b2;numG=numG+1;end
end
%The next loop computes the Fourier expansion
%coefficients which will be used for matrix
%differential operator computation.
for countG=1:numG-1for countG1=1:numG-1CN2D_N(countG,countG1)=sum(sum(structMesh.*...exp(-1i*((G(countG,1)-G(countG1,1))*xMesh+...(G(countG,2)-G(countG1,2))*yMesh))));end
end%The next loop computes matrix differential
%operator in case of TE mode. The computation
%is carried out for each of earlier defined
%wave vectors.
for kx_count=1:length(kx_param)kx=kx0+kx_param(kx_count);for countG=1:numG-1for countG1=1:numG-1for countK=1:length(kx)M(countK,countG,countG1)=...CN2D_N(countG,countG1)*...((kx(countK)+G(countG,1))*...(kx(countK)+G(countG1,1))+...(ky(countK)+G(countG,2))*...(ky(countK)+G(countG1,2)));endendend%The computation of eigen-states is also carried%out for all wave vectors in the k-path.for countK=1:length(kx)%Taking the matrix differential operator for%current wave vector.MM(:,:)=M(countK,:,:);%Computing the eigen-vectors and eigen-states of%the matrix[D,V]=eig(MM);%Transforming matrix eigen-states to the form of%normalized frequency.dispe(:,countK)=sort((sqrt(V*...ones(length(V),1)))*a/2/pi);endfigure(1);hold on;for u=1:15plot(ky,abs(dispe(u,:)),color,...'LineWidth',linewidth);endylabel('Frequency \omegaa/2\pic','FontSize',20);xlabel('Propagaion constant \beta, m^{-1}',...'FontSize',20);drawnow;ylim([0,0.37])xlim([0,3*1e6])
end

这个代码相对于书上的代码改了点参数,但其他部分和书上完全一样。

可以看到原始的代码和前面文章体光子晶体的数值算法思想不一样了,刚开始我思考了很久以为哪里没搞明白,但后来我修改了代码并和FEM的结果进行了比较,发现修改后代码得到的结果和FEM更符合,图像如下(蓝线是PWE的结果,蓝色小圆是FEM的结果):

在这里插入图片描述

但为了保险我还是发邮件问了作者,不过目前还没回复。(ps:这是09年的书了,不知道作者还会不会回复)

修改后的代码:

function PhC_waveguide_Test
%The program for the computation of the dispersion
%characteristic of the PhC waveguide based upon 2D
%PhC with square latice. Parameters of the structure
%are defined by the PhC period, elements radius, and
%by the permittivities of elements and background
%material. In contrast to pure PhC, the waveguide is
%also defined by the number or the elements in
%direction transversal to radiation propagation as
%well as by the number of elements missed to form
%the defect.
%Main part of the program is implemented as a
%function because it should be run two times, namely,
%for the structure with and without defect. At first
%run, the function computes the defect eigen-states
%and at the first run it compute the continuum of
%states of the PhC.
%Input parameters: PhC period, radius of an
%element, permittivities, number of elements in
%transversal direction, defect size
%Output data: The dispersion diagram of the
%2D PhC waveguide.
clear ;close all;clc
%The variable a defines the period of the structure.
%It influences on results in case of the frequency
%normalization.
a=1e-6;%晶格常数
%The variable r contains elements radius. Here it is
%defined as a part of the period.
r=0.4*a;%圆柱半径
%The variable eps1 contains the information about
%the relative background material permittivity.
eps1=9;%背景的相对介电常数
%The variable eps2 contains the information about
%permittivity of the elements composing PhC. In our
%case permittivities are set to form the structure
%perforated membrane
eps2=1;%柱子的相对介电常数
%Variable numElem defines the number of PhC elements
%in direction transversal to radiation propagation
numElem=7;%条状超原胞大小
%Number of holes missed
numDef=1;%缺陷大小
%Setting transversal wave vector to a single value
kx=0;
%Callint the function to copmpute the defect
%eigen-states. With this, we obtain the eigen-states
%of the linear defect
PWE(a, r, eps1, eps2, numElem, numDef, kx, "b", 1);
numElem=1;%条状超原胞大小
numDef=0;%缺陷大小
%Setting transversal wave vector to a range of
%values within Brillouin zone
kx=0:(pi/a)/200:pi/a;%设定的值要在布里渊区内
%Callint the function to copmpute the eigen-states
%of bulk PhC. This action fills the area of the
%continuum of states giving the possibility to
%analize the dispersion diagram%PWE(a, r, eps1, eps2, numElem, numDef, kx, 'r', 3);%这部分将会绘制很多很密的线条function PWE(a, r, eps1, eps2, numElem,...numDefect, kx_param, color, linewidth)
%The function implements the PWE method for 2D PhC
%The inputs are structure geometry and parameters,
%the number of transversal elements of the waveguide,
%the number of holed missed to form the defect and
%the transversal wave vectors set
%Computation precision parameters are set inside the
%function
%The variable precis defines the number of k-vector
%points between high symmetry points
precis=29;%高对称点间布里渊区的离散点数%The variable nG defines the number of plane waves.
%Since the number of plane waves cannot be
%arbitrary value and should be zero-symmetric, the
%total number of plane waves may be determined
%as (nG*2-1)^2
nG=8;%定义了平面波的数量
%The variable precisStruct defines contains the
%number of nodes of discretization mesh inside in
%unit cell
%discretization mesh elements.
precisStruct=30;%定义了单位原胞内离散份数
%The following loop carries out the definition
%of the unit cell. The definition is being
%made in discreet form by setting values of inversed
%dielectric function to mesh nodes.
for n=0:numElem-1%0~6nx=1;for countX=-a/2:a/precisStruct:a/2ny=1;for countY=-a/2:a/precisStruct:a/2%Following condition allows to define the circle%with of radius rif((sqrt(countX^2+countY^2)<r)&&(n>=numDefect))%这里numDefect=1%Setting the value of the inversed dielectric%function to the mesh nodestruct(nx+precisStruct*n,ny)=1/eps2;%Saving the node coordinatexSet(nx+precisStruct*n)=countX+a*n;ySet(ny)=countY;elsestruct(nx+precisStruct*n,ny)=1/eps1;xSet(nx+precisStruct*n)=countX+a*n;ySet(ny)=countY;endny=ny+1;endnx=nx+1;end
end
size(struct);%211 31figure
mesh(struct)
axis equal
%The computation of the area of the mesh cell. It is
%necessary for further computation of the Fourier
%expansion coefficients.
dS=(a/precisStruct)^2;
%Forming 2D arrays of nods coordinates
[xMesh, yMesh]=meshgrid(xSet(1:length(xSet)),...ySet(1:length(ySet)));
%======================%
xMesh(:,end)=[];
xMesh(end,:)=[];
yMesh(:,end)=[];
yMesh(end,:)=[];
%======================%% figure
% for ii = 1:numel(xMesh)
%     plot(xMesh(ii),yMesh(ii),'b.','Markersize',10)
%     hold on
%     
%     %rectangle('Position',[xMesh(ii),...
%         %yMesh(ii),(a/precisStruct),(a/precisStruct)]);
%     
% end
% axis equalsize(xMesh);%31   211
size(yMesh);%31   211
length(xSet);%211
%Transforming values of inversed dielectric function
%for the convenience of further computation
%====================================%
structMesh=(struct(1:length(xSet)-1,1:length(ySet)-1)*...dS/((max(xSet)-min(xSet))*(max(ySet)-min(ySet))))';
%====================================%b1=[2*pi/a 0]./numElem;
b2=[0 2*pi/a];
%横着的条状超原胞,宽numElem*a,高a(max(xSet)-min(xSet))./a;%7
(max(ySet)-min(ySet))./a;%1
size(struct);% 211*31
size(structMesh);%31*211%Defining the k-path within the Brilluoin zone. The
%k-path includes all high symmetry points and precis
%points between them
kx0(1:precis+1)=zeros(1,precis+1);
ky(1:precis+1)=0:b2(2)/2/precis:b2(2)/2;%布里渊区似乎只考虑了一条线上的(0~pi/a)
%ky长度30%After the following loop, the variable numG will
%contain real number of plane waves used in the
%Fourier expansionnumG=1;
for Gx=-nG*numElem:nG*numElem%Gx  Gy都是整数for Gy=-nG:nGG(numG,1:2)=Gx.*b1+Gy.*b2;numG=numG+1;end
end
%The next loop computes the Fourier expansion
%coefficients which will be used for matrix
%differential operator computation.
for countG=1:numG-1mark0=countG/(numG-1)for countG1=1:numG-1CN2D_N(countG,countG1)=sum(sum(structMesh.*...exp(-1i*((G(countG,1)-G(countG1,1))*xMesh+...(G(countG,2)-G(countG1,2))*yMesh))));end
end
size(CN2D_N);%145*145%The next loop computes matrix differential
%operator in case of TE mode. The computation
%is carried out for each of earlier defined
%wave vectors.
for kx_count=1:length(kx_param)kx=kx0+kx_param(kx_count);for countG=1:numG-1countG/(numG-1)for countG1=1:numG-1for countK=1:length(kx)M(countK,countG,countG1)=...CN2D_N(countG,countG1)*...((kx(countK)+G(countG,1))*...(kx(countK)+G(countG1,1))+...(ky(countK)+G(countG,2))*...(ky(countK)+G(countG1,2)));endendend%The computation of eigen-states is also carried%out for all wave vectors in the k-path.for countK=1:length(kx)Mark=countK/length(kx)%Taking the matrix differential operator for%current wave vector.MM(:,:)=M(countK,:,:);%Computing the eigen-vectors and eigen-states of%the matrix[D,V]=eig(MM);%Transforming matrix eigen-states to the form of%normalized frequency.dispe(:,countK)=sort((sqrt(V*...ones(length(V),1)))*a/2/pi);endfigurehold on;for u=1:15plot(1:length(ky),abs(dispe(u,:)),color,...'LineWidth',linewidth);endhold on%下面是和FEM算的数据比较,没有的话可以删除下面这段%%Data=csvread('C:\Users\LUO1\Desktop\WaveGuideTE.csv');
uniX=unique(Data(:,1));
Ymat=[];
for zz=1:length(uniX)Ymat=[Ymat,Data(Data(:,1)==uniX(zz),2)];
endplot(1:size(Ymat,2),Ymat,'bo','MarkerSize',3)
hold off
%%%%%绘制FEM的数据%%%%%%%ylabel('Frequency \omegaa/2\pic','FontSize',20);xlabel('Propagaion constant \beta, m^{-1}',...'FontSize',20);drawnow;%好像是动画?ylim([0,0.37])xlim([1,length(ky)])
end

在这里插入图片描述

下面我扩展了下前面改进的代码,可以计算TE TM模式,可以计算x或y是长边的超原胞的投影能带

clear ;close all;clca=1e-6;%晶格常数r=0.4*a;%圆柱半径eps1=9;%背景的相对介电常数eps2=1;%柱子的相对介电常数
TEorTM='TM';%设置模式precis=29;%高对称点间布里渊区的离散点数nG=14;%定义了平面波的数量precisStruct=30;%定义了正方形单位原胞的离散份数(最好设置为偶数)unitSto=[0,ones(1,6)];%和正空间条状原胞的结构有关。为0代表没有圆柱,为1代表有圆柱
numElem=length(unitSto);%长边方向的正空间超原胞大小,单位为a(晶格常数),注意短边方向的numElem永远为1
XorYlong='X';%光子晶体波导正空间原胞X方向还是Y方向是长边。
NumBand=15;%能带绘制条数(归一化频率freq从低到高数)%%%正空间基矢(需自己设置)%%%
a1=[numElem*a,0,0];%为方便求倒格子基矢,必须是三维矢量
a2=[0,a,0];
%横着的条状超原胞,宽numElem*a,高a
%%%正空间基矢(需自己设置)%%%%==========计算倒格子基矢==============%
a3=[0,0,1];%单位向量
Omega=abs(a3*cross(a1,a2)');%正空间单位原胞面积
s=2*pi./Omega;
b1(1,1)=a2(1,2);b1(1,2)=-a2(1,1);
b2(1,1)=-a1(1,2);b2(1,2)=a1(1,1);
b1=b1.*s;%1*2行数组,最终结果(必须是行数组)
b2=b2.*s;%1*2行数组,最终结果(必须是行数组)
%==========计算倒格子基矢==============%unitX=-a/2:a/precisStruct:a/2;%一个长宽都是a坐标中心为(0,0)的正空间单位原胞的离散网格节点的x坐标
unitY=unitX;%同上,但是是y坐标
lenNode=length(unitX);if strcmp(XorYlong,'X')==1struct=zeros(precisStruct+1,precisStruct*numElem+1);Mesh=zeros(precisStruct+1,precisStruct*numElem+1);Lx=numElem*a;Ly=a;
endif strcmp(XorYlong,'Y')==1struct=zeros(precisStruct*numElem+1,precisStruct+1);Mesh=zeros(precisStruct*numElem+1,precisStruct+1);Lx=a;Ly=numElem*a;
endfor n=0:numElem-1if strcmp(XorYlong,'X')==1for nx=1:lenNode%precisStruct+1个数据,变nx,nx=1~precisStruct+1countX=unitX(nx);for ny=1:lenNode%变ny,ny=1~precisStruct+1countY=unitY(ny);if abs(countX+1j*countY)<r && unitSto(n+1)==1struct(ny,nx+precisStruct*n)=1/eps2;%柱子的相对介电常数Mesh(ny,nx+precisStruct*n)=(countX+a*n)+1j*countY;%节点坐标elsestruct(ny,nx+precisStruct*n)=1/eps1;%背景的相对介电常数Mesh(ny,nx+precisStruct*n)=(countX+a*n)+1j*countY;%节点坐标endendendend%==================================%if strcmp(XorYlong,'Y')==1for nx=1:lenNode%precisStruct+1个数据,变nx,nx=1~precisStruct+1countX=unitX(nx);for ny=1:lenNode%变ny,ny=1~precisStruct+1countY=-unitY(ny);if abs(countX+1j*countY)<r && unitSto(n+1)==1struct(ny+precisStruct*n,nx)=1/eps2;%柱子的相对介电常数Mesh(ny+precisStruct*n,nx)=countX+1j*(countY-a*n);%节点坐标elsestruct(ny+precisStruct*n,nx)=1/eps1;%背景的相对介电常数Mesh(ny+precisStruct*n,nx)=countX+1j*(countY-a*n);%节点坐标endendendend%struct元素要和xMesh、yMesh元素位置相匹配
endxMesh=real(Mesh);
yMesh=imag(Mesh);
%xMesh是所有节点的x坐标;yMesh是所有节点的y坐标
%xMesh、yMesh合起来其实相当于存储了所有节点的坐标
%=====================%
%=====================%
figure
imagesc(1./struct);
colorbar;
colormap(jet);
axis equal
xlabel('X')
ylabel('Y')
title('相对介电常数分布可视化')
%=====================%
figure
scatter(xMesh(:),yMesh(:),20,'b.')
hold on
scatter(0,0,80,'r.')%绘制坐标原点
hold off
xlabel('X')
ylabel('Y')
axis equal
title('所有节点坐标可视化')
%=====================%
%=====================%if strcmp(XorYlong,'X')==1%下面是删掉部分节点xMesh(:,end)=[];xMesh(end,:)=[];yMesh(:,end)=[];yMesh(end,:)=[];struct(:,end)=[];struct(end,:)=[];
endif strcmp(XorYlong,'Y')==1%下面是删掉部分节点xMesh(1,:)=[];xMesh(:,end)=[];yMesh(1,:)=[];yMesh(:,end)=[];struct(1,:)=[];struct(:,end)=[];
enddS=(a/precisStruct)^2;
structMesh=(dS/(Lx*Ly)).*struct;% figure
% for ii = 1:numel(xMesh)
%     plot(xMesh(ii),yMesh(ii),'b.','Markersize',10)
%     hold on
%
%     %rectangle('Position',[xMesh(ii),...
%         %yMesh(ii),(a/precisStruct),(a/precisStruct)]);
%
% end
% axis equal%======离散BZ(需要根据实际情况设置)=======%
kx0=zeros(1,precis+1);%行数组
ky0=linspace(0,pi/a,precis+1);%行数组,布里渊区似乎只考虑了一条线上的(0~pi/a)
kx_ky0=kx0+1j.*ky0;%======离散BZ(需要根据实际情况设置)=======%numG0=0;
for mm=-nG*numElem:nG*numElem%mm  nn都是整数for nn=-nG:nGnumG0=numG0+1;G(numG0,1:2)=mm.*b1+nn.*b2;end
end
numG=size(G,1);%行Kap=zeros(numG,numG);
for countG=1:numGKapmark=countG/(numG)for countG1=1:numGExp=exp(-1j*((G(countG,1)-G(countG1,1)).*xMesh+...(G(countG,2)-G(countG1,2)).*yMesh));%矩阵Kap(countG,countG1)=sum(sum(structMesh.*Exp));%其实就是kappa(G_{||}-G_{||}^{\prime}})构成的矩阵%G(countG,1:2)其实就是G_{||},%G(countG1,1:2)其实就是G_{||}^{\prime}end
endif strcmp(TEorTM,'TE')==1%TE模式M=zeros(numG,numG,length(kx_ky0));for countK=1:length(kx_ky0)kx=real(kx_ky0(countK));ky=imag(kx_ky0(countK));for countG=1:numG%[Gx,Gy]=G(countG,1:2);%[Gx',Gy']=G(countG1,1:2);for countG1=1:numGM(countG,countG1,countK)=...((kx+G(countG,1))*...(kx+G(countG1,1))+...(ky+G(countG,2))*...(ky+G(countG1,2)))*Kap(countG,countG1);%TE模式特征矩阵endendendendif strcmp(TEorTM,'TM')==1%TM模式M=zeros(numG,numG,length(kx_ky0));for countK=1:length(kx_ky0)kx=real(kx_ky0(countK));ky=imag(kx_ky0(countK));for countG=1:numG%[Gx,Gy]=G(countG,1:2);%[Gx',Gy']=G(countG1,1:2);for countG1=1:numGM(countG,countG1,countK)=...Kap(countG,countG1)*...(norm([kx+G(countG,1),ky+G(countG,2)])*...norm([kx+G(countG1,1),ky+G(countG1,2)]));%TM模式特征矩阵endendendendEigsto=zeros(numG,length(kx_ky0));
for countK=1:length(kx_ky0)EigMark=countK/length(kx_ky0)MM(:,:)=M(:,:,countK);[vec,val]=eig(MM);val=diag(val);%列数组freq=sqrt(val)*a/(2*pi);%wa/(2pi c),归一化频率freq=sort(freq);%排序Eigsto(:,countK)=freq;endfigure
plot(1:length(kx_ky0),abs(Eigsto(1:NumBand,:)),'b','LineWidth',1);
hold on%下面是和FEM算的数据比较,没有的话可以删除下面这段%%
if strcmp(TEorTM,'TE')==1Data=csvread('C:\Users\LUO1\Desktop\WaveGuideTE.csv');
endif strcmp(TEorTM,'TM')==1Data=csvread('C:\Users\LUO1\Desktop\WaveGuideTM.csv');
enduniX=unique(Data(:,1));
Ymat=[];
for zz=1:length(uniX)Ymat=[Ymat,Data(Data(:,1)==uniX(zz),2)];
end
plot(1:size(Ymat,2),Ymat,'bo','MarkerSize',3)
hold off
%%%%%绘制FEM的数据%%%%%%%if strcmp(TEorTM,'TE')==1title('TE-Mode');
endif strcmp(TEorTM,'TM')==1title('TM-Mode');
endylabel('Frequency \omegaa/2\pic','FontSize',20);
xlabel('Propagaion constant \beta, m^{-1}',...'FontSize',20);
%drawnow;%好像是动画?
ylim([0,0.37])
xlim([1,length(kx_ky0)])

在这里插入图片描述
在这里插入图片描述

------------------------------------------------2023.8----------------------------------------

无论是体光子晶体或条带光子晶体的Comsol仿真对比文件都在阿里云盘中,读者可以根据合理要求从我这里获得mph文件

这篇关于用平面波展开法(PWEM)计算光子晶体条状超原胞的投影能带的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/319037

相关文章

计算绕原点旋转某角度后的点的坐标

问题: A点(x, y)按顺时针旋转 theta 角度后点的坐标为A1点(x1,y1)  ,求x1 y1坐标用(x,y)和 theta 来表示 方法一: 设 OA 向量和x轴的角度为 alpha , 那么顺时针转过 theta后 ,OA1 向量和x轴的角度为 (alpha - theta) 。 使用圆的参数方程来表示点坐标。A的坐标可以表示为: \[\left\{ {\begin{ar

【云计算 复习】第1节 云计算概述和 GFS + chunk

一、云计算概述 1.云计算的商业模式 (1)软件即服务(SaaS) 有些景区给游客提供烧烤场地,游客需要自己挖坑或者砌烧烤台,然后买肉、串串、烧烤。 (2)平台即服务(PaaS) 有些景区给游客提供烧烤场地,同时搭建好烧烤台,游客只需要自己带食材和调料、串串、烧烤。 (3)基础设施即服务(IaaS) 有些景区给游客提供烧烤场地,同时搭建好烧烤台,还有专门的厨师来烧烤,用户不需要关心前面的所有

什么是dB?dBm、dBc、dBi、dBd怎么计算,有什么区别?

什么是dB?dBm、dBc、dBi、dBd怎么计算,有什么区别? 引言 在电子工程、通信和音频领域,dB(分贝)是一个常见的术语。许多人刚接触时可能会感到困惑,因为它不仅仅是一个简单的单位,还有多种不同的形式,如dBm、dBc、dBi和dBd。这篇文章将详细解释这些概念,并介绍如何计算它们,帮助初学者更好地理解和应用。 什么是dB? dB,即分贝,是一种表示两个数值比值的对数单位。分贝的基

php字符串计算汉字、中英文数字个数

$str = '123abcDEF测试的事发地点';$length = strlen(preg_replace('/[\x00-\x7F]/', '', $str));$arr['en'] = strlen( $str) - $length; //(非中文)$arr['cn'] = intval($length / 3); // 编码GBK,除以2 (中文)print_r($

计算广告:第四章——合约广告

计算广告:第四章——合约广告 一、广告位合约 二、受众定向 1、受众定向方法概览 2、 受众定向标签体系 三、展示量合约 1、流量预测 2、流量塑性 3、在线分配 包括按 CPM 计费的展示量合约广告和按 CPT 结算的广告位合约。   一、广告位合约 按CPT结算广告位合约 缺点:无法做到按受众类型投放广告,无法进行深入的优化效果 优点:强曝光属性带来品牌冲击,或

计算广告:第三章——在线广告产品概览

第三章——在线广告产品概览 一、商业产品的设计原则 二、需求方层级组织及接口 二、供给方管理接口 (1)合约广告产品——主要服务于后续效果不宜直接衡量的品牌类广告主 按时段售卖的CPT广告按约定展示量售卖的CPM广告   (2)竞价广告产品 其形式主要是搜索广告,其产品形式为对搜索关键词的竞价。这种广告拓展到站外广告时,演变为了对页面关键词或者用户标签竞价的产品形式,也就是

计算广告:第二章——计算广告基础

一、广告有效性原理 二、互联网广告的技术特点 1、技术和计算向导 2、效果的可衡量性 3、创意和投放方式的标准化 4、媒体概念的多样化 5、数据驱动的投放决策 三、计算广告的核心问题 1、广告收入的分解 2、结算方式与ECMP估计关系 四、在线广告相关行业协会 五、问题 可衡量的效果以及相应的计算优化是在线广告区别线下广告的主要特点,千次展示期望收入(expect

给定正整数n,计算出n个元素的集合{1,2,....,n}可以划分为多少个不同的非空集合

给定正整数n,计算出n个元素的集合{1,2,....,n}可以划分为多少个不同的非空集合 附源代码: #include<iostream>using namespace std;int F(int n,int m){if(n<=2)return 1;if(m==1||n==m)return 1;elsereturn F(n-1,m-1)+m*F(n-1,m);}void main(

numpy.ndarray数据计算及操作集锦

目录 1. numpy.ndarray各列求均值1.1 列1.2 行 1. numpy.ndarray各列求均值 1.1 列 要对 v_sec_trans 数组的每一列求均值,可以使用 numpy 库中的 mean 函数。以下是具体的代码示例: import numpy as np# 定义 v_sec_trans 数组v_sec_trans = np.array([[ 7.

SQL Plu计算算数表达式及SQL Plus下清屏快捷键

用PL/SQL数据库语言计算sqrt(58+25*3+(19-9)^2)的值 SQL Plus下清屏快捷键是host cls或者 clear screen PL/SQL计算乘方是2个*号: