Mathematical Model for Glitches in Pulsars