Numerical Algorithm to Study the Stability of Damage Problems