A Dynamical Systems Theory of Thermodynamics (Princeton Series in Applied Mathematics)