For the simulation of electrical power systems (adjustable speed drives, wind farms, complete grids, etc.) the Kirchhoff's model is used. Each of the components of this model (transmission line, circuit breaker, electrical machines, etc.) is represented by an equivalent circuit. These equivalent circuit models are unable to take precisely into account the non-linearities of the electrical machines. These non-linearities (eddy currents, magnetic saturation of the materials, skin effect) are however accurately predicted by the finite element method. The goal of this thesis is to add a finite element model of an electrical machine, the hydro generator, to a grid solver. The nature of the link between the grid solver and the finite element model is first investigated. Then, a finite element program used solely to the simulation of the hydro generator and to its link with a grid solver is designed. The features required for such a program are mandated by the physic of the device modelled: dealing with non-linear materials, eddy currents and taking the movement of the rotor into account. Furthermore, it is possible to use the symmetries of the studied device to reduce both the calculating time and the necessary memory. All these features were validated individually, before being used together in the simulation of a hydro generator.