Variational Limits of Discrete Systems