Ferromagnetism of thermoelastic martensites: Theory and experiment