Simulation of mechanical drives with generalized power losses