A model for an alloy with shape memory