The question
A gain K = 4 drives the plant G(s) = 1/(s + 1)³, and the output is fed back and subtracted. Stable means every root of 1 + K·G(s) = 0 has a negative real part. Can we tell without solving?
Call L(s) = K·G(s) the open loop: the path round the loop with the feedback cut. A closed-loop pole is a value of s where 1 + L(s) = 0, which means L(s) = −1. So −1 is the critical point.
Draw the curve
Feed the open loop a sine at ω = 1 rad/s. Once settled, the output is a sine of the same frequency, 1.414 times as big and 135° behind. That pair is one complex number: L(j1) = −1 − 1j, a dot on the plane.
Turn ω from 0 to ∞ and follow the dot. It starts at 4, the phase falls toward −270° and the gain toward 0. It crosses the negative real axis at ω = √3 ≈ 1.73 rad/s, at −0.5. That is the Nyquist plot.
The s-plane is a map of every complex s; unstable poles live in its right half. Walk s clockwise round that half: up the jω axis, then round a huge arc. Turning the knob below zero gives the mirror image; the arc squeezes to 0.
Count the turns
Pin a needle at −1, pointing at the dot. Walk the dot once round the closed curve; the needle's net clockwise turns are N. The curve crosses at −0.5, right of −1, so the needle swings and comes back: N = 0.
The needle points along 1 + L(s). As s circles the right half plane, each zero of 1 + L inside adds one clockwise turn, each pole inside one anticlockwise turn. Zeros of 1 + L are closed-loop poles; its poles are L's poles.
So Z = N + P. P counts open-loop poles in the right half plane: none, all three sit at −1. Z counts closed-loop poles there. N = 0 and P = 0 give Z = 0: stable. Check the roots: −0.206 ± 1.375j, −2.587.
Change the gain
Raise K to 12. The same shape grows three times bigger and now crosses at −1.5, left of −1. The needle makes two full clockwise turns: N = 2, so Z = 2 + 0 = 2. Two closed-loop poles are unstable: 0.145 ± 1.983j.
At K = 8 the curve passes through −1 at ω = √3. A sine there returns the same size, upside down; the minus sign flips it back, so it feeds itself. Poles ±j√3: the edge, the same K < 8 limit Routh gives.
Automate the count: step ω along the whole axis, add up the small changes in the needle's angle, and divide by a full turn. Pure Python with cmath gives N = 0 at K = 4 and N = 2 at K = 12.
The working
# step 1/11 · loop # about: Sine source, Compare r − y, Gain K, Plant G(s), Output y, Feedback switch plant G(s) = 1 / (s + 1)³ open loop L(s) = K·G(s), K = 4 closed loop T(s) = L / (1 + L) closed-loop poles: roots of 1 + L(s) = 0 stable ⇔ all of them have real part < 0 Nyquist: decide this from L(jω) alone, the open loop's response to sines.
Every point on the Nyquist plane is L(jω) = K / (1 + jω)³ computed exactly; the sines are the exact steady-state output, |L|·cos(ωt + ∠L). Turn counts come from adding the needle's angle changes along the sampled contour. The Python uses only the standard library. With python-control installed, ct.nyquist_response(ct.tf([12], [1, 3, 3, 1])).count returns the number of encirclements of −1.