# How do integrators affect encirclements in the Nyquist plot?

I am trying to write a program to determine the closed-loop stability of a system using a frequency response function for data-driven control. I count the number of clockwise(CW) or counter-clockwise(CCW) encirclements by checking how many intersections the Nyquist curve has with a line starting on the critical point (-1, 0i). An intersection from left to right is CW and from right to left is CCW. It sort of looks like this: . \

So far, I get good results if there are not any integrators in the system. Integrators cause the Nyquist curve to go to infinity, which makes it difficult for my program to determine closed-loop stability. I have tried to find a pattern in the system's behaviour depending on the number of integrators, but I did not succeed. For example, by looking at the Nyquist plot of this system: $$\begin{equation} G = \frac{9}{s^6 + 1.5s^5 + 9.5s^4 + 9s^3} \end{equation}$$ it seems that the 3 integrators do not cause any encirclements. However, by using the Nyqlog function, we see that it does cause 2 CW encirclements around -1. Hence, the closed-loop system is unstable.

Is there any way to determine whether an integrator causes an encirclement or not?