Stability of beams with discrete lateral restraints