Computation of Electromagnetic Fields