2. Variational Methods for Diffractive Optics Modeling