FEM solution of time-harmonic electromagnetic fields by an equivalent electrical network