In this paper the rigorous coupled wave analysis (RCWA) was used to analyze the grating diffraction efficiency
properties. First, the RCWA must to be improved to avoid instability when the grating period and grating groove depth
are relatively large especially for TM mode incident wave. Then the global optimization method-genetic algorithm was
used to optimize the grating profile to achieve high diffraction efficiency. Based on the improved RCWA the grating
optimal design software(GODS) was developed with the aid of the genetic algorithms (GA). The optimized structure
parameters of several typical grating profiles in arbitrary incident angle were given by GODS within short time once the
optimal control parameters were selected.