⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multi_layers_filter.m

📁 Multi-Layer optical filter. FDTD Simulation comparing with analytic methods.
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%% In The Name of God %%%%%%%%%%%%%%%%%%%%%%

              % Advanced Engeeniring Electromagnetic

% Mohsen Bahrami Panah..................................8600374

% Problem 8......................... Multi-Layer Optical Filter
% Normal Incidence with Total Reflection ( Lossless Media )  

%          na |    nH   |    nL  | ... |    nH   | nb
%             |         |        |     |         |
% left medium | l(High) | L(Low) | ... | L(High) | right medium 
%   interface 1         2        3     M        M+1

% num = number of the layers
% 
% notes : num must be an odd number. because we wants to have 
%         the same layers at the begining and at the end of th layers.
%         so we define a parameter (ff) which is in relation with num
%         as below :
%                     num = 2*ff+1
%         we have done this program with ff=[6 25]
%         figure(1) illustrates the reflection and transmission coefficients   
%         for ff=6. and figure(2) illustrates these ones for ff=25.

function Multi_layers_Filter(f0)
format long
% f0=1*10^9;
f=0.01*f0:0.01*f0:2*f0;
for gg=1:1
ff=[6];
num=2*ff(gg)+1;
for ii=1:length(f)
    c=3*10^8;E0=1;
    lambda0=c/f0;lambda=c/f(ii);
    for tt=2:2:num+1
        n(tt)=1.6;
        n(tt+1)=1.2;
    end
    n(1)=1;
    n(num+2)=1;
    for k=1:length(n) 
         neta(k)=377/n(k);
    end
    for ki=1:num
         d(ki)=lambda0/(4*n(ki+1));
    end
    for kk=1:num
         z(kk+1)=sum(d(1:kk));
    end
    A=zeros(16,16);
    for mm=1:(num+2)
        B(mm)=2*pi*n(mm)*f(ii)/c;
    end
    A(1,1)=-1;A(1,2)=1;A(1,3)=1;A(2,1)=1/neta(1);A(2,2)=1/neta(2);
    A(2,3)=-1/neta(2);
    m=1;
    aa=(num+1)*2;
    for p=2:2:(aa-4)
    m=m+1;
    A(p+1,p)=exp(-j*B(m)*z(m));
    A(p+1,p+1)=exp(j*B(m)*z(m));
    A(p+1,p+2)=-exp(-j*B(m+1)*z(m));
    A(p+1,p+3)=-exp(j*B(m+1)*z(m));
    A(p+2,p)=(1/neta(m))*A(p+1,p);
    A(p+2,p+1)=(-1/neta(m))*A(p+1,p+1);
    A(p+2,p+2)=(1/neta(m+1))*A(p+1,p+2);
    A(p+2,p+3)=(-1/neta(m+1))*A(p+1,p+3);
    end
    m=num+1;
    p=aa-2;
    A(aa-1,aa-2)=exp(-j*B(m)*z(m));A(aa-1,aa-1)=exp(j*B(m)*z(m));
    A(aa-1,aa)=-exp(-j*B(m+1)*z(m));A(aa,aa-2)=(1/neta(m))*A(p+1,p);
    A(aa,aa-1)=(-1/neta(m))*A(p+1,p+1);A(aa,aa)=(1/neta(m+1))*A(p+1,p+2);
    u=zeros(1,aa);
    u=u';
    u(1,1)=E0;
    u(2,1)=E0/neta(1);
    X=(A)\u;
    a(ii)=X(aa);
end
for g=1:length(a)
    v(g)=(abs(a(g)))^2;
end
1-v(100)
figure(gg)
% subplot(2,1,1)
plot((f/f0),v,'m*-')
legend('FDTD','Exact')
grid on;
title('\bf\it Multi-Layers Optical Filter','color','b');
xlabel('\it f/f0','color','b');
ylabel('|\tau|^2','color','b');

for g=1:length(a)
    a(g)=1-(abs(a(g)))^2;
end
% subplot(2,1,2)
figure(2)
plot((f/f0),a,'m*-')
grid on;
legend('FDTD','Exact')
title('\bf\it Multi-Layers Optical Filter','color','b');
xlabel('\it f/f0','color','b');
ylabel('|\Gamma|^2','color','b');
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -