The Influence of Thermal History on the Multistage Transformation of NiTi Shape-Memory Alloys