A new quantitative approach to the thermoelastic martensitic transformation: The density of elastic states