Tools › Electrical and Controls › Control Systems › Transfer Function Analyzer


Transfer Function Analyzer

Type the numerator and denominator coefficients of a transfer function and get its poles and zeros, a stability verdict with the Routh array written row by row, the step response with rise time, overshoot and settling time, the Bode plots with gain and phase margins and, for a unity-feedback loop, the range of gain K that keeps it stable and the root locus. One click on a Try this case shows a complete example.

  • Poles, zeros, damping ratio and natural frequency of every pole pair; stable, marginally stable or unstable, with the reason

  • Routh array row by row, including a zero in the first column and a row of zeros with its auxiliary polynomial; with K as a symbol for a feedback loop

  • Step, impulse or ramp response computed exactly at every plotted point; rise time, peak time, percent overshoot, settling time, steady-state error and error constants

  • Bode magnitude and phase with every gain and phase crossover, gain margin, phase margin and the time delay the loop can tolerate; root locus with break points, asymptotes and axis crossings

Transfer Function Analyzer

/

G(s) = K N(s) / D(s). Coefficients, highest power first: 1 3 2 0 is s³ + 3s² + 2s




What to Analyze



Options







×

Transfer Function Analyzer

Transfer Function Analyzer: Poles, the Routh Array, Time Response, Margins and Root Locus

What the tool does

You type the numerator and denominator of a transfer function G(s) = K N(s) / D(s) as lists of coefficients. The tool finds its poles and zeros, says whether it is stable and why, writes the Routh array row by row, computes the step response with its rise time, overshoot and settling time, draws the Bode plots with the gain and phase margins, and, when G(s) is the open loop of a unity-feedback system, finds the range of K that keeps the closed loop stable and draws the root locus.

The idea

A transfer function is the ratio of output to input of a linear system, written in the Laplace variable s. Its denominator D(s) holds the system's own behavior: each root of D(s), called a pole, at s = σ ± jω puts a term eσt cos(ωt + φ) into every response. The sign of σ decides everything. Negative σ: the term dies away. Positive σ: it grows without limit. Zero σ: it neither grows nor dies. So a system is stable exactly when every pole lies in the left half of the s-plane, and almost every question in classical control is a question about where the poles are and how they move.

left half-plane: σ < 0 decays: stable never dies: marginal grows: unstable right half-plane: σ > 0 real, σ imaginary, jω × marks a pole pair s = σ ± jω; the sketches show its part of the response

Typing a transfer function

Multiply the factors out and type the coefficients from the highest power of s down to the constant, with a 0 for every missing power. For G(s) = K / (s(s + 1)(s + 2)) the denominator is s³ + 3s² + 2s, typed 1 3 2 0; the numerator is 1; and K goes in its own box. The numerator may not have a higher order than the denominator.

Poles, damping ratio and natural frequency

The tool finds all roots of the polynomial at once by the Aberth iteration and then polishes them. For a complex pole pair s = −σd ± jωd it reports

ωn = √(σd² + ωd²), ζ = σd / ωn,

the natural frequency (distance of the pole from the origin) and the damping ratio (the cosine of the angle the pole makes with the negative real axis). A real pole at s = −a has the time constant 1/a: its term falls to 37 % in that time and to 2 % in about four time constants.

The Routh array

The Routh test counts the roots of a polynomial a0sn + a1sn−1 + … + an that have a positive real part, without finding them. Write the coefficients alternately in two rows, a0, a2, a4, … and a1, a3, a5, …; each entry of a later row is

(b1 ak+1 − a1 bk+1) / b1,

where a is the row two above, b the row just above, and the subscript counts columns. The number of sign changes down the first column equals the number of roots in the right half-plane. Two special cases need care, and the tool shows both:

A zero in the first column, the rest of the row not zero. Replace the zero by a small positive ε, carry on, and read the signs as ε goes to zero. The tool carries every entry as a series in powers of ε, so the limit is exact, not a guess with a small number.

A whole row of zeros. The row above it gives the auxiliary polynomial A(s), which has only even (or only odd) powers; its roots are roots of the original polynomial placed symmetrically about the origin, often a pair on the imaginary axis. Replace the zero row by the coefficients of dA/ds and carry on. A row that vanishes as ε goes to zero is treated the same way.

For a unity-feedback loop the characteristic polynomial is D(s) + K N(s). Leaving K as a symbol in the array turns the first column into conditions on K; the tool prints that array and finds the stable range exactly, from the gains at which a root sits on the imaginary axis: set s = jω in D + K N = 0 and require K to be real.

Time response

The response is not integrated numerically. The transfer function is put in state-space form, x′ = A x + B u, y = C x + d u, and stepped from one plotted point to the next with the matrix exponential eAΔt, which is exact for a step, a ramp or an impulse. From the unit-step response the tool measures:

rise time, from 10 % to 90 % of the final value; peak time and percent overshoot, (peak − final) / final × 100; settling time, after which the response stays within 2 % (or 5 %) of the final value; and the final value itself, G(0), by the final-value theorem.

For a pure second-order system ωn² / (s² + 2ζωns + ωn²) with ζ below 1 these have closed forms, which the tool prints for the slowest pole pair beside the measured values:

overshoot = 100 e−ζπ / √(1 − ζ²) percent, peak time = π / ωd, settling time ≈ 4 / (ζ ωn).

Steady-state error of a unity-feedback loop depends on its type, the number of open-loop poles at s = 0. With Kp = lim K G(s), Kv = lim s K G(s) and Ka = lim s² K G(s) as s goes to zero, the error (input minus output) is 1 / (1 + Kp) for a unit step, 1 / Kv for a unit ramp and 1 / Ka for a unit parabola. These hold only if the closed loop is stable.

Frequency response and margins

Put s = jω: G(jω) is a complex number whose size is the amplification of a sine wave of frequency ω and whose angle is its phase shift. The Bode plots show 20 log10|G| in decibels and the phase in degrees against ω on a logarithmic axis. For a loop, instability begins when K G(jω) = −1, that is a gain of 1 with a phase of −180°. The two margins measure the distance from that point:

gain margin = 1 / |K G(jωpc)| at the phase crossover ωpc, where the phase is −180°; phase margin = 180° + phase of K G(jωgc) at the gain crossover ωgc, where the gain is 1.

The tool finds the gain crossovers exactly, as roots of |K N(jω)|² − |D(jω)|² = 0 in ω², and the phase crossovers as roots of the imaginary part of N(jω) times the conjugate of D(jω). A time delay T multiplies G by e−sT: the gain is unchanged and the phase falls by ωT radians. The largest delay a stable loop can take is therefore its phase margin in radians divided by ωgc.

Root locus

The root locus is the path of the roots of D(s) + K N(s) = 0 as K rises from zero. With n poles and m zeros: branches start at the poles and end at the zeros; n − m branches go to infinity along asymptotes at angles (2q + 1)·180° / (n − m) that meet on the real axis at (sum of poles − sum of zeros) / (n − m); branches meet and part on the real axis at break points, the real roots of N′D − N D′ = 0 with a positive K; and the crossings of the imaginary axis are the critical gains of the Routh test. The tool computes the roots on a fine grid of gains and reports these features.

What it assumes

A linear, time-invariant system described by a ratio of polynomials with real coefficients, optionally with a pure time delay. Unity negative feedback: the output itself is subtracted from the input, with no sensor dynamics in the feedback path (put any such dynamics into G). Zero initial conditions. Time in seconds and s in radians per second; any consistent pair of units works the same way.

When it misleads

If a pole and a zero coincide, the tool does not cancel them: a canceled unstable pole still shows as unstable here, which is the safe reading, but a canceled stable pair adds a term of zero size to the tables. Roots repeated three or more times are found less accurately than simple ones, and a system sitting exactly on the stability boundary is classed by roots that are rounded to the axis when they are within one part in 108 of it. Gain and phase margins predict closed-loop stability only for an open loop with no poles in the right half-plane and a single crossover of each kind; otherwise judge by the closed-loop poles, as the tool does. With a time delay, the poles, the Routh array and the root locus are those of the transfer function without the delay; the margins, the Bode plots and the plotted response include it, and for a loop that is unstable without the delay the tool does not examine whether the delay changes that. Real hardware saturates, and a linear model says nothing about that.

Common mistakes

Leaving out a zero coefficient. s³ + 2s is 1 0 2 0, not 1 2. A missing power changes the order of the system.

Reading stability from the open-loop poles. Feedback moves the poles. An unstable plant can make a stable loop, and a stable plant an unstable one; the closed-loop poles are the roots of D + K N, not of D.

Stopping the Routh array at a zero. A zero in the first column or a row of zeros is not the end of the test; use ε or the auxiliary polynomial. A row of zeros does not by itself mean marginal stability: check the sign changes too.

Counting signs instead of sign changes. Two negative entries in a row are one change in and one change out, so two roots in the right half-plane; a first column that is negative throughout has no changes at all.

Using the second-order overshoot formula on a higher-order system. A zero or a third pole near the dominant pair changes the overshoot a great deal: the lead-compensated Try this case overshoots by 23 % although none of its closed-loop poles is complex. The formula is a first estimate; the measured response is the answer.

Quoting a steady-state error for an unstable loop. The error constants come from a limit that assumes the response settles.

Mixing the two crossovers. The gain margin is read at the frequency where the phase is −180°, the phase margin at the frequency where the gain is 0 dB. They are different frequencies.

Trusting margins for an unstable open loop. There a gain margin below 1 can be healthy: it says how far the gain may fall, not rise.

Forgetting units of frequency. ω in these formulas is in radians per second; a frequency in hertz must be multiplied by 2π.




References

Greensite, A. L. (1967). Analysis and Design of Space Vehicle Flight Control Systems, Volume III: Linear Systems. NASA Contractor Report CR-822, National Aeronautics and Space Administration, Washington, DC.

Routh, E. J. (1877). A Treatise on the Stability of a Given State of Motion, Particularly Steady Motion. Macmillan, London.

Evans, W. R. (1950). "Control System Synthesis by Root Locus Method." Transactions of the American Institute of Electrical Engineers, Vol. 69, No. 1, pp. 66–69.

Bode, H. W. (1945). Network Analysis and Feedback Amplifier Design. Van Nostrand, New York.

Aberth, O. (1973). "Iteration Methods for Finding All Zeros of a Polynomial Simultaneously." Mathematics of Computation, Vol. 27, No. 122, pp. 339–344.

Moler, C., and Van Loan, C. (2003). "Nineteen Dubious Ways to Compute the Exponential of a Matrix, Twenty-Five Years Later." SIAM Review, Vol. 45, No. 1, pp. 3–49.

Van Loan, C. F. (1978). "Computing Integrals Involving the Matrix Exponential." IEEE Transactions on Automatic Control, Vol. 23, No. 3, pp. 395–404.

Ogata, K. (2010). Modern Control Engineering, 5th ed. Prentice Hall, Upper Saddle River, NJ.


DISCLAIMER: The methods and calculation on aNOWysis.com are provided as means to educate the reader. There is no warranty, expessed or implied, as to the relevance or accuracy of the methods or calculations. All calculations should be checked by a qualified analyst for appropriateness and accuracy. We will not be held liable for any damages, injuries or deaths caused by using methods or calculations from this site.