MADX code to compute the last turn of the PSB