The computation of magnetic field distribution is based on the magnetic scalar potential formulation in a nodal finite element context. An improvement of the formulation has been identified by taking into account the high permeability of the materials and of the connexity problem. The scalar potential formulation has been generalized for introduction of the coupling between field and electric circuit equations. A preliminary computation of an electric vector potential allows to take into account aIl coil types, filament or massive. The simultaneous resolution of field and circuit equations implemented permits the treatment of current or voltage driven problems and supply circuit with electronic component problems. This work has been validated on many industrial applications. In the course of these studies, we have developed a method of robust management for complex limited boundaries and a high level dedicated language to automate the implementation of our process.