Skip to content
Automatic Controls 1

Root locus in depth: the rules proved, difficult cases, MATLAB and Python

Angle and magnitude conditions, proof of all the rules, circular locus with a zero, departure angles, open-loop unstable process, locus with respect to a parameter, verified MATLAB and Python examples.

This page goes deeper into the lesson on the root locus. There the sketching rules are stated; here they are proved one by one, starting from the angle condition. Then we study the cases that cause difficulty in exercises: departure angles from complex poles, the circular locus of a system with a zero, the process that is unstable in open loop, the locus with respect to a parameter other than the gain. At the end are the examples in MATLAB and Python, with verified code.

Notation: L(s) = K\,\frac{N(s)}{D(s)}, with N monic of degree m and zeros z_i, D monic of degree n \ge m and poles p_i; the closed-loop poles are the roots of D(s) + KN(s) = 0, for K \ge 0.

The rules, proved

Angle and magnitude conditions. D + KN = 0 is equivalent to \frac{N(s)}{D(s)} = -\frac{1}{K}, a negative real number. A complex number is real and negative if and only if its argument is 180° (up to multiples of 360°). Since \arg\frac{N}{D} = \sum\arg(s - z_i) - \sum\arg(s - p_i), the angle condition follows; the magnitude gives the value of K. Every rule below is a consequence of these two.

Rule 1 (symmetry). D and N have real coefficients, so the complex roots of D + KN come in conjugate pairs: the locus is symmetric about the real axis.

Rule 2 (start and end). The polynomial D + KN has degree n for every K: there are n branches. As K \to 0 the equation becomes D = 0: the branches start from the poles. Dividing by K, \frac{D}{K} + N = 0: as K \to \infty, m roots tend to the zeros. The other n - m must go to infinity, because a polynomial of degree n has n roots and only m can stay finite.

Rule 3 (real axis). For real s, every real pole or zero to the left of s contributes an angle of 0°, every real pole or zero to the right contributes 180°, and a complex pair contributes opposite angles that cancel. The sum is 180°\cdot(\text{number of real poles and zeros to the right}), and it equals 180° modulo 360° if and only if that number is odd.

Rule 4 (asymptotes and centroid). For large |s|,

    \[ \frac{D(s)}{N(s)} = s^{n-m}\cdot\frac{1 - \frac{\sum p_i}{s} + \cdots}{1 - \frac{\sum z_i}{s} + \cdots} = s^{n-m}\left(1 - \frac{\sum p_i - \sum z_i}{s} + O(s^{-2})\right) \approx \left(s - \sigma_a\right)^{n-m} \]

with \sigma_a = \frac{\sum p_i - \sum z_i}{n - m}, because (s - \sigma_a)^{n-m} = s^{n-m}\left(1 - \frac{(n - m)\sigma_a}{s} + \cdots\right) (using the coefficients of D and N: the second coefficient of a monic polynomial is minus the sum of its roots). The locus equation becomes (s - \sigma_a)^{n-m} = -K: s = \sigma_a + K^{1/(n-m)}e^{i\frac{180° + k\cdot 360°}{n - m}}. These are half-lines starting from \sigma_a with the angles of the lesson. ∎

Rule 5 (breakaway). Where two branches meet, D + KN has a double root s_0: D(s_0) + KN(s_0) = 0 and D'(s_0) + KN'(s_0) = 0. Eliminating K: D'N - DN' = 0, which is the numerator of \frac{d}{ds}\frac{D}{N}. Equivalently, on the real stretch of the locus K(s) = -\frac{D(s)}{N(s)}, and the breakaway point is a maximum (or minimum) of K: there two real roots merge and become complex. ∎

Rule 6 (departure angles). Near a pole p_j, all factors except s - p_j have almost constant argument, equal to their value at p_j. The angle condition then gives the direction of departure:

    \[ \theta_{p_j} = 180° + \sum_i\arg(p_j - z_i) - \sum_{i \ne j}\arg(p_j - p_i) \]

and in the same way the arrival angle at a zero \theta_{z_j} = 180° - \sum_{i \ne j}\arg(z_j - z_i) + \sum_i\arg(z_j - p_i).

Rule 7 (sum of the poles). If n - m \ge 2, the coefficient of s^{n-1} in D + KN does not depend on K (because KN has degree at most n - 2), so the sum of the closed-loop poles is constant. If one pair moves to the right, another branch must move to the left by the same amount: a very useful check on sketches.

Rule 8 (imaginary axis). The crossing points are the solutions of D(i\omega) + KN(i\omega) = 0: setting real and imaginary parts to zero gives \omega and K. It is the same information as the zero row in the Routh table.

Asymptotes of a locus with four poles
For K over s times s plus 1 times s plus 3 times s plus 4 the four asymptotes, dashed, start from the centroid minus 2 at angles of 45, 135, 225 and 315 degrees. The branches leave the real axis at the breakaway points and approach the asymptotes.

A zero and a circular locus

    \[ L(s) = K\,\frac{s + 3}{s(s + 1)} \]

Real axis: the stretch between 0 and -1 and everything to the left of -3. Breakaway points: \frac{d}{ds}\frac{s(s + 1)}{s + 3} = 0 gives s^2 + 6s + 3 = 0, i.e. s = -0.551 (with K = 0.101) and s = -5.449 (with K = 9.90).

Theorem. The complex part of the locus is the circle centred at -3 (the zero) with radius \sqrt 6.

Proof. With s = x + iy, the equation s^2 + (1 + K)s + 3K = 0 has complex roots with x = -\frac{1 + K}{2}, y^2 = 3K - x^2. From K = -2x - 1: y^2 = -6x - 3 - x^2, i.e. (x + 3)^2 + y^2 = 6. ∎

In general, with two real poles and one real zero the locus is always a circle centred at the zero, with radius equal to the geometric mean of the distances of the zero from the two poles (here \sqrt{3\cdot 2} = \sqrt 6). The zero “attracts” the branches and keeps them in the left half-plane for every K: this is the effect of derivative action (lead network or PD).

Root locus of K times s plus 3 over s times s plus 1
The branches start from the poles 0 and minus 1, leave the axis at minus 0.55, describe a circle around the zero at minus 3 and rejoin the axis at minus 5.45; then one goes to the zero and the other to minus infinity.

Complex poles: the departure angle

    \[ L(s) = \frac{K}{(s + 3)(s^2 + 2s + 2)} \]

Poles at -3 and -1 \pm i. Departure angle from p = -1 + i: \arg(p + 3) = \arg(2 + i) = 26.6°; \arg(p - \bar p) = \arg(2i) = 90°. So \theta = 180° - 26.6° - 90° = 63.4°: the branch leaves upwards and to the right, and crosses the imaginary axis.

Crossing: (s + 3)(s^2 + 2s + 2) = s^3 + 5s^2 + 8s + 6. With s = i\omega: real part -5\omega^2 + 6 + K = 0, imaginary part -\omega^3 + 8\omega = 0. So \omega = \sqrt 8 = 2.83 and K = 34. Asymptotes: centroid \frac{-3 - 2}{3} = -1.67, angles \pm 60° and 180°.

Locus with a pair of complex poles
From the poles minus 1 plus or minus i the branches leave at an angle of about 63 degrees, rise to the right and cross the imaginary axis for K equal to 34, at plus or minus i times 2.83.

A process that is unstable in open loop

    \[ L(s) = K\,\frac{s + 1}{s(s - 2)} \]

The pole at +2 makes the process unstable on its own. Characteristic equation: s^2 + (K - 2)s + K = 0. By the Routh criterion (second order: all coefficients positive) the closed loop is stable for K \gt  2. The locus shows it: the branches start from 0 and from 2, meet on the real axis between the two poles, describe a circle around the zero at -1 (centre -1, radius \sqrt{1\cdot 3} = \sqrt 3) and cross the imaginary axis at \pm i\sqrt 2 for K = 2.

This is the typical situation of an inverted pendulum, a magnetic levitator or a fighter aircraft that is unstable by design: the feedback must have a minimum gain, and a failure of the controller is catastrophic.

Locus of an unstable process
The branches start from the pole at the origin and from the unstable one at 2, meet between the two, go round the zero at minus 1 and enter the left half-plane when K exceeds 2.

The locus with respect to another parameter

The method works for any parameter that appears linearly in the characteristic equation. Suppose we want to know how the poles of s^2 + as + 4 = 0 move as the damping a varies. Rewrite the equation as

    \[ 1 + a\,\frac{s}{s^2 + 4} = 0 \]

which is a root locus with “gain” a, poles at \pm 2i and a zero at 0. The locus is a circle of radius 2 centred at the origin (the poles have modulus \sqrt 4 = 2 as long as they are complex): damping changes the angle of the poles but not the natural frequency \omega_n = 2. For a = 4 the poles coincide at -2 (critical damping).

Root locus with respect to the damping coefficient
As a increases the poles start from plus and minus 2 i, go down along a semicircle of radius 2, meet at minus 2 for a equal to 4 and then split along the real axis.

The locus in MATLAB and Python

The locus of the lesson example, \frac{K}{s(s + 2)(s + 4)}, with the search for the gain that gives damping 0.5.

MATLAB (Control System Toolbox):

G = tf(1, [1 6 8 0]);          % G(s) = 1/(s(s+2)(s+4))
rlocus(G); sgrid(0.5, [])      % locus and damping line 0.5
[K, poles] = rlocfind(G)       % click on the desired point of the locus
T = feedback(8.3*G, 1); stepinfo(T)

Python (free libraries numpy and python-control):

import numpy as np
import control as ct

G = ct.tf([1], [1, 6, 8, 0])            # G(s) = 1/(s(s+2)(s+4))
rlist, klist = ct.root_locus(G, plot=False)

# gain for which the dominant pair has damping 0.5
for K in np.linspace(0.5, 47, 50000):
    p = np.roots([1, 6, 8, K])
    c = p[np.argmax(p.imag)]
    if c.imag > 0 and -c.real / abs(c) <= 0.5:
        print(f"K = {K:.2f}, poles = {np.round(p, 3)}")
        break

# critical gain: roots on the imaginary axis
print(np.roots([1, 6, 8, 48]))
T = ct.feedback(8.3 * G, 1)
print(ct.step_info(T)["Overshoot"])

Running it prints K = 8.30 with poles -4.667 and -0.667 \pm 1.155i, then the roots -6 and \pm 2.828i for K = 48, and finally an overshoot of 15.5 %: slightly less than the 16.3 % of a pure second-order system with \zeta = 0.5, because of the third pole at -4.67, which damps the response a little. With plot=True (or with ct.root_locus_plot in more recent versions of the library) the plot is drawn with matplotlib.

The gain for a given damping
The dashed green line corresponds to damping 0.5; the locus crosses it for K equal to 8.3, where the dominant poles are minus 0.67 plus or minus 1.15 i and the third pole is at minus 4.67.

Exercises covering all the cases on this page are on the exercise page linked at the top.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x