This paper presents a method for direct coupling electrical machines, represented by two-dimensional (2-D) finite elements with the external circuit. The movement is taken into account by means of the moving band technique. The field and circuit equations are calculated automatically and then solved simultaneously using a time step procedure. The major contribution of this work is the fact that the whole system is calculated automatically, i.e., the electromagnetic field (Maxwell equations) and the converter circuit (Kirchhoff voltage and current laws and the elements characteristics equations) are strongly coupled in an unique set taking into account the movement. In order to validate the implemented procedure, a permanent magnet generator feeding a flyback converter is simulated and tested.