10/1/2015 Instructor Dr. Raymond Rumpf (915) 747‐6958 rcrumpf@utep.edu EE 5320 Computational Electromagnetics Lecture #5 Transfer Matrix Method Using Scattering Matrices 5These notes may contain copyrighted material obtained under fair use rules. Distribution of these materials is strictly prohibited Lecture Slide 1 Outline • • • • • Recall 44 and 22 formulations Scattering matrix for a single layer Multilayer structures Calculating reflected and transmitted power Notes on implementation Lecture 5 Slide 2 1 10/1/2015 Recall 44 and 22 Formulations Lecture 5 Slide 3 Derivation Up to Matrix Form Start with Maxwell’s equations from Lecture 2. Assume LHI. Ez E y k0 r H x y z Ex Ez k0 r H y z x E y Ex k0 r H z x y H z H y k0 r E x y z H x H z k0 r E y z x H y H x k0 r E z x y Lecture 5 Assume device is infinite and uniform in x and y directions. jk x x jk y Ez jk y y dE y dz k0 r H x dE x jk x E z k0 r H y dz jk x E y jk y E x k0 r H z jk y H z dH y dz k 0 r E x dH x jk x H z k0 r E y dz jk x H y jk y H x k0 r Ez Normalize z and wave vectors kx, ky, and kz. z k0 z k kx x k0 ky ky k0 Eliminate longitudinal components Ez and Hz by substitution. k kz z k0 dE y jky Ez r H x dz dEx jkx Ez r H y dz jkx E y jky Ex r H z dH y jky H z r Ex dz dH x jkx H z r E y dz jkx H y jky H x r Ez dEx kx ky k 2 H x r x H y dz r r k dE y ky2 k x y Hy r H x dz r r dH x kx ky k 2 Ex r x E y dz r r dH y ky2 kx ky E r Ex dz r r y Slide 4 2 10/1/2015 Two Paths to Combined Solution 4×4 Matrix yz kx ky jkx yz zy kx zx yx yz zx j ky zz zz zz zz zz zz 2 k y Ex xz zx xz zx xz k zy jk j k xx y x y zz zz zz zz zz Ey zz 2 H z k k x yz zx x y yx yz zx k x yy yz zy j k k y x zz zz zz zz H y zz zz k 2 k k y xx xz zx x y xy xz zy jky xz zx zz zz zz zz zz zz Sort Eigen‐Modes E x Ey H yz zy x jkx H y zz zz xz zy j kx ky zz zz kˆx2 k yy yz zy zz zz kx ky xz zy xy zz zz W W E WH eλ z 0 e λz WE WH Ex Ey H x H y 0 λ z e Anisotropic Field Solution Maxwell’s Equations E k0 r H H k0 r E Isotropic or diagonally anisotropic Lecture 5 W ψ z E VH WE e VH 0 λ z W W e λz ψ z V V 0 r r kx2 1 kx ky 2 r k y r r kx ky r r kx2 1 kx ky Q 2 r k y r r kx ky 0 c e λ z c 0 c e c λz P No sorting! PQ Method Slide 5 Scattering Matrix for a Single Layer R. C. Rumpf, “Improved Formulation of Scattering Matrices for Semi‐Analytical Methods That is Consistent with Convention,” PIERS B, Vol. 35, pp. 241‐261, 2011. Lecture 5 Slide 6 3 10/1/2015 Motivation for Scattering Matrices Scattering matrices offer several important features and benefits: • Unconditionally stable method. • Parameters have physical meaning. • Parameters correspond to those measured in the lab. • Can be used to extract dispersion. • Very memory efficient. • Can be used to exploit longitudinal periodicity. • Mature and proven approach. • Much greater wealth of literature available. Excellent alternatives to S‐matrices do exist! Lecture 5 Slide 7 Geometry of a Single Layer Indicates a point that lies on an interface, but associated with a particular side. Layer i Medium 1 ψ1 ψ i 0 ψ1 ψ i 0 ψ zi i ψ i zi c1 ci Medium 2 ψ i k0 Li ψ 2 ψ i k0 Li ψ 2 c2 c2 c1 ci Li ψ i z field within i th layer Lecture 5 z ci mode coefficients inside i th layer ci mode coefficients outside i th layer Slide 8 4 10/1/2015 Field Relations Field inside the ith layer: Ex ,i zi E y ,i zi Wi ψ i zi H x ,i zi Vi H y ,i zi 0 ci e λi zi ci Wi e λi zi Vi 0 Boundary conditions at the first interface: ψ1 ψ i 0 W1 W1 c1 Wi V V V 1 c1 1 i Wi ci Vi ci Boundary conditions at the second interface: ψ i k0 Li ψ 2 Wi V i Wi e λ i k0 Li Vi 0 ci W2 e λ i k0 Li ci V2 W2 c2 V2 c2 0 Note: k0 has been incorporated to normalize Li. Lecture 5 Slide 9 Definition of A Scattering Matrix c1 S11 S12 c1 c2 S 21 S 22 c2 S 21 c 1 S11 c1 Lecture 5 S11 reflection S 21 transmission transmission reflection c2 S 22 S12 This is consistent with experimental convention. c2 Slide 10 5 10/1/2015 Derivation of the Scattering Matrix Solve both boundary condition equations for the intermediate mode coefficients ci and ci . 1 ci Wi ci Vi ci e λ i k0 Li c i 0 Wi W1 W1 c1 Vi V1 V1 c1 0 e λ i k0 Li Wi Vi 1 Wi W2 Vi V2 W2 c2 V2 c2 Both of these equations have Wi Vi 1 Wi W j Vi V j W j 1 A ij V j 2 Bij A ij Wi1W j Vi1V j Bij A ij Bij Wi1W j Vi1V j We set substitute this result into the first two equations and set them equal. 1 Ai1 2 Bi1 Bi1 c1 1 e λ i k0 Li Ai1 c1 2 0 0 e λ i k0 Li Bi 2 c2 Ai 2 c2 Ai 2 Bi 2 We write this as two matrix equations and rearrange terms until they have the form of a scattering matrix. c1 ? ? c1 c2 ? ? c2 Lecture 5 Slide 11 The Scattering Matrix The scattering matrix Si of the ith layer is defined as: c1 i c1 S c2 c2 i S11 S i S 21 S12 S 22i i i After some algebra, the components of the scattering matrix are computed as S A S A S A i A i1 Xi Bi 2 A i21Xi Bi1 S11 i 12 i1 Xi Bi 2 A i21Xi Bi1 i 21 i2 Xi Bi1A i11Xi Bi 2 i 22 Lecture 5 1 i 2 Xi B i1 A i1 X i B i 2 X B A X A X A B A X A B A X B A X A 1 i i2 1 i2 i i1 1 Si Bi1 i i2 i2 1 i2 i i1 i1 1 i1 1 1 i i1 1 i1 i Bij Wi1W j Vi1V j Bi 2 Bi1 i 2 Bi 2 A ij Wi1W j Vi1V j X i e λ i k0 Li i is the layer number. j is either 1 or 2 depending on which external medium is being referenced. Slide 12 6 10/1/2015 Scattering Matrices in the Literature For some reason, the computational electromagnetics community has: (1) deviated from convention, and (2) formulated scattering matrices inefficiently. S 22 transmission c S11 S12 c c S 21 S 22 c i 1 i i i 1 S12 reflection S 21 S11 ci1 ci ci1 ci Lecture 5 • Here s11 is not reflection. Instead. it is backward transmission! • Here s21 is not transmission. Instead, it is a reflection parameter! • Scattering matrices can not be interchanged. • Scattering matrices are not symmetric so they take twice the memory to store and are more time‐consuming to calculate. Slide 13 Limitation of Conventional S‐Matrix Formulation Note that the elements of a scattering matrix are a function of materials outside of the layer. This makes it difficult to interchange scattering matrices arbitrarily. For example, there are only three unique layers in the multilayer structure below, yet 20 separate computations of scattering matrices are needed. Three unique layers 20 layer stack Lecture 5 Slide 14 7 10/1/2015 Solution To get around this, we will surround each layer with an external regions of zero thickness. This lets us connect the scattering matrices in any order because they all calculate fields that exist outside of the layers in the same medium. This will have no effect electromagnetically as long as we make the external regions have zero thickness. Gap Medium Layer i Gap Medium Li Lecture 5 Slide 15 Visualization of the Technique We calculate the scattering matrices for just the unique layers. Three unique layers Then we just manipulate these same three scattering matrices to “build” the global scattering matrix. Gaps between the layers are made to have zero thickness so they have no effect electromagnetically. Faster! Simpler! Less memory needed! Lecture 5 Slide 16 8 10/1/2015 Revised Geometry of a Single Layer same Gap Medium Gap Medium Layer i ψ1 ψ i 0 ψ1 ψ i 0 ψ i zi ψ i k0 Li ψ 2 r ,h r ,h r ,h ψ i zi ψ i k0 Li ψ 2 c1 ci r ,h c2 c2 c1 ci Li Lecture 5 Slide 17 Calculating Revised Scattering Matrices The scattering matrix Si of the ith layer is still defined as: c1 i c1 S c2 c2 S i S i 11i S 21 i S12 S 22i But the elements are calculated as S A i 12 i i S21i S12 i i S 22 S11 Lecture 5 Xi Bi A i1 Si X B A X A B X B X A B A B i S11 A i Xi Bi A i1Xi Bi 1 i 1 i i i 1 i i i i i i 1 i i i • Layers are symmetric so the scattering matrix elements have redundancy. • Scattering matrix equations are simplified. • Fewer calculations. • Less memory storage. A i Wi1Wh Vi1Vh Bi Wi1Wh Vi1Vh X i e λ i k0 Li Slide 18 9 10/1/2015 Layers in TMM are Four‐Port Systems We have written the scattering matrices as 22 block matrices. S11 S12 S 21 S 22 For TMM, this actually expands to a 44 element scattering matrix. S11 S 21 s11 S12 s21 S 22 s31 s41 s S11 11 s21 s S 21 31 s41 s12 s22 s32 s42 s12 s13 s22 s23 s32 s33 s42 s43 s S12 13 s23 s S 22 33 s43 s14 s24 s34 s44 s14 s24 s34 s44 Each mode provides an I/O mechanism and there are two modes on each side. Lecture 5 Slide 19 Scattering Matrices of Lossless Media If a scattering matrix is composed of materials that have no loss and no gain, the scattering matrix must conserve energy. That is, all incident energy must either reflect or transmit. This implies that the scattering matrix is unitary. If the scattering matrix is unitary, it must obey the following rules: S H S 1 S H S SS H S 1S SS 1 I Note: If the regions external the layer are different from each other, the scattering matrices will not be unitary. This is because the field amplitudes will be different even though the field carries the same amount of power. Lecture 5 Slide 20 10 10/1/2015 Hints About Stability in These Formulations • Diagonal elements S11 and S22 tend to be the largest numbers. Divide by these instead of any off‐diagonal elements for best numerical stability. S11 S12 S S S 22 21 • X describes propagation through an entire layer. Don’t divide by X or your code can become unstable. Lecture 5 Slide 21 Multilayer Structures Lecture 5 Slide 22 11 10/1/2015 Solution Using Scattering Matrices The scattering matrix method consists of working through the device one layer at a time and calculating an overall scattering matrix. S 1 S 2 S 3 S 4 S 5 S device S1 S 2 S 3 S 4 S 5 Redheffer star product. NOT matrix multiplication! Lecture 5 Slide 23 Redheffer Star Product Two scattering matrices may be combined into a single scattering matrix using Redheffer’s star product. S AB S A S S A S A 11A S 21 B A S12 S22A S B S B 11B S 21 B S12 S22B The combined scattering matrix is then S11 AB S AB AB S11 AB S 21 AB S12 S22AB 1 S11 S12 I S11 S 22 S11 S 21 A A B A B A 1 AB A B A B S12 S12 I S11 S 22 S12 1 S21 S21 I S22 S11 S 21 AB B A B A 1 B A B S22AB S22B S21B I S 22A S11 S 22 S12 R. Redheffer, “Difference equations and functional equations in transmission-line theory,” Modern Mathematics for the Engineer, Vol. 12, pp. 282-337, McGraw-Hill, New York, 1961. Lecture 5 Slide 24 12 10/1/2015 Derivation of the Redheffer Star Product We start with the equations for the two adjacent scattering matrices. A c1 S11 A c2 S 21 A S12 c1 A S22 c2 B c2 S11 B c3 S 21 B S12 c2 B S 22 c3 We expand these into four matrix equations. A A B B Eq. 1 Eq. 3 c1 S11 c1 S12 c2 c2 S11 c2 S12 c3 A A B B Eq. 2 Eq. 4 c2 S 21 c1 S 22 c2 c3 S 21 c2 S 22 c3 We substitute Eq. (2) into Eq. (3) to get an equation with only c2 . We substitute Eq. (3) into Eq. (2) to get an equation with only c2 . I S S c I S S c B 11 A 22 2 A 22 B 11 2 B A B S11 S 21 c1 S12 c3 A A B S 21 c S 22 S12 c 1 3 Eq. 5 Eq. 6 We eliminate c and c by substituting these equations into Eq. (1) and (4). We then rearrange terms into the form of a scattering matrix. 2 c1 ? ? c1 c3 ? ? c3 2 Overall, this is just algebra. We start with 4 equations and 6 unknowns and reduce it to 2 equations with 4 unknowns. Lecture 5 Slide 25 Putting it All Together We have one remaining problem. In the revised framework, the global scattering matrix places the device in free space. In many applications, we may want something other than free space outside the device. We connect the global scattering matrix to the external materials by surrounding it by “connection” scattering matrices that have zero‐thickness Device exists within gap medium S global S ref S S S S 1 2 N trn Device in gap medium Lecture 5 S device Slide 26 13 10/1/2015 Reflection/Transmission Side Scattering Matrices The reflection‐side scattering matrix is ref 1 ref ref 1 ref S11 A B ref S12 2 A s ref A ref Wh1Wref Vh1Vref S 21ref 0.5 A ref B ref A ref1 B ref 1 h r ,I r ,h r ,I r ,h 1 h B ref W Wref V Vref S 22ref B ref A ref1 lim L0 The transmission‐side scattering matrix is B trn A trn1 S11 s trn trn 0.5 A trn B trn A trn1 B trn S12 trn S21 2A trn1 trn S22trn A trn1 B trn 1 h 1 h 1 h 1 h A trn W Wtrn V Vtrn r ,h r ,II r ,h r ,II B trn W Wtrn V Vtrn lim L0 Lecture 5 Slide 27 Calculating Transmitted and Reflected Power Lecture 5 Slide 28 14 10/1/2015 Recall How to Calculate Source Parameters Incident Wave Vector Surface Normal sin cos kinc k0 ninc sin sin cos aˆ y aˆTE nˆ kinc nˆ k inc aˆ k ˆaTM TE inc aˆTE kinc 0 nˆ 0 1 Right‐handed coordinate system x y Unit Vectors Along Polarizations z 0 0 Composite Polarization Vector P pTE aˆTE pTM aˆTM In CEM, we usually make P 1 Lecture 5 Slide 29 Solution Using Scattering Matrices The external fields (i.e. incident wave, reflected wave, transmitted wave) are related through the global transfer matrix. c ref global cinc c S 0 trn E 1 x ,inc cinc Wref E y ,inc We get Ex,inc and Ey,inc from the polarization vector P. E P x ,inc x E P y ,inc y This matrix equation can be solved to calculate the mode coefficients of the reflected and transmitted fields. global c ref S11 c global trn S 21 global S12 cinc global 0 S 22 global c ref S11 cinc c trn S21globalcinc cinc right cinc not typically used Lecture 5 Slide 30 15 10/1/2015 Calculation of Transmitted and Reflected Fields The procedure described thus far calculated cref and ctrn. The transmitted and reflected fields are then inc Exref global global 1 Ex ref Wref c ref Wref S11 cinc Wref S11 Wref inc E y E y inc Extrn global global 1 Ex trn Wtrn c trn Wtrn S 21 cinc Wtrn S 21 Wref inc E y E y Lecture 5 Slide 31 Calculation of the Longitudinal Components We are still missing the longitudinal field component Ez on either size of the layer stack. These are calculated using Maxwell’s divergence equation. E 0 E0, x e jk r E0, y e jk r E0, z e jk r 0 x y z jk x E0, x e jk r jk y E0, y e jk r jk z E0, z e Note: E 0 reduces to E 0 when is homogeneous. jk r 0 k x E0, x k y E0, y k z E0, z 0 k z E0, z k x E0, x k y E0, y E0, z k x E0, x k y E0, y kz Ezref kx E xref ky E yref k ref z Eztrn kx Extrn ky E ytrn k trn z Lecture 5 Slide 32 16 10/1/2015 Calculation of Power Flow Reflectance is defined as the fraction of power reflected from a device. 2 Eref 2 2 2 2 R 2 E Ex E y Ez Einc Transmittance is defined as the fraction of power transmitted through a device. 2 Note: We will derive these Etrn k formulas in Lecture 7. T 2 Re r ,ref z ,trn k Einc r ,trn z ,inc It is always good practice to check for conservation of energy. 1 materials have loss R T 1 materials have no loss and no gain 1 materials have gain Lecture 5 Slide 33 Reflectance and Transmittance on a Decibel Scale Decibel Scale PdB 20 log10 A PdB 10 log10 P How to calculate decibels from an amplitude quantity. How to calculate decibels from a power quantity. P A2 PdB 10 log10 A2 20 log10 A Reflectance and Transmittance Reflectance and transmittance are power quantities, so RdB 10 log10 R TdB 10 log10 T Lecture 5 Slide 34 17 10/1/2015 Notes on Implementation Lecture 5 Slide 35 Outline • • • • • • • • • • • • • • Step 0 – Define problem Step 1 – Dashboard Step 2 – Describe device layers Step 3 – Compute wave vector components Step 4 – Compute gap medium parameters Step 5 – Initialize global scattering matrix Step 6 – Main loop through layers Step 7 – Compute reflection side scattering matrix Step 8 – Compute transmission side scattering matrix Step 9 – Update global scattering matrix Step 10 – Compute source Step 11 – Compute reflected and transmitted fields Step 12 – Compute reflectance and transmittance Step 13 – Verify conservation of energy Lecture 5 human does this computer does the rest Step 6: Iterate through layers • Compute P and Q • Compute eigen‐modes • Compute layer scattering matrix • Update global scattering matrix Slide 36 18 10/1/2015 Storing the Problem How is a the device described and stored for TMM? We don’t use a grid for this method! Store the permittivity for each layer in a 1D array. Store the permeability for each layer in a 1D array. Store the thickness of each layer in a 1D array. ER = [ 2.50 , 3.50 , 2.00 ]; UR = [ 1.00 , 1.00 , 1.00 ]; L = [ 0.25 , 0.75 , 0.89 ]; Input arrays for three layers We will also need the external materials, and source parameters. er1, er2, ur1, ur2, theta, phi, pte, ptm, and lam0 Lecture 5 Slide 37 Storing Scattering Matrices We often talk about the scattering matrix S as a single matrix. S12 S S 11 S 21 S 22 However, we never actually use the scattering matrix S this way. We only ever use the individual terms S11, S12, S21, and S22. So, scattering matrices are actually best stored as the four separate components of the scattering matrix. S12 S S 11 S 21 S 22 Lecture 5 S11 , S12 , S 21 , and S 22 Slide 38 19 10/1/2015 Initializing the Global Scattering Matrix Before we iterate through all the layers, we must initialize the global scattering matrix as the scattering matrix of “nothing.” What are the ideal properties of nothing? 1. Transmits 100% of power with no phase change. global S12 S21global I 2. Does not reflect. global S11 S 22global 0 We therefore initialize our global scattering matrix as 0 I S global I 0 This is NOT an identity matrix! Look at the position of the 0’s and I’s. Lecture 5 Slide 39 Analytical Expressions for W and The dispersion relation with normalized wave vectors is r r kx2 ky2 kz2 Using this relation, we can simplify the matrix equation for 2. Ω 2 PQ 1 kx ky r r ky2 r r r r kx2 kx ky kx ky 2 k y r r r r kx2 kz2 0 kx ky 0 2 kz I 2 k z 1 0 I identity matrix 0 1 Since this is a diagonal matrix, we can conclude that 1 0 WI 0 1 λ 2 Ω2 jk λ z 0 0 jkz I jkz e λz e jkz z 0 0 e jk z z We don’t actually have to solve the eigen‐value problem to obtain the eigen‐modes! Lecture 5 Slide 40 20 10/1/2015 Calculating the Parameters of the Homogeneous Gaps Our analytical solution for a homogeneous layer is 1 kx ky Qh r ,h ky2 r ,h r ,h r ,h r ,h kx2 kx ky kz2,h r ,h r ,h kx2 ky2 Wh I λ h jkz ,h I We are free to choose any r and Vh Q h Wh λ h1 r that we wish. We also wish to avoid the case of kz,h = 0. For convenience, we choose r ,h 1.0 r ,h 1 kx2 ky2 and We then have kx ky Qh 2 1 kx 1 ky2 kx ky Wh I W not even used in TMM. Vh jQ h Lecture 5 Slide 41 Simplifications for TMM in LHI Media In LHI media, 1 0 Wi I 0 1 and Ωi jkz ,i I 1 0 I identity matrix 0 1 Now we do not actually have to calculate because λ i Ωi Given all of this, the eigen‐vectors for the magnetic fields can be calculated as Vi Qi Wi λ i1 Qi Ωi1 When calculating scattering matrices, the intermediate matrices Ai and Bi are A i Wi1Wh Vi1Vh I Vi1Vh Bi Wi1Wh Vi1Vh I Vi1Vh The fields and mode coefficients are now related through P Px 1 x cinc Wref P P y y Lecture 5 Exref ref Wref S11cinc S11cinc E y Extrn trn Wtrn S 21cinc S 21cinc E y Slide 42 21 10/1/2015 Calculating Xi = exp(-ik0Li) Recall the correct answer: Xi e Ωi k0 Li e jkz k0 Li 0 e jk z k0 Li 0 It is incorrect to use the function exp() because this calculates a point‐by‐point exponential, not a matrix exponential. X = 0.0135 + 0.9999i 1.0000 WRONG X = exp(OMEGA*k0*L); 1.0000 0.0135 + 0.9999i Approach #2: diag() Approach #1: expm() X = expm(OMEGA*k0*L); X = diag(exp(diag(OMEGA)*k0*L)); X = 0.0135 + 0.9999i 0 X = 0.0135 + 0.9999i 0 0 0.0135 + 0.9999i 0 0.0135 + 0.9999i Lecture 5 Slide 43 Efficient Calculation of Layer S‐Matrices There are redundant calculations in the equations for the scattering matrix elements. S S A X B A X A B X B X A B A B i S11 S 22i A i Xi Bi A i1Xi B i i 12 i 21 i Xi B i A 1 i 1 i 1 i i i 1 i i i i i i 1 i i i This should be calculated as A i I Vi1Vh Bi I Vi1Vh Xi e λ i k0 Li D A i Xi B i A i1Xi B i i S11 S 22i D1 Xi B i A i1Xi A i B i i S12 S 21i D1Xi A i B i A i1Bi Lecture 5 Slide 44 22 10/1/2015 Efficient Star Product After observing the equations to implement the Redheffer star product, we see there are some common terms. Calculating these multiple times is inefficient so we calculate them only once using intermediate parameters. S AB S A S B S11 AB AB S12 AB 1 S11 S12 I S11 S 22 S11 S 21 A A B A B A B I S11 S 22 S12 B A B 1 A 1 B F S21B I S22A S11 1 A AB A B A S11 S 21 S11 DS11 1 A S12 B A B A D S12 I S11 S 22 AB B S12 DS12 S 21 S 21 I S 22 S11 S 21 S21AB FS21A 1 B A B S22AB S22B S21B I S 22A S11 S 22 S12 B S22AB S22B FS22A S12 Lecture 5 Slide 45 Using the Star Product as an Update Very often we update our global scattering matrix using a star product. When we use this equation as an update, we MUST pay close attention to the order that we implement the equations so that we don’t accidentally overwrite a value that we need. S global Si S global global i F S21 global reverse order global Lecture 5 S22 global S 21 global S12 global S11 S22 global S22 i global I S22i S11 FS22S1 2 i global i FS 21 global DS12 i 1 global i S11 DS11 S 21 global i global D S12 I S11 S 22 1 global i i F S21 I S22 S11 standard order D S12 I S11 S global S global S i 1 1 global global i global S11 S11 DS11 S 21 global i S12 DS12 S21global FS21global i S22global S22i FS22global S12 Slide 46 23 10/1/2015 Simplified External S‐Matrices in LHI Media The reflection‐side scattering matrix is ref 1 ref ref 1 ref S11 A B ref S12 2 A s ref A ref I Vh1Vref S 21ref 0.5 A ref B ref A ref1 B ref r ,I r ,h r ,I r ,h 1 h B ref I V Vref S 22ref B ref A ref1 lim L 0 The transmission‐side scattering matrix is S11 B trn A trn1 s trn trn 0.5 A trn B trn A trn1 B trn S12 trn 1 h A trn I V Vtrn r ,h r ,II r ,h r ,II 1 h B trn I V Vtrn S21 2A trn1 trn S22trn A trn1 B trn lim L 0 Lecture 5 Slide 47 Block Diagram of TMM Using S‐Matrices Initialize Global Scattering Matrix kx ky Qh 1 kx2 0 I S global I 0 Calculate Parameters for Layer i Calculate Transverse Wave Vectors kx ninc sin cos Calculate Gap Medium Parameters 1 ky2 kx ky Vh jQ h ky ninc sin sin Calculate Scattering Matrix for Layer i kz ,i i i kx2 ky2 Ai I Vi1Vh i i kx2 1 kx ky Qi 2 i ky i i kx ky Ωi jk z ,i I Vi Qi Ωi1 Bi I Vi1Vh A B A D S12 I S11 S 22 B i S11 S22i D1 Xi Bi A i1Xi A i B i i 1 1 i S12 S 21 D Xi Ai Bi A B i Start S global S global S i Xi eλ i k0 Li D A i Xi Bi A i1Xi B i i Update Global Scattering Matrix 1 A B 1 F S 21 I S 22 S11 AB A B A S11 DS11 S11 S 21 AB S12 B DS12 S 21AB FS21A B S 22AB S 22B FS 22A S12 no yes Connect to External Regions S global S ref S global S global S global S trn Lecture 5 Loop through all layers Done? Finish Calculate Source P pTE aˆTE pTM aˆTM P 1 Px esrc Py Calculate Transmitted and Reflected Fields Calculate Longitudinal Field Components E ref e ref xref S11esrc E y E zref E trn e trn xtrn S 21esrc E y E ztrn kx Exref ky E yref k ref z kx E xtrn ky E ytrn k trn z Calculate Transmittance and Reflectance R Eref 2 2 T Etrn Re ref trn kztrn kzref Slide 48 24 10/1/2015 How to Handle Zero Number of Layers Follow the block diagram!! Setup your loop this way… NLAY = length(L); for nlay = 1 : NLAY ... end For zero layers: ER = []; UR = []; L = []; If NLAY = 0, then the loop will not execute the global scattering matrix will remain as it was initialized. 0 I S global I 0 Lecture 5 Slide 49 Can TMM Fail? Yes! The TMM can fail to give an answer and behave numerically strange any time kz = 0. This happens at a critical angle when the transmitted wave is at or near its cutoff. We fixed this problem in the gap medium, but this can also happen in any of the layers or in the transmission region. This happens in any medium where r r kx2 ky2 Lecture 5 Slide 50 25