Abstract
Scattering from a two-dimensional diffraction grating is analyzed numerically. The scattered field is decomposed into TM and TE modes giving rise in each case to a generalized Helmholtz equation supplemented by a pseudo-periodic boundary condition which must be solved in the unit cell of the grating. The unit cell is truncated at a finite distance from the grating where a radiation condition is enforced. The resulting boundary value problem for plane wave excitation is discretized via the Control Region Approximation with the discrete equations so generated then solved using a sparse direct method (Yale Sparse Matrix Package). The accuracy and extreme flexibility of this approach are demonstrated by a collection of numerical examples.