An Energy Model for the Calculation of Losses and their Effects on Machining Accuracy