The present work describes the mathematical models and their computer implementation to study common electromagnetic problems involving the propagation of light in dielectric structures. Both time- and frequency-domain algorithms are analysed, comparing their performances with state of the art commercial software. Real case studies will be described to validate experimentally the mathematical models used.