Computation of low-frequency electromagnetic fields