The aim of the work is to develop algorithm for determining the optimal switching frequency of a transistor pulse-width converter (PWM) to minimize the total electrical losses in a DC drive. Electrical losses in the armature winding and in PWM transistors are divided into two components: static from the direct current component and dynamic. The latter include losses in the armature winding from the harmonic components of the current and losses in transistors from transient switching currents. Since the dynamic losses in transistors increase with increasing frequency, and in the armature winding from current harmonics they decrease, there is an optimal switching frequency value at which the total dynamic losses in the PWM drive will be minimal. This aim is achieved by solving the problem of determining the analytical dependence of dynamic electrical losses in the armature winding on the PWM switching frequency and computer simulation of a transistor DC drive. As a result of the research, an analytical expression was obtained for calculating the relative dynamic electrical losses in the armature winding with polyharmonic power supply. An algorithm is proposed for determining the optimal switching frequency of the PWM: 1) on computer models of the DC motor and PWM, the dependences of dynamic electrical losses on the switching frequency are determined; 2) build a graph of the dependence of the total dynamic electrical losses, on the which determine the point of minimum losses, which corresponds to the optimal value of the switching frequency. The novelty of the work lies in the fact that the theory of electrical losses in the armature windings with polyharmonic power has been further developed.