🌀 Root Locus: How Poles Move as Gain Changes
Interactive root locus plot: place open-loop poles and zeros, sweep gain K and watch the real closed-loop poles trace their exact trajectories through the s-plane, with a live stability verdict and critical gain.
About this simulation
The root locus, invented by Walter R. Evans in 1948, is the classical graphical technique for showing exactly how a closed-loop system's poles — the roots of the characteristic equation 1 + K·G(s)H(s) = 0 — move through the complex s-plane as a real gain K sweeps from 0 to infinity. This simulation builds the real characteristic polynomial from whatever open-loop poles and zeros you place, then solves for its exact roots at every gain using a Durand–Kerner numerical root-finder, so every branch you see is a genuinely computed trajectory rather than a hand-drawn sketch. Because a system is stable exactly when every closed-loop pole has negative real part, the locus directly shows the real range of K for which the loop stays stable, and pinpoints the critical gain K_crit at which a branch crosses the imaginary axis into the shaded right-half-plane.
🔬 What it shows
The × markers are the open-loop poles (roots of the denominator of G(s)H(s)) and the ○ markers are the open-loop zeros. As K rises from 0, each branch starts exactly at an open-loop pole; branches either terminate at an open-loop zero or run off to infinity along straight asymptotes whose angles and shared centroid follow the standard root-locus construction rules. The filled amber dots are the actual closed-loop poles at the current gain K — solved numerically, not interpolated — and the shaded right half of the plane is the unstable region.
🎮 How to use
Drag any × (pole) or ○ (zero) directly on the plot, or type exact coordinates in the side panel; the locus recomputes live. Use + Pole / + Zero to add more (zeros can't outnumber poles for a physically realizable system), and Remove mode to click a marker away. Move the K slider to slide the live pole markers along the actual computed locus, or press Animate K to sweep it automatically. K max controls how far the sweep and the K slider search.
💡 Did you know?
For the classic example G(s)H(s) = K / [s(s+2)(s+4)] loaded by default, Routh–Hurwitz analysis predicts the loop goes unstable exactly at K = 48 — and this simulation's bisection search on the numerically tracked branch finds the same K_crit ≈ 48 purely from root positions, with no algebra at all. Adding a zero (try the "Add a zero" preset) pulls a branch back toward the left half-plane, which is exactly why lead compensators — built from an extra zero — are used to stabilize marginal systems.
Frequently asked questions
What exactly is the root locus, and who invented it?
The root locus is a plot, in the complex s-plane, of every root of the closed-loop characteristic equation 1 + K·G(s)H(s) = 0 as the real, non-negative gain K varies continuously from 0 to infinity. It was introduced by Walter R. Evans in 1948 specifically so control engineers could see how feedback gain affects closed-loop pole locations — and therefore stability and transient response — without having to factor a new polynomial by hand for every candidate gain. This simulation performs that same exact root-solving numerically at every K instead of by hand.
Why does every branch start at an open-loop pole and end at an open-loop zero or infinity?
At K = 0, the characteristic equation 1 + K·G(s)H(s) = 0 reduces to just the denominator of G(s)H(s) equal to zero — so the closed-loop poles are exactly the open-loop poles. As K → ∞, the equation is dominated by the numerator, so roots approach the open-loop zeros. If there are fewer zeros than poles, the "extra" branches have nowhere finite to go and instead diverge to infinity along straight-line asymptotes, whose angles are (2k+1)·180°/(n−m) and whose common origin (the centroid) is (Σpoles − Σzeros)/(n−m), where n is the pole count and m the zero count.
How does the root locus reveal stability, and what is K_crit?
A linear system is stable if and only if every closed-loop pole has strictly negative real part — i.e. sits in the left half of the s-plane, shaded white here versus the red-tinted right half. As K increases along a branch, the moment that branch's real part crosses zero into the shaded region is the critical gain K_crit: for K below it the system is stable, for K above it that branch has gone unstable. This simulation finds K_crit by scanning the computed locus for a sign change in a branch's real part, then refining it with bisection on the exact numerically tracked root.
How does this simulation actually compute the locus — is it a real calculation?
Yes. From your placed poles and zeros it builds the monic denominator polynomial Den(s) and numerator polynomial Num(s), forms the exact characteristic polynomial Den(s) + K·Num(s) for a swept sequence of K values, and finds all of that polynomial's complex roots simultaneously using the Durand–Kerner iteration — a genuine numerical polynomial root-finding method. Consecutive K samples are warm-started from the previous roots and matched by nearest distance so each branch stays continuous, exactly the same continuity a hand-drawn locus assumes.
Why can a pole or zero placement make the system unstable at low gain?
If any open-loop pole already sits in the right half-plane (positive real part) and no zero or nearby pole reshapes the locus fast enough, the corresponding branch can remain in the right half-plane for small K, or a branch can cross into it very early. The "Complex pair" preset in this simulation loads poles at 1 ± 2j — already unstable in open loop — so you can see how much (or how little) feedback gain is needed, if any, to pull that branch back into the stable region.
What real-world design decisions does the root locus support?
Control engineers use the root locus to choose a gain K that places closed-loop poles where they want them — for example, far enough left for a fast response, or with a damping ratio that limits overshoot. It also motivates compensator design: adding a zero (as in a lead compensator) bends branches toward the left half-plane and can stabilize a marginally stable plant, while adding a pole (lag compensation) does the opposite locally but can improve steady-state accuracy. This is why nearly every classical control-systems course builds the root locus by hand before ever touching a computer.
Interactive root locus plot: place open-loop poles and zeros, sweep gain K and watch the real closed-loop poles trace their exact trajectories through the s-plane.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install