Thermomechanical analysis of machining and brazing