Hysteresis and phase transitions for one-dimensional and three-dimensional models in shape memory alloys