One of the important tasks of non–destructive testing of rotary mechanisms is to determine the degree of shaft misalignment. Currently, the misalignment is detected based on the analysis of the amplitude spectrum of vibration. Experimental data show that the amplitudes of the vibration components depend on the displacement of the shafts according to a law close to linear, but with different coefficients of proportionality. The coefficients depend on the design of the coupling, and are usually unknown. In well-known works, the vibration of centered shafts is modeled as a rule by introducing forces into the system at different frequencies of equal amplitude. This does not agree with the observational data, in particular with the different dependence of the amplitudes of the components on the magnitude of the misalignment. In addition, there are usually several sources of forces in the system. In particular, parallel and angular misalignment can be expressed simultaneously and create oscillations at three harmonics of the rotor speed. The imbalance of the rotor leads to the appearance of oscillations at the frequency of its rotation. The oscillations can only be summed vector-wise, i.e. taking into account the phase. Without taking into account the phases of the vibration components, it is impossible to make a correct conclusion about the magnitude of the defects present. In this paper, a method is proposed for calculating the magnitude of the parallel alignment of the shafts and the imbalance of one of them