Diffraction hysteresis loop modeling in magneto-optical gratings