Routh array calculator
Build the Routh–Hurwitz table of a characteristic polynomial and count its right-half-plane roots without solving for them, including both special cases.
- Poles of G(s)
- −2−10
- Zeros of G(s)
- none
- DC gain G(0)
- ∞
- Closed-loop poles at this K (1)
- −2.325−0.3376 ± 0.5623j
- Stability
- Closed loop stable: every pole is in the left half-plane.
Closed-loop characteristic polynomial D(s) + K·N(s): p(s) = s³ + 3s² + 2s + 1
| Row | 1 | 2 | Sign |
|---|---|---|---|
| s³ | 1 | 2 | + |
| s² | 3 | 1 | + |
| s¹ | 1.6667 | 0 | + |
| s⁰ | 1 | 0 | + |
- Sign changes in the first column
- 0
- Right-half-plane roots
- 0
- Imaginary-axis roots
- 0
- Left-half-plane roots
- 3
−2.325−0.3376 ± 0.5623j
The numerical roots agree with the table.
Same result in code
% MATLAB has no built-in Routh table; check the root count directly.
p = [1 3 2 1];
r = roots(p)
nRHP = sum(real(r) > 0)import numpy as np
p = [1, 3, 2, 1]
r = np.roots(p)
print(r, np.sum(r.real > 0))MATLAB uses the Control System Toolbox; Python uses python-control 0.10 or later (pip install control).
What this calculator computes
By default the table uses the closed-loop characteristic polynomial D(s) + K·N(s) of the system above; you can also type any polynomial directly.
The number of sign changes in the first column equals the number of right-half-plane roots. For s⁴ + s³ + 2s² + 2s + 3 a zero appears in the first column; replacing it with ε gives the column 1, 1, ε, −3/ε, 3, with two sign changes, so two roots lie in the right half-plane.
How to read the result
- Zero in the first column (rest of the row not zero): the zero is replaced by a small positive ε and the table continues. Entries are shown by their leading behaviour as ε → 0⁺, which fixes their signs.
- Row of zeros: the row above gives the auxiliary polynomial A(s); its derivative replaces the zero row. A(s) is a factor of the polynomial, and its roots are symmetric about the origin, so this case signals roots on the imaginary axis or mirror pairs.
- Roots at s = 0 (a zero constant term) are factored out first and counted on the imaginary axis.
Method and conventions
- Entries are carried as truncated series in ε, so cancellations that only show up at higher order in ε are still resolved exactly instead of depending on one small number.
- The counts are cross-checked against the numerical roots of the same polynomial, which are listed below the table.
Coefficients must be numbers; to find the stable range of a symbolic gain K, use the root locus calculator, which computes it directly.