Comparison & Reference:
1. Checked the simulation material that will be used
2. Input the builtin function
3. Press the run button to execute the code
4. Checked out the geometries
5. If correct! then Press 【輸出 output】button to output the *.csv files.
the builtin function geometries variable are
gdx is (grid) dx value, gdy = dy. gdz = dz;
ib= X grids, jb= Y grids, kb= Z grids;
icenter= ib/2; jcenter= jb/2; kcenter=kb/2;
Initialize_geometries % use to initialize all geometries%=================矩形 Brick===========================xstart=1*gdx;xend=ib*gdx;ystart=1*gdy;yend=jb*gdy;zstart=30*gdz;zend=30*gdz+100e-9;nindex=1.25^2;sigma=0;choice='E_Iso'; %E_Iso,PEC,M_Iso,PMC,E_Model1,M_Model1,EM_Model1gridtype=-1; %Iso_Brick(choice,gridtype,nindex,sigma,xstart,xend,ystart,yend,zstart,zend)%=================矩形 Brick===========================%=================矩形 Brick===========================xstart=1*gdx;xend=ib*gdx;ystart=1*gdy;yend=jb*gdy;zstart=30*gdz+100e-9;zend=30*gdz+300e-9;nindex=1.5^2;sigma=0;choice='E_Iso'; %E_Iso,PEC,M_Iso,PMC,E_Model1,M_Model1,EM_Model1gridtype=-1; %Iso_Brick(choice,gridtype,nindex,sigma,xstart,xend,ystart,yend,zstart,zend)%=================矩形 Brick===========================%=================矩形 Brick===========================xstart=1*gdx;xend=ib*gdx;ystart=1*gdy;yend=jb*gdy;zstart=30*gdz+300e-9;zend=30*gdz+600e-9;nindex=1.75^2;sigma=0;choice='E_Iso'; %E_Iso,PEC,M_Iso,PMC,E_Model1,M_Model1,EM_Model1gridtype=-1; %Iso_Brick(choice,gridtype,nindex,sigma,xstart,xend,ystart,yend,zstart,zend)%=================矩形 Brick=========================== gdx is grid dx value,here set the resolution at 5 nm,and gdy=gdz=gdx 。X from 1 to boundary ib,Y from 1 to boundary jb。
The Z direction (thickness)
The first layer is 100 nm, and the incident source is set at Z=21 *gdz position of C.Wave & Observation step.
So, here the first layer Brick geometry is set from Z=30 *gdz, and the Zend is Zstart + 100 nm.
The material choice E_Iso (Electric Isotropic),The relative permittivity (Epsilon_r)。
Epsilon_r=nindex=n^2, (n equal to refractive index)
zstart=30*gdz;zend=30*gdz+100e-9;nindex=1.5^2;sigma=0;choice='E_Iso';The comparison of FonSinEM simulation results and analytical solution are shown in below figure., The analytical solution can be obtained by multilayer_p.m, multilayer_s.m in the pdf file
% This program is an example to use thin film model. The design if a% broadband reflector for the visible region of design.% Data resource: Figure 4-27 in "Optical thin film"% initial programclear all;close all;um = 1e-6;nm = 1e-9;% define admittance for mediumAir = 1;Glass = 1.52;% define the reference wavelength and thicknesslambda_f = 480*nm;% define visible region of lightlambda = linspace(200,1500,501)*nm;% define thin film structurey_inc = Air; % incident medium admittancey_sub = Air; % substrate medium admittancetheta = 0; % in degree%d = film thickness%y = index for d, n-ik d=[100*nm;200*nm;300*nm;];y=[1.25;1.5;1.75;];%rho= sqrt(R), complex reflection coefficient%tao= sqrt(T), complex reflection coefficient% y_inc|y|y_sub 共三層for ii=1:length(lambda),[rho(ii),tao(ii),R(ii),T(ii)] =multilayer_s(d,y,y_inc,y_sub,lambda(ii),theta);end% plot the resultfigure;hold on;plot(lambda/nm,R*1,'-k','LineWidth',3);plot(lambda/nm,T*1,'-k','LineWidth',3);title('A broadband reflector for the visible region');xlabel('Wavelength(nm)');ylabel('Reflectance(%)');%axis([350 850 0 105]);grid on; for ii=1:length(lambda),[rho2(ii),tao2(ii),R2(ii),T2(ii)] =multilayer_p(d,y,y_inc,y_sub,lambda(ii),theta);end% plot the resultfigure;hold on;plot(lambda/nm,R2*1,'-k','LineWidth',3);plot(lambda/nm,T2*1,'-k','LineWidth',3);title('A broadband reflector for the visible region');xlabel('Wavelength(nm)');ylabel('Reflectance(%)');%axis([350 850 0 105]);grid on;