The Analytical and Numerical Solution of Electric and Magnetic Fields