• 平面波法用于一维光子晶体


    本算法进一步深入熟悉平面波展开法

    结果如下:与文献molding the flow of light 相一致

    ps:当有多余G存在会产生多余线,需要进一步研究

     

    主程序如下:

    %This is a simple demo for 1D Photonic Crystals simulation 
    %10 points is considered.
    %by Gao Haikuo 
    %date:20170411
    
    clear; clc;
    global NG G f  Nkpoints eigenValue modeset kCorner 
    global epsa epsb epssys a b1 b2
    epssys=1.0e-6; %设定一个最小量,避免系统截断误差或除0错误
    
    %this is the lattice vector and the reciprocal lattice vector
    a=1; a1=a*[1 0]; a2=a*[0 1]; 
    b1=2*pi/a*[1 0];b2=2*pi/a*[0 1];
    Nkpoints=10; %每个方向上取的点数,
    modeset=2;% 1:'TE' 2 'TM'
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    %定义晶格的参数
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    epsa = 13; %inner
    epsb = 12; %outer
    
    % Pf = 0.1257; %Pf = Ac/Au 填充率,可根据需要自行设定
    % Au =a^2; %二维格子原胞面积
    % Rc = (Pf *Au/pi)^(1/2); %介质柱截面半径
    % Ac = pi*(Rc)^2; %介质柱横截面积
    kCorner=(2*pi/a)*[0.5 0;epssys 0]; %T X M 
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %get gap
    [G,f]=getGAndf_1D(0.5);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %get gap
    eigenValue=getFrequency(kCorner);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %get gap
    gap=getGap();
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %绘draw band
    drawBand(gap,0.3);

    其中的获取展开系数的getGAndf_1D函数如下

    function [G,f]=getGAndf_1D(d)
    %这个生成一维空间中的G和f
    global NG G f  Nkpoints eigenValue kCorner modeset a
    global epsa epsb epssys b1 b2
    NrSquare = 10;
    NG =(2*NrSquare+1);  % NG is the number of the G value
    G = zeros(NG,2);
    i = 1;
    for l = -NrSquare:NrSquare
            G(i,:)=l*b1;
            i=i+1;
    end
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    %生成k空间中的f(Gi-Gj)的值,i,j 从1到NG。
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    f=zeros(NG,NG); 
    for i=1:NG 
        for j=1:NG 
            Gij=G(i,:)-G(j,:); 
            if abs(Gij(2))>epssys    % * a
                f(i,j)=0; 
            elseif abs(Gij(1))<epssys  % 0 0
                f(i,j)=1/epsb+(1/epsa-1/epsb)*d; 
            else   % a 0
                f(i,j)=(1/epsa-1/epsb)*2/Gij(1)*sin(Gij(1)*d/2); 
            end; 
        end; 
    end; 
  • 相关阅读:
    MVVM CopyValuesTo接触属性上下级关联
    怎样控制WPF GroupBox.HeaderTemplate中的控件
    wpf动态创建DataGrid
    mvvm 绑定textbox焦点丢失问题
    C# 导出CSV文件
    使用C#选择文件夹、打开文件夹、选择文件或者如何使用C#选择文件夹
    EF 强制从数据库刷新集合
    WPF及Silverlight中将DataGrid数据导出
    VS 2005中winForm开发(C#)—图片上传到数据库与显示(sql server 2005)
    数据导出为csv文件时 数值型数据为科学计数法 时间被截取的解决方法
  • 原文地址:https://www.cnblogs.com/Iknowyou/p/6753954.html
Copyright © 2020-2023  润新知