Thermodynamics and physics of matter