===Perfectly Matched Layer Termination===
The FDTD simulation time depends directly on the size of the computational domain. For free space radiation or scattering problems, the computational domain must be extended to infinity, which means an infinite number of cells in the computational domain. The solution to this problem is to truncate the domain by a set of artificial boundaries at a certain distance from the objects in the computational domain. The absorbing boundaries should be such that the field propagates through them without any back reflection. Different methods have been used to simulate an absorbing boundary condition in FDTD simulations. The most common ones are Mur, Liao, and the perfectly match layer (PML). The Mur boundary condition calculates the boundary field values from the three dimensional scalar wave equations, while the Liao boundary condition is based on extrapolation of the fields in space and time. In 1994, Berenger proposed a new boundary condition called the perfectly matched layer (PML), which provides a much better performance than the Liao and Mur boundary conditions. The PML medium properties surrounding the computational domain are chosen to effectively absorb all the outgoing waves propagating towards the boundaries. In PML regions, an artificial conductivity is introduced such that it starts with very small values at the free space-PML interfaces and gradually increases until it reaches its maximum value at the last layer of the PML region.
The PML boundary condition is not effective in absorbing evanescent waves, and it suffers from late-time reflections when simulating fields with very long time signaturesSee more about EM. This is partly due to the weakly causal nature of the PML. A strictly causal form of the PML, known as the complex frequency-shifted PML (CFS-PML), was later developed by simply shifting the frequency dependent pole off the real axis and into the negative-imaginary half of the complex plane. It has been shown that the CFS-PML is highly effective at absorbing evanescent waves and signals with a long time signature. Therefore, using the CFS-PML, the boundaries can be placed closer to the objects in the computational domain, and considerable time and memory savings can be achieved. The convolutional PML (CPML) is an efficient implementation of the CFS-PML based on a stretched coordinate formulation in conjunction with recursive convolution. It has been shown that CPML requires only two auxiliary [[variables]] per discrete field point and absorbs waves in isotropic, homogeneous, inhomogeneous, lossy, dispersive, anisotropic or non-linear media without any further generalization. The CPML is formulated in the stretched coordinate space. The CPML layers are assumed to terminate the FDTD computational domain. The X components of MaxwellTempo's frequency-domain curl equations can then be written in the following form: :<math> (j\omega\epsilon_x + \sigma_{ex})\tilde{E}_x = \frac{1}{s_{ey}} \frac{\partial \tilde{H}_z}{\partial y} - \frac{1}{s_{ez}} \frac{\partial \tilde{H}_y}{\partial z} </math> :<math> (j\omega\mu_x + \sigma_{mx}) \tilde{H}_x = -\frac{1}{s_{my}} \frac{\partial \tilde{E}_z}{\partial y} + \frac{1}{s_{mz}} \frac{\partial \tilde{E}_y}{\partial z} </math><!-- [[Image:FDTD95.png]] --> where s<sub>ei</sub> and s<sub>mi</sub> are the stretched coordinate metrics defined by: :<math> s_{ei} = \kappa_{ei} + \frac{\sigma_{ei}}{\alpha_{ei} + j\omega\varepsilon_0}, \quad i=x,y,z </math> :<math> s_{mi} = \kappa_{mi} + \frac{\sigma_{mi}}{\alpha_{mi} + j\omega\mu_0}, \quad i=x,y,z </math><!-- [[Image:FDTD96(2).png]] --> s<sub>ei</sub> and s<sub>mi</sub> are the anisotropic components of the synthesized electric and magnetic conductivities in the CPML region. κ<sub>ei</sub> , κ<sub>mi</sub>, α<sub>ei</sub> and α<sub>mi</sub> are all assumed to be positive real and κ<sub>ei</sub>, κ<sub>mi</sub> ≥ 1. Similar equations hold for the Y and Z components of the electric and magnetic fields in the CPML layers. The requirement for zero reflection at PML-PML interfaces imposes the following condition: :<math> s_{ei} = s_{mi} \quad \Rightarrow \quad \kappa_{ei} = \kappa_{mi} ,\quad \frac{\sigma_{ei}}{\varepsilon_0} = \frac{\sigma _{mi}}{\mu_0}, \quad \frac{\alpha_{ei}}{\varepsilon_0} = \frac{\alpha_{mi}}{\mu _0} </math><!--[[Image:FDTD99.png]]--> The tilde notation above denotes the Fourier transform of the field components in the frequency domain. Transforming the above equations back to the time domain, one encounters convolution on the right hand side due to the frequency dependence of the stretched coordinate metrics: :<math> \left(\varepsilon_x \frac{\partial E_x}{\partial t} + \sigma_{ex}E_x \right) = \breve{s}_{ey}(t) \frac{\partial H_z}{\partial y} - \breve{s}_{ez}(t)\frac{\partial H_y}{\partial z} </math> :<math> \left(\mu_x \frac{\partial H_x}{\partial t} + \sigma_{mx}H_x \right) = -\breve{s}_{my}(t)\frac{\partial E_z}{\partial y} + \breve{s}_{mz}(t)\frac{\partial E_y}{\partial z} </math><!--[[Image:FDTD98.png]]--> where Å¡<sub>ei</sub>(t) and Å¡<sub>mi</sub>(t) denote functions of time that are indeed the inverse Laplace transform of s<sub>ei</sub><sup>-1</sup> and s<sub>mi</sub><sup>-1</sup>,respectively, given by: :<math> \breve{s}_{ei}(t) = \frac{\delta(t)}{\kappa_{ei}} - \frac{\sigma_{ei}}{\kappa_{ei}^2} u(t)\exp \left[-\left(\frac{\sigma_{ei}}{\kappa_{ei}} + \alpha_{ei} \right)\frac{t}{\varepsilon_0} \right] </math> :<math> \breve{s}_{mi}(t) = \frac{\delta(t)}{\kappa_{mi}} - \frac{\sigma_{mi}}{\kappa_{mi}^2} u(t)\exp \left[-\left(\frac{\sigma_{mi}}{\kappa_{mi}} + \alpha_{mi} \right)\frac{t}{\mu_0} \right] </math><!--[[Image:FDTD97(1).png]]--> where d(t) and u(t) denote the Dirac delta and unit step functions, respectively. The convolutions on the right hand side of the time domain equations can be accelerated by the use of the recursive convolution (RC) method. The CPML [[parameters]] are chosen to be an increasing function of the distance from the boundaries of the computational domain. [[EM.Cube]] uses a polynomial profile of degree n<sub>PML</sub>. Given the interrelationships among these [[parameters]], one can write: :<math> \sigma_{ei}(r) = \frac{\varepsilon_0}{\mu_0}\sigma_{mi}(r) = \sigma_{max}\left( \dfrac{r}{\delta} \right)^{n_{PML}} </math> :<math> \kappa_{ei}(r) = \kappa_{mi}(r) = 1 + \left( \kappa_{max} - 1 \right) \left( \dfrac{r}{\delta} \right)^{n_{PML} } </math> :<math> \alpha_{ei}(r) = \frac{\varepsilon_0}{\mu_0} \alpha_{mi}(r) = \alpha _{min} + \left(\alpha_{max } - \alpha_{min } \right) \left( \frac{r}{\delta} \right)^{n_{PML}} </math><!--[[Image:FDTD100(1).png]]--> where r is the distance of field observation point inside the CPML layer from the edge of the computational domain. The [[parametersPerfectly Matched Layer Termination]] σ<sub>max</sub>, κ<sub>max</sub>, α<sub>min</sub> and α<sub>max</sub> as well as n<sub>PML</sub> can be modified by the user.
===Time Domain Simulation Of Periodic Structures===