Modelling the constrained recovery in shape memory wires