The article presents the results of modeling a ship’s synchronous generator. Based on preliminary design calculations, a geometric model of the generator was built. The static and overclocking processes of the generator are investigated. For static modes, the frequency response of the process is obtained. A numerical model was used to identify a mechanical defect. On the example of a simulated defect of an electrical machine - the eccentricity of the generator rotor, the signature of the defect signal is obtained. The study revealed that the presence of rotor eccentricity leads to the appearance of a harmonic component in the spectrum of the force of large amplitude with a maximum value at a low frequency. Transient analysis was carried out using wavelet transformations. The results of the study of dynamics show how the rotor speed increases. The simulation revealed three frequency regions of the signal under study: the region of the increase in speed, the achievement of the critical speed (between the second and third seconds), and the exit to the steady-state. A diagram of a system for diagnosing defects in an electrical machine using a digital twin - a numerical model is proposed. Generator defects (mechanical and electromechanical) can be identified based on model data. Databases of defect signatures in a static mode and a diagnostic model, which contains algorithms for deciding on the presence of a defect, can serve as the basis of information for an operator to decide.