Dynamical Systems and Thermodynamics