Modeling Electric Motors and Drivetrains