Can the Herglotz's variational principle be used to derive the fundamental thermodynamic relation?
Or in general, does there exist some functional $\mathcal F[u]$ for which the variation set to zero:
$$\delta \mathcal F[u] =0 $$ produces the fundamental thermodynamic relation:
$$dU = TdS-pdV $$
as the Euler-Lagrange equation of $\mathcal F$?