Stability of an Elastic bar with Non-Convex Energies: Discrete vs Continuous