Variational and Extremum Principles in Macroscopic Systems