-
Notifications
You must be signed in to change notification settings - Fork 0
/
fmm_calc_T.m
50 lines (46 loc) · 1.73 KB
/
fmm_calc_T.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%{
Copyright © 2022 Alexey A. Shcherbakov. All rights reserved.
This file is part of the SemiinfiniteScatteringMedium2D project.
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This sortware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
mailto: alexey.shcherbakov@metalab.ifmo.ru
%}
%% description:
% T-matrix of an interface between a photonic crystal and a homogeneous medium
% the case of the collinear diffraction on 1D gratings
%% input:
% no: number of Fourier harmonics
% EV: matrix of the electric field eigenvectors for the photonic crystal
% HV: matrix of the magnetic field eigenvectors for the photonic crystal
% kz: row of plane wave propagation constants in the homogeneous medium
% eps: permittivity the homogeneous medium
% pol: polarization
%% output:
% T: T-matrix of size 4*no by 4*no
%% implementation:
function [T] = fmm_calc_T(no, EV, HV, kz, eps, pol)
T = zeros(2*no,2*no);
ib1 = [1:no];
ib2 = [no+1:2*no];
if strcmp(pol,'TE')
ikz = transpose(0.5./kz);
T(ib1,ib1) = -HV.*ikz;
T(ib2,ib1) = 0.5*EV - T(ib1,ib1);
T(ib1,ib1) = T(ib1,ib1) + 0.5*EV;
T(ib1,ib2) = T(ib2,ib1);
T(ib2,ib2) = T(ib1,ib1);
elseif strcmp(pol,'TM')
eikz = transpose((0.5*eps)./kz);
T(ib1,ib1) = EV.*eikz;
T(ib2,ib1) = 0.5*HV - T(ib1,ib1);
T(ib1,ib1) = T(ib1,ib1) + 0.5*HV;
T(ib1,ib2) = -T(ib2,ib1);
T(ib2,ib2) = -T(ib1,ib1);
end
end