Use reversible martensitic transformations to explain shape-memory effects and superelasticity in nickel–titanium and related alloys.