Gradient Dynamics and Entropy Production Maximization