A comprehensive manual on the efficient modeling and analysis of photonic devices through building numerical codes, this book provides graduate students and researchers with the theoretical background and MATLAB programs necessary for them to start their own numerical experiments. Beginning by summarizing topics in optics and electromagnetism, the book discusses optical planar waveguides, linear optical fiber, the propagation of linear pulses, laser diodes, optical amplifiers, optical receivers, finite-difference time-domain method, beam propagation method and some wavelength division devices, solitons, solar cells and metamaterials. Assuming only a basic knowledge of physics and numerical methods, the book is ideal for engineers, physicists and practising scientists. It concentrates on the operating principles of optical devices, as well as the models and numerical methods used to describe them.