Sie sind auf Seite 1von 176
SN CLE CO NR een oe LEO Roger D. Pollard and Richard Booton, Series Edi ELECTROMAGNETIC SIMULATION USING THE FDTD METHOD IEEE Press 445 Hoes Lane, 20. Box 1331 Piscataway, NJ_08855-1331 IEEE Press Editorial Board Robert J. Herrick, Editor in Chief M. Akay M. Eden M. S. Newman J.B. Anderson M.E. El-Hawary —M. Padgett P.M. Anderson R.E. Hoyt W.D. Reeve JE. Brewer S.V. Kartalopoulos G. Zobrist D. Kisk Kenneth Moore, Director of IEEE Press Catherine Faduska, Senior Acquisitions Editor Linda Matarazzo, Associate Acquisitions Editor Anthony VenGraitis, Project Editor Marilyn G. Catis, Marketing Manager IEEE Microwave Theory and Techniques Society, Sponsor MITES Liaison to SEEE Press, Lawrence Dunleavy Cover Design: William T. Donnelly, WT Design “Technical Reviewers Roger Pollard, University of Leeds, United Kingdom Richard W. Ziolkowski, University of Arizona, Tucson, AZ Tatsuo Itoh, UCLA Raymond Luebbers, Pennsylvania State University, University Park, PA Melinda Piket-May, University of Colorado at Boulder Nihad 1. Dib, Jordan University of Science and Technology, Irbid, Jordan Books of Related Interest from the IEEE Press MAGNETIC RECORDING: The First 100 Years Eric D. Daniel, Denis C. Mee, Mark Clark 1999 Softcover 360 pp IEEE Order No. PP5396 ISBN 0-7803-4709-9 MAGNETIC HYSTERESIS Edward Della Torre 1999 Hardcover 240 pp. IEEE Order No. PC5766 ISBN 0-7803-4719-6 MAGNETO-OPTICAL RECORDING MATERIALS Edited by Richard J. Gambino and Takao Suzuki 2000 Hardcover 424 pp IBEE Order No, BC3582 ISBN 0-7803-1009-8 EMC AND THE PRINTED CIRCUIT BOARD: Design, Theory, and Layout Made Simple Mark 1. Montrose 1999 Hardcover 344 pp JEEE Order No. PC5756 ISBN 0-7803-4703-X PRINTED CIRCUIT BOARD DESIGN TECHNIQUES FOR EMC COMPLIANCE: A Handbook for Designers, Second Edition Mark I. Montrose 2000 Hardcover 336 pp IEEE Order No. PC5816 ISBN 0-7803-5376-5 ELECTROMAGNETIC SIMULATION USING THE FDTD METHOD Dennis M. Sullivan Electrical Engineering Department University of Idaho IEEE Microwave Theory and Techniques Society, Sponsor IEEE > PRESS & IEEE Press Series on RF and Microwave Technology Roger D, Pollard and Richard Booton, Series Editors The Institute of Electrical and Electronics Engineers, Inc., New York This book and other books may be purchased at a discount from the publisher when ordered in bulk quantities. Contact IEEE Press Marketing ‘Aun: Special Sales 445 Hoes Lane P.O, Box 1331 Piscataway, NJ 08855-1331 Fax: +] 732 981 9334 For more information about IEEE Press products, visit the IREE Online Catalog & Store: hitp://www.ieee.org/ieeestore © 2000 by the Institute of Electrical and Electronics Engin 3 Park Avenue, 17th Floor, New York, NY 16016-5997 All rights reserved. No part of this book may be reproduced in any form, nor may it be stored in a retrieval system or transmitted in any form, withour written permission from the publisher Printed in the United States of America. ISBN 0-7803-4747-1 IEEE Order No, PC5400 tion Data rary of Congress Cataloging-in-Publi Sullivan, Dennis M Electromagnetic simulation using the FDTD method / Dennis M. Selfivan : 1 Microwave Theory and Techniques Society, sponsor. pcm, -- (IEEE Press series on RF and microwave technology) Includes bibliographical references and index. ISBN 0-7803-4747-1 I. Electromagnetism—Computer simulation. 2. Finite differences. 3. Time-domain analysis. L Title, Il, Series. QCT60 S92 2000 537.01 13-de2L (00-038922 To Sully and Jane Contents GUIDE TO THE BOOK xi CHAPTER 1 CHAPTER 2 ONE-DIMENSIONAL SIMULATION WITH THE FDTD METHOD 1 L.L One-Dimensional Free Space Formulation 1 1.2 Stability and the FDTD Method 4 1.3 The Absorbing Bou 1.4 Propagation in a Dielectric Medium 5 15. Simula ¥y Condition in One Dimension 4 1g Different Sources 7 8 1.7 Propagation in a Lossy Dielectric Medium 9 Appendix LA 1 References I! 1.6 Determining Cell MORE ON ONE-DIMENSIONAL SIMULATION 19 2.1 Reformulation Using the Flux Density 19 2.2 Calculating the Frequency Domain Output 21 2.3 Frequency-Dependent Media 23 2.3.1 Auxiliary Differential Equation Method 26 24 Formulation Using Z Transforms 27 2.4.4 Simulation of an Unmagnetized Plasma 28 2.5 Formulating a Lorentz Medium 31 25.1 Simulation of Human Muscle Tissue 33 References 35 CHAPTER 3 CHAPTER 5 CHAPTER 6 APPENDIX Contents ‘TWO. IMENSIONAL § ULATION 49 3.1 BOYD in Two Dimensions 49 3.2 The Perfectly Matched Layer (PML) SI 3.3 Total/Scattered Field Formulation 58 3.3.1 A Plane Wave Impinging on a Dielectric Cylinder 59 3.3.2 Fourier Analysis 61 References 63 THREE-DIMENSIONAL SIMULATION 79 4.4 Pree Space Formutation 79 4.2 The PML in Three Dimensions 83 4.3 Total/Scattered Field Formulation in Three Dimensions 85 4.3. A Plane Wave Impinging on a Dielectric Sphere 85 References 89 TWO APPLICATIONS USING FDTD 109 5.1 Simulation of a Microstrip Antenna 109 5.1.1 Description of the Problem 409 5.1.2 Modeling the Materials 110 5.1.3 Source 11 5.14 Boundary Conditions {11 5.1.5 Calculating the $,, 112 5.2 Calculation of the Far Field of an Aperture Antenna 113 5.2.1 Pormulating the Transformation from the Aperture 115 5.2.2 Verification of the Accuracy of the Transformation 118 2.3 FDTD Implementation of the Far Field Calculations 120 References 121 USING DTD FOR OTHER TYP! ES OF SIMULATION 133 6.1 The Acoustic FDTD Formulation 133 6.2 Simul: 6.2.1 Formulating the Schroedin, ion of the Schrocdinger Equation 136 cr Equation inte FOTD (37 6.2.2 Cafculating the Expectation Values of the Observables 138 6.23 Simulation of an Electron Striking @ Potential Barrier 139 References 140 THE Z TRANSFORM = 147 A.I Definition of the Z Transtorm 147 A2 Convolution Using the Z Transform 148 A.2.1 Proof of the Convolution Theorem 149 A2.2 Example: A Low-Pass Filter 150 A33 Convolution of Sampled Signals 152 A3.1 Simulation of a Two-Pole Digital Filter 152 4.3.2 Sum of Two Parallel ns 154. Contents ix Ad Alternative Methods to Formulate the Z Transform 155 Adu1 Backward Rectangular Approximation 156 AA42 Trapecoidal Approximation (Bifinear Transform) 157 AS Summary 158 References 159 INDEX 161 LIST OF C PROGRAMS 163 ABOUT THE AUTHOR | 165 Guide to the Book PURPOSE This book has one purpose only: to enable the reader or student to learn how to do three dimensional electromagnetic simulation using the finite-difference time-domain (FDTD) method. It does not attempt to explain the theory of FDTD simulation in great detail. It is not a survey of all possible approaches to the FDTD method nor is it a “cookbook” of applications. It is aimed at those who would like to learn to do FDTD simulation in a reasonable amount of time. FORMAT ‘This book is tutorial in nature. Every chapter attempts to address an additional level of complex- ity, The text increases in complexity in two major ways: Dimension of Simulation ‘Type of Material One-dimensional Free space Two-dimensional Dielectric material Three-dimensional Lossy dielectric material Frequency-dependent material The first section of Chapter 1 is one-dimensional simulation in free space. From there it progresses to more complicated media. In Chapter 2, the simulation of frequency-dependent media is addressed. Chapter 3 introduces two-dimensional simulation, including the simulation of plane waves and how to implement the perfectly matched layer. Chapter 4 introduces three- dimensional simulation. This is the approach taken throughout the book SPECIFIC CHOICES DEALING WITH SOME TOPICS ‘There are many ways to handle individual topics having to do with FDTD simulation, This book does not attempt to address all of them, In most cases, one single approach is taken and used xii Guide to the Book throughout the book for the sake of clarity. My philosophy is that when first learning the FDTD method, it is better to Jean one specific approach and learn it well rather ghant to be confused by switching among different approaches. In mos¢ cases, the approach being taught is this author's preference. That does not make it the only approach or even the best; it is just the approach that this author has found to be effective. In particular, the following are some of the choices that have been made L. The use of normatized (Gaussian) units. Maxwell's equations have been normalized by substituting This is a system called Gaussian units, which is frequently used by physicists. The reason for using it here is simplicity in the formulations. The E field and the H fields have the same order of magnitude, This has an advantage in formulating the perfectly matched layer (PML), which is a crucial part of FDTD simufation. 2. The PME far boundary conditions. The absorbing boundary conditions (ABCs) are an important topic in FDTD simulation. The ABCs prevent spurious reflections from the edge of the problem space, There are numerous approaches to this, but this book will use the perfectly matched layer (PML) for two- and three-dimensional simulation exclusively. (A simpler boundary condition will be used in one dimension just for convenience.) The ason is its effectiveness and versatility in working with different media. 3. Maxwell’s equations with flux density, There is some leeway in forming the tim domain Maxwell’s equations from which the FDTD formulation is devefoped. The fol- lowing is used in Chapter J E a 1 7 Lox 2 Hy This is a straightforward formulation and among the most commonly used. How: Chapter 2, the following formulation using the flux density is adopted: rer, by aD GP =UKH 8) D=eE 4) aH_ ot og xE 6 In this formutation, itis assumed that the materials being simulated are nonmagnetic; that is, H= lo? However, we will be dealing with a broad range of dielectric properties, so Eq. (4) could be a complicated convolution. There is a reason for using this formulation Eqs. (3) and (5) remain the same regardless of the material; any complicated mathemnat- jes stemming from the material is in Eq. (4). We will see that the solution of Eq. (4) can be looked upon as a digital filtering problem. In fact, the use of signal processing, techniques in FDTD simulation will be a recurring theme in this book. Z TRANSFORMS As mentioned above, the solution of Eq. (4) for most complicated material can be viewed as a digital filtering problem. That being the case, the most direct approach to solving the problem is Guide to the Book iti to take Eq. (4) into the Z domain. Z transforms are a regular part of electrical engineering educa- tion, but not that of physicists, mathematicians, and others, In teaching a graduate class on FDTD. simulation, I begin the semester by teaching two topics in parallel: FDTD simulation and Z. trans: forms, When we have progressed to the simulation of complicated dispersive materials, the stu- dents are ready to apply the Z transform theory. This had two distinct advantages over and above the simulation applications: (1) Electrical engineering students have had another application of Z. transforms io strengthen their understanding of signal processing and filter theory; and (2) phys- ies students and others now know and can use Z transforms, something that had not previously been part of their formal education, Based on my positive experience, | would encourage anyone using this book when teaching an FDTD course to consider this approach. However, I have left the option open to simulate dispersive methods with other techniques. The sections on Z transforms are optional and may be skipped. An appendix of Z transform theory is provided. PROGRAMMING EXERCISES ‘The philosophy behind this book is that the student will learn by doing. Therefore. the m: exercises involve programming, Each chapter has one or more FDTD programs written in C. If there is more than one program per chapter, typically only the first will be a complete program listing. The subsequent progs to the first program, For instance, section | of Chapter I describes one-dimensional FDTD simu- lation in free space. The program fd1d_1.1.c at the end of the chapter is a simul free space. Section 3 describes how a simple absorbing boundary condition is implemented, The program fdld_1.2.c is not a complete program, but shows the changes necessary to fdld_I.1.c to implement the boundary condition. Furthermore, important lines of code are highlighted in bold- face. jority of ns will not be Complete, but will only show changes as compared tion of a pulse in PROGRAMMING LANGUAGE The programs at the end of each chapter are written in the C programming language, The reasons, for this are the almost universal availability of C compilers on UNIX workstations. and the fact that so many engineers and scientists know C. However, the reader should keep one fact in mind: most researchers who do large scientific programming use FORTRAN because FORTRAN was written for scientific programming. The structured style of C may have aesthetic appeal, but it typically runs slower than FORTRAN. This is particularly true of supercomputers. Dennis M. Sullivan Electrical Engincering Deparinent University of Idaho Acknowledgments 1 am deeply indebted to Professor John Schneider of Washington State University for technical assistance, and to Ms. Judith C. Breedlove for editorial assistance. Dennis M. Sullivan Electrical Engineering Department University of Idaho One-Dimensional Simulation with the FDTD Method This chapter is a step-by-step introduction to the FDTD method. It begins with the simplest possible probiem, the simulation of a pulse propagating in free space in one dimension. ‘This example is used to illustrate the FDTD formulation, Subsequent sections lead to the formulation for more complicated media 1.1 ONE-DIMENSIONAL FREE SPACE FORMULATION ‘The time-dependent Maxwell's curl equations in free space are aE | 0F toy (ta) at on 1 = Vx E. (L.1b) at Me E and H ate vectors in three dimensions, so in general, Eq, (1.1) and (1.1b) represent three equations each. We will start with a simple one-dimensional case using only F, and Hy, so q. (I.1a) and (1.1) become (12a) (1.26) These are the equations of a plane wave with the electric field oriented in the x direction, the magnetic field oriented in the y direction, and traveling in the z direction. ‘Taking the central difference approximations for both the temporal and spatial derivatives gives Vy = Br Pay 1 AN 1/2) — Hk = 1/2) 13a Ar 0 Ax ‘ y Hy Nk + 1/2) — Hk + 1/2) LE a + EP) Ar Ho Ax (1.36) Chapter 1 m One-Dimensional Simulation with the FDTD Method In these two equations, time is specified by the superscripts, ie., “n” actually means a time 1 = Arn, Remember, we have to discretize everything for formulation into the computer. ‘The term “n + 1” means one time step later, The terms in parentheses represent distance, i.e., “k” actually means the distance z = Ax -k. (It might seem more sensible to use Az as the incremental step, since in this case we are going in the z direction. However, Ax is so commonly used for 2 spatial increment that I will use Ax.) The formulation of Eq. (1.3a) and (2.3) assumes that the E and H fields are interleaved in both space and time, Hf uses the arguments k + 1/2 and k — 1/2 to indicate that the H field values are assumed to be located between the E field values. This is illustrated in Fig. 1.1. Similarly, the m + 1/2 orm ~ 1/2 superscript indicates that it occurs slightly after or before n, respectively. Er" en re k ker fry a k een \ 7 gene V+ eee [oat ‘ ker | ev? Figure 11 Inerleving othe and Hs space time ine FDTD formulation To caleulate H,(k + 1/2), for instance, the neighboring values of Ey atk and k + 2 are needed. Similarly, tocalculate B, (+ 1). the valueof My atk + 1/2 and k-+ 11/2 are needed. Eq. (1.3a) and (1.3b) can be rearranged in an iterative algorithm: a ER 2 (ky = BMV) [HM (k + 1/2) — Hk 1/2) (4a) fo: A ; ; HOG 1/2) = HM + 1/2) Lf 1) EA). Ab) Bo Ax Notice that the calculations are interleaved in both space and time. In Eq. (1.4a), for example, the new value of E, is calculated from the previous value of E, and the most recent vatues of Hy. This is the fundamental paradigm of the finite-difference time-domain (FDTD) method [1]. Eqs. (1.4a) and (1.4b) are very simitar, but because &9 and j1y differ by several orders of magnitude, E, and #, will differ by several orders of magnitude. This is circumvented by making the following change of variables [2} [eo = Vino Substituting this into Eqs. (1.4a) and (1.4b) gives, 1 At Sk — RMR —1)2) Jets x E+ ND HEWN (1.60) He" (k + 1/2) = HM(k + 1/2) = 05} a gy = BYR) ~ Ar VEOH AX LES ke + 1) — B26) Section 1.1 @ One-Dimensional Free Space Formulation 3 Once the cell size Ax is chosen, then the time step Ar is determined by Ax Ar= 17 re ap where cy is the speed of light in free space. (The reason for this will be explained later) Therefore, 1A Ax/2-cy_ 1 aoe ag) Veoila Ax ‘Ax Rewriting Eqs. (1.6a) and (1.6b) in C computer code gives the following: extk] = extk] + 0.5*( hytk-2] - hyfid ) (1.9) hy] = hy(k] + 0.54( ex{k] - ex(ke2) ) (1.9) Note that the m or m+ 1/2 orn ~ 1/2 in the superscripts is gone. Time is implicit in the FDTD method. In Bq. (1.9a), the ex on the right side of the equal sign is the previous value atn ~ 1/2, and the ex on the left side is the new value, n + 1/2, which is being calculated. Position, however, is explicit. The only difference is that k + 1/2 and k ~ 1/2 ate rounded off to k and k ~ 1 in order to specify a position in an array in the program. ‘The program fdld_1.1.c at the end of the chapter is a simple one-dimensional FDTD. program. It generates a Gaussian pulse in the center of the problem space, and the pulse Propagates away in both directions as seen in Fig. 1.2. The Ey field is positive in both directions, but the Hy field is negative in the negative direction, ‘The following things are worth noting about the program: 1. The E, and Hy values are calculated by separate loops, and they employ the inter- leaving described above. 2. After the E, values are calculated, the source is calculated. This is done by simply specifying a value of E, at the point k = kc, and overriding what was previously calculated, This is referred to as a “hard source,” because a specific value is imposed on the FDTD geid. i : JN oe XY - : S = 0 2 40 B10 «20~SCOHOSSCGSSC«ROSSCO ' IN 10012006200 FDTD cells 20 40 Figure 1.2 FDTD simulation of a pulse in free space ater 100 time steps. The pulse ‘originated inthe center and travels outward 4 Chapter 1m One-Dimensionat Simulation with the FDTD Method PROBLEM SET 1.1 2, Get the program fd1d_1.1.€ running. What happens when the pulse hits the end of the atray? Why? Modify the program so ithas (wo sources, one at ke - 20 and one at ke + 20 (Notice that kes the center ofthe problem space). What happens when the pulses meet? Explain thi basie EM theory 3. Instead of B, a8 the source, use H, ate = Kee as the sourve, What difference does it make? Try a two-point magnetic source at ke = 1 and ke such that hy Tke-2] = ~hy [kc] ‘What does this look like? What does i correspond to physically? 1.2 STABILITY AND THE FDTD METHOD Let us retum (o the discussion of how we determine the time step. An electromagnetic wave propagating in free space cannot go faster than the speed of light. To propagate a distance of one cell requires a minimum time of Ar = Ax/cy. When we get to two-dimensional simulation, we have to allow for the propagation in the diagonal direction, which brings the time requirement to Ar = Ax/(<2co). Obviously, three-dimensional simulation requires At = Ax/(¥/3ep). This is summarized by the well-known “Courant Condition” (3, 4] ars — = Yae where n is the dimension of the simulation, Unless otherwise specified, throughout this book wwe will determine Ar by (10) Ax Ar= aap co ‘This is not necessarily the best formula; however, we will use it for simplicity, PROBLEM SET 1.2 1. In fld_1.1.e, go to the two governing equations, Eq, (1.9a) and (96). und ehange the factor 0.5 to 1.0. What happens? Change it t 1.1, Now what happens? Change it to .25 and see what happens. 1.3 THE ABSORBING BOUNDARY CONDITION IN ONE. DIMENSION Absorbing boundary conditions are necessary to keep outgoing E and Hf fields from being ‘effected back into the problem space. Normally, in calculating the E field, we need to know the surrounding H values; this is a fundamental assumption of the FDTD method. At the edge of the problem space we will not have the value to one side. However, We have an advantage because we know there are no sources outside the problem space. Therefore, the fields at the edge must be propagating outward. We will use these two facts to estimate the value at the end by using the value next to it [5] ‘Suppose we are looking for a boundary condition at the end where k = 0. Ifa wave is going toward a boundary in free space, itis traveling at ca, the speed of light, So in one time step of the FDTD algorithm, it travels distance = ey» At = ey - = Section 1.4 m Propagation in a Dielectric Medium equation basically explains that it takes (wo time steps for a wave front to cross one cell Soa common sense approach tells us that an acceptable boundary condition might be E10) = It is relatively easy to implement this. Simply store a value of E, (1) for two time step: then put it in ,(0). Boundary conditions such as these have been implemented at both ends of the E, array in the program fdld__1.2.c. (In the printout labeled fd1d_1.2.c at the end of the chapter, the entire program hasn't been reproduced, only those parts which are different from. fdld_1.1.c. Furthermore, key points are highlighted in boldface.) Figure 1.3 shows the results of a simulation using fd1d_1.2.c. A pulse that originates in the center propagates outward and. is absorbed without reflecting anything back into the problem space. i —— ato? wr 0s \ \ \ ° x . ne er 20 40 8010120 40 160180 2» 40 0 a ar 05 160180 30100 FDTD cells 2 a0 Figure 1.3 Simulation of an FDTD program with absorbing boundary conditions. Notice that the pulse is absorbed atthe edges without reflecting anything back PROBLEM SET 1.3 1. The program fdld_1.2.¢ has absorbing boundary conditions at both ends. Ge¢ this program running and test it to ensure the boundary conditions are completely absorbing the pulse, 4.4 PROPAGATION IN A DIELECTRIC MEDIUM In order to simulate a medium with a dielectric constant other than one, which corresponds to free space, we have to add the relative dielectric constant ¢, to Maxwell's equations: Bsa (13a) a ee oH __texe (1.13b) ar Ho Chapter 1 One-Dimensional Simulation with the FDTD Method We will stay with our one-dimensional example and make the change of variables in Eq. (1.5), ai 1 aman ar eJeoHo Oz any) Lae) ar Viola and then go to the finite difference approximations UR) Breve HN + 1/2) — HK +172 : oe H+ 12) ~ H+ 172) anes t Hk +1/2) Hel /2 ere (1.145) ar From the previous section 1 art Vinnie Ax 2 so Bq, (1.14) becomes peta egy ez 4 ones 1/2)— HR(k+ 1/2] (1.1Sa) & He (k + 1/2) = HM(k + 1/2) her We 1) — Bk) (1.15b) From these we can get the computer equations, ex[k] = ex(k] + cb(k)*(hy(k-1] + hy{k] } (1.16a) hy (kl = hy[k] + 0.5¥(exk] - ex(k+1) ), (1.166) where cbIk] = .5/epsilon (can) over those values of & which specify the dielectric material The program fd1d_1.3.c simulates the interaction of a pulse traveling in free space until it strikes a dielectric medium, The medium is specified by the parameter cb in Eq, (1.17). Figure 1.4 shows the result of a simulation with a dielectric medium having a relative dielectric constant of 4, Note that a portion of the pulse propagates into the medium and a portion is reflected, in keeping with basic EM theory {6} PROBLEM SET 1.4 ‘The program [dld_1.3.c simulates a problem partly containing free space and party dicieetie material. Run this program and duplicate the results of Fig. 14 2, Look at the relative amplitudes ofthe reffected and transmited pulses. Are they comect? Check thom by calvuiating the reflection and transmission coetficients. (See the appendix at the end of this chapter.) 3, Siill using a dielectric constant of 4, let the transmitted pulse propagate until it hits the far right wall. What happens? What could you do (o correct this? Section J.5 m Simulating Different Sources 7 7 po . 1] a i = —= _ 0s Eps=4 0 —_ 0s 4 10160 1KO 200 1. : Lassen \ - os T= 440 NE =4 4 a 20 40 BO oo -120~=COOSCSHSSCKSSC FDTD cells Fe L4 Simulation of a pulse striking 4 dielectric material with « dielectric constant of 4. The source originates at cell number 5. 1.5 SIMULATING DIFFERENT SOURCES In the first two programs, a source is assigned a value to E, ; this is referred to as a hard source. In fdld_1.3.c, however, a value is added to E, at a certain point; this is called a soft source. The reason is that with a hard source, a propagating pulse will see that value and be reflected, because a hard value of E,, Iooks like a metal wall to FDTD. With the soft source, a propagating pulse will just pass through, Up umtil now, we have been using a Gaussian pulse as the source. It is very easy to switch (0 a sinusoidal source. Just replace the parameter pulse with the following: pulse = sin(2*pitfreq intdt*T] ex[5] = ex[5] + pulse The parameter freq_in determines the frequency of the wave. This source is used in the program fdld_1.4.c, Figure 1.5 shows the same dielectric medium problem with a sinusoidal source. A frequency of 700 MHz is used. Notice that the simulation was stopped before the wave reached the far right side. Remember that we have an absorbing boundary condition, but it was only for free space! Note that in fd1d_1.4.c the cell size ddx and the time step dt are specified explicitly. We do this because we need dt in the calculation of pulse. The cell size ddx is only specified because it is needed to calculate de: from Eq. (1.7). 8 Chapter 1m One-Dimensional Simulation with the FDTD Method pg a e006 TO 2 so To 1 FDTD cells Figure 1.8 Simulation of « propagating sinusoidal wave of 700 Miiz striking a mediam, with a relative diclectie constant of 4. PROBLEM SET 1.5 1. Modify your program fdld_1.3.¢ 10 simulate the sinusoidal source (see fld_1 4.0. 2, Keep increasing yourincident frequency from 700 MHz upward at intervals of 300 MHz. What happens? 3. A type of propagating wave function that is of great interest in areas such as optics is the “wave packet,” which is a sinusoidal funetion in a Gaussian envelope. Modify your program to simulate a wave packet 1.6 DETERMINING CELL SIZE Choosing the cell size to he used nan FDTD formulation is similar to any approximation procedure: enough sampling points must be taken (o ensure that an adequate representation is made. The number of points per wavelength is dependent on many factors (3, 4]. However, a good rule of thumb is 10 points per wavelength. Experience has shown this to be adequate. with inaccuracies appearing as soon as the sampling drops below this rate Naturally, we must use a worst-case scenario. In general, this will involve looking at the highest frequencies we are simulating and determining the corresponding wavelength. For instance, suppose we are running simulations at 400 MHz, In free space, EM energy will propagate at the wavelength eo 400 MHz Ir we were only simulating free space we could choose de (1.18) Ax = y/10 = 7.5 em. However, if we are simulating EM propagation in biological tissues, for instance, we must look at the wavelengths in the tissue with the highest dielectric constant, because this will have the corresponding shortest wavelength, For instance, muscle has a relative dielectrie constant (of about 50 at 400 MHz, so ¢o/V50_ 424 x 10% m/sec eo Oe = 10.6em, 19) 400 MHz ~ 4x 10% sec and we would probably select a cell size of one centimeter. tion 1.7 Propagation in a Lossy Dielectric Medium 9 PROBLEM SET 1.6 1. Simulate @ 3-GHz sine wave impinging on a material with a dielectric constant of ¢, = 20. 1.7 PROPAGATION IN A LOSSY DIELECTRIC MEDIUM So far, we have si ulated EM propagation in free space or in simple media that are specified by the relative dielectric constant ¢,.. However, there are many media that also have a loss tetm specified by the conductivity. This loss termi results in the attenuation of the propagating energy ‘Once more we will start with the time-dependent Maxwell's curl equations, but we will write them in a more general form, which will allow us to simulate propagation in media that have conductivity ak VxH-J (1.20a) ar a, \ See (1.20b) ar ju J is the current density, which can also be written Jao-E, where o is the conductivity. Putting this into Eq. (1.208) and dividing through by the dielectric constant we get aE o = —-V x H- ar vey eae, We now revert fo our simple one-dimensional equation o En) ee and make the change of variable in Eq. (1.5), which gives aE 1 aH o - iw Ey (2ia) ar ee Jinn a2 en aH) 1 a8, ae (1.21) ar evan a: Next take the finite difference approximations for both the temporal and spatial derivatives, similar to Eq. (1.3ay 2 Hk 1/2) — Hk = 1/2) o een Notice that the last term in Eq. (1.214) is approximated as the average across two time s in Eg, (1.22). From the previous section 1 art Violin Ax wo Chapter} @ One-Dimensional Simulation with the FDTD Method so Eg, (1.22) becomes Er) [ aaa “ 2660 Feral ew 2] ere Yan, " = et 2) ~ Hk ~ 1/2)) 12 A ONT ae From these we can get the computer equations | (k + 1/2) — A (k ~ 1/2) ex(k] = calk]*extk] + cbtk] *( hy(k-2] - hy(k) } (1.23a) hy(k] = hyTk] + 0.5*( ex(k] - ex{k+i) ), (1.23b) where eaf = dt*sigma/(2*epsz*epsilon) (24a) ca(k] = (2. - eaf}/(1. + eat} (240) ebIk] =0.5/(epsilon* (1. + eaf)). (1.24) ‘The program {d1d_1.5.c simulates a sinusoidal wave hitting alossy medium that has adielectric constant of 4 and aconductivity of 0.04. The pulse is generated at the far eft side and propagates to the right. This is illustrated in Fig. 1.6. Notice that the waveform in the medium is absorbed before it hits the boundary, so we don’t have to worry about absorbing boundary conditions. 2% 40 OSSCKSCSSCSSCOSSCSSC EDTD cells Figure 1.6 Simulation ofa propagating sinusoidal wave stiking lossy dielectric material ‘with adielectric constant of 4 and a conductivity of O14 (Sim). The source is 714) MH, and originates at cell number 5, PROBLEM SET 1.7 1. Run program fald_I.S.c to simulate a complex dielectric material. Duplicate the results of Fig. 16, 2. Verify that your calculation ofthe sine wave inthe lossy dielectric is correct, ie. it isthe correct amplitude going into the slab, and then it attenuates at the proper rate. You can best do this by ‘writing a litte program that calculates the parameters given in the appendix of this chapter, 3. How would you write an absorbing boundary condition for a lossy material? 4, Simulate a pulse hitting a metal wall. This is very easy to do, if you remember that metal has a very high conductivity. For the compiex dietectric, justuse o = f.6, or aay targe aubes. (HC does not have to be the correct conductivity of the metal, just very large.) What does this do to the FDTD parameters ca and cb? What result does this have for the field parameters E, and H,2 I you dicin’e want co specify dictectric parameters, how else coukt you simulate metat ia an FDTD program? References u APPENDIX 1.4 When a plane wave traveling in medium | strikes a medium 2, the fraction that is refected is, given by the reflection coefficient I, and the fraction that is transmitted into medium 2 is given by the transmission coefficient v. These are determined by the intrinsic impedances 7, and 3 of the respective media (6, p. 398) (LAL) (.A.2) The impedances are given by n=/+ (a3 "= Vevey » where «7 is the complex relative dielectric constant eset. Joey For the case where 2 = jup, Eqs. (1.A.1) and (1.A.2) become (Aa) (LAS) The amplitude of an clectric field propagating in the positive z direction in a lossy dielectsic medium is given by Eye tee-iP= where Eo is the amplitude at z = 0. The parameters # and f are determined by the dielectric constant ¢,, the conductivity o, and the radian frequency « = 2:rf of the propagating wave, via the following two formulas [6, p. 420}: v+( < ) -1 (Np/m) (1.46) coEye, (S) REFERENCES HI (rad/m), (LAT) LI] K.S. Yee, Numerical solution of initial boundary value problems involving Maxwell's equations in isotropic media, IEEE Trans. Antennas and Propagar., vol. 17, 1966, pp. 585~589. [2] A. Taflove and M. Brodwin, Numerical solution of steady state electromagnetic scattering problems using the time-dependent Maxwell's equations, /EEE Trans, Microwave Theory Tech., vol. 23, 1975, pp. 623-730. R Chapter 1m One-Dimensional Simulation with the FDTD Method 1B] A. Taflove, Computation Electrodynamics: The Finite-Difference Time-Domain Method. Boston, MA: Artech House, 1995 [4] K.S. Kunz and R.J. Luebbers, The Finite Difference Time Domain Method for Electromagnetics Boca Raton, FL: CRC Press, 1993 {5} G. Mur, Absorbing boundary conditions forthe finte-difference approximation of the time domain electromagnetic field equations, IEEE Trans. Electromagn. Compat., vol. 23, 1981, pp. 377-384 {6} D.K. Cheng, Field and Wave Electromagnetics, Menio Park, CA: Addison-Wesley, 1992 € Programs B /* PDID_l.1.c, 1D FDTD simulation in free space */ # include # include # include fdefine KE 200 /* KE is the number of cells to be used */ main () { float ex(KE] ,hy [KE] ; int n,k, ke, ke, NSTEPS; oat T; float t0,spread, pulse; FILE *fp, *fopen(}; /* Initialize */ for ( kel; k < KE; ks) ex{k] = 0; hy([k] = 0. } ke = KE/2:; /* Center of the problem space */ £0 = 40.0 /* Center of the incident pulse */ spread /* Width of the incident pulse */ T= NSTEPS = 1; while ( NSTEPS > 0 ) printf( "NSTEPS --> "); /* NSTEPS is the number of times the */ scanf("$d", gNSTEPS) ; /* main loop has executed */ printf ("td \n", NSTEPS); n= 0; for ( nz1; n <=NSTEPS ; n++) { TeT+a; /* T keeps track of the total number +/ /* of times the main loop is executed */ /* Main FDTD Loop */ /* Calculate the Ex field */ for (kel; k < KE; k++ ) { extk] = ex(k) + .5#( hy(k-2] - hylk) ) 3 } /* Put a Gaussian pulse in the middle */ pulse = exp(-.5*(pow( (t0-T)/spread ex(ke] = pulse; printf ( "45.1f 46.2£\n",to-T,ex[kel) ; 4 ‘Chapter 1 One-Dimensional Simulation with the FDTD Method /* Calculate the Ry field */ for ( k#0; k < KE-1; k++ ) { hy(k) = hy(k) + .5¢( extk] - exfkel] ) i} } /* End of the Main FDTD Loop */ /* At the end of the calculation, print out the Ex and Hy fields */ for ( ko c= KE; kee ) { print( "#3d 9 %6.2f $6.2£\n",k,ex(k] ,Ay[k]); } /* Write the £ field out to a file "Ex" */ fp = topen( "Ex", "W") ; for ( kel; k <= KB: ket) { fprinte( fp," 6.2£ \n",extk]); } fclose (fp); /* Weite the H field out toa file "Hy" +/ fp = fopen( "Hy", "W"); for ( kel; k <= RE; ktt { fprinte( fp," ¥6.2€ \n",hy(k]); } fclose (fp) + printf ( *T = %5.0f\n",7); € Programs 1s /* FDID_1.2.c. 1D FDTD simulation in free space */ /* Absorbing Boundary Condition added */ main () float ex (KE) , hy [KE] ; float ex_low ml,ex_low m2,ex high ml,ex high m2; STEPS ; n++) TeT+1; /* Main FDTD Loop */ {* Calculate the Bx field */ for ( ok < KE; k++ ) ( extk] = ex(kl + .5#( by{k-2] - hylk] ) ; } /* Put a Gaussian pulse in the middle */ pulse =.5*(pow( (t0-T) /spread,2.0) )); ex{kel = ex(ke] + pulse; printf ( "$5.1£ $6.26 ¥6.2£'cn",to-T,arg,ex (kel); /* Absorbing Boundary Conditions */ ex(0] ex_low_m2; ex_low_m2 ex_low_m1, ex_low mi ex (11; ex (KE-1] ex _high_m2; ex high m2 = ex_high_m1; ex high ml ex(KE-217 /* Calculate the Hy field */ for ( k-0; k < KB-1; k++ ) ( hy(k] = by(k] + .5*( extk] - extke1] ) ; } } /* Bnd of the Main FDTD Loop */ 16 Chapter 1 One-Dimensional Simulation with the FDTD Method /* FDID_1.3.c. */ /* Simalation of a pulse hitting a dielectric medium */ main () { float ex (KE) ,hy(KE]; int n,k,ke, ke, ketart, nsteps; float ddx,dt,T,epsz,epsilon, sigma, eat; float cb [KE]; for (kel; k <= KE; ker) { /¥ Initialize to free space */ cbik] = .5; ) print£( "Dielectric starts at --> *): scant ("d", skstart) print£( "Epsilon --> *); scant ("%f", kepsilon) ; printf ("d ¥6.2£ \n", katart, epsilon); for ( kekstart; k cb[k] = .5/epsilon; ) for ( kel; k <= KE; kes } { printf( "82d $4.2£\n",k,cb(kl); } KE; ker) { /* Main part of the program ¥/ while (nsteps > 0) { printf ( "nsteps --> “); scanf("td", gnstepsi; printf ("sd \n", nsteps) ; for ( n=l; n <=nsteps ; n++) { TeT+a /* Calculate the Bx field */ for ( k=O; k < KE; k++) { extk] = exfk) + cb{ki*( hyfk-1] - hy(k] ) ; } /* Put a Gaussian pulse at the low end */ pulse = exp(~.5# (pow! (t0-T) /spread,2.0))); ex(5] = ex{5] + pulse; print£( "#5.1f %6.2f %6.2f\n",7,pulse,ex(S]) ; Programs. a /* FDID_1.4.c. */ ys: lation of a sinusoidal wave hitting a dielectric medium */ float ddx, dt; float freq_in; dax = .01; /* Set the cell size to 1 cm */ dt = dadx/(2*3e8) /* Calculate the time step */ /* These parameters specify the input pulse */ printé( "Input freq (Miz)--> ")7 scant ("f", gfreq in); freq_in = freq in*le6; printe(" %8.0f \n", freq in); T= 0; nsteps = 1; /* Main part of the progam */ while (nsteps > 0} { / printf ( "nsteps --> "); scant ("$d", &nsteps) ; print ("¥d \n", nsteps) ; for ( nel; n <=nsteps ; t+) { Tetsd; /* Calculate the Ex field */ for ( ka0; k < KB; k++) { extk] = ex(k] + cb(k)*( byfk-1] - hytkl ) 7 } /* Put a sinusoidal source at cell 5 po pulse = sin(2*pitfreg in*dt*T); ex(5] = ex(5] + pulse; print£( "$5.1f %6.2£ %6.2£\n",T,pulse,ex(5]); 8 Chapter | m One-Dimensional Simulation with the FDTD Method /#PD1D_1.5.c, 1D FDTD simulation of a lossy dielectric medium */ float cafKEl ,cb [KE] ; epaz = 8.85419e-12; for ( k=1; k calk] = 2 cb{k) = ) KE; kv+ ) { /# Initialize to free space */ printf ( "Dielectric starts at --> "); scanf("td", akstart) ; print£( "Epsilon --> "); scant ("%£", gepsilon) ; printf ( "Conductivity --> "); scant ("%E", &eigna); print£ ("td 36.2f %6.2£ \n", kstart,epsilon, sigma); eaf = at+sigma/(2*epsz*epsiton) ; printf (* %6.4f \n", eat); for ( kekstart; k <= KE k++) { catk] = (1. - eaf)/(1 + eaf) ; ebtk] = .5/(epailony(1 + eat) ); } /* Main part of the program */ /* Calculate the Ex field */ for ( k=0; k < KE; kee ) { extk] = calk]*ex(k] + cb{k]*( hy(k-1] - hy[k] ) 7 } More on One-Dimensional Simulation Before moving on to two- and three-dimensional problems, we will stay with one-dimensional simulation in order to introduce some advanced concepts. First we will change the formulation slightly and introduce the use of the flux density into the simulation, This may initially seem like an unnecessary complication, However, as we get to frequency-dependent materials in section 2.3, the advantages will become apparent. Then in section 2.2 we introduce the use of the discrete Fourier transform in FDTD simulation. This is an extremely powerful method to quantify the output of the simulation. It should become very apparent in this chapter how closely signal processing is linked to time-domain EM si transforms to simulate complicated media. ulation. This will be most obvious in section 2.4, where we use Z. 2.1 REFORMULATION USING THE FLUX DENSITY Up to now, we have been using the form of Maxwell's equations given in Eq. (1.1), which uses only the E and the H fields. However, a more general form is aD ae Z at (2.1a) D(w) = €- €{(@) + E(w) Q.1b) Qe) where D is the electric flux density. Notice that Eq, (2.1b) is written in the frequency domain. The reason for this will be explained later. We will begin by normalizing these equations, using » 20 Chapter 2. More on One-Dimensional Simulation which leads to ab 1 = _vxn 2.3a) a” Jena ean) Dio) = ef) - E(w) (2.3b) aH 1 a —_vxé. 2. a Joa ** 30) We saw in Chapter £ that this form of Eqs. (2.3a) and (2.3c) will lead to the very simple finite difference equations, Eq. (I.4a) and (1.4b), ‘The only change is the use of D instead of E. However, we still have to get Eq. (2.36) into a time domain difference equation for implementation into FDTD, The first task is to get it from the frequency domain to the time domain, We will assume we are dealing with a lossy dielectric medium of the form, Qa) and substitute Eq. (2.4) into (2.36): Dio) = 6, - E(w) + — Elo) @5) Foe Taking the first term into the time domain is not a problem because itis simple multiplication. In the second term, Fourier theory tells us that 1/j in the frequency domain is integration in the time domain, so Eq. (2.5) hecomes DO = BOS | BO)-ar’ 0 by We will want to go to the sampled time domain, so the integral will be approximated as a summation over the ime steps Ar: D' =e, E+ El (2.6) imo Note that E and D are specified at time t = n- At. There is one problem remaining: looking back at Bq. (2.3b), we see that we have to solve for E" given the value D". Unfortunately, the Value £" is needed in the calculation of the summation. We will circumvent this by separating the E* term from the rest of the summation: a-At., oat Di =e, EM + rT el Now we can calculate £* from nt oat £0 ind At (2.7) e+ & We can calculate E", the current value of E, from the current value of D and previous values of E. Itwill prove advantageous to define a new parameter for the summation eat ty fim Section 2.2 = ‘alculating the Frequency Domain Output a so Eq, (2.7) can be reformulated with the following two equations: phere Pa (2.8a) e+ £0 oat mai"! 4 EB". (2.8b) 0 Note that the summation is calculated by Eg. (2.8b), which, at every time step 1, simply adds the value £” times the constant term to the previous values of the summation at n — 1. Ttis not necessary to store all the value of £" from 0 to n! Now the entire FDTD formulation is axtk] = dx{k] + .5*( ny(k-2) - hy(kl ) (2.9a) extk] = gaxtk]*( dx(k) - ixtk) ) (2.9) Axl] = Axi) + gbx {k) ¥ex (k] (2.9) hy[k] = hy(k] + .5* ( ex(k] - ex(k+2] (2.94) where gax{k] = 1/(epsilont (signa*dt /epsz)) (2.10a) gbx{k] = sigmatdt/epsz. (2.10b) ‘The important point is this: all of the information regarding the mediais contained in Egs. (2.9b) and (2.9¢). For free space, gax = 1 and gbx = 0.; forlossy material, gaxand gbx are calculated according to Eqs. (2.10a) and (2.10b). In calculating ex (k] at the point k, it uses. only values of dx (k] and previous values of ex {k] in the time domain. Equations (2.9a) and (2.9d), which contain the spatial derivatives, do not change regardless of the media! It may seem as though we have paid a high price for this fancy formulation compared to the formulation of Chapter 1. We now need D, as well as E, and an auxiliary parameter i.x. The real advantage comes when we deal with more complicated materials, as we'll see in the following sections PROBLEM SET 2.1 1. The program fd1d_2.1.cimplements the reformulation using the flux density. Get this program running and repeat the results of problem 1.7.1 2.2 CALCULATING THE FREQUENCY DOMAIN OUTPUT Up until now, the output of our FDTD programs has been the E field itself, and we have been content to simply watch a pulse or sine wave propagate through various media. Needless to say, before any such practical applications can be implemented, it will be necessary to quantify the results. Suppose now that we are asked to calculate the E field distribution at every point in a dielectric medium subject to illumination at various frequencies. One approach would be to use a sinusoidal source and iterate the FDTD program until we observe that a steady state has been reached, and determine the resulting amplitude and phase at every point of interest jum, This would work, but then we must repeat the process for every frequency of interest. System theory tells us that we can get the response to every frequency if we use an impulse as the source, We could go back to using the Gaussian pulse, which, if it is narrow enough, is a good approximation to an impulse, We then iterate the FDTD program until the pulse has died out, and take the Fourier transform of the £ fields in the slab. If we have the Fourier transform of the E field at a point, then we know the amplitude and phase of the E field that would result from illumination by any sinusoidal source. This, too, has a very setious inthen 2 Chapter 2s More on One-Dimensional Simulation drawback: the E field for all the time domain data at every point of interest would have to be stored until the FDTD program is through iterating so the Fourier transform of the data could be taken, presumably using a fas! Fourier transform algorithm. This presents 2 logistical nightmare. Here is an alternative. Suppose we want to calculate the Fourier transform of the E field E(0) ata frequency f,. This can be done by the equation Qip Notice that the lower limit of the integral is 0 because the FDTD program assumes all causal functions, The upper limit is fr, the time at which the FDTD iteration is halted. Rewriting (2.11) in a finite difference form, r ED = YO El B1) Phir 2.2) Where T is the number of iterations and Ar is the time step, so fr = T - At. Equation (2.12) may be divided into its real and imaginary parts A E(f) = D> Ela At) -cos(2z fy - Arn) 1 2.13) — {LEM - An -sinQa fs Arn) which may be implemented in computer code by real_pt{m,k] = real_ptim,k] + ex(k]*cos(2*pitfreq(m)¥ét*n) ——(2.14a) imag_pt ([m,k] = imag_pt{m,kl + ex(k]*sin(2*pitfreq(m)*dt+n). — (2.14b) For every point k, in the region of interest, we require only two buffers for every frequency of interest f,. At any point k, from the real part of E( fi), real_pt (m, k] and the imaginary part imag_pt [m, k], we can determine the amplitude and phase at the frequency fy amp {m,k] = s (pow (xeal_pt [m,k} ,2.) +pow(imag_pt fm,k],2.)) (2.15a) phase {m,k] = atan2(imag_pt [m,k] ,real_pt (m,k]} (2.15b) Note that there is an amplitude and phase associated with every frequency at each cell (1, 2]. The program fdld_2.2.c at the end of the chapter caleulates the frequency response at three frequencies throughout the problem space. Figure 2.1 is a simulation of a pulse hitting a dielectric medium with a dielectric constant of 4, similar to Fig. 1.4. The frequency response at 500 MHz is also displayed. At T = 200, before the pulse has hit the medium, the frequency response is | through that part of the space where the pulse has traveled. After 400 time steps, the pulse has hit the medium, and some of it has penetrated into the medium and some of it has been reflected. The amplitude of the transmitted pulse is determined by Eq. (1.4.2) at the end of Chapter 1, eee 1+ v4 which is the Fourier amplitude in the medium. ‘The Fourier amplitude outside the medium varies between I — .333 and 1 + .333. This is in keeping with the pattern formed by the standing wave that is created from a sinusoidal signal, whose reflected wave is interacting with the original incident wave. 667, Section 2.3 @ Frequency-Dependent Media 23 1—> ‘Time Domain 7 a, a nT ) ¥req. Domain at S00 MHz a ° 20 40 60 80 100 120 140 160, 180 200 | a a a a

10'). Atthis frequency, the free space wavelengthis 3x 108 ~ ax 108 In following our rute of thumb of at least ten points per wavelength, a cell size of one nanome- ter, ie., Ax = 10°, willbe used. Figure 2.4 shows our first simulation at 500 THz, well below the plasma frequency. The incident pulse is a sine wave inside a Gaussian envelope. Notice that it interacts with the plasma slmost as if it were a metal barrier and is almost completely reflected. Figure 2.5 is a similar simulation at 4000 THz, well above the plasma frequency. A small portion of itis reflected, but the majority of the pulse passes right through. 0.75 x 1077 Chapter 2 More on One-Dimensional Simufation 7 30 «tO OSSCDSSCSCSSCOSCAS «SO a ee a Ce) Figure 2.4 Simulation of a wave propagating in ree space and striking a plasma medium. “The plasma has the properties of iver; Jp = 2000 THz and v, = 57 THe. the ‘propagating wave has a center frequency of $00 THz. After 1200 time steps, it has been completely eeflocted by the plasma, Phasma Figure 2 Simulation of «wave propating in fee space and striking a plasma mediom, “The plasma has the properties of silver: fy = 2000 THe and », = 57 TH ‘The propagating wave hes 3 center Frequency of 4000 THe. Aer 1000 hme step. ithas completely passed trough the plasma PROBLEM SET 2.4 1. Modify the program fdld_2.3.¢ to simulate plasma and duplicate the results of Figs. 2.4 and 2.5. This is much easier than it might look. First change your cell size to | nanometer. Then replace the calculation of the F field for a lossy Debye medium with that of Eqs. 2.38). Alter doing the simulations at SD THz and 4000 THz, sepeat at 2000 THz. What happens? 2. Repeat problem 2.4.1, hut use a narrow Gaussian pulse as your input and calculate the fre- quency response at 500, 2000, and 4000 THz, Does the result look the way you would expect, particufarty at 2000 TH2? Section 2.5 m Formulating a Lorentz Medium 3 2.5 FORMULATING A LORENTZ MEDIUM ‘The Debye model described a single-pole frequency dependence, We move now to the next level, which is a two-pole dependence referred to as a Lorentz, formulation: ef(w) =e, + ———""___, 2.39) vne()-) Figure 2.6 is a graph of the dielectric constant and conductivity of a material with the following Lorentz parameters: €, = 2, €, = 2, fo = 100 MHz, 8 = .25 (wp = 2x fo). To simulate a Lorentz medium in the FDTD formulation, we first put Eg. (2.39) into Eq. (2.36), a) El) EEE TS SNE 1428 (2) _ (2) F289 (2.40) = 6 E(w) + Sw), where we have again defined an auxiliary term, ote, Wi + jo2%Boan + (joy We will use the ADE method to move this to the time domain, Start by rewriting it in the following manner: Do) = & E(w) + S(w) EW) (a + j28a + (jo)") S@) = oF, Eo), Finally, we proceed to the finite difference approxim: ; Shed gri2get a gee aS" + 28qa%9$-— ++ Ree"! : Far ar oad A few things are worth noting: the second-order derivative generated a second-order differ- encing as(t) _ S*— 28") 4 $n ae ar ‘The first-order equation is taken over two time steps instead of one: ds). Ss" dr Dielectric constant Conductivity os 4 0 p AN 2 & J \ 001 ° ~ ee 10) 10° to to 10 10" Frequency (MH) Frequency (MHz) Figure 2.6 Relative dielectric constant and conductivity as functions of frequency for a Lorenta medium with the following properties: 2.81 =2, fo = 100 MHz, 5 = 25. 32 Chapter 2 a More on One-Dimensional Simulation This was done because the second-order derivative spanned two time steps. Next, we solve for the newest value of S: S00 | 1 fo2 2 (50% (2 + Ja (ag - +r (* s (Sy ‘ wt a s art (“2 ; 1 At Ar (2= AP 08) oy = Atb000) oy a, AP aer (1# Arig)” TF AtBa0)” (1 do@p 0) Now let’s go back to Eq. (2.40) and take it (© the sampled time domain = ajc E" ent (2.43) D=e,k" +S"; and since we are interested in solving for E, we'll write it as pr-s" e Notice that we already have a solution for S" in Eq. (2.41). And since we need only the previous value of E, ie., E"~', we are in business! We don’t need to worry about expanding the auxiliary term to make sure they don’t require values of E that we don’t have yet. Let's try a different approach. Go back to Eq. (2.39). An alternative form of the Lorentz formulation is 1E(), (2.42) where B= any — 35 At this point, we can go to Table A.1 and look up the corresponding Z. transform, which gives enw a. sin(B- Ar) Ar-z! S@ = Tyee cos Bane) +e yerE(o). ‘The corresponding sampled time domain equation is P44! sin (B-At)y Aree bE"! (2.43) Well and good. Bat if both methods are correct, they should both yield the same answers, which means the corresponding terms in Eqs. (2.41) and (2.43) should be the same. Let’s see if that’s true amas SY = 2e-* cos (B- At) S™! —? term: We saw earlier that (1 = Arbo00) C+ At8.00)" 2am At Section 2.5 @ Formulating @ Lorentz Medium 3 E*-" term: If B- Ar & 1, then sin(B - Ar) = (At), and fe B-Ar et sin AN y-At=— yar ad Tta-ar'” aR _ (oi 5 ar) oy ge 0 © T# 89a + Ar ~ 1+ Bat yi ‘S*" term: By using a Taylor series expansion of the cosine function, we get (tw )( B an") (Ban? _ 2-03 - (1-8) Ai I+q@-Ar 1+ wpydp > Ar ‘The last step is perhaps our weakest one. In depends upon 8 being small compared to | so 6? will be negligible. 2e-#* cos(B - At) = 2.5.1 Simulation of Human Muscle Tissue ‘We will end with the simulation of human muscle tissue, Muscle tissue can be adequately simulated over a frequency range of about two decades with the following formulation: ep e5(w) =e, + —— +5, jot “(op +e) + fawto? (2.44) (Problem 2.5.2 addresses how one determines the specific parameters, but we will not be concerned with that here.) Inserting Eq. (2.44) into Eq. (2.1b} and taking the Z transforms we get o-At/eo e7@ 84 sin(wy AD) At z D(z) = Bt) + EO. Bz) + 6, “FC 2) = sr Efe) + l=z! @+az 2e-®4! cos(ey - At) - 2~* + e2# tz w (2.45) We will define two auxiliary parameters: 1(2) = (2.46a) ee sin(wo - Ar) - Ar- E(@) S(z) = ELS Sno “AD OTE) 2.460) © = 36-68 costa AN) 271 ea ‘ Now Eq. (2.45) becomes D(z) = €,E(z) + I(2) + 27*S(2), 47) Once we have calculated F(z), /(z) and S(z) can be calculated from Eqs. (2.46a) and (2.46b): A 1a) = 1 + ee) (2.484) 0 S(z) = 2e~*4! costa + A) 27" S(z) 2) costeop - Ar) +27 S(2) an 278(2) +e, eT. sin(wy - Ar)- Ar» EC): Remember that in calculating E(z), we need the previous value of S(z) (as indicated by 2°'S(z)), the present value of D(z), and the present value of /(z). The present value of D(z) Chapter 2 s More on One-Dimensional Simulation is not a problem because, in the order in which the algorithm is implemented, it has already been calculated in Eq. (2.18). However, we will need the expanded version of I(z). Equation (2.47) becomes o D(z) = € E(z) +2 fz) + EW) +2 SG), e0 from which E(z) can be calculated by (2.499) (2.490) 2e-*** cos(wy + At) + z7!S(z) _ poten (2.49¢) *8(z) + ey e°* 8! - sin(wy - At)» Ar» E(2). Note that (2) did not have Co be expanded out because it already had a z numerator. in the PROBLEM SET 2.5 1. Modify fi1d_2.3.cto simulate a Lorentz medium with the properties used in Fig, 2,6. Caleulate the Fourier amplitudes at 50, 100, and 200 Metz. tn light of Fig 2.6, do you get the results you expect? 2 Quantify the results of problem 2.5.1 by comparing thert with analytic cafculations of the reflection coefficient and transmission coefficient at the three frequencies using Appendix 1. 3. FDTD simulation has been used extensively to model the effects of lectramagnetie radiation ‘on human tissue both for safety {8} and for therapeutic applications {9]. Human muscle tissue is highly frequency dependent. Table 2.1 shows how the dielectric constant and conductivity ‘of muscle vary with frequency {10}. Other tissues display similar frequency dependence {11}. TABLE 23 Properties of Human Moscte Ti Frequency (MHz) Dielectric Constant Conductivity (S/an} 10 160 025 40 7 693 10 n 89 200 365 1.28 300 54 137 433 33 143, 91s 31 2.60 Write a program ¢o calculate vatues of ¢, 0. x1, and fy that would give an adequate Debye representation of the data in Table 2.1. You probably will not be able to fit the values exactly. (Pint: Do nor try for a purely analytic solution; do ic by tial and error. Tn other words, have your program prompt You for the parameters €, 0, x1, and tp and then calculate and display the effective dielectric constant and conductivity at each frequency of interest,} Then write a program that will doa similar calculation for the Lorentz parameters. Which one is better? 4, Using a Debye or Lorentz formulation, use the parameters you found from problem 2.5.3 to do a simuiation of a pulse striking a medium of muscle tissue at 50, 100, and 433 MHz References 38 REFERENCES [1] C.M. Purse, 8, P. Mathur, and ©. P. Gandhi, Improvements to the finite-difference time-domain method for calculating the radar cross section of a perfectly conducting target, /EEE Trans, Mi- crowave Theory and Tech. vol. MTT-38, July 1990, pp. 919-927, [2] D.M. Sullivan, Mathematical methods for treatment planning in deep regional hyperthermia, J Trans. Microwave Theory and Tech., vol. MTT-39, May 1991, pp. 864-872, [3] R.Luebbers, F. Hunsberger, K. Kunz, R. Standler, and M, Schneider, A frequency # include # include fidefine KE 200 main () { float dx (ke) ex (KEL , hy (kB) , ix (KE) + float ga [KE] ,gb IKE] ; int n,k,ke,ke, kstart ,nsteps; float ddx.dt,T,epsz,epsilon, sigma; float ¢0,spread,pi,freq_in,arg, pulse; FILE *fp, *fopen(); float ex_low_ml,ex_low_m2,ex_high_ml,ex_high_m2; pi = 3.14159; ke = KE/2; /+ center of the problem space */ ddx = .01; /* Cell size */ dt = ddx/6e8; /* Time steps */ epsz = 8.8e-12; { /* Initialize to free space * printf "Dielectric starts at scanf("$d", &kstart); printf£( "Epsilon --> scant ("$f", wepsilon) ; printf ( "Conductivity scanf("8£", gsigma); Printé("$d %6.2f %6.2£ \n", kstart,epsilon, signa); > for ( kekstart; k <= KB: kes) { galk) = 1./(epsilon + sigma*dt/epsz) ; gb{k] = sigmatdt/epsz ; } for ( kel; k <= KE; kes ) ( printe( "2d $4.2f $4.2£\n",k,gafk] ,gb{k]); } /* These parameters specify the input pulse */ C Programs £0 = 50.0; spread = 20,0; Teo nsteps = 1; /* Main part of the program */ while ( nsteps > 0) { printf ( ‘nsteps scanfi*sd*, unsteps) ; printf ("td \n", nsteps); for (nel; a { neteps ; nit) /* Calculate the Dx field */ for (kel; k < KE; kes ) { dxtk] = dx(k] + 0,.5*( hy[k-1] - hy[kl ) ; } /* Put a Gaussian pulse at the low end */ freq, 308; pulse = exp(-.5* (pow( (t0-T) /spread,2.0))); dx{ke] = dx{ke] + pulse; printf ( "$5.1£ %6.2£ 86.2£\n",T, pulse, dx [ke]; /* calculate Ex from Dx */ for ( k=0; k < KE-1; k++ ) { exlk) = galk)*(dxtk} - ix [fe] ixfk) = ix[(k] + gb{k]+ex(k]; } {* Boundary conditions */ ex [0] = ex_low_m2; ex_low.m2 = ex_low_ml; ow ml = ex[il; ex(KE-1] = ex_high_m2; ex_high_m2 = ex_high_m1; ex high m= ex(KE-2]; {+ caleulate the Hy field +/ for ( k=O; k < KE-1; kes } ( hylil = hyfk) + .5*( extk] - extket) ) 5} for ( k=0; k < KE; ket ) { printf( "¥2d $6.26 86.2 \n",k,dxfk] ,ex(kl); } 37 Chapter 2. More on One-Dimensional Simulation /* Write the E field out to a file "Ex" */ fp = fopen( "Ex", "w"); for ( k=O; k < KE; ket} { fprinté( fp," ¥6.3£ \n",extkl); } felose (Ep) ; printe( "65.26 \n",1); Programs /* FD1D_2.2.c. The Fourier Tranform has been added.*/ # include «math h> # include # include fidefine KE 200 main 0) { float dx (KE) , ex (KE) , ny {KEL , 4x [KE] ; float ga [KE] , gb [KE] ; int n,m,k,ke,ke,kstart ,nsteps; float ddx,dt,T,epsz, epsilon, sigma; float t0,spread,pi, pulse; PILE *£p, *fopen(); float ex_low_m1,ex_low_m2,¢x_high_ml,ex_high m2: float real_pt [5] [KB) , smag_pt [5] (KE) ; float freq(5],arg{5] ,ampn{5] [KE] ,phasen [5] [KE] ; float real_in{S) ,imag_in{5] ,amp_in[5] ,phase_inI5) ; float mag KE] ; ke = KB/2; /+ Center of the space pi = 3.14159; epsz = 8.8e-12; ddx = .01; /* celis size */ at = ddx/6es; /* Time steps */ printé(" $6.4f $10.5¢ \n",ddx,dt) ; for ( kat; k < KB; kes) { /* Initialize to free space */ gatk) = gb{k] = @xtk) = extkl = for (m=O; mc= 2; me) ( real_ptiml fk] = 0.7 /* Real and imaginary parts imag_pt (ml [kK] = 0.; /* of the Fourier Transform ampn [m] (k] =O. /* Amplitude and phase of the phasen{m] [k] = 0.7 /* Fourier Transforms } } for (m0; m c= 3; m+) { real_in{m] = 0 /* Poutier Trans. of input pulse */ imag_in{m] = 0. 39 vs 7 */ 40. Chapter 2. More on One-Dimensional Simulation ex_low m2 ex_low_m2 ex_high_m1 ex_high_m2 /* Parameters for the Fourier Transform */ freq{o] = 100.86; freg!1] = 200.66; freq(2) = 500.86; for ( n-0; nee 2; nte J { arg{n) = 2*pitfregin] *at; printf "s2d %6.2£ 87.5£ \n".n, freg(n} *1e-6,arg{n}) ; } printf ( "Dielectric starts at --> i; scant ("*d", sketart) ; printé( "Epsilon --> "); scant ("*£", &epsilon) ; printf( "Conductivity --> "); scant ("8£", &sigmal; printé("*d 6.26 %6.2£ \n", kstart,epsilon, sigma); for ( kekstart; k <= KB; kt+) { galk] = 1./(epsilon + sigma*dt/epsz ) ; gbtk] = sigma*dt/epsz ; } for ( k=l; k <= KE; ket ) { peint£( "s2d %6.2£ 46.46 \n",k,ga(kl gb(kl); } /+ These parameters specify the input pulse */ to = 50.07 spread = 10.0; T-0; nsteps = 1; /* Main part of the program */ while (nsteps > 0) { printé( "nsteps --> "); scant ("$d", gnsteps) ; printf ("td \n", nsteps) ; for ( nel; 1 <=nsteps ; n++) { C Programs 4 /* Calculate the Dx field */ for ( k=0; k < KE; k++ ) { dxtkl) = dxtk) + 0.5#( hyfk-2] - byt) ) ; } /* Initialize with a pulse */ pulse = exp(-.5* (pow((t0-T) /spread, dx(S] = 4x[5] + pulse; print£( "85.18 %6.2£ ¥6.2£ \n",T,pulse,dx(5]); -O0)95 /* Calculate Bx from Dx */ for ( k-0; k < KB-1; kee } { exfkl = gatkl*(ax(k] - ixtkl ) i; ix(k] = ix(k] + gbfk]textk] ; } /* Calculate the Fourier transform of Ex. */ for ( k=0; k < KE; kes ) { for ( m0; m <= 2; me) { real_pt {ml (k] = real_pt{m] (k] + cos(arg{m]*T)*ex(k] 5 imag_pt (m] (x1 = imag pt (ml (k] - sin(arg{m]*T)*ex(k) ; } } /* Fourier Transform of the input pulse */ sf (T < 100) { for ( m=0; m <= 2; m+) { real_in{m] = real_in{m) + cos(arg{mJ*T)*ex{10] ; imag_in(m] = imag in{m) - sin(arg{m)*T)*ex(10] ; } + /* Boundary conditions */ ex(0] ex_low_m2; ex_low_m2 = ex_low_ml; ex_low. exl ex (KE-1 ex_high_m2; ex_high_m2 h_mi; ex_high_m1 /* Calculate the Hy field */ kc KEL; kee ) (hy(] = hy[kl + .5*( ext) - ex(ke2} ) for ( k=0 /* Bnd of the main loop */ y+ for (ke { printe( pk < Ke; kee ) 82d 86.26 $6.2 \n" k,dxikl,ex(kl}; } */ 2 Chapter 2. More on One-Dimensional Simulation /* Write the E field out toa file "Ex" */ fp = fopen( "Bx", "w") ; for ( k=0; k < KB; k++) { fprinte( fp," $6.36 \n",ex(kl); } Eclose (fp); /* Calculate the amplitude and phase of each frequency */ /* Amplitude and phase of the input pulse */ for (m=0; m<= 2; m+) { amp_in{m] = sgrt( pow(imag_in(m],2.) + pow(real_intm),2.) ); phase_infm] = atan2( imag in{m],real_in{m)); printé( "8d Input Pulse : 40.4f $6.4f 40.46 %7.2f\n", m,real_in{m] ,imag_in{m] ,amp_in{m] , (180.0/pi) *phase_in{m]); for (kel; k < RR} ket ) {° ampn[m) (k] = (1. /amp_in(m]) *sqrt( pow(real_pt [m) [k] ,2.) + pow(imag pt {m] [k],2.) ); phasen{m) [k] = atan?( imag pt {m] [k],real_pt (m] [k]) - phase_inim]; J+ for ( kels k < REY kee) { printe( "td 46.36 46.36 86.36 \n", ke, ampn (0) (ke) ), ampn (1) (ik) ,ampn [2] [k]; } */ /* Write the amplitude field out to a files "Amp" */ £p = fopen( "amp0","w"); for ( ke0; k < KE; kee ) { fprinté( fp," %8.5£ \n",ampn[0) [k]); } felose (fp) ; fp = fopen( "Ampl",*w'); 7k < KE; kee ) { fprines( p," ¥8.5£ \n*,ampalt] (k1); } fclose (fp); fp = fopen( "Amp2","w"); for ( ke0; k < KE; k++ ) { fprinte( €p," ¥8.5£ \n*,ampn(2] [k}); } fclose (fp); for ( printé( "%5.1£ \n",7); Programs /* ¥DID_2.3, 1D FDTD simulation of a frequency dependent # include # include # include define KR 200 main () { float dx (Ke) ,ex [KB] , hy [KB] , ix [KB], 6x (KE) : float ga [KE] , gb [KE] ,gc [KE] ; int n,m,k,ke,ke,kstart ,nsteps; float ddx,dt,T,eps2,epsilon, sigma; float t0,spread,pi,pulse; FILE *£p, *fopen(); float ex_low_m1,ex_low_m2,ex_high_mi,ex_high m2; float tau, chi1,del_exp; float real_pt [5] [KB] , imag_pt (5) (KE] ; float freq[5],arg[5],ampn 5] [KE] , phasen(5] [Ke] ; float real_in[S],imag_in[5] ,amp_in[5) ,phase_in(S]; float mag [KE] ; ke = KE/2; /* Center of the space */ pi = 3.14159; epsz = @.8e-12 ax = .01; /* Cells size */ dt = ddx/6ee; /* Time steps */ printf (" ¥6.4£ %10.5e \n",ddx, dt) ; material */ for (kel; k < KE; k++) { /# Initialize to free space */ ga(k] = 2 gbtk) = 0 gctkl = 0 oxtk) = 0 ex{k] = 0.; ° 0 ° hy(l = ix] x(k] for (m=O; m<= 4; m+) { real_pt(m)(k] = 0.; | /* Real and imaginary parte —*/ imag_pt (m) [x] = ampn [ml] [1 phasen [m) (k] = a /* Fourier Transforms for (m0; men 4; mie) { v) /* of the Fourier Transform */ /+ Amplitude and phase of the */ s Chapter 2. More on One-Dimensional Simulation veal_in(m] = 0.; /* Fourier Trans. of input pulse */ imag_in{m} = 0.; } ex_low_ml = 0 ex_low_m2 = 0. ex_high_ml = 0.; ex high m2 = 0.; /* Parameters for the Fourier Transform */ freq(0] = 50.26; frea(1] = 200.¢6; freq[2) = 500.e6; for (n=O; ne= 4; ne4 ) { argin] = 2*pirfreqin] *at; printé( "#2d %6.2f $7.S£ \n",n,freq{n}*ie-6,arg{nl}; } printf( "Dielectric starts ar --> "); scanf("%d", gkstart) ; Print£( "Epsilon --> "); scant ("$£", epsilon) ; print£( "Conductivity --» "); scant ("8£", &sigma) ; print£( "chit --> "); scanf ("t£", gchil); tau = 1000.; /* Make sure tau is > 0. */ i£(chil > 0.0001 ) { printf ( "tau (in microseconds) --> scant ("¥£", gtau) ; del_exp = exp(-at/tau); } printf("td $6.2f $%6.2£ %6.2£ %6.2f\n", kstart,epsilon, sigma,tau,chit); tau = 1.e-6*tau; { print£( "del_exp = $8.5£ \n",del_exp); } for ( kekstart; k <= KE; ket) { galk] = 1./(epsilon + sigmatdt/epsz + chiitdt/tau) ; gb{k] = sigma*dt/epsz ; gctk] = chittdt/tau ; } for ( kel; k <= KE; kt) { printf ( "82d %6.2£ 86.4£ 86.4f \n",k,galk],gbIk] ,aclk]); } /* These parameters specify the input pulse */ to = 50.0; C Programs epread = 10.0; T=0; nsteps = 1; /* Main part of the program */ while (nsteps > 0) { printf ( "nsteps --> "); scanf("$d", ansteps) ; printf ("$d \n", nsteps); for ( n { jn censteps ; ns+) TeT+l; /* calculate the Dx field */ for ( K=O; k < KE; kee ) { ax(k] = dx[k] + 0.5*( hy[k-1] - hy[k] ) ; } j* Initialize with a pulse +/ pulse = exp(-.5*(pow((t0-T) /epread,2.0))); dx{5] = dx{5) + pulse; printé( "5.16 $6.26 ¥6.2£ \n",T,pulee, dx (51); /* Calculate Ex from Dx */ for ( keO; k < KB-1; k++ ) { extk] = galk]*(dx(k] - ixtkl - sx[kl) 5 ix(k] = ix(kl + gbtkltextkl ; sx(k] = del_exp‘sx(k] + gclkl*ex(k] ; } /* Calculate the Fourier transform of Ex. */ for ( ke0; k < KB; k++ ) { for ( m=O; m <= 2; mee} { real_pt (m] (k] = real_pt [ml {k] + cos(arg{m]*7) *ex(k] ; imag_pt (m] [k] = imag_pt [m] {k] - sin(arg{m]+T)*ex(k] ; } /* Fourier Transform of the input pulse +/ if (T < 100) { for ( m 2: ms) { real_in{m] = real_in(m] + cos(arg{m)*T)*ex(10) + imag_in{m] = imag_in{m] - sin(arg{m]*T)*ex(10] ; } pm } /* Boundary conditions */ ex (01 = ex_low_m2; ex_low_m2 = ex_low_ml; Chapter 2. More on One-Dimensional Simulation ex_low_mt = ex(1]; ex (KE-1] ex_high_m2; ex_high_m2 = ex_high mi; ex highml = ex(KE-2]; /* Calculate the Hy field for ( k=0; k < KB-1; kes ) { hy(k] = hytk] + .5*( extk] - extk+1] ) ; } } /* End of the main loop */ /* for ( k=O; k < KE; k++ ) { printe( "82d $6.2F 46.2 \n",kax(klextk)); } */ /* Write the B field out to a file "Ex" */ fp = fopen( "Ex", "w"); for ( ke0; k < KE; k++ ) ( fprinte( fp,* 46.3£ \n" extkl); } felose (tp) ; /* Calculate the amplitude and phase of each frequency */ /* Amplitude and phase of the input pulse */ for (m=O; m <= 2; m+) ( amp_in[m] = sqrt ( pow(imag_in{m] ,2.) + pow(real_in{ml,2.) 13 phase_in(m] = atan2( imag_in{(m] ,real_in{m]); printf( "$d Input Pulse ; $8.4f $8.4f $8.4f #7.2£\n", m,real_in{(m] , imag_in{m] ,amp_in{m] , (180.0/pi) *phase_in(m)) ; for (kel; k < KE; ket } { ampnim] (k] = (2. /amp_in(m]) *sqrt ( pow(real_pt (ml (k) ,2.) + pow(imag_pt fm] (k1,2.) phasen[m] (k] = atan2( imag_pt (m] [k] ,real_pt {m] [k])-phase_in{ml ; printf( "$d %8.4f $6.4f $8.5f %8.2f \n", k,zeal_pt {m] [k] , imag_pt (m) [] ,ampn [m] (] , (180.0/pi) *phasen {m) (]) 7 } /* for ( kekstart; k < KE; k++) { printf ( "ed 46.3 46.36 46.3 \n", 4e,ampn (1) [x] ) ,ampn (2) {ke} ,ampn(3] (k]; ) #/ /* Write the amplitude field out to a file "Amp" +/ fp = fopen( *Ampo", "w") ; for ( kel; k < KB; k++ ) C Programs { fprint£( fp," #8. Felose (Ep); fp = fopen( “Amp1","w") ; for ( kel; k < KE; k++ } { fprint€( fp," ¥6.5£ \n",ampn [1] [k}}; } felose (fp); fp = fopen( "Amp2", "w") ; for ( kel; k < KE; ke+ ) { fprinté( fp," $8.5£ \n",ampn (2) tk]) fclose (fp) ; £ \n",ampn [0] {k]); } £( "65.16 \n",T); 7 Two-Dimensional Simulation This chapter introduces two-dimensional simulation. It begins with the basic two-dimensional formulation in FDTD and a simple example using a point source, Then the absorbing boundary conditions are described, along with their implementation into the FDTD program. Finally, the generation of electromagnetic plane waves using FDTD is described. 3.1 FDTD IN TWO DIMENSIONS Once again, we will start with the normalized Maxwell's equations that we used in Chapter 2: ab 1 ap!) yy 3.12 ar > Jeora” * oro) Do) = €1(w) Eo) (3.1b) oH 1 zz on vx B. 3.1 ar JEoHo ae ‘When we get to three dimensional-simulation, we will wind up dealing with six different fields: E, H,, H,,and H. In doing two-dimensional simulation, we choose between one of two groups of three vectors each: (1) the transverse magnetic (TM) mode, which is composed of E, H,, and H,, or (2) transverse electric (TE) mode, which is composed of E,, By, and H,. We will work with the TM mode. Equations (3.1) are now redaced to aD, 1 aH, aH, or ~ euite ( a 8 ) ey) DAw) = £7 (w) - E(w) (3.2b) a E, oH B.20) ar JEoHo ay aH, 1 =— 3.2d) a Jeans Ox ry) As in one-dimensional simulation, it is important that there is a systematic interleaving of the fields to be calculated. This is illustrated in Fig. 3.1. Putting Eqs. (3.2a), (3.2c), and 49 Si ae sane ees SeEESS ESS TEEESS SS OeSEOSCOSSSSSOSESUSSSSSESSOSEEISSSSS EE ISESSSSOIESSESSCOOEESESOOORESEESEOOEEEES 50 Chapter 3 Two-Dimensional Simulation Figure 3.1 Intesieaving of the E and Hf fields for the two-dimensional TM formulation. pie “GD ar HN +1/2, i) ~ WMG = 1/2, jy ee) + 1/2) = Hei, j = 1/2 Jeo Ax (3.3a) AMG 1/2) — HG, j +.1/2) 1 Meg fH EPG (5+ 1/2) ~ HG j + 1/2) GIFD- ENGI Gap) at veoita Ar Hel + 1/2, f) — HME + 1/2, /) 1 eM PGe Aer a Me = aD 3.3¢) ar Véoito Ax Using the same type of manipulation as in Chapter I, including Ar Are, Te we get the equations: @z{i) (5) = a2 (4) G1 + SAthy fil G) = nyl-2) G1) - nx (iG) + ext) G-a; da) ez {iJ (5) = gaz (il (1* (dz (i) (i) - 42G41 G31); (G.4b) i2li) G) = i204) (9) + ab2ti) (5) e204) G5); Gado) px (i) (3] = bx] G) + -5*( e2 (4) (5) - e2 (4) Gea) ); Gada) ny [i] (J] = byl] G) + -5*( ez(iei) G) - ez(il GG] 1; (Ge) Note that the relationship between £ and D, is the same as that for the simple lossy dielectric in the one-dimensional case. Obviously, the same modification can be made to include frequency- dependent terms, The program fd2d_3.1.c implements the above equations. It has a simple Gaussian pulse source that is generated in the middle of the problem space. Figure 3.2 demonstrates a simulation for the first 50 time steps Section 3.2 a The Perfectly Matched Layer (PML) st T= os Ze Figure 3.2 Results of a simulation using the program fU2d_3.1.c. A Gaussian pulse is initiated in the middle and travels outward. PROBLEM SET 3.1 1. Get the program f2d_3.L.c running. Duplicate the results of Fig. 3.2. Let it run until it its the boundary. What happens? 3.2 THE PERFECTLY MATCHED LAYER (PML) Up to now, we have only briefly mentioned the issue of absorbing boundary conditions (ABCs). The size of the area that can be simulated using FDTD is limited by computer resources. For instance, in the two-dimensional simulation of the previous section, the program contains two- dimensional matrices for the values of all the fields, dz, ¢2, hx, and hy, as well as matrices to hold the parameters gaz, gbz, and iz. Suppose we are simulating a wave generated from a point source propagating in free space as in Fig. 3.2. As the wave propagates outward, it will eventually come to the edge of the allowable space, which is dictated by how the matrices have been dimensioned in the program. If nothing were done to address this, unpredictable reflections would be generated that would go back inward. There would be no way to determine which is the real wave and which is the reflected junk. This is the reason that ABCs have been an issue for as long as FDTD has been used. There have been numerous approaches to this problem [2, 3]. ‘One of the most flexible and efficient ABCs is the perfectly matched layer (PML) de- veloped by Berenger [4]. The basic idea is this: if a wave is propagating in medium A and it impinges upon medium B, the amount of reflection is dictated by the intrinsic impedances of the two media G5) 82 Chapter 3 Two-Dimensional Simulation which are determined by the diefectric constants © and permeabilities jz of the two media fe. 66) n Ve Up to now, we have assumed that jz was a constant, so when a propagating pulse went from ¢ = | toe = 4, as in Fig. 2.1, it saw a change in impedance and reflected a portion of the pulse given by Eq. (3.5). However, if ju changed with ¢ so 7 remained a constant, P would be zero and no reflection would occur. This still doesn’t solve our problem, because the pulse will continue propagating in the new medium. What we really want is a medium that is also lossy so the pulse will die out before it hits the boundary. This is accomplished by making both e and y of Eq. (3.6) complex, because the imaginary part represents the part that causes decay. (See Appendix 1A at the end of Chapter 1.) Let us go back to Eqs. (3.2), but move everything to the Fourier domain. (We are going to the Fourier domain in time, so d/dt becomes jw. This does not affect the spatial derivatives.) aHy dH, oD, =o-(—*-* 37. FOE Ch ay ) a D.(o) = €() - Ew) (3.7) aE, Jol, = co (3.7c) ay joHy = eon (3.74) Remember that we have eliminated & and jx from the spatial derivatives in Eqs. (3.7a), (3.70), and (3.74) for the normalized units. Instead of putting them back to implement the PMI will add fictitious dielectric constants and permeabilities e., wp, and J«}, [5}: ere aH, aH, 38 jd, e200) -€5.0) = 00+ (FP F (3.8a) Dw) = €{(w) - E(w) 3.8) dE, a +) = co! (3.8¢) Jolly He) “Hh, 0) = 05 ) joH, My (2) Mh (9) = eo (38d) A few things are worth noting: first, the value & is associated with the flux density D, not the electric field E; second, we have added two values each of ey in Eqs. (3.8a), and pr in Eq. (3.8c) and (3.8d), one for the x direction and one for the y direction; and finally, nothing was added to Eq. (3.80), These fictitious values to implement the PML have nothing to do of €(«w) which specify the medium. al, (6] shows that there are 16 conditions to form a PML: =1 (39) ‘The impedance is 1 because of our normalized units. 2, In the direction perpendicutar to the boundary (the x direction, for instance), the relative dielectric constant and relative permeability must be the inverse of those in Section 3.2. m The Perfectly Matched Layer (PML) 33 the other directions 1 thee (3.10a) eee Mee = G.10b) ‘We will assume that each of these is a complex quantity of the form Elm = em + 22 form =x or y G.11a) joe Mh = hem + 2 form = x ory (1b) Jous The following selection of parameters satisfies Eqs. (3.10a) and (3.106) [7] FF = Kim = | G.12a) om _ iim _ oD 3.12) Hof Substituting Eq. (3.12) into (3.11, the value in Eq, (3.9) becomes lamella TCT [uz _ [1+ ewn/joey m= Mn = Vey This fulfills the first requirement above. If increases gradually as it goes into the PML, Eqs. (3.8a), (3.8c) and (3.84) will cause D. and Hy to be attenuated. ‘We will start by implementing a PML only in the X direction. Therefore, we will retain only the x dependent values of ef and yx}- in Eq. (3.8) J+a(x)/joery De-e-() =e: ( 2th — OMe Jods ea) = 00° (Fe a} Hy - ie ke JOH Mpls) = C05 aE, wHy «wey (X) = e% 7 Jol, Wp, 0) = 605 and use the values of Eq. (3.12): on(x) aH, OH, o(1 D.=¢ 3.13a) o(1 RP) ve (F ») a) op)\"! aE, jw (1+ a) Hy = -c0— B.13b) joey ay apa) a — Ly = co 3.134 jo (14 22) a .13¢) Note that the permeability of H, in Eq. (3.13b) is the inverse of that of H, in Eq. (3.13c) in keeping with Eq. (3.10b). Therefore, we have fulfilled the second requirement for the PML. (Eq. (3.10a) is irrelevant for this 2D case, because we only have an E field in the z direction, which is perpendicular to both x and y, the directions of propagation.) Now Eqs. (3.13) have to be put into the FDTD formulation. First, look at the left side of Eq. (3.13. ee. 4 Chapter 3 Two-Dimensional Simulation Moving to the time domain, and then taking the finite difference approximations, we get the following: aD: , onli) p a EMG, ~ DEM EAD | and) DING f+! aD ar & ar €0 2 2g nt op(i)- Ar Peel oli) At = DMG, p— | 1+ S| - Dra jpn oji-— ] ° rz + ye | ex 2-60 If we put this into Eq. (3.13a) along with the spatial derivatives, we get DIP G, j) = gi3i)- DEG, j) 14) + gi2(i) 0.5 [HG + 1/2, j) — APG = 1/2, ) — WMG, § + 1/2) — ARG, §-— /29], where once again we have used the fact that At _ Ax/Q-a@) 1 x0 == c= 5 Ax Ax 2 ‘The new parameters gi2 and gé3 are given by 1 i2(i) = a 3.15 8220) = To Al/@ a) Coe 1 = apli)-At/2-e0) gi3(i) = — 3.156) 830 = Papi) Ar/O) . An almost identical treatment of Eq. (3.13¢) gives HUNG 1/2, j) = fE3G + 1/2)- HOG + 1/2, MG + 1/2, j) = fis L i + 1/3 wp 3.16) + Fi2G + :1/2)-0.5 [EPPA +1, jf) — EG, j)] where FidG + 1/2) : (3.172) 0°" T¥ ap + 1/2) Ar/2e0) = onli + 1/2)- AQ fi3( + 1/2) = LOE HN) AUG 60) (3.170) T+ onl + 1/2)- Ar/Q- 0) Notice that these parameters are calculated at i + 1/2 because of the position of H, in the FDTD grid (Fig. 3.1). Equation (3.13b) will require a somewhat different treatment than the other two. Start by rewriting it as Remember ({/jo) may be regarded as an integration operator over time and jay as a derivative over time. The spatial derivative will be written as ak ay Implementing this into an FDTD formulation gives HE j + 1/2) ~ HBG 5 +1/2) -o| curle 2008), Sr cul ‘| ar “Ax 0 Ax EMG, j 41) — EY Ax i,j) __curle = Note the extra Ar in front of the summation. ‘This is part of the approximation of the time Section 3.2 m The Perfectly Matched Layer (PML) 55 domain integral. Finally we get a 1/2) = HBG, j 41/2) + curt PMG f+ 12 = AGF curl At) -At jmst2g 5 4 4/2) ax & co At = HM jf +12 curl AEG, j +12) + SS eurl_e ole) AE nstya, Tei, fF #A/20 Eq, (3.13b) is implemented as the following series of equations curl_e = [EP G, jf) — BPP. 7 + D) (3.184) Ty +2) = Wy PG, F + 1/2) + curl_e (3.18b) HOG, j + 1/2) = Hi f+ 1/2) $0.5 -curl_e (B.18¢) + FD PG +12 with fl@= Sa G19) In calculating the f and g parameters, it is not necessary to actually vary conductivities: Instead, we calculate an auxiliary parameter, o-At 2-6 that increases as it goes into the PML. The f and g parameters are then calculated: ni) = 333% = 1,2... slength_pmt 3.20) me (iengin-pna) cae : fil) = xn) Gata) 1 «n= (as) (3.216) 1=an gi3(i) = (LO 3.2le cee (528) B2t0 Notice that the quantity in parentheses in Eq. (3.20) ranges between 0 and 1. The factor “.333” was found empirically to be the largest number that remained stable. Similarly, the cubic factor in Eq. (3.20) was found empirically to be the mont effective variation—/i2 and /i3 are different only because they are computed at the half intervals, i + 1/2. The parameters vary in the following manner: Fill) from 0 to 333 (3.22a) gi2) from 110.75 (3.22) gi3()) from 1 to 5. (3.22) Throughout the main problem space, fil is zero, while gi2 and gi3 are 1, Therefore, there is a “seamless” transition from the main part of the program to the PML (Fig. 3.3). So far, we have shown the implementation of the PML in the x direction. Obviously, it must also be done in the y direction. Therefore, we have to go back and add the y dependent a 56 Chapter 3 @ Two-Dimensional Sisuulation The comers ean __Deeresingvalues of Grecopot bam sts [je tnereakng values of f parameters. PIM), a0 83) Decreasing values of fils nereasing values of (21. f3i, hand 331 Figure 3.3 Parameters related tothe perfectly matched layer (PML). terms from Eq, (3.8) that were set aside. So instead of Eg. (3.13) we have jn (14 202) (14 222) op wey (MEME) amy “1 jo(1+ 224 ) (1 r ON) 1, =e ( (3.236) joey Joe 4 70) cat) : ( ) o H,= 3.230 - (1+ Jost \Qu joey ONG eee) Using the same procedure as before, the following replaces Eq. 3.14) DY2G, j) = gi3i) - gj3)- DI") HG + 1/2, j) — HM 2. + gi20)- @i20)) os-[ LER ry artes Caen as) ] HE, J+ 1/2) HMi, j= 1/2) In the ¥ direction, H, will requice an implementation similar to the one used for Ay in the X direction giving curl_e = [EMG +1, fy — EMG, fy] (B.24a) Ty PG 4 1/2. 9) = MG + 1/2.) + curl_e (3.24b) ARG NZ = fi3 + 1/2)- H7G + 1/2, f) = fi2i 4 1/2)-0.5 -curl_e + f{UCA Ty PG + 1/27). 3.240) Finally, the Hy in the x direction becomes curl_e =[. RG) BMG +] 41/2) = Miz! G, j + 1/2) + curl_e HIN G, j + U2) = FA3GG + 1/2) HIG, § +1/2) + f72(j + 1/2) -O5-curl_e + SAUD Hy Pi. 5 + 1/2). Section 3.2 The Perfectly Matched Layer (PML) 37 Now the full set of parameters associated with the PML are the following: FUMING) from 0 to .333 (3.25a) Fi2@), BI2), F72G), & gj2AJ) from 1 to.75 (3.25b) SiH), 813), f73G),& g/3)_— from 110.5 (3.25¢) Notice that we could simply “tum off” the PML in the main part of the problem space by setting 71 and fj1 to 0, and the other parameters to 1, They are only one-dimensional parameters, so they add very little to the memory requirements. However, Iy7. and [yy are 2D parameters. Whereas memory requirements are not a main issue while we are in 2D, when we get to three dimensions, we will think twice before introducing (wo new parameters that are defined throughout the problem space, but are needed only in a small fraction of the space. The PML is implemented in the program fd2d_3.2.c. Figure 3.4 illustrates the effec- tiveness of an 8-point PML with the source offset five cells from center in both the X and ¥ directions. Note that the outgoing contours remain concentric. Only when the wave gets within eight points of the edge, which is inside the PML, does distortion start to occur. 30 40 30 2» 0s 6 o Figure 3.4 Results of a simulation using the program {82d_3.2.c, A sinusoidal source is initiated a a point that is offset five cells from the center ofthe problems space in cach direction, As the wave reaches the perfectly matched layer (PML), Which is eight cells on every side, it is absorbed. The effectiveness of the PML. is apparent in the bottom figure because the contours would not be concentric circles ifthe outgoing wave were partially reflected, ee 58 Chapter 3. @ Two-Dimensional Simulation PROBLEM SET 3.2 1, The program £424_3.2.cis the same as f2d_3. 1. but with the 2D PML added. Add the PML to your version of fd2d_3.L.e. Offset the point source by setting ic = IE/2 - 5 and je = JE/2 5. Verity the results of Fig. 3.4 3.3 TOTALSCATTERED FIELD FORMULATION ‘The simulation of plane waves is often of interest in computational electromagnetics. Many problems, such as the calculation of radar cross sections (2, 3], deal with plane waves. Fur- thermore, after a distance on the order of teas of wavelengths, the field from most antennas can be approximated as a plane wave. In order to simulate a plane wave in a 2D FDTD program, the problem space will be divided up into évo regions, the total field and the scattered field (Fig. 3.5). There are two primary reasons for doing this: (1) The propagating plane wave should not interact with the absorbing boundary conditions; (2) the load on the absorbing boundary conditions should be minimized. These boundary conditions are not perfect, i., a certain portion of the impinging. wave is reflected back into the problem space. By subtracting the incident field, the amount of the radiating field hitting the boundary is minimized, thereby reducing the amount of error. One-dimensional Incident aray Bes] Incident pane subtracted out here je A. incident plane A wave is generated Source, H ja = point Figure 3.5 Total feld/scattered field of the two-dimensional problem space. Figure 3.5 illustrates how this is accomplished. First note that there is an auxiliary one- dimensional buffer called the incident array. Because this is a one-dimensional array, itis easy to generate a plane wave: a source point is chosen and the incident E, field is just added at that point. Then a plane wave propagates away in both directions. Since it is a one-dimensional array, the boundary conditions are perfect. As illustrated in Fig, 3.6, in the two-dimensional field every point in the problem space is either in the total field or it is not: no point lies on the border. Therefore, if a point is in the total field but it uses points outside to calculate the spatial derivatives when updating its value, it must be modified. The same is true of a point lying just outside that uses points inside the total field. This is the reason for the incident array: it contains the needed values to make these modifications. There are three places that must be modified: 1. The D, value at j = ja or j = jb Deli, ju) = Deli, jg) + 05+ He inca ~ 1/2 (3.26) Dia ju) = Deli jp) — 0.5 He inc jn + 1/2) (3.260) per eee eter ee ei ; pee 5 wots tung ths tae D. dD, dD, D, aoe — + ms me i” i, . ha, tae , ots te, tt, 2, a rs i a a, © tno tino tne os wo th dD. D. D. D, ee ee HK, A, ‘A, A, en iat ia jas ias2X Figure 3.6 Every point is in either the total field or the scatered field 2. The Hy field just outside j = ja and j = jh Heli, jg = 1/2) = Heli, fa — 1/2) +5 - Es inca) (3.27a) Hei, jp + 1/2) = Aili, fo + 1/2) — 5» Ey inc (jo) (3.276) 3. Hy just outside i = ia and i = ib: Hy (ig 1/2. f) = Heli = 1/2, j) — 5+ Ex inc) (3.28a) Hylin + 1/2. J) = Hein + 1/2, f) + 5+ Be ine) (3.286) Figure 3.7 illustrates the propagation of a Gaussian pulse through the problem space. Notice how the pulse is generated at one end and completely subtracted out the other end. 3.3.1 A Plane Wave Impinging on a jectric Cylinder Now we have the ability to simulate a plane wave. To simulate a plane wave interacting with an object, we have to specify the object according to its electromagnetic properties, the dielectric constant and the conductivity. For instance, suppose we are simulating a plane wave striking a dielectric cylinder 20 cm in diameter which has a dielectric constant specified by the parameter epsilon and a conductivity specified by the parameter sigma. The cylinder is specified by the following computer code: for ( 5 = jar j < jb; jee) { for ( isia; i < ib; is) { xdist = (ici); ydist = (je-J); dist = sqrt (pow(xdist,2.) + pow(ydist,2.)); 4€( dist <= radius) { galil (j] = 1./(epsilon + (sigma*dt/eps2)); gb(i] J] = sigmatat/epsz; , yd Of course, this assumed that the problem space was initialized to free space. For every cell, 60 Chapter 3 Two-Dimensional oo T=90 T=115 40 —~6o Figure 3.7 Simulation ofa plane wave pulse propagating in fee space. The incident pulse is generated at one end and subtracted out the other end. the distance to the center of the problem space is calewstated, and if itis less than the radius, the dielectric constant and conductivity are reset to epsilon and sigma, respectively. & diagram of the problem space to simulate a plane wave interacting with a dielectric cylindet is shown in Fig. 3.8. ib ee Scattering from the eylinder 7 ja Figure 3.8 Diagram of the simulation of a plane a a wave striking a dieleciric cylinder. The felis Scattered from the cylinder are the only fields to ————> x leave the tolal field and sivike the PML. ‘The weaknesses of this approach are obvious: since we determined the properties by a simple “in or out” approach, we are left with the “staircasing” at the edge of the cylinder Section 3.3 m Total/Scattered Field Formalation 61 Clearly it would be better if we had a way to make a smooth transition from one medium to another. One method is to divide every FDTD cell up inte subcells; then determine the average diclectric properties according to how many subcells are in one medium and how many are in the other. The following code implements such a procedure. The ability to mode! multiple layers of different material has also been added, for (j= jar j < db; i++) { for ( isia; i < ib; its) [ eps = epsilon(0l; cond = sigma[0] : for (jj = -1; 33 1s j++) { for (ii = -1; di ce 4; dite) { xdist = (ie-i) + .333+4i; ydist = (je-j) + .333*45; dist = sqrt (pow(xdist,2.) + pow(ydist,2.)); for (nel; n <= numeyl: ne+1) { if( dist <= radius) ( eps = eps + (1./9)*(epsilon{(n] - epsilon {n-1]); cond = cond + (1./9)*(sigma[n] - sigmaln-1]); ae y ga(i] 5] = 1./leps + (sigma*at /epsz)); gb{i] (5) = condtat/epsz; Each cell is initialized to the values epsilon [0], sigma [0]. Notice that the inner loops, which are iterated by the parameters ii and jj, each move the distance 1/3 of a cell length. Therefore, the cell has been divided up into nine subcells. Also, notice that as a subcell is determined to be within the radius, its contribution is added to the total epsilon (epsilon [n] ), while subtracting out the previous epsilon (epsilon [n-1]). The above code is valid for an arbitrary number of layers in the cylinder, specified by mum: The simulation of a plane wave pulse hitting a dielectric cylinder with , = 30 and o = .3 is shown in Fig, 3.9. After 25 time steps, the plane wave has started from the side; after 50 time steps, the pulse is interacting with the cylinder, Some of it passes through tt cylinder, and some of it goes around it. After 100 steps, the main part of the propagating pulse is being subtracted out the end of the total field. 3.3.2 Fourier Analysis ‘Suppose we want to determine how the EM energy is deposited within the cylinder for a plane wave propagating at a specific frequency. Recall that we did something similar to in section 2.4 where we were able to determine the attenuation of the energy at several frequencies by using a pulse for a source and calculating the discrete Fourier transform at the frequencies of interest. This is exactly what we will do here. The only difference is that we have a larger number of points because it is a two-dimensional space. Furthermore, we can use the Fourier transform of the pulse in the one-dimensional incident buffer to calculate the amplitude and the phase of the incident pulse. There is a reason why a dielectric cylinder was used as the object: it has an analytical solution. The fields resulting from a plane wave at a single frequency interacting with a dielectric cylinder can be calculated through a Bessel function expansion [8]. This gives us 2 Chapter 3. Two-Dimensional Simulation i P| . A 05 4 Aw a eo Figure 3.9 Simulation ofa plane wave pulse impinging on a dielectric eylinder, The cylin der is 20 em in diameter and has a dielectric constant of 30 and of 0.3 Si, an opportunity to check the accuracy of our simulations. Figure 3.10 is a comparison of the FDTD calculations versus analytic solutions from Bessel function expansions along the center axis of the cylinder in the propagating direction (see Fig. 3.8) at 50, 300, and 700 MHz. This ‘was calculated with the program that averaged the values across the boundaries, as described above. The accuracy is quite good. Remember, we were able to calculate all three frequencies with one computer run by using the impulse response method. PROBLEM SET 3.3 The program fd24_3.3.c implements the 2D TM FDTD algorithm with an incident plane wave. Note that Eq. (3.26) is implemented to give the correct &. field atthe total/scattered field bound: ary and Eq. (3.27) is implemented to give the correct H, field, Why is there no modification tothe H, field? 2. Get the program fd2d_3.3.¢ running. You should be able to observe the pulse that is generated at }=Ja, propagates through the problem space, and is subtracted out at }=38. 3. The program fa2d_3.4.¢ differs from fa2d_3.3.c in that it simulates a plane wave hitting a dielectric cylinder. It also calculates the frequency response at three frequencies within the cylinder. Get this running and verify the results in Fig. 3.10. 4, The cylinder generated in fd2d_3.4.¢ generates the cylinder by the “in-or-out” method. Change this to the averaged values and add the ability to generate layered cylinders, as described in the last section of this chapter. References 8 1 o _ 50 MHz § -100 S os 3 | g pangngoeseseooooooot £ 7 792220000000000000005 0 3 0 [PPeesose B -100 § 300 Mite $ -200 ~ $8eececns0088 & | “ea, | ~300 i os 0 3 10 “0S 0 5 0 1 S 700 Miz 3 ~ [Peroovcce eS 0 So 0 3 10 10 u a BI 41 (51 (6 m (8) Figure 3.10 Comparison of the FDTD results vs. Bessel funetion expansion results along the propagation center axis of aeylinder a three frequencies. The eylinder is 20 em in diameter and has a dielectric constant of 30 and a conductivity of 03 Sim. REFERENCES K. S. Yee, Numerical solution of initial boundary value problems involving Maxwell's equations in isotropic media, IEEE Trans. on Antennas and Propagation, vol. AP-17, 1996, pp. 585~589. A. Taflove, Computational Electrodynamics: The Finite-Difference Time-Domain. Boston: Artech House, 1995. K.S. Kunz, and R. J. Luebbers, The Finite Difference Boca Raton, FL: CRC Press, 1993. J.P. Berenger, A perfectly matched layer for the absorption of electromagnetic waves, J. Comput Phys., vol. 114, 1994, pp. 185-200. D. M. Sullivan, A simplified PML for use with the FDTD method, IEEE Microwave and Guided Wave Letters, vol. 6, Feb. 1996, pp. 97-99. ZS. Sacks, D. M. Kingsland, R. Lee, and J. F. Lee, A perfectly matched anisotropic absorber for use as an absorbing boundary condition, IEEE Trans. Anten. and Prop., Vol. 43, Dec. 1995, pp. 1460-1463 D. M, Sullivan, An unsplit step 3-D PML for use with the FDTD method, IEEE Microwave and Guided Wave Letters, vol. 7, July 1997, pp. 184-186. R. Harrington, Time-Harmonic Electromagnetic Fields, New York: McGraw-Hill, 1961 1¢ Domain Method for Electromagnetics. | eee eee oA Chapter 3 ® Two-Dimensional Simulation /* £24 3.1.c. 2D TM program */ # include # include # include define TE 60 fidefine JE 60 main © { float ga [re] [JE] ,dz (IE) [9El,e2 (IE) (JB) ,hx{TB] (JE) , hy [TE] (JE) ; int 1,n,i,j,i¢, je,nsteps; float ddx, dt, T,epsz,pi, epsilon, sigma,eaf; float to, spread, pulse; FILE *fp, *fopen(); ic = IE/2; je = 98/2; dax = .01; /* Cell size +/ dt =dax/6es; /* Time steps */ epsz = 8.8e-12; pi-3.14159; for ( 4-0; 3 < TB; joy) { printf( "#2d 0", i); for ( i=0; i < IB; ist) { a2 (il li) = 0.7 ez(il (j] = 0. hx (il [3] = 00; hy (i) (31 = 0.5 gaQlisb= 1.0; printé( "$5.26 ",galil {31} } print£{ " \n"); } 0 = 20.0; spread ~ 6.0; T= 0; nsteps = while ( nsteps > 0} { printf ( “nsteps --> "); cant ("$d", gnsteps); printé ("$d \n", neteps); for (nel; n consteps ; net) ( rT-T+a, ie Start of the Main FDTD loop ” C Programs {* Calculate the Dz field */ for ( j=1; 3 < IB; ger) ( for ( i=l; i < IB; its) { dz(il [j] = de(il (i) + .5*( hy(i) Cj) - hy(i-2) (5) - px fi] (5) + hx (dl G-1)) ¢ ; } /* Put a Gaussian pulse in the middle */ pulse = exp(-.5* (pow( (to-T) /spread,2.0)}) + dz[ic] [jc] = pulse; /* Calculate the Bz field +/ for ( j=1; j < dB; i++) ( for ( i=l; i < IB; ite ) ( esli] (j] = gal) (j)*az(4) G1: } ) J+ Calculate the Hx field +/ for (<0; j < JB-1: j++) { for ( is0; i < IE-1; ive) { hx i] [4] = hx (4G) + .5*( ez [i] (5) - ez) G21); } } /* calculate the Hy field +/ for ( j-0; j < JE-1; j++) ( for Ci Te-2; ist 1 ( hy [i] (j] = hy(i] (3) + -5*( ez(i+l) [j] - ezlillj) ) ; } End of the main FDTD loop for ( j=l; 5 < jes er) f printé( "2d ",j); for ( 441; 4 < de; ise) ( printf ( "$5.2£ ",ez[2*i] [2*3]); printé( " \n"); printé( $5.06 \n", 7); i rite the E field out to a file "Ez" */ fp = fopen( "Ez", "w"); for ( j=0: i < JE: it+) { for ( is0; i < IB; itv) { fprint£( fp, "¥6.3£ ",ez(i) (51); 66 fprintt( fp," \n"); } fclose (fp) ; Chapter 3 @ Two-Dimensional Simulation C Programs or /* Fa24_3.2.c. 2D TM program with the PML +/ # include # include # include #define IE 60 fdefine JE 60 main () { float ga (1B) (JE) ,dz [TE] (aE) ,e2 (18) [IB] , hx (7B) (9B) hy (TE) (JE) ; int 1,n,i,j,1¢, je,nsteps, npml; float ddx,dt,,eps2,pi, epsilon, sigma, eaf; float xn,xxn,xnum, xd, curl_e; float to, spread,pulse; float gi2 (TE) ,gi3 (Tel ; Float 9i2(JE} ,a53 (Tel ; float £11 (TE), £12 (12) , £43 (JE); float £51 (IE) , £52 [98] , £33 (9E); float ihx(IE] (JE), ihy(1E] (8) ; FILE *fp, *fopen() c= IB/2-5; c= JE/2-5; dx = .01; /* Cell size */ dt =ddx/6e8, /* Time steps */ epsz = 8.8¢-12; pie3.14159; /* Initialize the arrays */ for ( j=0; j < dB; j++) { printf( "82d ",3); for ( i=0; i < IB; ite) { dz(i] (J= 0.0 ; hxli} = 0.0; hy(i] (5}= 0.0; ihx (il (j]l= 0.0 ; ihy (i) (j]= 0.0 gali] (j]= 1.0 ; printf( "5.2f ",gali] (31); } printf( " \n"); } /* Calculate the PML parameters */ (i=0;ic TE; ite) { (4) = 1.0; gi3 [4] = 1.0; fil [1] = 0.0; 68 ‘Chapter 3 @ Two-Dimensional Simulation £42 (4) £43 (4) } for (j=0;j< Te; j++) ( gi2[j] = 1.0; 9315} = 1.0; [il = 0.0; £3219] = 2.0; = 1.0; ) printf ( "Number of pML cells --> *); scanf ("$d", gnpmd) ; for (is0;ice npml; { ynum = npml - i; xd = mpm; xxn = xnum/xd; xn = 0.33*pow(xxn, 3.0); printf(" $4 47.4£ 87.46 \n",i,s0m,xn); gi2(i] = 1.0/(2.0+xn); gi2(1E-1-i] 0/ (2.040) + gi3[i] = (2.0 - xn)/(1.0 + xn); gi3(TB-i-1] = (1.0 - xmi/(1.0 + xml; vom = (xmum-.5) /xdi xn = 0.25*pow (xn, 3.0); fil (i) = om; f£i1(TE-2-i) = xn, £12 [i] = 1.0/(1.0+xm); £i2{78-2-i) = 1.0/(1.0+xn); £43[4] = (1.0 - xn) /(1.0 + an); £i3(1E-2-i] = (1.0 - xnd/(1.9 + xn) } for (j20;j<= mpm; j++) { xnum = npml ~ j7 xd = npml; pom = xnum/xd; yn = 0.33#pow (20, 3-0) ; printe(" ¥d $7.4£ 87.46 \n",4,xxn, xn); 93213] = 21.0/(1.04%n) ; 932 [JE-1-j] = 1.0/(2.08%n) ; 953(3] = (2.0 - xn)/(2.0 + xn); g33(9B-j-1] = (1.0 = xn)/(2.0 + xn) xxn = (xnum-.5) /xd; xn = 0.25*pow(xxn, 3.0); #515] = xn J2(JE-2-3] = xn; £52 (9) = 1.0/(1.0exn) ; = 1.0/(1.0¢xn) ; £32 (gE-2 C Programs, £33(4] = (2.0 - xn)/(1.0 + xm; £33 [0B-2-3] = (1.0 = xn)/(1.0 + xn); t print£ ("gi + £4 \n"); for (i20; ic IB; it+) { print€( "2d %5.2£ $5.26 \n", i,gi2ti],gi3(i]), printe( * $5.2f $5.26 $5.26 \n ", £41 [4], £42 (4) ,£43(4)); } printf ("gj + £J \n"); for (j-0; j< JE; j++) { printf( "#2 #5.2€ 45.26 \n", j,g3213],93313]), printf(" $5.26 5.26 $5.26 \n", £5205), £3205) .£3305))7 ) £0 = 40.0; spread = 15.0; T= 0; neteps = 1; while (nsteps > 0) { printé( "nsteps scanf("%d", gnsteps) ; printe("td \n", nateps) ; >"; for (n=; n o) “nsteps { ensteps) ; print£ ("td \n", nsteps) ; for ( net; T-THd; ys for n <=nsteps ; Start of the Main FDTD loop me) { “ Gel: $< os jee) { ez_inc[j] = ez_inc(] + .5*(hx_ine[j-1] -hx_ine(J1); /* ABC for the incident buffer */ ex_inc [0] ez_inc_low_m2 ez_inc_low ml. ez_inc [JE-1] ez_inc_high m2 ez_inc_low m2; = ez_inc_low m1; ez_inc [1] = ez_inc_high m2; = ez inc high ml; C Programs 3 ez_inc_high ml = ez_inc(JB-2]; /* Calculate the Dz field */ for ( jelr 4 < TE; jee) ( for ( fel; i < Iz; ise) { dz (i) [i] gi3 [i] *gi3(j] "dz [il (4) + gi2[il*gj2[j]*.5*( hylil{j] - hyli-11 [41] = he (i) 5) + bet) 2d) ) /* Source */ /* pulse = sin(2*pisaooriestateT) ; */ pulse = exp(-.5* (pow(it0-T) /spread, 2.0) ez_inc[3] = pulse; /* Incident Dz values */ for (isia; ice ibs ite) { az(i] [ja] = 4z(4] (Jal + 0.5*hx_ine[ja-1]; az [4] [jb] = dz(i] [jb] - 0.5#hx ine [3b]; } /* Calculate the Ez field +/ for ( j=0; j < JE; j++) { for ( iO; i < IB; ise) ( ez(il (j] = galil [j]*dz(i) (3) ; } } printé("$3£.0 $6.2 \n ",T,ezlicl (Jel); J+ Set the Bz edges to 0, as part of the PML */ ( ja0; 4 < gB-as jae) { ez[0]{j] = 0.0; ez(TB-1] (J) = 0.05 for ( isd; ie Tea; i+) { ezlil [0] = 0.0; ez [i] [JB-1] = 0.0; ) for (j=0; j< JB; j++) { hx_ine[j] = hx_ine{j] + .$*(ez ine(j]-ex ine [j+11); /* Calculate the Hx field */ for ( $*0; j < JE-1; j++) { a "4 Chapter 3 @ Two-Dimensional Simulation for ( i=0; i < IB; ite) { curl_e = ez(il(j] - ezlillj+l ; ihx(G] (3) = dmx (il (J) + £i1[i)*curl_e ; hx [i] [7] = £33(3)*hx (i) (31 + £42(4]*-5*(curl_e + ihx (i) (41); ) } 7* Incident Hx values */ for (isia; ice ibs ite) { bx(i] [Ja-1] = hx{i] (Ja-2] + .5*ez_inc{jal; hx[i] [jb] = hx(4] [Jb] - .5*ez_inc [3b]; } /* Calculate the Hy field */ for ( j-0; J <= OE-1; j++) { for ( isd; ic IB-2; ist) { curle = ez(i+t][j] - ez(i] (31; ihy() (9) = dhy (i) (j] + £4203} *curl_e ; hy [i] (9) = £434] *hy (4) (3) + €42[41*.5*(curl_e + ihy(i] (j1); } } /* Incident Hy values */ for (J=Jar jee jb: i+) hy (4a-1] [J] = by[4a-1] [5] - .5*ez_anc(3]; by [4b] (31 hy[ib] [J] + .S*ez_inc(j]; } / End of the main FDTD loop C Programs, 8 /* F62d_3.4.c, 2D TM simulation of a plane wave source impinging on a dielectric cylinder Analysis using Fourier Transforms */ # include # include # include fdefine TE 60 define JB 60 fidefine NFREQS 3 main () { float —_real_pt [NFREQS] [IZ] [J] , imag_pt (NFREQS) [IE] (JE]; float real amp [IE] [JE] ,phase [IE] [JE]; float real_in[5],imag_in(5],amp_in[5],phase_in [5]; /* Parameters for the Fourier Transforms */ freq[0] = 50.06; freq[1] = 300.e6; freg(21 = 700.06 for ( n=0; 9 < NFREQS; n++) { arg[n] = 2*pitfreqin} *dty print£( "ed %6.2£ %7.5£ \n"/n, freqin]*1e-6,arginl) ; + /* Bpecity the dielectric cylinder */ print£( "Cylinder radius (cells), epsilon, sigma --> ecant ("$f %£ %£", Gradius, kepsilon, sigma); printf ( "Radius = %5.2f Eps = %6.2£ sigma = %6.2f \n “, radius, epsilon, sigma) ; for (4 = ja; 3 < db; j++) { for ( isda; i < ibr dee) { xdist = (ic-i); yaist = (je-3); dist = sqrt (pow(xdist,2.) + pow(ydist,2.)); 1f( dist <= radius) ( ga(il [J] = 1./(epsilon + (sigmatat/epsz)); gblil [3] = sigmatdt/epsz; yo} printf( "Ga \n" for ( j=jar J < iby i++) { for ( izia; i <= iby ist) { printé( 5.26", ga[i] [J]); 16 Chapter 3 Two-Dimensional Simulation printe( " \n%); printf( * Gb \n") for ( d< dbs dee) ¢ for (iia: ice iby ivy) { printé( "5.2£",gblil (iJ); 5 printe( " \n"); + tO = 25.0; spread = 8.0; Teo; nsteps = 1 while ( nsteps > 0) { printé( "nsteps --> "I; scant ("¥d", ensteps) ; printf ("sd \n", nsteps) ; for (mel; n censteps ; nes) { TeT+a, i Start of the Main FDTD loop ---- */ /* Calculate the incidnet Bz */ for (jx2; j< JE; j++) { ez_inc[j] = ez_ine(j] + .5*(hx_ine{j-1]-hx_ine{j]); } /* Pourier Transform of the incident field */ for (m=O; m < NFREQS ; m+ ) { real_infm) = real inim] + cos(arg{m/*T)*ez_inc[ja-1] ; 4mag_in(m] = imag infm] - sin(arg(m]*T)*ez_inc(Ja-1] ; /* Calculate the Dz field */ for ( je; 3 < TB; jee) { for ( del; i < IB; ise) { dz} fj) = gis (il*g33(j)*dzli) 5) + gi2[i]*gj2{j]*.5*( hy(i] [3] ~ hyli-1) [3] - wel] (5) + bei) 5-11) /* Source */ Programs 7 pulse = exp(-.5*(pow((t0-T) /spread.2.0) )); ez_inc[3] = pulse; print£("$3.0£ %6.2£ \n ",T,ez_inc[3]} /* Incident Dz values */ for (isia; i<- ib; its) dz (i) Wal = deli] [Jal + 0.5+hx_inc{ja-1]; dz [il [3b] = deli} Gb] - 0.5*hx_inc jb] ; } /* Calculate the Ez field */ for ( j=; j < JE-1; jor) { for ( isl; i < TB-1; itt) { ez{il (j] = galil (3]*( dztil (3) - izG) 1) ; iz(4] [9] = i2fd] G) + gblil G)*e2 (i) 41: ,} /* Calculate the Fourier transform of Ex. */ for ( j=0: j < JE; J++) { for ( ino; i JBy ite) {for ( ms0; m < NFREQS; m+ ) { real_pt (m] [1] [3] = real_pt (mj (4] [3] + cos (argim]*7)*ez [4] [5] 5 imag_pt (m] [4] [3] = imag pt (m] {4} (3] + sin(arg(m]*7)*ez[i] [5] 5 y3 /* Calculate the incident Hx */ for (j=0; j< JB; i++) hx_inc [3] = bx_inc[j] + .5#(ez inc J-ez_ine j+2)); } /* Calculate the Ex field */ for ( j<0; j ¢ JE-1; j4+ ) { for ( isd; i < TE; ive) { curle = ez (4) {j] - ez{iljeal > ihx (2) [4] = ihx (il) + fi1li}ecurt_e ; hx (41 15) = £49 (9) *hx (il G31 + £52(9)*.8#(curl_e + ihx {i (51); yo} /* Incident Hx values */ for (isia; ic= ib; ist) { hx (i) (ja-2] = hx fi] (ja-1) + .5#ez_ine (jal; hx {iJ jb] = AX[A] jb] - .5*e2_inc [jb]; 1 8 Chapter 3. @ Two-Dimensional Simulation /* calculate the Hy field */ for (420; 5 <# JE-1; j++) { for { 4-0; i < IB-4; i++) { curle = ez(i+t] (j] - eztillji; ihy(i] (3) = dhy(i] 31 + £92 []*curl_e ; hy (3) (5] = £43 (4) hy (4) (41 + §A2(41+.5*(curl_e + ihy(i] (41); ae) /* Incident Hy values */ for (j=ja; j<= jbr dre) nylia-1] [j] = hylia-1](j] - .Stez_inelj); hy (ibl 1 = hy (ib) (3) + -Stez_inc [i]; \ End of the main TD loop ---- */ /* Calculate the Fouier amplitude and phase of the incident pulse */ for ( m0; m < NFREQS; m+ ) { ampinim) = {eget (pow(real_in{m] ,2.)+pow(imag_in[m],2.))7 phase_in{m] = atan2(imag in{ml,real_in(m]) ; printf( "Sd Input Pulse : 46.4f %8.4£ %88.4f %7-2£\n", cea em ee cae he a acco } /* Calculate the Fouier amplitude and phase of the total fiela field +/ for { me; m < NFREQS; m+ ) { if( m == 0) fp = fopen( *ampl","w") ; else if( m=: 1) fp = fopen( "amp2","w"); else if( m== 2) fp = fopen( "amp3","w"); { printé( "ed €7.2£ Milz\n",m, freqim)*l.e-6); for ( j=jaz J <= jb; i++) { i£( galicl 1 < 1.00) { ampise} (4) (1. /amp_in[m)) ‘sart( pow(real_pt im] [ic] [41,2-) + pow (imag_pt [m] [ic] (],2.)); print€( "924 %9.4£ \n",jc-3,amplicl (41); fprint£( fp," 9.4 \n",amplicl (51): y } 3 close (£p); y Three-Dimensional Simulation At last we have come (o three-dimensional simulation. In actuality, three-dimensional FDTD simulation is very much like two-dimensional simulation—it’s just harder! It's harder because of logistical problems: you are using all vector fields and each one is in three dimensions. Nonetheless, if you pay attention and build your programs carefully, the process is straight- forward. 4.1. FREE SPACE FORMULATION The original FDTD paradigm was described by the Yee cell, (Fig. 4.1), named, of course, after Kane Yee [1]. Note that the E and # fields are assumed interleaved around a cell whose origin is at the location i, j, k. Every E field is located 1/2 cell width from the origin in the direction of its orientation; every H field is offset 1/2 cell in each direction except that of its orientation. Not surprisingly, we will start with Maxwell's equations: abd 1 = —-VxH 4.1a) ar ein ‘ Diw) = &{) - Ew) (4.16) aH 1 > —=-. VxE (4.1 ar Veaito a Once again, we will drop the ~ notation, but it will always be assumed that we are referring to the normalized values. 0 80 Chapter 4 Three-Dimensional Simulation 1 The Yee eel aD (2 ae (4.2a} a Jeans Vay aD, I att, = ( (4.26) 1 Yeare \ Oz aD. ( ee ( (420) ar aH, a et ( (4.2d) ar any a e ( (4.22) at aH. 1 GE. = ( 4.26) an Jeane Vay The first step is to take the finite difference approximations. We will use only Eqs. (4.2c) and (4.2f) as examples: DIFP, jk + 1/2) = DY PUi, j.k + 1/2) ar FSM 1/2. jE AD Bae Jiaeg EF Pd AMG. f+ A/2 + A/D + HOG § — 12K 41/20) AMG = 1/2 jk 41/2 (4.3) HEME + 1/2, f+ 1/2, = MEG + 1/2, j + 1/24) At A pettng 4 ar fiom PFT 2b) = BG 7 41/2) (4.3b) + 1/2 FHL E+ EMG 41/2, 7.) Section 4.1 @ Free Space Formulation 81 From the difference equations, the computer equations can be written: ex (4) (91 Del = ax i] 5) OK) + .5*( bz (4) (4) Ok) - he fi) (5-21 = hy (2) G0 Ge) + hy fi) 00-11); dy (2) (4) Ok) = ay (i) (5) tk) + 58 ¢ hei) (9) (ed = mx (4) (9) Oe-2] = he (i) (41 Oe) + hz (4-1) G1 0K): az (i) (1 0k) = dz (i) (5) tk 1 + .5*( hy] (91 Ok) - ay li-2) (3) Oe px (i) G1 Ue) + be lid G-21 0) ; hx (2) (4) Oe) = Bx] C51 Ok + .8*( eylil [4] (ert) - ey fi] (51 Uk] = ezlil [j+4) Ok) + ez (i) (31 0K1) hy (4) (9) Gel = hy C4) (31 01 + .5*( ezli+t) (3) (k) - ez fil (41 0K] = ex [il (5) Okee2] + ex (i) (31 0K)) + Ue] + .5#( ex(i] (+1) Gel - exfil (5) Ge ey(i+1] (3) Oc) + ey (i) 13] 01) 5 he (il (9) 0k) = he (i) The relationship between E and D, corresponding to Eq. (4.1b), is exactly the same as the one-dimensional or two-dimensional cases, except now there will be three equations! The program fd3d_4.1.c at the end of the chapter is a very basic three-dimensional FDTD program with a source in the middle of the problem space. This is similar to the two- dimensional program fd2d_3.1.c, except that the source is not a simple point source. In three dimensions, the E field attenuates as the square of the distance as it propagates out from the point source, so we would have trouble just seeing it. Instead, we use a dipole antenna as the source. A simple dipole antenna is illustrated in Fig. 4.2. It consists of two metal arms. A dipole antenna functions by having current run through the arms, which results in radiation. FDTD simulates a dipole in the following way: The metal of the arms is specified by setting the gaz parameters to zero in the cells corresponding to metal (See Eqs. (2.9) and (2.10). ‘This insures that the corresponding E. field at this point remains zero, as it would if that point were inside metal. The source is specified by setting the E. field in the gap to a certain value. In fd3d_4.1.¢, we specify a Gaussian pulse. (In a real dipole antenna, the E; field in the gap woud be the result of the current running through the metal arms.) Notice that we could have specified a current in the following manner: Ampere’s circuital law says (2) fu di=I, i.e., the current through a surface is equal to the line integral of the HT field around the sur- face. We could specify the current by setting the appropriate HT field values around the ‘gap, as illustrated in Fig. 4.2. I think you can see that specifying the E field in the gap is easier. Figure 4.3 shows the propagation of the E, from the dipole in the XY plane level with the gap of the dipole. Of course, there is radiation in the Z direction as well. This illustrates a major problem in three-dimensional simulation; unless one has unusually good graphics, visualizing three dimensions can be difficult. 82 Chapter 4 @ Three-Dimensional Simulation gaz = 0 to specify metal H fiolds resulting f ‘current in the dipole eA ¢— The stimulating E. value is specified atthe gap. Figure 42 A dipole antenna, ‘The FDTD pro- ‘gram specifies the metal arms of the dipole by Setting gaz = 0. The source is specilied by seting the E- field to a value atthe gap. Figure 4.3. field radiation froma dipole antenna in a three-dimensional FDTD program, PROBLEM SET 4.1 1. Get the program fd3d_4.1.¢ running. Duplicate the results of Fig. 4.3, (Remember, there is no PML yet!) Section 4.2 m The PML in Three Dimensions 83 42 THE PML IN THREE DIMENSIONS ‘The development of the PML for three dimensions closely follows the two-dimensional version. The only difference is that you deal with three directions instead of two [3]. For instance, Eq, (3.23a) becomes oe oy oz)! aH, aH, jo (14 22) (14 22) (16 OY py (MEM) joey Joey jwe ax ay and implementing it will closely follow the two-dimensional development. Start by rewriting, Eg. (4.4) as (14 202) (14 2) mB). (Mme joey jwen ax ay oz) 1 —curl_h je (4.5) = cy curl_h + co We will define 1 In: = —curl_h jo which is an integration when it goes to the time domain, so Eq. (4.5) becomes jo (1 + oe) (: + 202) Dz = (cura +2 2 tne) joe jae 0 The implementation of this into FDTD parallels that of the two-dimensional PML, except the right side contains the integration term p.. Therefore, following the same math we used in Chapter 3, we get HOG 41/2, jk YD) — HE — 1/2, jk + 1/2) curlh = HBG, j + 1/2,k + 1/2) (46a) HHO, j = 1/2,k 41/2) Th i,j RAV /2) = WRG, J. K+ 1/2) Heurlh (4.66) DEG, j, K+ 1/2) = gi3Q) -@73G)- DEG, 7, KAU/2) (4.6) + gi2(i) + Bj2C)) + 5+ (curl_h+ gkU(k) > 13, j. #12). The one-dimensional g parameters are defined the same as Eq. (3.25) We also mentioned in the last chapter that this is a “seamless” transition from the main problem space to the PML, but it suffers from one main drawback: the integral parameter Ip. isan additional three-dimensional array that is dimensioned throughout the problem space, but used only at two edges. The three-dimensional implementation will have a total of six such arrays, which clearly is a waste of computer resources. For this reason, J. will be broken up into two smaller three-dimensional arrays, one defined at the low values of k (idz1) and one defined at the high values of k (idzh). for( ist; ic IB,it+) { for( j=1; j< JE,j++) { for(k=0; k hx {i} G10) + hx (4) [3-2] [1 idzh (i) [4] [keh] = idzh [i] [51 (kzh]+ curl_h gz (i) (5) tk) = gi3 14] #95305] *az 4) [5] Oe] + gi2 li] *gj2(3].5*(curl_h + gki [k] *idzh (4) (5) (keh}) ; yoy} Figure 4.4 shows the E field emanating from a dipole source in a program wing a seven- point PML. Notice that the part of the field not in the PML radiates concentrically from the source, as it should. Figure 4.4 Radiation from a dipole antenna in an FDTD program with a seven-point PML: ‘The contour diagrams on the right illustrate the fact that the elds remain ‘concentric until they reach the PML. Section 4.3 m Total/Scattered Field Formulation in Three Dimensions 85 PROBLEM SET 4.2 1. Add the PML to your three-dimensional program. The program fd3d_4.2.¢ at the end of the i chapter has the PML, but it also has the things described in the next section, You should be able to pick out those things having to do with the PML. Duplicate the results of Fig, 44, 4.3 TOTAUSCATTERED FIELD FORMULATION IN THREE DIMENSIONS Senerating plane waves in three dimensions is similar to two dimensions, The three-dimen- sional problem is illustrated in Fig. 4.5. A plane wave is generated in one plane of the three- dimensional problem space, in this case an XZ plane, at j = ja and subtracted out at j = jb. Therefore, in free space with no obstacle in the total field, we should see only E. and H,. The plane wave is generated at one side and subtracted out the other side by adding to D or H fields that are on the boundary and subtracting from D or H fields that are next to the boundary Therefore, Eqs. (3.26) through (3.28) are still used, but they are imposed on an entire plane instead of just a line as in two dimensions, Another difference in three dimensions is the | additional surfaces at k = ka and k = kb. Figure 4.6 illustrates the k = ka boundary. The calculation of D,(i, j..ka), which is in the scattered field, requires the values of Hy (i. j. ka), which is in the total field. The difference between the two is the incident component of the Hy field. A similar difference exists at the k = kh boundary, where D,(i. j. kb + 1) is just above the scattered field, Therefore, besides equations similar to Eqs. (3.26), (3.27), and (3.28) the following are necessary Dy(i. j + 1/2. ka) = Deli, j + 1/2. ka) = SMe inci) (4.70) | Deli f+ V/2.kb +1) = Deli jf + /2.kb +) +S He ne) (4.7b) 4z The plane wave is venerated at this wall = Figure 4.5 Toialscattered field in 3D, 4.3.1 A Plane Wave Impinging on a Dielectric Sphere Now that we have a program that gererates a plane wave in three dimensions, we will want to start putting objects in the problem space to see how the plane wave interacts with them. In two dimensions, we chose a cylinder because we had an analytic solution with which 86 Chapter 4 Three-Dimensional Simulation ska +1) fn Toa ies —e Hgiikay ha QO scaeesiat bin, @ Daijkay SP HGiika-) tn, fu x Figure 46 Toval/scattered field boundary we could check the accuracy of out calculation via a Bessel function expansion. It turns out that the interaction of a plane wave with a dielectric sphere can be determined through an expansion of the modified Bessel funetions [4] Specifying a sphere in three dimensions is very similar to specifying a cylinder in two dimensions. The major difference is that it must be done for all three electric fields. The following code specifies the parameters needed for the E, field calculation: for ( isia; for ( j= ja: j < jb; j++) { ( i< ib; ive) { for (k= ka; k < kb; k++} { xdist = (ic-i); ydist = (je-3); zdist = (ke-k-.5); dist = sqrt (pow (xdist,2.) +pow(ydist, 2.) +pow(zdist,2.)) if( Gist <* radius) { gaz [i] (3] {kl = 1./(epsilon + (sigmatdt/epsz)) ; gbz [i] (3) (k] = sigma*dt/epsz: in Besides the obvious differences, e.g., three loops instead of two, there is another that should be pointed out; the parameter zdist calculates the distance to the point as if it were 1/2 a cell further in the z direction. That's because it is! Look at the diagram of the Yee cell in Fig. 4.1, Each E field is assumed offset from i, j, k by a half a cell in its own direction. In Fig. 4.7, we show a comparison between FDTD results and Bessel function expansion results for a plane wave incident on a dielectric sphere. The sphere had a diameter of 20 em, a dielectric constant of 30, and a conductivity of 0.3. The FDTD program is 40 x 40 x 40, and Section 4.3 m Total/Scattered Field Formulation in Three Dimensions 87 on ° g £ 00s 50 Miz So 3 ° 5 10 ee 20 200 Mi 3 poe 02, a 0 5 10 CREE euee scenes ens s ues eens nnn Tso nnE sree ne nou 06 z soo Miz E04 02 6 Sto 0 5 10 Figure 4.7 Comparison of FDTD calculation (circles) with Bessel function expansion ‘calculations (lines) along the main axis ofa dielectric sphere, 20 em in diameter With & = 30 and ¢ = 0.3. The program for the FDTD calculation used the simple “in or out” strategy to determine the paraanetes. uses a seven-point PML. Apparently, the “in and out” method of determining the parameters like gaz and gbz is not as forgiving as it was in vxo dimensions! This method of determining parameters in three dimensions will give the same “stait- casing” that we faced in two dimensions. We can do an averaging aver subcells to improve efficiency. We might jump to the conclusion that because this meant averaging subcells in a plane in two dimensions, we will have to average subcubes in three dimensions. It wetns out that this is not the case. Figure 4.8 illustrates the calculation of E., which uses the surrounding H, and H, values. Since this calculation is confined to a plane, we may think of the calculation Medium 2 Medium 1 HG 4 12, j.k 1D) "= - keen? G+ U2 jk 12) Figure 4.8 £. is calculated by the surrounding #1, and H, parameters. The paraineters used to calculate B. are determined by the percentage of subcells that Tie in each medium. In the above example, six subcells are in mediums { and three subeells are in medium 2, Chapter 4 Three-Dimensional Simulation o € os sont oF 5 0 3 vo oa 200 He as s 02 q on 0 5 0 06 soe gos e o2 cs 0 5 0 Figure 4.9 Comparison of FDTD calculation (circles) with Bessel function expansion calculations (lines) along the main axigof a dielectie sphere, 20¢m in diameter, with &¢ = 30 and ¢ = 0.3. The program used for the FDTD calculation averaged over nine subcells within each cel to determine the parameters of E- as being a two-dimensional problem. Therefore, in determining the parameters gaz and gbz, we will go by how much of the area of the plane containing H, and H, is in each of the different media. The following code averages the properties over nine subcells for (j= ja; i < $b; des) [ for ( ivia; i < ib; ies) { eps = epsilon(0); cond = signa (0); for (jj = -2; dj <= di afer) { for (id = -1; di <= 1; dive) { xdist = (Ac-i) + 33341; ydist (je-j) + .333*94; zdist (je-5--5); dist sqrt (pow (xdist,,2.) +pow(ydist,2.) +pow(zdist,2.); for (nel; n c+ numeyl: n++1) { if ( dist <= radius) { eps = eps + (1./9)*(epsilonin] - epsilon[n-1]); cond = cond + (1./9)*(sigmafn] - sigma(n-3]); hy y gaz (i) (4) = 1./(eps + (sigma*at/epsz)); gbz (i) (j} = cond*at/epsz; v) References 89 Figure 4.9 repeats the FDTD/Bessel compa Clearly, it results in an improvement. json, but with the averaged parameter values. PROBLEM SET 4.3 1. Add the plane wave propagation (o your 3D FDTD program. Make sure that it can propagate a wave through and subtract it out the other end. (See the program fd3d_4,2.c). 2. The program fd3d_4.2. creates the spheres by duplicate the results of Fig. 47. n or out.” Get this program running and 3. Use the averaging technique to get a more accurate calculation of the parameters, and duplicate the results of Fig. 4.9. REFERENCES [1] K.S. Yee, Numerical solution of initial boundary value problems involving Maxwell's equations in isotropic media, IEEE Trans. on Antennas and Propagation, vol. AP-17, 1996, pp. 585-589. [2] D. K. Cheng, Field and Wave Electromagnetics, Menlo Park, CA: Addison-Wesley, 1992. [3] D. M. Sullivan, A simplified PML for use with the FDTD method, /E1 Wave Letters, vol. 6, Feb. 1996, pp. 97-99. [4] R. Harrington, Time-Harmonic Electromagnetic Fields, New York: McGraw-Hill, 1961 Microwave and Guided 90, Chapter 4 m Three-Dimensional Simulation /* #434_4.1.c. 3D FDTD. Dipole in free space.*/ # include # include # include define IE 40 fdefine JE 40 define KE 40 main () { float gax (IE) (JE) (KE) ,gay (1B) [JE] [KE] , gaz [TE] [JE] (KE) ; float dx (TE) [JE] (KE) , dy (TB) (JE) (KE) , dz [1B] [JE] [KE] ; float ex (IE) [JE] (KE) , ey (TH) [JE] [KE] , ez [1B] [JE] [KE] ; float hx (IE) [JE] (KB) ,hy (1B) (JE) (KB) , hz [TB] [JE] (KE) ; int 1/n,4,3,k,i¢, jc,ke,nsteps,npml; float ddx,dt,7,epsz,pi,epsilon,sigma,eaf; float xn,2xn,xnum,xd,curl_e; float to, spread, pulse; FILE *fp, *fopen(); ic = 18/2; je = 38/2; ke = KE/2; dax = 01; /* cell size */ at =ddx/6e8; /* Time steps */ epsz = @.8e-12; pis3.1425 /* Initialize the arrays */ for ( k=0; k < KE; ket) { for ( j=0; | < JE; ++) { for ( i=0; i < IE; ise) { ex [i] [3] (x) ey [4] (41 0&1 ez [4] (3) (x) @x (4) (91 043 ay (4) (31 «1 az [i] (31 01 hx (4) (51 0 hy (41 3] Oe) hz (4) (5) Oc) gax (4) [3] 0 gay (4) (3) 0 gaz (i) (3) Oe /* specity the dipole */ C Programs or for ( kell; k < 30; kts) ( gaz lic] (Jel (kK) = 0.5 d gaz [ict (jel [ke] = 0.; 0 = 20.0; spread = 6.0; nsteps while ( nsteps > 0) ( printf( "nsteps --> "); scanf("td", gnsteps) ; printé("%d \n", neteps); for (nel; a % include # include fdefine TE 40 fdefine JE 40 fdefine KE 40 fdefine ia 7 define ja 7 fdefine ka 7 #define NFREQS 3 main () ( float dx (1#] [JB] (KB) , dy (1B) (9B) (KE) , dz [TE] (JE) (KET; float ex (1B) (JB) [KE] , ey (TE] [JE] [KE] , ez [TE] [JE] [KE]; float hx (TE) [JE] [KE] , hy (TE) (9B) (KE) ,hz [TE] [JE] [KE]; float ix (TE) (98) [kB], iy [ZB] [9B] (KE), i2 [18] [9B] [KE]; float gax(I8] [JE] [KE] , gay [TE] [JE] [KE] , gaz (TE) (JE) [KE] ; float gbx{TB] {9B} [KEL ,gby (El (E] [KE] ,gbz [TE] [JE] [KE] ; int 1,m,n,i,j,k, ic, je,ke,nsteps,n_pml; float ddx,dt,T,epsz,muz,pi,eaf ,npml; int ib, jb, kb; float xn, xxn, xnum,xd,curl_e; float t0, spread, pulse; FILE *fp, *fopen(); float ez_ine (JE) ,hx_inc [JB] ; float ez low ml,ez_low m2,ez_high_ml,ez_high m2; float idx (ia] (JE) (KE), idxh{ia) (JB) [KE]; float ihxl [ia] (JE] (KE), ihxch [ia] (JE) [KE] ; float idyl (TE) (ja] [KE], idyh [TE] (jal (KE); float ihyl (18) (ja] [Ke] , ihyh (TE) (5al (KE); float idz] [18] (JE] (ka), idzh (1B) [JE] (kal; float ihzl [Te] (JB] (kal, ihzh(TB] [JE] (kal ; int ixh, jyh, kzh; float gi (TE) ,gi2 (TE) ,gi3 118) + float 91 (JE) ,g}2 (98) ,g33 [JE] ; float gki (KE] , gk2 [KE] ,gk3 (KE] > float £11 (1B) , £12 (TE) , £43 [TB]; float £31 (08) , £52 (JE) ,£)3 1981; float ki [KE], fk2 [KE] , #3 [KE] ; float curl_h,curl_d; float radius (10) , epsilon [10], sigma [10] ,eps, cond; int ii, jj,kk,numsph; float dist,xdist,ydist, zdist; C Programs float freq [NFREQS] , arg (NPREQS] ; float real_pt (NPREQS] [TE] [JE] ,imag_pt [NFREQS] [1E} (81 ; float amp {IB} [JE] , phase (1E] (JE) ; float real_in{5],imag_in(S] ,amp_in (5) ,phase_in [5]; ic = 18/2; je = JE/2 ; ke = KE/2; ib = IE - ia - 1; jb = gE - ja-1; kb = KE - ka - 1; pi = 3.14159 epez = 8.8e-32; muz = 4*pitl.e-7; ddx = .01; y* Cell size */ dt = ddx/6es; j* Time steps */ /* Initialize the arrays +/ for ( j=0; j < JB; j++) { ez_inc[j] = 0. hx_inctj} = 0. for ( keO; k < KE; ker) { for ( is0; i < IE; itt) { ex(il (1 {kl= 0.0 ; ey [i] [J] [el= 0.0 ; ez [4] [3] (K1= 0.0 ; dx [il [3] [k]= 0.0 ; ay{i} (1 fkl= 0.0 dzli) [i] (k]= 0.0 ; hx li] [j] (k]= 0.0 ; hy[i] (3) Id= 0.0 ; heli) G] (k= 0.0 ; axl] Gj] Ued= 0.0 5 iy (i) (1 [k]= 0.0 ; a2 G1 G1 Od= 0.0 5 gax (il [i] (kl= 1. 5 gay (i) (1 fk gaz(i] (j] [k]= 1. 5 abx (i) [5] [l= 0. 5 aby [i] (31 [k gbz [i] 15] [k yy 3 for ( n=0; i < NFREQS; nt+ ) { real_in{n] = 0. imag_in{n] = 0.; for (420; j < OB; j++) { for ( is0; i < TB; itt) { real_pt[n} [4] {j] = 0.; imag_pt in} i] [J] = 0.7 96 ye /* Parameters freq(0] freq[1] = 100 freq[2] = 433. lo. Chapter 4 s Three-Dimensional Simulation for the Fourier Transforms */ 6; 66; 26; for ( ne0; n < NFREQS; n++) printf ( "$2d ¥6.2£ $7.5£ \n")n, freqin]*1.e-6,arg{nl); { { { {argin] = 2*pitfreq{nl *at; } for ( i=0; is ia; ist) { for ( j=0; j < JE; j++) for (20; k < KE; k++) { idx (4) 192 Ges = 0.0; idxh(i] 13] Oc) = 0.0; ihxl [4] [5] Ik] = 0.0; iheeh [4] [9] Ok] = 0.0; oy} for ( is0; i < TE; iss) { for ( 3-0; 3 < jar j+t) for ( k=O; k < KE; kes ) idy1 (41 (31 0) = 0.0% dayn (i) (1 tk] = 0.0 ahyl(4] (31 (d= 0.0; ahyh(i] [5] Uc] = 0.0; ,oyd for ( idzi[ idzh i ihz1 (i ihzh[i roy) i < IB; ise) { Boundary Conditions +/ gi2 ti} £42 (4) gi3li) = f£43{i] = } 5 < 9B; j++) pk < kay kee) 114] 1k) = 0.0; 1 (310k) = 0.0; 1 (4) 0k] = 0.0; 1131 Uk] = 0.0; i< TE; ise) { { { C Programs for ( }<0; j < JE; j++) { gilli] = 0.5 f£41(j]l = 00; 932) = #3201 = o3G1 = £3301 = } for ( k oki (k] £k1 (e] ok2 [] £k2 (k] gk3 [kl] £3 [] } k < IB; ket) { print£( "npml --> "); scant ("$£", gnpml) ; printé("$f \n", npml); n_pml = npml; for (ist: i < mpml; iss) { xxn = (npwi-i) /npml ; xn = .33*pow (xn, 3.) 5 print£( "$d xn = 38.4f xn = $8.4 \n", 3 20«n ,2n) 7 fi1(i] = xn; fi1(TE-i-1] = xn; giz [i] = 2./(1.4xn); giz (TB-i-2] = 1./(2.4xn); is [4] = (1.-xn) / (1.920) ; gid (TE-i-2) = (1.-xn) /(1.4xn) ; xxn = (npml-i-.5)/mpml; xn = .33*pow (xx, 3.07 gill] = on; gi1[TE-i-2] = xn; £42(4] = 1./(1.4xn): £42(TE-i-2] = 2./(1.+xn); £43(4) = (L.-xn) /(L.+xn); £43 (TB-i-2] = (1.-xn)/(1.+xn); printf ( "£ \n"); for ( is0; i < IB; ite) { print£( "$2d %6.4£ $6.4 86.4f $6.4f\n", 4, £42 [4] ,gi2 141,913 (11); print£( " %6.4£ 86.4f $6.4 $6.4f\n", gil (i) £4204), £43040); 98, Chapter 4 m Three-Dimensional Simulation } for ( j=0; j < mpm; xen = (npml-j) /npml ; ged xn = .23*pow(somn, 3.) ; #91) = xn; £41 [5B-3-1) = x g32(5] = 1./(1.+xm ; gi2(9E-j-1] = 1./(1.4xn); 94315) = (2.-xm) /(2.42n); 933 (JB-j-1} = (2.-xn)/ (2.4m); xexn = (npml-j-.5)/npmi; xn = .33*pow(0m,3.); gi21(4) = xn; gj1(5B-j-2] = xn; £5203) = 1./(2-+xn); £2(9B--2] = 2./(2.4xn); £9305) = (2.-xn) /(.4xn) ; £53(9E--2] = (1.-xn) /(2.4xn) ; print€( "fj & 9) \n"); for ( j=0; j < JE; j++) { printé( "82d $6.4 $6.4f $6.4f %6.4f\n", 3, €52 15191205) 953091) print£( " 86.4f $6.4 $6.4€ ¥6.4£\n", g§2 (5) £5205), £93050) } for ( ke0; k < n_pml; K+) { xexn = (npml-k) /apml; xa = .334pow (en, 3.) 7 fka Uk] = xn; ki [RB-K-2] = xn; gk2(k) = 2./(2.+3n) ; gk2 [KE-K-1] 7 (hon) 5 Gk3(k] = (1.-xn) /(2.+xn) ; gk3 [KE-k-1 own) / (1.43); xxn = (npml-k-.5) /npml; xR .33*pow (om, 3.17 gki tk] = xn; QkL(KE-k-2] = xn; fk2(k] = 2./(2.42n) 5 £k2 [KE-k-2] Ahn): £3 Ok) = (1.-xn) / (1.49) ; £3 (KE-k-2) = (2.-xn} / (1.4m) ; printé( "fk & gk \n"); for ( ke0: k < JE; kes ) { Programs » printf( "$2d 4%6.4f $6.4f %6.4f %6.4£\n", k, ERL TRL gk2 (k) ,gk3 [k]) 5 printf( " 46.4f %6.4f %6.4f %6.4f\n", gk (k] , £2 [k] , £3 (k]) ; } /+ specify the dielectric sphere +/ epsilon{o) = 1 sigma (0) oF printf( "Number spheres --> scant ("$d", gnumsph) ; printf( "numsph= $d \n ",numsph) ; for (n = 1; n «<= numsph; ne+) { print£( "Sphere radius (cells), epailon, sigma --> "); scanf ("tf $f $f", sradius{n], &epsilon(n), ésigma{n}); printf ( "Radius = %6.2£ Eps = %6.2f Signa = $6.2f \n ", radius [n] ,epsilon in] , sigma (n]); ' for (mn = 0; n <= numsph; nes} ( printf ( "Radius = %5.2f Bps = %6.2f Sigma = 46.2f \n ", radius (n] ,epsilon(n] , signa (nl) ; Ie calculate gax,gbx +/ for (i = ia: i< for (j= jar i< for (k = ka; k< eps = epsilon(0]; cond = sigma (0) ; yaist = (je-3); xdist = (ic-i-.5); zdist = (ke-k); dist = sqrt (pow(xdist,2.) + pow(ydist,2.) + pow(zdist,2.)); for (n=l; ne= numsph; n++) ( i£( dist <= radius{n}) { eps = epsilon(m); cond = sigmatn] ; } } gax(il (3) (k] = 1./(eps + (condsat/eps2)} ; gbx [i] [j] [k] = cond*dt/epsz; Hh printf( * Gax \n"); for ( j=jaz j <= jb; j++) ( printf ( "$3d",3); 100 Chapter 4 @ Three-Dimensional Simulation for ( isiay i co ib; ist) { printf ( "#5.2£",gax[i) (j] (kel) ; } printé( " \n"); } fclose (Ep) ; n calculate gay,gby */ for (i= da; i < ib; itt) { for (j= jar 5 < Sb; j++) { for ( k = kay k < kb; ket) { eps = epsilon(ol; cond = sigma[0]; xdist = (ic-i); ydist = (je-j-.5); zdist = (ke-k); dist = sqrt (pow(xdist,2.) + powlydist,2.) + pow(zdist,2.)); for (n=2; ne= numsph; n++) { if( dist <= radius(nl) { eps = epsilonin] ; cond = sigma(n] ; } } gay li] (G10) = 1./(eps + (cond*at/eps2)}; gby [i] [J] k] = cond+at /epsa; MY printf( * Gay \n"); for ( jeja; j <= jb; j++) { printf ( "3d", 5); for ( isia; i ce ib; ist) { printf ( "%5.2£",gay([il] (j] [ke]l}; }) printf( " \n"); } €close (Ep) ; a calculate gaz.gbz */ for (i= ia; i < ib; ise) { for (j= jar j < Sb; j++) { for ( k = ka; k < kb; kes) { eps = epsilon(ol; cond = sigma lo) ; xdist = (ic-i)l; ydist = (je-j); zdist = (ke-k-.5); dist = sqrt (pow(xdist,2.) + pow(ydist,2.) + pow(zdist,2.)); for ( numeph; n++) { if( dist <= radius(n]) { eps = epsilonin] ; cond = sigmain]; } gazli) (5) (k) = 1./(eps + (cond*at/epsz)); gbz li] [j] [k] = cond*dt/epsz; C Programs: 101 vy printé( "Gaz \n"); for ( jeja; i <= jb; j++) { printé( "834", 3); for ( isia; i c= ib; ite) ( printé( *5.2£",gaz (il [4] [kel]; } printf ( " \n"); } close (fp); £0 = 40.0; spread = 10.0; Teo; nsteps = while ( nsteps > 0) { printf( "nsteps --> "); scanf ("#d", snsteps) ; printf ("sd \n", nsteps); for (neiy n censteps ; nee) Tetea y Start of the Main FDTD loop - s /* Calculate the incident butter */ for ( js oe; 5H) { ez_ine(j] = ez_inc(j] + .5*( hx_inc(}-1] - hx inclj] ); } /* Fourier Tramsform of the incident field */ for ( m=0; m < NFREQS ; m+ ) { real_in[m] = real_in{m] + cos(arg{m]*T) *ez_inc(ja-1] imag_in{m] = imag_in{m) - sin(arg[m)*T)*ez_inc{ja-1]) + /* Source */ /* pulse = sin(2*pisgoorlestateT); */ pulse = exp(-.5* (pow((t0-T) /spread,2.0) }); ez_inc(3]_ = pulse; printf ("t4.0f %6.2£ \n *,T,pulsel; 7/* Boundary conditions for the incident buffer*/ ez_inc[0] = ez_low m2; ez_low_m2 = ez_low ml; ez_low_ml = ez_ine(i]; 102 Chapter 4 Three-Dimensional Simulation ez_inc(JB-1] = ez_high_m2; ez_high_m2 = ez_high ml; ez_high_m1 = ez_inc(JE-2]; /* Calculate the Dx field */ for ( isl; i< ia; i++) { for ( j=1; 4 < JE; j++) { for ( kel; k < KE; kes ) ( eurl_h = ( ha {i] (5) 0c) - he (il (5-21 Ok] = hy li GG) Oe) + hy Gi) GI) Deal); idx (4) (51 0k] = ded (4) (51 0K) + curl; ec] [5] Uk] = 99305] *gk3 Uk] tax (4) (51 Tk] + 9§2(5] *gk2 (kl *.5*(curl_h + gi [i] #idx) [4] (5) (k)); }y} for ( isia; i <= ib; it+ ) { for ( j=l; j < JE; j++) { for ( k-1; k < KE; k++ ) { curl = ( hz (i) (5) Oc) - he il (3-1) Oe) - hy(i] (j] [k] + hy[il{3] (k-1]) ; x4] 51 Oc) = 99319] ¥9k3 Ok] *ax (4) (3) [1 + 9§2 [4] #gk2 (31 *-Stcurl_h ; for ( isibe1; i < IB; iss) { ish = i - ib - 1; for ( j=1; j < JB; j++) { for ( kel; k < KE; kes) { curl_h = ( he (i) [3] (k] - hefi) (3-1) tk) = hy (4) (5) Ok) + Ayla) GG) 0k-a)) idxh [ixh] [3] Uk] = idxh (ixh] [7] Ue] + curl_h; bei] (5) Del = 993 1] *gk3 [ke] *dx (2) (4) 0) + g}2(4] *gk2 [k]*.5*(curl_h + git (i) *idxh[ixh) (5) [k]); Py} /* Calculate the by field */ for ( isl; i < TB; itt) { for ( jel; j < ja; j++) { for ( kel; k < KE; k++) { curl = (hx (i) (910k) = efi) (3) Oe-2) > hz (4) (9) Ok) + he (4-2) (5) Del); Say] (4) (5) Ok) = ddyl (4) (5) (k] + curl_h; dy [4] 15} Ok) = 9i3 Li] +93 [ie] *ay (4) [5] De) + giz (4) *gk2 (k]*.5*( curl_h + 9)2(5]#idyL (4) [31 1k]); yoy} for (isl; i < TB; ite) { for ( dbs i++) { C Programs 103 for ( kel; k < KB; k++) { eurl_h = ( hx(i} (4) 0c) - hx fi] (3) Uk-2) = be (4) (9) Ok) + Re C4-1] (5) OKI); @y [4] 5] DA) = gi3 143 +943 (he) +ay C4 G51 Cel + gi2 [i] *gk2[k]#.5* curl_h ; for ( isl; i < TB; ise) { for ( j=jbel; 5 < OB; j++) { jyh = j - jb- 1; for (kel: k < KE; k++} { curt_h = ( hx (i) (51 De - bx (4) (3) O-2) = he (S] (91 Ok] + he [4-2] (51 0K); idyh [4] [jyh] (k] = idyh (4) (4yh] (4) + curl; ay (4) (4] Uk] = 943 Ci] *gk3 ie] *ay (4) (5) [1 4 gi2L[4] #gk2(k]¥.5#( curl_h + 991 (3) *idyh [4] [Jyh] (e]); /* Incident Dy */ for ( isda; i <= ib; iss) ( for ( de3a; 3 <= db-1i G++) ( ay (4) [§] (kal = ay (4) (5) [kal 5*hx_ine (31; ay [4] (5) Oxb+a) = dy (a) [5] (xbe2] +. 5¢hx_ine [3]; /* Calculate the Dz field */ for (ist; i < IB; ive) { for ( j=1; J < JB; jee) { for (k=O; k < ka; kee ) { curl_h = ( hy(i) (3) Ok) = nyfi-2] (5) 00 = h(i] (51 0k] + Wx i §-21 OD): idz1(4] [4] Oe] = idz1 (4) (5) Ok] + curl_h; dz (i] [5] Uk] = gi3 [i] #9434] #42 (i) (5) Ded + gi2(il*g}2(3]*.5*( curl_h + gkt[k] ide) (4) (51 (k] ); bt for ( isl; i < IB; ise) { for ( j=1; 3 < JB; 54) { for ( kska; k <= kb; k++) { curl = ( byfi) (9) 06) - hy(i-2] (3) be) = hx (i) (5) [ke] + hoe (4) (5-1) 0k)) = 42 [i] [J] (kl = gi3 [i] *g}3 (4) *4z [4] (5) [e) + gi2[4]*g}2[4]¥.5* curl_h ; yy} for ( isl; i < Im; ite) { for ( j=1; j < JB; j++) { for ( kekbt+1; k < KE; k++) { 104 Chapter 4 Three-Dimensioral Simulation kzh = k - kb - 1; curth = ( hy{iJ (51 0 - hyli-1) (9) Oe) = hx (i) 19 OK) + oe (4) (G-2) Od) idzh (i) (j] tkeh] = ddzh[i] [3] Ge2h] + carl_h: dz [i] (31k) = 943 (4) +933 (51 *d2 (4) (3) Od + gi2(i]*g2(5)*.5*( curl_h + gki[k]*idzh [il [4] [keh]; yyk /* Incident Dz */ for ( isia; i <= ib; itt) { for ( keka; k <= kbj k++) { az [i] [jal fk] = dz (i) (al (kl + .S*hx_ine[ja-11; az{S] GBI Ek) = 620i] (3b) (el - .S*hx_ine [3b]; bo} /* Source */ /* pulse = sin(2*pi+400*1e6+at+r) ; for ( k=ke-6; k <= kea6; k++ } { dz [ic] [je] tk] = 0.7 } pulse = exp{-.5* (pow ((to-T) /spread,2.0) )}; dz[icl [jel [ke] = pulse; print£("$4.0f 46.2f \n “r,polsel; */ /* calculate the B from D field +/ /* Remenber: part of the PML is Ex0 at the edges */ for (ist; i < IB-d; ise) ( for ( jel; j < OB-A; dee) [ for ( kel; k < KE-1; kt) { ex (4) (41 Ok] # gax [i] (5) (i) * (@x (4) (5) Ok) ~ ix (4) 192 060); inc(i] [9] (kJ = ix (4) (5) Ok) + gbx [i] [5] (ie) vex (i) (51 [kK]: ey (4) (31 Ue] = gay (i) (5) Ol * (dy (4) (41 OK - iy (47 151 01); ayLi 93 (1 = dy (41 (5) (k} + gby (i) (G3) Ok) vey La) (5) Oe; ez (i) (41 Uk] = gaz (4) (9) Dd * 4d (4) G] Ol - iz fi) (5) 1): 42(4] [5] Oe) = i204] (4) Ok] + gbz (i) (4) tk] *e2 143 G1 Ol; yd {* Calculate the Fourier transform of Ex. */ for ( 5-0; j < JB; i++) { for ( iso; i < JB; iss ) { for ( meso; m < NFREQS; m++ } { veal_pt (ml [i] (] = real_pt tm] (41 [31 + cos(arg(m]*T)*ez[i) [j] [ke] ; imag_pt {m) (i1(]] = imag_pt [m] [i] (3) + sin(arg[m]*T) *ez [4] [3] Ike} ; ae /* Calculate the incident field */ C Programs 105 for ( j=0; j < dB-1; j4+) { hx_ine[j] = hx_inc[j] + .5#( ez_inc[j] - ez_inc{j+1] ); } /* Calculate the Hx field +/ for ( is0; i < ia; i++) { for ( 320; j < JB-1; S++) { for ( 20; k < KE-1; k++} { curl_e = ( ey[i] (J) Desa} - ey fi) (3) Ok] ~ ec (i) (+1) tk] + ez [4] G1) : dbx] (4) (5) Ok] = ih) [i] (310) + curd_e; hx (4) [5] De] = £53 (51 *£3 (k] “hx (4) (3) UX] + £42(9] *£k2 [k]*.5*( curl_e + £11 [i] *inx] [i] [3] (k] ); for ( isia; i cm ib; ist) { for ($20; 4 < JE-1; i++) { for ( yok < KE-1; k++) { curl_e = ( ey (i) (3) (+1) ~ ey 4) (5) (i) > ez(i) (541) (k) + ezlil (5) Ue)) ; hoe [] (5) U6) = £49 (51 #f%3 (i) #hx 4) (5) Oe) + £52 [)) #82 1k)*.S¥curl_e ih for ( j=0; j < JB-1; j++) { for ( keO; k < KE-1; ker) ( curl_e = ( ey{i] (j] (kel) - ey fil (31 00 ex(i] (J+2) [k) + e2fi) 5) 06) + ihxh[ixh] (3] fk] = itech [ixh) [9] Oke] + curl_e; Dox (4) (3) Oc] = £53 (91 *£K3 Oe) #hx (4) (5) Ce] + €42U)] *£k2 [a] *.5*( curl_e + £41[i] #ihxh[ixh] (3) OK) 1; yy} /* Incident Hx */ for ( isia; i <= ib; ite) { for ( keka; k <= kb; k++) { bx [i] [Ja-1] [k] = hx[i] (ja-1] [k] + .5*ez_ine[jal; hx [i] [3b] De) bx [3] [jb] [k] - .S*ez_ine [jb] ; /* Calculate the Hy field */ for ( is0; 4 < TE-1; ist) { for ( j=0; j < ja; j++ for ( { pk < KE; kee) { 106 Chapter 4 m Three-Dimensional Simulation curl_e = ( ez{i+i] (j] 0k) - ezfi) (5) te) ~ ex (i) (3] [ken] + exc 4] (5) ORD) ahyl [4] [J] Uk] = aby] [i] (91 [kl + curl_e ; hy [4] (5) De] = £43 (4) *£k3 [ke] *hy (4) (5) Od + £42 [4] #£k3 fk] +.5#( curl_e + £31(5)]*ihyl (4) (3) Ol); ee) for ( is0; 4 < TB-2; itt) { for ( jaja; 3 <= jb; jee) { for ( k=0; k < KE-1; ket} { eurl_e = ( ez (isi) [j] Gel - ez (4) (3) Oe) - ex (i) (5) (ke2] + exfi] (3) 0) ; hy (41 [9] Uk] = £33 [4] *£k3 (kl *hy [4] (51 [k] + £42 [4] *fk3 [k]¥.S*curl_e ; hyd for ( is0; i < TE-2; ist) { for ( j=jbel; j < JB; j++) { jyh = j - jb-as for ( ke0; k < KE-1; kes) { curl_e = ( ez(i+2) [3] 0k) - ez (i) (3) 01 = ex {i} [5] Beet) + ext) GORD: ihyh(i] [Jyh] (1 = Ghyh [i] [yh] Uk) + curl_e ; hy (4) (3) Ok) = £43 (41 ¥£k3 (i) #hy [4 (51 01 + £12 (4) #£k3 [k]*.5#( curl_e + £51(5] *ihyh (i) Ciyhl Ok] 1; yo} /* Incident Hy */ for ( jaja; j <= jb; j++) { for ( k-ka; k <= kb; ket) { hy[ia-2] [3] Ok) = hy[ia-2] [31 0¢ - .5*ez_inclj]; hy (ib) [3] (k] = hy(ib] [3] (k] + .S*ez_ine [i]; Vy /* Calculate the Hz field */ for ( in0; 4 ¢ 18-2; ise) { for ( j=0; j < dB-1; j++) { for (ke0; k < ka; k++) { curle = ( ex{i] [j+1] Ok) ~ exfi) (3) ikl = eylied] (1 Oe) + evil G10) 05 inl [1] [4] (k) = ihz1 [i] [J] (ke) + curl_e; hz (i) (3) Ok) = £43 (4) *£53 0) *he2 (4) (5) Te) + £42 [414852 (5]*.5*( curl_e + fk1(k] *ihz} [4] [9] fel); for ( is0; i < TE-1; ite) ( for ( j 14 ‘Two Applications Using FDTD Sed a Figure 5.6 Toe electric field in the aperture E(x’, »") can be used to calculate the far Feld E(x, y, 2). Toe aperture is an opening ina metal plate that lies in the xy plane we also want to know the radiation pattern many wavelengths away from the slot. This would requiring modeling a prohibitively large problem space for simulation with FDTD. In cases like this, one usually uses the equivalence principle [5] to calculate the far fields after FDTD has calculated the near fields (6~10}. The necessary computation can often be considerable. In this section we present a method that calculates the far field at a few specific points as the FDTD simulation is running. We can do this because we know that the source of the far field is confined to a limited number of points in the slot. We will also use the equivalence principle, which says we can treat the slot of the antenna as a group of radiating currents, similar (0 an antenna. Therefore, we will only have to model the area immediately in front of and in back of the slot. This is illustrated in Fig. 5.7. The first thing we have to do is develop the formulation for the calculation of the external fields based on the field within the slot. Point ABC Incident array |— Aperture i Figure 5.7 Diagram of the FDTD program used Plane wave to calculate the data needed to determine the ex- source temal points Section 5.2 @ Calculation of the Far Field of an Aperture Antenna us This section illustrates several important characteristics of time domain simulation. Per- haps the most important is the following: while computer simulation makes possible the calculation of many problems which can’t be handled analytically, it does not replace electro- magnetic theory. Specifically, we will use the well-known Green’s function approach to calcu: late the far field. This section will further demonstrate how a complicated frequency domain expression can be converted into the sampled time domain for implementation into FDTD. 5.2.1 Formulating the Transformation from the Aperture We begin with the vector potential [11, 12] 1 eke AW) = fees 5 (5.3) an Jj = the current source, where R= ent = the Green's fun and the magnitude of R is R=[w-xP+-y¥ 42]. The primed parameters indicate the source while the unprimed parameters are the scattered field (See Fig. 5.6). The H field can be obtained by H=V,xA 64) Putting these together gives Jak H=—V, I(r" as’ a fe OR (5.5) fl ye ag =~ / Vx) dsr d 4 [x¢ ) R | i The integrand can be simplified by the following: eye ik om vr x r') Vex d(T (r') x ¥ [re] ae IO) ene = HT) eS ‘The V, x Jr’) term can be dropped because J(r’) is only a function of r’. Also, ce eae wt oy, R R and we - where FP (5.6) We now have — a Had ff (sere) (i+ as 3 116 Chapter $ @ Two Applications Using FDTD Sectio Using the principle of duality {5} we can deduce the following equation: 1) eke I (mer xA)( dk+ = nr) ($7) E an Now we have an expression for the external & field in terms of the magnetic current Min the aperture. The magnetic current is a fictitious current that is calculated from the & fields in the aperture [5]. We know that the fields in the aperture result from an x-polarized plane wave, and the direction normal to the aperture is the z direction, so we can write M=2E, xii 2Eak x 2 = -2E WS. eke x x Ife Ears x (ie eas. per. 68) Hence, From Eg. (5.6) xPa(ndan so we can write the E field in terms of the two polarizations: Bas ff £,(jk+ 4) as" (5.9a) 125g ff re Balik t Rg) Gas 5: 1 x If Ea (sk+ 5 as. (5b) oper. rr, and r, represent the portions of the unit vector F in the x and < directions, respectively. From here on, we will restrict our development to the E, term, which is the dominant term as long as the incoming plane wave in Fig. 5.6 is x polarized. Just be aware that we could always come back and duplicate the following results for E,. We begin by separating E, into two terms 1 ewe = E Ras + in i cae te ee Starting with the first term, we will rewrite it a an explicit frequency domain function of x, Ex (5.10) yyand z Bale. y,z0) ff YO) ike R ay’ dy’ ie fe The following changes will be helpful jee d® AR gion co ‘So now we have Bale, y.2,0) = a Me ffi Cy snr. The first step to implementing an equation like (5.11) into the FDTD formulation is to take it to the time domain: 1 Eals.¥,2,0 = weredase [fr per. (1D yt = Rico) dx' dy’ (8.12) Section 5.2 m Calculation of the Far Field of an Aperture Antenna 7 ‘The exponential term in the frequency domain resulted in a retardation in the time doma Jeo term became a time domain differentiation. In FDTD, the time is quantized as n-At and the distance R is quantized as RE Ax-Ra where 4.x is the cell size used in the FDTD simulation. (We use cubic cells, i., Ax = Ay = Az.) We will use the usual relationship between the time step and the cell size: Ax 2-00 Therefore, the retardation in E, in Eq. (5.12) is approximated by R_ Rae Ax _ Raz -(St-2¢0) & % We will further use the spatial quantization = 2+ Rar At (8.13) x Si-Ax,y=j-Ax, andz=k- Ox togive Ea(x',y',t — R/co) = Eqli', j'n —2+ Ras). (5.14) The first-order approximation for the time derivative in Eq. (5.12) is i’, j',n—2+Ray) — Eali', jn = ar 2: Ras) d abel Yt ~ Rico) For convenience, we will define the parameter del_ER(i, jpn —2-Rar) = Eali', j’,n —2- Ray) — Eali’, j'.n—1-2- Ray). 6.13) ‘The finite difference approximation of Eq. (5.12) is a ot del_ER(', j',n—2+ Rad EnG AWS 5, ar Ray Dx AF (5.16) rr del_ER@, jn ~2- Ras) ~ ae Rar Ax -(Ax/2- 0) By dividing out extra terms, we obaain the expression 17) We will now go back and ed the second term of Eq, 10) into the time domain -L ff. Falts Yet = RIO) gr gy over Following the same quantization procedures, we obtain the following expression: : al ENG. jn 2: Rao En Gi = 50 nae (5.18) Finally, we write the two components of E, together: EN" EvG, Mel DLas [et EMG, jn —2- Ras) + na Res) 6.19) 2- Rar Obviously, we would obtain identical expressions for the calculation of E, in Eq. (5.9), except with an r, term instead of an r, term. 18 Chapter $m Two Applications Using FDTD ‘There is a point worth emphasizing: Eq, (5.19) was developed using no assumptions other than Eq, (5.8), which assumes that the magnetic current is exclusively y polarized because the incoming plane wave was z polarized. These equations are not far field approximations, nor are they restricted to the area perpendicular to the aperture. 5.2.2 Verification of the Accuracy of the Transformation ‘The accuracy of this method is verified by using an FDTD program that calculates the E field at three external points via Eq, (5.19) and compares these to the FDTD computed values. Thisis illustrated in Fig. 5.8. The FDTD program is 140 x 100 x 100 cells and occupies twelve megawords of core memory on a Cray T90 supercomputer. It is bordered by a 15 cell PML. Each cell is a 1.cm cube. The slot antenna is a rectangular aperture that is 10 em in the X direction and 5 cmin the ¥ direction in Fig. 5.6. The plane wave pulse is a Gaussian pulse 0.25 nanoseconds wide. A simulation is illustrated in Fig. 5.9 showing the incoming plane wave interacting with the aperture. The comparison results are shown in Fig, 5.10. The first plot, labeled Source, is the Gaussian pulse of the incoming plane wave. The second plot, Egrid, is the E field in the center of the aperture. The third plot, labeled E-deriv, is the derivative function of Eq. (5.15). The other plots correspond to E field data at the points in Fig. 5.8, with the solid lines representing the FDTD simulation and the dashed line the computation of, Eq. (5.19). Point 1 is 2.cm directly perpendicular from the center of the aperture; point 2 is 80 ‘om out. Point 3 is also 80 em from the aperture, but 30 cm to the side. Clearly, the agreement is quite good. These points were chosen as representative. We could have done the calculation Metal sereen Plane wave Figure $.8 Diagram ofthe problem space for the three-dimensional FDTD program. By using the time domain values inthe aperture, the time domain fields at points, 1.2, and 3 are calculated via Bq, (5.5), The accuracy is verified by comparison withthe time domain data calculated directy by the FDTD program, Point 1 is 2 cm in front of the aperture, point 2 is 80 cm in front of the aperture, and point 3 is 80cm from the aperture and 30 em tothe side Se Section 5.2 m Calculation of the Far Field of an Aperture Antenna 119 hh i, : i) 149 99 Figure §.9 Simslation of a plane wave hitting a slot ina metal sereen, as illustrated in Fig. 5.8, Afier 100 time steps the plane wave is propagating oward the sereen, After 150 steps, it his hit the screen, and part of it has started to propagate through the aperture, By 170 steps, part ofthe pulse has made it through the aperture, while the majority has been reflected. After 270 steps. the pulse resulting from the interaction with the aperture is propagating away from the slot for any number of points at any position in the three- far out of reach of a reasonable FDTD computation. It is interesting to compare the shapes of point | with those of points 2 and 3. Look at the Egrid plot in Fig. 5.10. Its amplitude is an order of magnitude greater than E-deriv. However, in the generating function of Eq. 5.19, the function £, is divided by an additional term of Ras compared with the derivative function de!_E,. It is not surprising that the waveform at point 1 resembles Egr id more closely than E-deriv, because it is in the near field and the additional 1/Ray effect has not attenuated it. However, when we get to point 2, which is, 80 cm away, the Egr id term has been substantially attenuated compared to E-deriv, and points 2 and 3 both resemble £- der iv more closely. This simulation was done in the large FDTD space to verify the method. Now that we have confidence in the accuracy of the transformation, we can go back and use the much smaller problem space illustrated in Fig, 5.7 to calculate any points in the far field. You may have already noticed one glaring disadvantage to this method: the far field is only being calculated at a small number of points. Of course, we could increase this number very substantially, but it still would not give us the time domain wave patterns that we are able to see when using FDTD. We could simply store all the time domain data that appears in the aperture. Then we could go back and generate the far field at any given time, However, the storage of all that time domain data could be a problem, particularly if the aperture is fairly large and the time domain excitation is fairly long. mensional space, including distances 120 Chapter 5 Two Applications Using FDTD Figure 8.10 Comparison of the transformation values and the direct FDTD as illustrated in Fig.5.8. The top graph labeled “Source” isthe Gaussian plane wave pulse that impinges on the metal screen. "E deriv” i the derivative ofthe field in he csmter ofthe aperture, as calculated by Eq, (5.13). Points 1,2, and 3 show the comparison of the FDTD generated time domain data (Solid line) anv the ime domain data generated via Bq, (519). The aperture was 10 em (4 direction) by Sem (y diwston). The field was polarized. One solution is to use wavelets to compress the time domain data down to a manageable set of parameters [13]. Then the parameters can be uncompressed and the time domain used to generate the far fields [14]. The use of wavelets is beyond the scope of this book. However, it is mentioned to illustrate how important the use of signal processing techniques can be in doing FDTD simulation. 5.2.3 FDTD Implementation of the Far Field Calculations The file fdtd_far_field.c printout at the end of this chapter shows some of the critical parts of the program used to calculate the far field points via the transformation of Eq. (5.19). (The coordinates used in Fig. 5.6 are the traditional coordinates used in electromagnetic theory; specifically the Z direction is the direction of propagation. Of course, we are used to using the ¥ direction as the direction of propagation, so the coordinate system used in fdtd_far_field.c is essentially rotated ninety degrees compared to Fig, 5.6.) First of all, note that it would be very wasteful to stop and calculate the values for the parameters Ra, and r; every time, because Ref References 121 they consist of values that are used at every iteration. Therefore, they are calculated prior the main FDTD loop and stored in the arrays R_dist and x_z, respectively. Also note that the value n —2- Ras is an integer, so2- Ry Will have to be an integer. These values are stored in the array N_shift. The values of E,(i, j, 4) im Eq, (5.19) are calculated and stored in the array Bana. PROBLEM SET 5.2 |. Write a program to simulate a plane wave impinging on an aperture in a metal screen. By now you should have enough experience to alter one of your previous programs. Begin with the simulation of a plane wave. Add the metal screen in the main problem space, and in the incident butfer, as shown in Fig, 5.7. Your program should have the ability to generate a plane ‘wave and then subtract the reflection from the screen. 2, When you have the program of problem 5.2.1 running, then add the ability to put a rectangular aperture in the screen, You should be able to generate waveforms like the ones shown in Fig. 5.9. 3. Add the transformation of Eq, (5.19) to your aperture simulation, Duplicate the results of Fig, 5.10. REFERENCES [I] D.M. Sheen, S.M. Ali, M.D, Abouzabra, and J. A. Kong, Application of the three-timensionat finite-difference time-domain method to the analysis of planar microstrip circuits, [EEE Trans. Microwave Theory Tech., vol. MTT-38, July 1990, pp. 446-453. (2) P.C. Cherry and M.F.Iskander, FDTD analysis of high frequency electronic interconnection effects, IEEE Trans. Microwave Theory Tech., Wol. MTT-43, Oct. 1995, pp, 2445-2451 [31 S. G. Garcia, T. M Hung-Boa, R. G. Martin, and B. G. Olmedo, On the application of finite methods in time domain to anisotropic dielectric waveguides, IEEE Trans. Microwave Theory Tech., vol. MTT-44, Dec. 1996, pp. 2195-2206. [4] A.P. Zhao, J Juntunen, and A. V, Rasisanen, An efficient FDTD algorithm for the analysis of mi- crostrip patch antennas printed on a general anisotripoc dielectric substrate, [EEE Trans. Microwave Theory Tech., vol. MTT-A7, July 1999, pp. 1142-1146, 15] R. Harrington, Tme-Hurmonic Electromagnetic Fields, New York: McGraw-Hill, 1961 [6] A. Taflove, Computational Electrodynamics: The Finite-Difference Time-Domain. Boston: Artech House, 1995 [7] K.S. Yee, D. Ingham, and D. Shlager, Time-domain extrapolation to the far field based on FDTD calculations, IEEE Trans. on Antennas and Propagation, vol. AP-39, March 1991, pp. 410-413. [8] R.J. Luebbers, K. S. Kunz, M. Schneider, and F. Hunsberger, A finite-difference time-domain neat Zone to far zone transformation, IEEE Trans. on Antennas and Propagation, vol. AP-39, March, 1991, pp. 29-433 (9] M. Kragalott, M. S. Kluskens, and W, P, Pala, Time-domain fields exterior to a two-dimesional FDTD space, /EBE Trans. on Antennas and Propagation, vol. AP-45, Nov, 1997, pp. 1655-1663. [10] J. De Moerloose, and D. De Zutter, Surface integral representation radiation boundary condition for the FDTD method, /EBE Trans, on Antennas and Propagation, vol. AP-411, Nov. 1993, pp. 890-895. [11] D.K. Cheng, Field and Wave Electromagnetics, Menlo Park, CA: Addison-Wesley, 1992 [12] S. Silver, Microwave Antenna Theory and Design. London: Peter Pergrinus, Lid., 1984 [13] G. Strang, and T. Nguyen, Wavelets and Filter Banks, Wellesley, MA: Welles 1996 [14] D. M. Sullivan and J. Young, Far field time domain calculation from aperture radiators using the FDTD method, JEEE Trans. on Antennas and Propagation, submitted for review. /-Cambridge Pres mm Chapter 5 @ Two Applications Using FDTD /* ¥a3d_patch.c. 3D simulation of a patch antenna. */ # include # include # include define Iz 62 fidefine JE 120 define KE 14 define ia 14 fdefine ja 18 fidefine ka 7 fidefine NFREQS 3 fidefine ktop 2 ax (TE) (JE) (KE) dy (TE) (9E] [Ke] , dz (TE) (9B) (KE) ; ex (TE) (SE (KE) , ey (TE) [JB] [KE] ,e2 [TE] (Je) [KE] ; hx [1B] [JE] [KB] , hy [TE] (9B) (KE) , hz (TE) (JE) [KE] ; float gax [IB] [JE] [KE] ,gay [TE] [JE] [KE] , gaz 1TE) {ge} [KE] ; int 1,m)n,i,j,k, ic, jc,ke,nsteps,n_pml; float ddz,ra_x,ra_y,dt,T,epez,muz,pi,eaf,npml. int ib, jb, kb float xn,xxn,xnum, xd float t0, spread, pulse; FILE *fp, *fopen(),*£pt; float ez_inc [JE] ,hx_inc [JE]; float €z_low_ml,ez_low_m2,ez_high_m1,ez high m2; float idx] [ia] (98) [KR] , idxh fia) (JE) (KE); float ihxl] [ial (78] [KE] , ihxh (ia) [JE] [Xe] ; float idyl [18] [ja] (KB), idyh {18} (al [KE] ; float ihy] (TE) [ja] (XB), ihyh(1E) (jal [KE]; float idz1 (Tz) (J8) (kal, idzh (1B) (J) [ka] ; float ihz1 {1} [JE] (ka), ihzh(T#] [JB] [ka] ; ixh, jyh, kzh; float gil [IE] ,gi2 (TR) ,gi3 (TE); float g}1 [Je] ,g52 (JE) 93 [JE]; float gk1(Ke] , gk2 [KE] ,gk3 [KE] + float £11[Te) , £12 (18] , £43 (TE! float £31 [Je], £32 (JE) , £33 (JE: float £k1 (Ke) , k2 [KE] , £3 [KE] ; float curl_h,curl_e; int ii,}J,kk,numsph; float dist, xdist,ydist, dist; int istart,iend,k ref, jend,i_ref; cP pee ee ee ec We € Programs int j_p: j_patch_end, j_ref; int i_patch_st,i_patch_end; float eps_sub, float shape [IE] (KE) ,half_wv: ic = IB/2 ; je = JB/2 ko = KE/2 ib = IE-ia-1; jb = Je - ja -1; kb = KE - ka - 1; i_patch_st = iae5; i_patch_end = i_patch_st + 31; j_patch_end = jb - 5; j_patch_st = j_patch_end - 39; juref = j_patch_st - 30; k_ref = ktop - 1; pi = 3.14159; epsz = 8.8e-12; muz = 4*piti.e-7; ddz = .265e-3; /* Cell size */ ra_y = .6625; ax = .6812; dt = ddz/6es; /* Time steps */ printé ("$12.5e Se \n", ddz,dt); INITIALIZE PARAMETERS, CALCULATE PML PARAMETERS /* Dielectric constant of the substrate material */ eps_sub = 2.2; print£("£ \n", eps_sub); for ( 4-0; 4 < 98; t+) { for ( is0; i < TB; ite) { for ( k=0; k pi ket) { gax(i] [J] {kl = 1. /eps_sub; gay (i] (j] 0K = 1. /eps_sub; gaz [i] [j] [k] = 1./eps_sub; ee eae /* Add a metal plate at k =0 */ ic Te-ay iss) { 4 < HB; ite) { gax(i] [J] tel = 0. ; gay (i) [3] (k] = 0.5 123 124 to Chapter 5. Two Applications Using FDTD istart = ia + 6; jena istart + 6; i_vef = ietart + (iend - istart )/2; printé("td $d ¥d\n", istart,iend,i_ref); half_wy = (iend - istart)/2.; printé("half_wv = %5.2£\n", half_wv); for ( isistart; i <= iends iss) { for ( ke0; k <= ktop; kes ) { shape [i] {k) =1.; } /* Add the conductor lead at k = ktop+1 */ for ( j=1; j <= j_patch_st; j++) ( for ( isistart; $ <= send-1; i++) [ gax [i] [3) (ktop+l] 0 } for ( isistart; i <= iend-1; iss) | gaylil [4] (ktopet] = 0.; y J* Add the rectangular patch at k - ktop */ for ( j=j_patch_st; j j_patch_end; j++ ) { for (ieiatl; i <= abel; itt) { gax(i] [J] [ktopel] = 0.; } for ( dsiatt; 4 <= ibd; itt) { gayi [4] [ktop+a] = 0. bo} 150.0; spread = 28.0; printf ( "Pulse width ig #12.5e \n",spreadtdt) ; Teo; nsteps Ep fpt = fopen( "Time", "w"); while ( nsteps > 0) { ye printf ( "nsteps --> scanf("'d", gnsteps); printf ("td \n", nsteps) ; 1; n censteps ; nev) { TeT+a; Start of the Main FDTD loop ---- */ r c Pr C Programs 12s /* Calculate the incident buffer */ for ( ge1; 4 < 9B; 444) { ez_inolj} = @f3(3]*e2_inet4) 93215) *(.5*ra_y/eps_eub)*( hx_inc{j-2) - hx_ine(j] ); /* Source */ pulse = exp(-.5*(pow((t0-T)/spread,2.0) )); ez_inc[ja-2] = pulse; printf ("4.0f %6.2f \n ",T,pulse); /* Calculate the Dx field */ for (ist; i < ia; ise) { for ( j-1; 3 < JB; je) { for ( kel; k < KE; k++) { curl_b = ( ra_y* (ha (i] (3) fk) - ha [i] (-2] 0k) - hy (i) (3) Uk] + by [i] (5) Uk-1)) ¢ idxd (41 [5] [k] = idl (4) (4) (K] + curt_h; dx (41 (5) Ok) = 993 (4) *gk3 [kc] ax (4) [5] [7 + 9)2(3] *gka(k]*.Se(curl_h + git [i] +x) (4) [9] O)); for ( isia; i <= ib; ist) { ij caer jee) { sk < KE; kee) { curl = ( ra_y+ (he (il (3) {e) - bei] (5-2) [k]) > hy (0 (51 Oe) + hy Ci] (31 tka) xc (4 (9) OK) = 93 (91 vak3 fh) dx (4 (4) (4) + 9)2(3] *gk2 [k]*-S#curl_h ; for ( j= for ( for ( j=l; j < JE; j++) { for ( kel; k < KE; k++) { eurl_h = ( ra_y*(h2(i) (91k) - 2 (4) G-2) (k)) - by(4) GG] Ok] + by [i] (91 k-21) ddxh [xh] (j] [k] = idxh Lixehl (J] Ue + curd_h; @xc(4] (51 Dk) = 9339] *9k3 fe] *ax (4) (5) [4] + 99205] *gk2 (kl *.5* (curl h + gil [i] *ideh Lixch] [3] Uk1) /* Calculate the Dy field */ for ( ist; i < IB; ist) { for ( j=l; J < jar jee) { for (kel; k < KE; k++) { 126 Chapter 5 m Two Applications Using FDTD curl_h = ( hxli) (5) 0k) - hx (i) (4) O-23 = ra_xe (hz (i) (3) 0) - hz (4-2) (3) 01) ); ady] (4) (5] 0k) = ddy1 [4] [5] Ok) + curl_h; dy (4) 5) Ok] = gi3 [i] ¥9k3 Ok] #ay (4) (51 0] + gi2 [4] *gk2 [ke] *.5*( curl_h + gj3 [J] *idyl [4] (5) 01) 5 yy} for ( ist; i < 1B; iss) { for ( jwjar 3 <= by jue) { for ( kel; k < KE; kee) { eurl_h = ( hx (i) [5] De) - bx fi) (3) Ok-11 ~ ra_x* (hz [i] (5) 0k) ~ hefi-2] (31 Oe) ); dy i] (91 0) = 43 La) *ok3 (k1 "dy Li] £51 1) + gi2 [4] *gk2 [k]*.5* curl_h ; ,y) for ( i-1; i < IB; ist) { for ( je¥b+l; j < JB; j++) { jyh «5 - jb - a; for ( kel; k < KE; k++) { curt_h = ( hx (i) (9) 00 = bx (i) (5) [k-2) - wa_xe (hz (4) [9] Ok) ~ he (4-21 (90 00) 0; idyh (4] [yh] (k] = idyh (4) (Jyh] Oc) + curl_h; | dy C4] (31 Oc) = gi3 (4) *gk3 Uk] *dy [4] [5] [e] | + gi21i)*gk2 [ke] *.5*( curl_h + g§1(J] *idyh [i] [jyhl [k]); }} /* Calculate the Dz field */ for ( ist; i < TE; ite) { for ( j+l: j < JE; j++) { for ( ke0; k < ka; Kee ) { curl_h = ( ra_xe (ny [i] (5) 0k) - byl4-11 05) 0d} = ra_y+(ix(i] (5) (k] - bx (i) (5-2) tk)) 0; idzl [4] [5] {k] = idzl (i) (J) tk] + curl_h; az (4) [5] fk) = gi3 [i] #933 [3] ¥dz (4) (5) 04) + gi2 (4) ¥aj2[9]*.5*( curl_h + gk1 Uc] *idzl (i) (5) [k} ); for ( j i< IE; ist) { for ( j=1; 5 < OB; j++) ( for ( k <= kb; kee) curl = ( ra xy (hy [i] (5) Ok) - hyli-a) (31 0d ) = ra_y+(hx(i] [3] (k] - x(i) (5-2) (k1) 0; dz (i) (J) Ue) = gid Ci] ¥ai3 (5) "az (4) (51 OK) + gi2[i]*g§2[5]+.5* curl; yy} for ( ist; i < IE; ise) [ for ( jely j < dB; See) { C Programs 27 for ( kekbsl; k < KE; kee) ( kah = k= kb = 1; curlh = ( ra_x¢(hy [i] (3] Oc) - ny (4-2) [3] 0k] ) = ea_y* (hx (i) (3) OK) = mx (4) (5-2) 0) 05 idzh (4) [5] (k2h] = idzh[i] [3] (keh) + curl_h; dz (i) (5) Oc) = gi3 (4) 959 05] #4) (5) Ol + gi2(i] #g)2(5]*.5+( curi_h + gk [k] *idzh [4] [3] (keh) ); /* Incident Dz */ for ( nd; itt) ( for ( k=0; k <= ktop; k++) { dz(i] (jal (k] = de (il Gal [k) + (.5/eps_sub) *shape [i] [k] *hx_inc [ja-2]; ¥) /* Calculate the E from D field */ /* Bx and By are zero at k = 0. */ for ( ist; i < IB-2; itt) { for (j=l: j < SB-1; j++) { for ( kel; k < KE-1; k++) ( ex(i] (31 fk) = gax (i) (5) Ue) *@xC4) (51 0) ey (2) (1 [1 = gay [i] [3] fk] *ay (i) (31 OK) ez (i) (41 {k] = gaz (il (4) (k) "az Ci) (51 OK): yy} /* Write out the time domain data at the input port */ Eprint£( fpt,"*8.4f \n",e2(i_ref) (3_ref] [k_ref]); /* Calculate the incident field +/ for ( j-0; j < dB-1; j++) { hx_ine(j] = £33(3] *hx_inc[3] + .5+£)2(j1*( e2_inc(3] - ez_inclj+2] uy /* Calculate the Hx field */ for ( i=0; i < da; ite) { for ( j=0; 5 < JB-1; j++) { for ( ke0; k < KE-1; k++) { curl_e = ( ey(4) [1 feea) - ey (i) (3) 06) ~ ra_y*(ez(i) [j+1] [k] - ez[il [5] (kl) ); ihxl [i] [3] [k] = ihxl [i] [j](k] + curl_e; hx (i) [5] (k) £43 (j] *£k3 [k] *hx [i] [5] [k] + £)2[5} *£k2 fk] *.5*( curl_e + £42 [4] +ibved (4) (5) OK) 0; 128 Chapter $ Two Applications Using FDTD cP: for ( isiay i <= ib; int) { for ( $20; j < Jel; j++) { for ( ke0; k < KE-1; kee) { curl_e = ( ey[i} {j] (k+1) - ey[il ~ra_y* (ez fi] [5+1] Ok] - e2 fi) (9 KI) 5 hx (i) (5) Oe) = £53 (9) © £3 (k] hx (4) (5) OD + £52(j]*£k2(k]*.S¥curl_e ; }} for ( isib+l; i < IB; i++) { ivh = i - ib-2; for ( j=0; 4 < JE-1; j++) { for ( k=0; k < KB-1; k++) { curl_e = ( ey(il (j1 (ket) - ey (i) 51 G1 ~ ra_y*(ez[il (j+1] [k] ez (il (j] Ikh) Ve ihxh (ixh] (j] [k] = ihxh{ixh] (j] [k] + curl_e; hx (4) [5] (k] = £53 (5) *£k3 (k] *hx [i] [5] (k] + £52(3]#£k2 Uk] *.54( curl_e + £41 [i] vibwb [ish] (5) 0); yoyo} J+ meident Hx */ for ( isistart; i <= iend; ist) { for ( k=0; k <= ktop; kee) { bx (il (Ja-4] Uk) = bx (i Ga-2) Ded + (:5/eps_sub) *shape [i] [k] +ee_ine {jal ; }) J/* Calculate the Hy field */ for ( iso; i < TB-1; ise) [ for (420; 5 < jar jee) { for ( ke0; < KB-1; k++ ) { curl_e = ( ra_x*(ez[i+t} (il [kl - ezfi} j) Ik) ~ ex [i] (9) Oked) + exti) (5) 1): | ihy1 [i] (j] tk] = ihyl [4] G10 + curle ; hy (4] [9] Uc] = £43 [4] *£k3 [k] why (4) (5) Oc) + £12 [4] *£k2 (k)#.5*( curl_e + £31()] *ihyl (il 10) J; ey for ( is; i < TE-1; ise) { for ( j=ja: j <= jb; j++) { for (k=0; k < KE-1; ket) { curl_e = ( ra_xt(ez{i+1) 31 [k] ~ ez [4] (] [k]) = ex(i] (j] fea) + exfil(j) 0d) ; i hy (i) [9] Uk] = £43 [4] *£%3 (k] *hy [4] (5) Oe) + £12 [4] *€k3[k]*.5*curl_e ; yy} for ( is0; i < IE-1; itt) { for ( jejbe1; j < JE; j++) { C Programs 129 jyh = j + gba; for (k=O; k < KE-1; kee} { curl_e = ( ra xt (ez (ist (j} Oc) - ex (i) (31 [K1) > ex (i) G1 Oke1 + ex G11 0) ihyh [i] [Jyh] fk] = ihyh [i] [Jyh] (k) + curl_e ; ny 4] (3) Ok] = £43 [4] *£K3 Ok] *hy (4) (51 (00) + £42 Ci] *£k2 [k] #.5#( curl_e + £31(j]*ihyh [i] Lym) (kl); ete) /* Calculate the Hz field */ for ( i=0; i < IB-1; ist) { for (520; j < JE-1; jet) ( for (k=O; k < ka; ket) { curl_e = ( ra_y*(ex(il [+1] fk] - ex{i) (51 0a) = axe (ey litt] (10k) - ey ll G10) ) ihe (4) (4) 1k) = ihz1 (41 (5) (el + curl_e; he (41 (31 Ue] = £43 (41989309) *he il (51 Od + €42(1] £520] *-5*( curl_e + fk1 (k] *ihe1 (4) (41 fed for ( is0; i < TB-2; it+) [ for ( j20; j < JE-t; j++) { for ( keka; k <= kb; k++) { curt_e = ( ra_y*(ex(i] (j+1] kl ~ ex(i) [5] [k]) ~ ext (ey (i+t] (10k) - ey (i) [91 0k)) ): hati} (9) Uk) = £43) +853 05] #h2 (4) (5) ed + £42 [4] ¥£)2[5]*-5tcurl_e ; yy} for ( i=0; 4 < IE-1; i++ ) { for ( j=0; j < SB-1; j44) { for ( k=kb+l; k < KE; k++) [{ keh =k - kb - 1; curl_e = ( ra_y*(ex{il [j+2] (el - ex] (51 (1) ra_x*(ey[i+l] [j] (k] - eyfi} GI UkI]) 0; iheh(4] (4] [keh] = ihzh[i] (j] (keh) + curl_e: hei] (3] Oc) = £43 (4) £33 [5] *h (4) (3) Ol + €12(4]*£52151*.5*( curl_e + €k1(k] *inzh [il [4] (keh) ); End of the main FDTD loop / /* Write the E field out to a file "Ez" */ fp = fopen( "Ez", *w") : for ( j=0; j < JE; j++) { 130 fprinté } fprintt felose(£p); printe("T = $4 fclose(£pt) ; £p,"89.6£ ",ez [i] fp," \n"); of \n", 0); Chapter 5 m Two Applications Using FDTD. 3] (ktop T cP C Programs 131 /* Pa3d_far_field.c. */ /* These arrays are calculated before the main loop */ /* ipos,jpos,and kpos are arrays which specify the location at which the far field values will be calculated. iwid and kwid specify the size of the slot in che I and k directions, respecively.+/ for (11; 1 <= 3;le+) { for ( ic-iwid; i <= ictiwid; iss) { for (k = ke-kwid; k <= keskwid; kre) { R_dist [1] {k] [1] = sqrt( pow( (ic - ipos(1)-i),2.) + pow( (ke - kpos(1)-k),2.) ); x_2[il(k] (1] = jpos/R_dist (4) (k] (11; N_shift (4] fel [1] = 2*R_dist (4] [el [1]; /* Just before the new value of Ez is calculated from the Flux density, the old value is stored in ecm */ /* jgrid_end is the location of the slot antenna in the j direction ¥/ for (i = ic-iwid; i <= ictiwid; i++) { for (k = ke-kwid; k <= ketkwid; kee) { ezmi [i] (k] = ez{i] Ligrid_end] (k]; /* Here is the calculation of the of the far field values. This is done right after the calculation of the Ez field. */ for (let; 1 <= 3;1++) { for (i = ic-iwid; i <= ictiwid; ist) { for ( k = ke-kwid; k <= ke+kwid; kee J { Bna(1) [iT + N_shift [4] [k] [1]] = Bana[1] [it + N_shift (4) (k] 1 1 + (x2 (4) tk] (11 /pid* ( ez(il (jgrid_endl fk] - ezm2 (i) (k] )/R_dist {iJ (k] [21 + ez(i] [jgrid_end] [kJ /(2*pow(R_dist [4] fk] (11},2.) by} 6.1 Using FDTD for Other Types of Simulation In this chapter, we will discuss the use of the FDTD method for applications other than electromagnetics. The first application is an acoustic simulation problem. The mathematics of acoustics is similar to electromagnetics [1], so it is natural that the developments of FDTD are used in acoustic simulation [2, 3]. The second example is the simulation of the Schroedinger equation, which is at the heart of quantum mechanics. Quantum mechanics is radically different from both acoustics and electromagnetics. However, the Schroedinger equation is still a wave equation and it lends itself to simulation with FDTD. In both cases, only simple examples of one-dimensional simulations are presented. 6.1 THE ACOUSTIC FDTD FORMULATION In the following development, we will deal only with pressure waves and ignore elastic waves. We start with the first-order acoustic equations, agra Vou (6.1a) a Por 5 ule. 1) = Vp ts (1b) where p(x, 1) is the pressure field [F/m?] = [kg /(m — sec*)] u(x, 1) 4s the vector velocity field [m/sec] , ‘by is the mass density of water [kg/nt?] 6, is the relative (to water) mass density of the medium, « is the compressibility of the medium {(m — sec*)/kg] . (Table 6.1) Notice that water has been chosen as the background medium instead of air. The compress- ibility is ae (6.2) where c is the velocity of sound, 133, 1M Chapter 6 i Using FDTD for Other Types of Simulation TABLE 6.1 Acoustic Properties of @ Few Materials Material Speed of Sound (nvsee) Density (ka/m")_-Compressbility (m -s*/kg) 1. Water 1500 1000 44 x10 2 aie 3 121 702% 10-8 3. Metal 5900 7800 Eg, (6.1a) can be written dpyiet) 1 Wet), dus y.2.0) ae Et dy We will use a differencing scheme similar to Yee's FDTD for electromagnetics [4]; however, ‘we will assume that the pressure locations are at nodes in a three-dimensional lattice, and that the velocities are located between the nodes, as shown in Fig. 6.1 dt ky Wik) Figure 6.1. The acoustic Yee cell, Using first-order differencing in time and space, Eq. (6.1.a) can be written Bled, jk) = pIPG jk) fee 1/2, j,k) — uti — 2.50) ar OTD ‘Ax a 1 [a ik + 1/2) — wi, j,k = 12) GRD Ay yt [aes KA1/2) — Wl bk- 1) EID Be First, the compressibility will be replaced by Eq. (6.2). Then Ar will be moved to the right side, giving a difference equation suitable to the FDTD formulation: A re AL: pope? 5g | ne . Pht, j,k) = ph PG J. + aan [uh + 1/2, 7) = Wh = 1/2. 5.) At + [MiG 41/2.) - Whi, 7-1/2, O] (6.3) At [w2@ fk 1/2) — uM, jk — 1/20] TT Section 6.1 The Acoustic FDTD Formulation 135 A similar procedure in Eq. (6.1b) yields three equations of the type UG fA A/2) = uP, jk + 1/2) At + FG ET 1/) fy Be Obviously, equations in the X and ¥ direction would be similar, We will limit ourselves, to a simple one-dimensional problem in the Z direction and rewrite Eqs. (6.3) and (6.4) as, follows: (64) [PMG jk +1) = PMG 5] pty = p™ "(ky + gatk) » [ut(k + 1/2.) — wk — 1/2)] (65a) Nk + 1/2) = ub (k + 1/2) + gbk + 1/2)- [pK + 1) = ph 2(k)], (6.56) where we have the parameters At popr-¢ az at pK +1/2)- po Az Notice that we have chosen to write ga in terms of the speed of sound and the pressure rather than the compressibility since these are the parameters that are most widely used. As before, Ar is chosen after Az is chosen according to gatk) (66a) gh{k + 1/2) (6.6b) Ac ars, Where Cyay is the fastest velocity of sound that we encounter. We will suppose that this will be metal, in which the velocity of sound is 5900 meters per second. Just to give ourselves a margin, we will take Since pp = 1000 kg/m, Eqs. (6.6) become gatk) = 107! + p, (k) c? (k) (6.7a) 107 b(k + 1/2) = 6.7b abil /2) pk+ 1D (6.7b) For water, which we will use as our background medium, Eqs. (6.7a) and (6.7b) turn out to be ga(k) = 107! p, (k)c2 (k) = 107! - 1 - (1, 500)? = 2.25 x 105 (68a) gb(k + 1/2) = 1077 (6.8b) The program usl.c at the end of the chapter is a one-dimensional acoustic simulation program. In its present form, itis only simulating water. Figure 6.2 shows the result, A pulse is generated at one end and subtracted out at the other. So where did the PML come from’ Here is how this program was developed: I went back and made a copy of the program fdld_1.L.c. Using the text editor, I replaced ex with p, and hy with u. Then I went to the program we developed in Chapter 5 to simulate microstrip antennas, and I took the PML from the 1D incident buffer and copied it over. I added the parameters ga and gb, changed some constants, and so forth, and there it was! The entire process took about 30 minutes. The point is, an acoustic simulation program, complete with PML, was written by using the ideas we had already developed for EM simulation. 136 Chapter 6 @ Using FDTD for Other Types of Simulation é om wa Bos oo ———.. oe CSC OO ——— gos r= 660 A nr om Figure6.2 Simulation ofan acoustic pulse, The pulses generated a cell 1S and propagates ‘outward in both directions. After 200 time stops, the part that propagated to absorbed hy the PML. Similarly, after 660 time steps the part PROBLEM SET 6.1 1. Develop your own program usl.c using the procedure described and g 2 Put a metal sheet of about 10 cells in the center of the problem spac Then put in sa air pocket of 10 cells and see what happens. 3. Repeat the above problem, but for a sinusoid waveform of 2.5 MHz in a Gaussian envelope In determining the ceil size remember: 10 points per wavelength of the shortest wavelength in the problem. Since metal has the highest speed, it will have the shortest wavelength, it running. id see what happens. 6.2 SIMULATION OF THE SCHROEDINGER EQUATION In this section a simple formulation of the Schroedinger equation in FDTD is described. The Schroedinger equation is the basis of quantum mechanics. If you do not know any quantum mechanics, this section may prove to be a little puzzling. (An excellent text for beginning quantum mechanics is the one by Griffiths [5].) Problems involving quantum mechani unlike the previous section where it wasn’t difficult to pick up the basics of acoustics, are quite different. For instance, the parameter used in our wave equations is y(r. 1), which, like the electric field or the pressure, is a function of space and time. But unlike the electric field or pressure, if is a complex number, even though it is a time domain parameter. 1 is also difficult to attribute any distinct physical meaning to yy. Itis the product of y with its complex conjugate, W(r, 1)"y( 1), that indicates the probability of a particle being at the point r at time 1 TT.

Das könnte Ihnen auch gefallen