Control SystemsPreliminary engineering
Stability & Margins Checker
Close the unity-feedback loop around L(s) and check it two independent ways: the Routh–Hurwitz table on the characteristic polynomial, and the gain/phase margins with their crossover frequencies.
About this calculator
This tool answers the design review question — 'is this loop stable, and by how much?' — using two methods that check each other. Enter the open-loop transfer function L(s); the closed negative-unity-feedback loop has characteristic equation 1 + L(s) = 0, i.e. D(s) + N(s) = 0.
The Routh–Hurwitz test builds the classical array from that polynomial's coefficients and counts sign changes in the first column: each change is one right-half-plane closed-loop pole, determined without computing a single root. The two textbook special cases are handled the standard way — a lone zero in the first column by the ε-substitution, an entire zero row by differentiating the auxiliary polynomial (which itself signals symmetric root pairs, usually an imaginary-axis crossing).
The margins tell you how FAR from the boundary you are: gain margin, the additional gain (in dB) the loop tolerates before oscillating at the phase-crossover frequency; phase margin, the additional lag it tolerates at the gain crossover. Both crossings are located by bisection on the exact frequency response. When the two views disagree with your intuition — positive margins but a Routh verdict of unstable — you have found precisely the situation (open-loop RHP poles, multiple crossings) where margins alone mislead, and the tool says so in plain language.
The worked solution shows the closed-loop polynomial, the full Routh array, the sign-change count, and each margin's defining computation.
Design notes & common mistakes
- Routh answers 'is it stable' with zero rounding risk (pure arithmetic on coefficients); margins answer 'how robustly'. A review needs both — one number without the other is half an answer.
- Run Routh on the CLOSED-loop polynomial D + N, never on D alone — testing the open-loop denominator tells you about the plant, not the loop.
- A necessary quick check before any table: all characteristic-polynomial coefficients present and of one sign. Any missing or negative coefficient already guarantees non-LHP roots.
- Symbolic gain sweeps are Routh's real power: leave K symbolic in the first column and the stable K-range falls out — this tool evaluates numerically, so sweep K by editing b₀ (the classic K/(s(s+1)(s+2)) goes marginal at exactly K = 6).
Assumptions
- Negative unity feedback around the entered L(s); the characteristic polynomial is formed as D(s) + N(s).
- Routh special cases use the standard remedies: ε-substitution for a first-column zero, auxiliary-polynomial derivative for a zero row.
- Margins presume the classical crossover definitions; when several crossings exist the binding (smallest-magnitude) margin is reported.
- Coefficients are exact as entered — no parameter uncertainty is propagated through the table.
When to use this calculator
Appropriate for
- Checking closed-loop stability two independent ways — the Routh–Hurwitz table and the gain/phase margins
- Finding how much gain or phase headroom a loop has before instability
- Teaching the Routh criterion and the meaning of the margins
Not suitable for
- Reading the margins as a stability certificate when the open loop has RHP poles or multiple crossovers — trust the Routh/Nyquist count there
- Systems with transport delay, which the polynomial Routh test cannot represent without approximation
- Sampled-data loops, where the Jury test replaces Routh
What this calculator does not cover
- Numeric gain only — the symbolic-K Routh sweep (stable gain RANGE in one table) is a planned extension alongside the root-locus tool.
- No transport delay: delay is not a polynomial and needs a Padé approximation before entry, which is itself an approximation of the true margin.
- Margins are reported even where they don't certify stability (open-loop RHP poles); the tool warns rather than suppresses, because the numbers still measure distance-to-boundary along their slices.
- Continuous-time only; for sampled loops the discrete (Jury) test replaces Routh.
- As with every calculator on this site: results are preliminary and educational, are not verified for any specific installation, and must be reviewed against the applicable code edition and stamped by a licensed Professional Engineer before real-world use.
Frequently asked questions
What does each sign change in the Routh first column mean?
Exactly one root of the characteristic polynomial in the right half-plane — one unstable closed-loop pole. No sign changes means none; the test is exact and needs no root computation at all.
What does a whole row of zeros in the table signify?
The polynomial has roots placed symmetrically about the origin — most often a ±jω pair, which is a loop sitting exactly at its critical gain. The row is replaced by the derivative of the auxiliary polynomial, whose roots are those symmetric pairs.
Can Routh and the margins disagree?
They answer different questions, and apparent disagreement is diagnostic: positive-looking margins with a Routh verdict of unstable happens when the open loop has RHP poles or the response crosses the critical levels multiple times. In those cases the Routh/Nyquist count is authoritative; margins are only slices.
How do I find the range of gain K that keeps the loop stable?
Classically, leave K symbolic in the characteristic polynomial and demand the whole first column positive. This tool computes numerically, so sweep the numerator gain and watch the verdict flip — for K/(s(s+1)(s+2)) the boundary lands at exactly K = 6, where the s¹ row becomes all zeros.
References
- Nise, N. S., Control Systems Engineering, 8th ed., Ch. 6 (Routh–Hurwitz criterion including both special cases)
- Ogata, K., Modern Control Engineering, 5th ed., Ch. 5 (Routh stability criterion) and Ch. 7 (relative stability, margins)
- Franklin, G., Powell, J. & Emami-Naeini, A., Feedback Control of Dynamic Systems, 8th ed., Ch. 6 (stability margins)
Related calculators
Bode Plot Generator
Magnitude (dB) and unwrapped phase of H(jω) on a log-frequency axis, with gain and phase crossovers located and both stability margins annotated.
Nyquist Plot & Stability Criterion
The L(jω) locus in the complex plane with the −1 point marked, plus the exact Nyquist accounting: open-loop RHP poles P, closed-loop RHP poles Z, and the implied encirclement count N.
Transfer Function Analyzer
Enter H(s) as polynomial coefficients and get poles, zeros, gain, characteristic equation, system order and type, and a stability verdict — with the pole-zero map and a live step-response preview.
Step / Impulse / Ramp Response
Simulate the step, impulse, or ramp response of H(s) and read the performance metrics — rise time, peak time, overshoot, settling time — with markers on the curve.
Get the ComputeVerse.ai quick reference
A free engineering quick-reference PDF, plus a note when new calculators launch across the library — one or two emails a month, nothing else.