# Enhancing Efficiency of Electromagnetic Simulation in Time Domain with Transformation Optics
## 3 Simulation System and Courant Condition
For the coordinate transformation, the dispersive medium will become anisotropic. The updating scheme for this kind of medium has been implemented in Meep. Therefore, the conventional FDTD algorithm does not need any further modification to employ the simulation with non-uniform grids. The maximum time-step is limited by the cell size in the \(x\), \(y\), and \(z\) directions, known as the Courant condition [8], to avoid numerical instability. For the optical transformation medium used in the numerical grids to map to smaller physical grids, the numerical phase velocity of light is greater than that in the physical space because the coordinate transform is invariant of time. Under the circumstance, the Courant condition should be re-considered. Assuming that \(\varepsilon^{\prime}\) and \(\mu^{\prime}\) are obtained from Equation (1) by the mapping functions \(u=f(x)\), \(v=\mathrm{g}(y)\), and \(w=h(z)\), then they can be written as the diagonal matrixes:  
\[\varepsilon^{\prime}=\left[ \begin{array}{ccc}\varepsilon_{u}&0&0\\ 0&\varepsilon_{v}&0\\ 0&0&\varepsilon_{w}\end{array} \right],\;\mu^{\prime}=\left[ \begin{array}{ccc }\mu_{u}&0&0\\ 0&\mu_{v}&0\\ 0&0&\mu_{w}\end{array} \right], \tag{12}\]  
where \(\varepsilon_{u}=\varepsilon(\partial u/\partial x)/[(\partial v/\partial y)( \partial w/\partial z)]\), \(\varepsilon_{v}=\varepsilon(\partial v/\partial y)/[(\partial u/\partial x)( \partial w/\partial z)]\), \(\varepsilon_{w}=\varepsilon(\partial w/\partial z)/[(\partial u/\partial x) (\partial v/\partial y)]\), \(\mu_{u}=\mu(\partial w/\partial y)/[(\partial u/\partial x)(\partial w/ \partial z)]\), and \(\mu_{w}=\mu(\partial w/\partial z)/[(\partial u/\partial x)(\partial v/ \partial y)]\). From [36], the altered time-step limitation is given as:  
\[\Delta t\leq\frac{\Delta}{c}\Bigg{[}\frac{1}{\left(\Delta u/\Delta\right)^{2} \sqrt{\varepsilon_{v}\varepsilon_{w}\mu_{v}\mu_{w}}}+\frac{1}{\left(\Delta v/ \Delta\right)^{2}\sqrt{\varepsilon_{u}\varepsilon_{w}\mu_{u}\mu_{w}}}+\frac{ 1}{\left(\Delta v/\Delta\right)^{2}\sqrt{\varepsilon_{u}\varepsilon_{v}\mu_{u} \mu_{v}}}\Bigg{]}^{-1/2}, \tag{13}\]where \(\Delta\) is the normalizing cell size. If no coordinate transformation is taken (\(x=u,y=v,z=w\)), and the medium is vacuum (\(\varepsilon=\mu=1\)), this inequality can be reduced to conventional Courant as indicated in [8], i.e. :  
\[\Delta t\leq\frac{\Delta}{c}\left[\frac{1}{\left(\Delta x/\Delta\right)^{2}}+ \frac{1}{\left(\Delta y/\Delta\right)^{2}}+\frac{1}{\left(\Delta z/\Delta \right)^{2}}\right]^{-1/2}. \tag{14}\]  
The Courant condition stability factor can be defined as \(S=c\Delta t/\Delta\). If we let the mapping functions be \(u=5x\), \(y=v\), and \(w=5z\), and let the cell size be \(\Delta u=\Delta v=\Delta w=\Delta\), we obtain the stability factor \(S=51^{-1/2}\) (\(\sim\)0.14). On the other hand, in the physical coordinate, the corresponding cell size in the \(x,y\) and \(z\) directions becomes \(\Delta x=0.2\Delta\), \(\Delta y=\Delta\), and \(\Delta z=0.2\Delta\), respectively. From Equation (14), the same stability factor \(S\) is obtained. Therefore, Equation (13) is valid. Note that in Meep, the time-step \(\Delta t\) is decided by the stability factor \(S\) and \(\Delta\). According to the definition in [33], the transmittance spectrum is the amount of the transmitted power flux that passes through the aperture exit and normalized to that passes the same area in the absence of the film. In the simulation, the power flux in the \(v\) direction is:  
\[P(\omega)=\text{Re}\{-\vartheta\cdot\int_{s}\mathbf{E}_{\omega}(u,v=-h/2,w) \times\mathbf{H}_{\omega}(u,v=-h/2,w)ds\}, \tag{15}\]  
where \(s\) is the area of the aperture exit, and \(\mathbf{E}_{\omega}\) and \(\mathbf{H}_{\omega}\) is the Fourier transform of the simulated electric and magnetic field vectors; the normalized transmittance is obtained from the measured \(P(\omega)\) divided by that measured at the same location without the film.