stepK = 21 / (s(s + 2))→ 1K = 2−1 ± 1jK = 2
−4−3−2−101−2−1012σ, real partjω, imaginary partS-PLANEunstableζ = 0.5 (60°)024681000.511.5time (s)ySTEP RESPONSE y(t)earlier Know
Lit wire with moving dashes: a signal is flowing along itBlocks: the step input, the summing junction, the gain K, the plant G(s), the output, the gain knob and the closed-loop pole tilePlots: the s-plane (× open-loop poles, ● closed-loop poles, the root locus) and the step response, computed from the polesThe pill travelling into the K block is the new gainA unity-feedback loop with one knob, the gain K, in front of the plant G(s) = 1 / (s(s + 2)). The s-plane shows the loop's two closed-loop poles, the roots of s² + 2s + K = 0, and the step response is recomputed from them. Turning K moves the poles: they start at G's poles 0 and −2, meet at −1 when K = 1, then run straight up and down. The path they trace is the root locus, and reading it lets you pick the gain for the response you want. The root locus is the set of closed-loop poles of K·G / (1 + K·G) as K runs from 0 to infinity. Each point s on it satisfies the magnitude condition K = 1 / |G(s)|, which reads the gain off the drawing.

The loop

  1. A step goes in. The loop compares it with the output, multiplies the error by a gain K, and drives G(s) = 1/(s(s + 2)). With K = 2 the output rises, overshoots by 4.3%, and settles at 1.

Turn up the gain

The locus

Compute it

The working

# step 1/9 · loop
# about: Input: unit step, Compare: input − output, Gain K, Plant G(s), Output y(t), Feedback path, step response

G(s) = 1 / (s(s + 2))        gain K in front, output fed back

closed loop  T(s) = K·G / (1 + K·G)
                  = K / (s² + 2s + K)

K = 2:  T(s) = 2 / (s² + 2s + 2)
peak  1.043 at t = 3.14 s   (overshoot 4.3 %)
final value  2/2 = 1

Every curve is the exact step response of T(s) = K / (s² + 2s + K), computed from its poles every frame. Overshoot and peak time are exact for this two-pole, no-zero loop; settling times are measured on the curve to a 2% band. This loop is stable for every positive K because its two branches stay on σ = −1. Add a third pole and the branches bend into the right half at some gain: the Routh test from the stability module finds that limit, and the root locus shows where it happens. The Python uses only the standard library. With python-control installed, ct.root_locus_map(ct.tf([1], [1, 2, 0]), gains=[0, 0.75, 1, 2, 5]) gives the same closed-loop poles in the .loci array of the result. Python prints a signed zero such as -0j for a real root; it is still just 0.