Root Locus Calculator
Plot the root locus of a single-input single-output (SISO) linear time-invariant system, inspect closed-loop poles for a given gain \(K\), and read damping ratio and natural frequency.
Educational tool – always verify results against your course notes or a trusted CAS for critical designs.
1. Enter the open-loop transfer function
The calculator assumes a unity-feedback system with open-loop transfer function \( G(s) = K \dfrac{N(s)}{D(s)} \). Enter numerator and denominator polynomials in descending powers of \(s\).
Space-separated real numbers. Example: 1 3 2 →
\(s^2 + 3s + 2\).
Must be proper: degree of \(D(s)\) ≥ degree of \(N(s)\).
More samples → smoother locus, slower computation.
2. Root locus plot
Real axis (horizontal), imaginary axis (vertical). Stable closed-loop poles lie in the left half-plane (Re < 0).
Closed-loop characteristic equation: \( D(s) + K N(s) = 0 \).
What is a root locus?
In classical control theory, the root locus is the locus of closed-loop poles of a feedback system as a real scalar gain \(K\) varies from 0 to \(+\infty\). For a unity-feedback system with open-loop transfer function \( G(s) = K \dfrac{N(s)}{D(s)} \), the closed-loop characteristic equation is:
Each solution \(s_i(K)\) of this equation is a closed-loop pole. Plotting all \(s_i(K)\) in the complex plane as \(K\) varies gives the root locus. The location of these poles determines:
- Stability – all poles must lie in the left half-plane (LHP) for asymptotic stability.
- Transient response – damping ratio \(\zeta\) and natural frequency \(\omega_n\) of complex poles.
- Steady-state error – via system type and pole at the origin.
Closed-loop poles, damping ratio, and natural frequency
For a second-order complex pole pair \( s = \sigma \pm j\omega_d \), we define:
The table in this calculator computes \(\omega_n\) and \(\zeta\) for each pole at the selected gain \(K\). Real poles have \(\omega_d = 0\) and \(\zeta = 1\) (overdamped).
Basic root locus rules (qualitative design)
Some standard rules used in hand sketching:
- The number of branches equals the number of poles of \(G(s)\).
- Branches start at open-loop poles and end at open-loop zeros (including zeros at infinity).
- The locus lies on real-axis segments where the total number of real poles and zeros to the right is odd.
- Asymptotes for branches going to infinity have angles \(\theta_k = \dfrac{(2k+1)\pi}{n-m}\), where \(n\) = number of poles, \(m\) = number of zeros.
- The centroid of asymptotes is \(\sigma_a = \dfrac{\sum \text{poles} - \sum \text{zeros}}{n-m}\).
This interactive tool does not rely on these rules to draw the plot; instead, it numerically computes the closed-loop poles for many values of \(K\). However, understanding the rules helps you interpret the plot.
How this calculator works (numerical method)
- Parse numerator and denominator coefficients into polynomials \(N(s)\) and \(D(s)\).
- Generate a grid of gain values \(K\) between \(K_{\min}\) and \(K_{\max}\).
- For each \(K\), form the characteristic polynomial \( P_K(s) = D(s) + K N(s) \) and compute its roots numerically.
- Collect all roots and plot them in the complex plane as the root locus.
- For a user-selected \(K\), recompute roots and derive \(\omega_n\) and \(\zeta\) for each pole.
This is similar in spirit to tools like MATLAB’s
rlocus, but implemented entirely in JavaScript for
quick visual exploration in the browser.
Root locus FAQ
What kinds of systems does this root locus calculator support?
It supports SISO, LTI, rational transfer functions of the form \( G(s) = K \dfrac{N(s)}{D(s)} \) with real coefficients. Both numerator and denominator can be any order, as long as the system is proper (degree of \(D(s)\) ≥ degree of \(N(s)\)).
How do I know if the closed-loop system is stable?
For each chosen gain \(K\), the calculator recomputes the closed-loop poles. If all poles have negative real parts, the system is asymptotically stable. The “Closed-loop pole summary” box shows a Stable or Unstable label accordingly.
Can I design for a target damping ratio or settling time?
This tool is mainly for visual exploration. A common workflow is:
- Plot the root locus for a reasonable range of \(K\).
- Use the \(K\) slider / input to move along the locus.
- Watch the damping ratio \(\zeta\) and natural frequency \(\omega_n\) of the dominant poles.
- Pick a gain \(K\) that meets your design specs (e.g. \(\zeta \approx 0.7\), desired \(\omega_n\)).
For more advanced design (lead/lag compensators, PID tuning), you would typically combine root locus with analytical formulas or a dedicated control design environment.
Why do I sometimes see numerical noise or strange branches?
The calculator uses floating‑point arithmetic and a generic polynomial root finder. For high‑order systems, very large gains, or nearly repeated poles, numerical conditioning can cause:
- Small asymmetries in symmetric loci.
- Apparent “jumps” in branches for certain \(K\) values.
If this happens, try reducing \(K_{\max}\), lowering the number of samples, or simplifying the transfer function.