when i > nmax, maximum number of iterations reached