Thermodynamic treatment of cyclic amorphization during ball milling