Finite Difference Equations Maxwell’s Equations are continuous. For all but the simplest geometry, closed form solutions of Maxwell’s Equations are not able to be obtained. We must convert the continuous equations (with infinitesimal differences) to discrete equations with finite differences
Discretize and Conquer Ey(i,j) = Ey(i,j) - (dt/eps_0)*(Hz(i-1,j)-Hz(i,j))*(1/dx) (Hz(i, j)-Hz(i-1, j))*(1/dx) = (eps_0)*(Ey(i,j) now - Ey(i,j) before ) / dt Hz(i,j) = Hz(i,j) – (dt/mu_0)*(Ey(i,j)-Ey(i+1,j) + Ex(i,j+1) - Ex(i,j))*(1/dx) ((Ey(i+1, j)-Ey(i, j)) – (Ex(i, j+1) – Ex(i, j)))*(1/dx) = -(mu_0)*(Hz(i, j) now - Hz(i, j) before )/dt
Convergence When we go from continuous to discrete, does the solution become “incorrect”? If you keep making the spatial step smaller and smaller, eventually the results converge to the correct result – Rule of thumb: make x equal to 1/100 of the wavelength of the incident light The Courant Condition specifies a value for t:
Programming I wrote examples of 1-D and 2-D FDTD in Fortran 90, C and Python. Maxim uses Fortran 90 for everything and therefore so should you. – Ask him for the Absoft Fortran 90 editor. If you try to compile and run with this editor it will give you trouble. I suggest using the cluster.
Fortran 90 Variables must be declared (but not initialized) at the very beginning Constants must be declared and initialized at the beginning After variables are declared and constants are declared and initialized, variables must be set Then you can start writing your code. End your code with the word “end”.
!Record Ex OPEN(file='Ex.dat',unit=32) do i=1,Nx write(32,*) Ex(i) enddo CLOSE(unit=32) end Import into Matlab and type Plot(Ex):
Results As one is learning FDTD, it is helpful to plot electric field over the entire grid
Results Graphs of the T and R coefficients (obtained from the Poynting vector) are measured in experiments
Next Steps Look at a single-processor 2-D code with a dielectric cylinder (ask me or Maxim for it) The absorbing boundary conditions (ABC’s) are implemented via convolutional perfectly matched layers (CPML) – It’s there and it works. In general, there’s no need to mess with it.
Later On The best metals for SPP’s are silver and gold – Metal is represented by the Drude Model The interaction of the two-level emitters with the classical EM field is handled by the Liouville-von Neumann equation Longer simulations benefit from message passing interface (MPI); the simulation is split up between several processors – Ask me or Maxim for the MPI slits code Rather than using point sources, we can define a Total Field / Scattered Field boundary to introduce a plane wave into the system