Computational Methods for Electromagnetic and Optical System