The loop
A gain K drives the plant G(s) = (s + 3) / (s(s + 1)(s + 2)(s + 4)), and the output is fed back. The closed-loop poles solve 1 + K·G(s) = 0. Five rules sketch where they go as K grows.
Where branches go
At K = 0 the K(s + 3) term vanishes, so the closed-loop poles sit exactly on the open-loop poles: 0, −1, −2 and −4. Four poles, so four branches. Nudge K up and each one slides off its ×.
For a huge K, divide the equation by K: only s + 3 = 0 is left. So one branch ends on the zero ○ at −3. Four branches but only one zero: the other 4 − 1 = 3 run off to infinity.
The real axis
Slide a test point along the real axis and count the real poles and zeros to its right. An odd count puts it on the locus; even, not. That gives three pieces: −1 to 0, −3 to −2, and left of −4.
Asymptotes
The three branches going to infinity follow straight lines called asymptotes. They meet on the real axis at the centroid: σa = (sum of poles − sum of zeros) / (n − m) = (−7 − (−3)) / 3 = −4/3.
Their angles are (2k + 1)·180° / (n − m) for k = 0, 1, 2: 60°, 180° and 300°. One branch heads left along the axis. Two leave at ±60°, mirror images, because complex poles come in conjugate pairs.
Turn up the gain
Now raise K from 0 to 30. The poles from 0 and −1 meet, leave the axis and bend toward the ±60° lines. −2 slides to −3; −4 runs left. Past K ≈ 9.65 two poles cross into the right half: unstable.
Add the four closed-loop poles: the sum is −7 for every K, because K never touches the s³ term. For large K one pole sits near −3, so the three far poles must average (−7 + 3) / 3 = −4/3.
Compute it
Python turns the two lists, poles and zeros, straight into the sketch: the number of branches, the centroid, the asymptote angles and which pieces of the real axis are on the locus. No polynomial solving needed.
The working
# step 1/9 · loop # about: Reference r, Compare point, Gain K, Plant G(s), Output y, open-loop poles × and zero ○, closed-loop poles closed loop T(s) = K·G(s) / (1 + K·G(s)) poles of T: 1 + K·G(s) = 0 s(s + 1)(s + 2)(s + 4) + K(s + 3) = 0 s⁴ + 7s³ + 14s² + (8 + K)s + 3K = 0 open-loop poles 0, -1, -2, -4 n = 4 open-loop zero -3 m = 1 the root locus = every place these four roots can be, for K from 0 upward
Every closed-loop pole in the figure is a root of s⁴ + 7s³ + 14s² + (8 + K)s + 3K, found numerically for the current K; the locus is those roots traced over K. Nothing on the s-plane is sketched by hand. The Python uses only built-ins. With python-control installed, ct.root_locus_plot(ct.tf([1, 3], [1, 7, 14, 8, 0])) draws the same locus by finding the roots of 1 + k·G(s).