A nonlinear thermodynamic model for phase transitions in shape memory alloy wires