Driving force for shape memory effect of polymers