differential equations and sets of differential equations in mere minutes. Separate chapters are included that describe how Maxwell's equations are approximated using finite-differences and how outgoing waves can be absorbed using a perfectly matched layer absorbing boundary. With this background, a chapter describes how to calculate guided modes in waveguides and transmission lines. The effective index method is taught as way to model many three-dimensional devices in just two-dimensions. Another chapter describes how to calculate photonic band diagrams and isofrequency contours to quickly estimate the properties of periodic structures like photonic crystals. Next, a chapter presents how to analyze diffraction gratings and calculate the power coupled into each diffraction order. This book shows that many devices can be simulated in the context of a diffraction grating including guided-mode resonance filters, photonic crystals, polarizers, metamaterials, frequency selective surfaces, and metasurfaces. Plane wave sources, Gaussian beam sources, and guided-mode sources are all described in detail, allowing devices to be simulated in multiple ways. An optical integrated circuit is simulated using the effective index method to build a two-dimensional model of the 3D device and then launch a guided-mode source into the circuit. A chapter is included to describe how the code can be modified to easily perform parameter sweeps, such as plotting reflection and transmission as a function of frequency, wavelength, angle of incidence, or a dimension of the device. The last chapter is advanced and teaches FDFD for three-dimensional devices composed of anisotropic materials. It includes simulations of a crossed grating, a doubly-periodic guided-mode resonance filter, a frequency selective surface, and an invisibility cloak. The chapter also includes a parameter retrieval from a left-handed metamaterial. The book includes all the MATLAB codes and detailed explanations of all programs. This will allow the reader to easily modify the codes to simulate their own ideas and devices.-- |