Thermal potential, mechanical instability, and melting entropy