A derivation of the Maxwell–Cattaneo equation from the free energy and dissipation potentials