When modeling transient processes in electric power systems, the issue of designing reliable models of electrical machines is of great interest. The most difficult task is to design the models of synchronous and asynchronous machines. The purpose of the project is to develop mathematical models of synchronous and asynchronous machines based on a generalized model of an implicit-pole machine that considers the change of rotor speed, geometric shapes, and the type of rotor and stator windings. Methods of mathematical modeling of electromagnetic fields in the air gap based on Maxwell equations and methods of the theory of electrical circuits are applied. A system of nonlinear differential equations is considered as a mathematical model of a generalized implicit-pole machine. The key assumption made is the high magnetic permeability of the stator and rotor cores. Technical data of real electric machines have been used for verification. Mathematical models of an implicit pole synchronous machine and an asynchronous machine with a phase rotor have been developed. These models can be used to analyze transient processes in the aggregate without dividing them into electromagnetic and electromechanical ones. The novelty of the models is the fact of non-sinusoidal distribution of the magnetic field in the air gap, various types of multiphase AC windings and rejecting the principle of constant rotation frequency at the time step of the simulation. The proposed mathematical models can be used to solve design problems, to analyze the modes of electric power systems, the operation of relay protection and automation of electric power facilities, and emergency automation. In the future, the equations that consider the influence of the damper circuits and the peculiarities of the windings will be added to the developed mathematical models. The purpose of further research is to develop models of salient-pole synchronous machines and asynchronous machines with a squirrel-cage rotor.