Analytical method for the prediction of quench initiation and development in accelerator magnets