A History of Thermodynamics: The Doctrine of Energy and Entropy