Computer Systems Modelling · Sections 8.3–8.4 · Interactive lab

First- and second-order systems

Many real systems respond to a sudden change in their input in one of two ways: they rise smoothly towards a new level, or they store and release energy and so overshoot and oscillate on the way. Sections 8.3 and 8.4 model these as first- and second-order transfer functions and study their response to a unit step. In this lab you set the gain, the time constant, the natural frequency and the damping ratio, and see the step response and the poles change together. The partial fraction expansions behind each formula use Table 5.4; see the Laplace Transform Lab for a refresher.

How it works and what to try

How it works: In two tabs. (1) First-order system: set the gain K and time constant τ of K/(1 + τs) and see the response of Equation 8.8 next to its pole, with optional steady-state and transient parts and the tangent at t = 0. A card at the bottom hides a first-order system behind noisy step measurements, for you to identify. (2) Second-order system: set K, ωn and ζ in Equation 8.9 and watch the poles travel around a semicircle and then split along the real axis, as the response goes from undamped through underdamped and critically damped to overdamped (Equations 8.10–8.13). Overlays reproduce the families of curves in Figures 8.5 and 8.6.

Try this: Read τ off a step response as the time to reach 63% of the final value, then identify a few hidden systems with the noise on. Slide ζ slowly from 0 to 3 and watch the overshoot shrink and vanish at ζ = 1. Change ωn with ζ fixed and see the response keep its shape but change its time scale. Set ζ = 3 and see a second-order system behave almost like a first-order one.

Section, figure and equation numbers refer to Chapter 8 (Control Theory) of S. Keshav, Mathematical Foundations of Computer Networking, Addison-Wesley, 2012.

Gain and time constant

A first-order system has the transfer function

G(s) = K1 + τsEQ 8.7

where K is the gain and τ is the time constant. Its only pole is at s = −1/τ. For a unit step input, whose transform is 1/s, the output is Y(s) = K/(s(1 + τs)). Its partial fraction expansion gives

y(t) = K(1 − e−t/τ)EQ 8.8

The output settles at K times the input, which is why K is called the gain. It reaches 1 − 1/e, about 63%, of this value at t = τ, and 99.33% at t = 5τ. For all practical purposes the system has settled by 5τ, which is why τ is called the time constant.

Writing the response as y(t) = K − Ke−t/τ splits it into a steady state response K and a transient response −Ke−t/τ that dies away. Because a step is easy to generate, we can often find K and τ for a real system by giving it a step and measuring the output. The card at the bottom of this tab lets you try this.

2.5
2
Time axis

The system

—
pole
—
final value
—
y(τ)
—
y(5τ)
—
Unit step response y(t)y(t); Figure 8.3 (faint); dashed line: the final value K
The s-planethe pole × of G(s) at −1/τ; the pole of Figure 8.3 (faint)
Python · EQ 8.8 against the differential equation

    

What to notice

Change K with τ fixed. The whole curve is stretched vertically, but the times at which it reaches 63% and 99.3% of its final value do not move. The pole does not move either: the gain sets how far the output goes, not how fast it gets there.

Change τ with K fixed. The final value stays the same, but the curve is stretched horizontally. As τ grows, the pole at −1/τ moves towards the origin. A pole close to the origin means a slow system; a pole far to the left means a fast one.

Turn on the tangent. The response starts with slope K/τ, so if it kept rising at its initial rate it would reach its final value at exactly t = τ. Instead it slows down as it approaches K, and is only at 63% by then.

Turn on the two parts. The steady state response is flat and the transient response starts at −K and decays to zero. Their sum is y(t), and it starts at zero, as it must for a system initially at rest.

Identify a system from its step responseA hidden first-order system has been given a unit step. Its measured output is shown as dots. Find its K and τ.
1
1

Hint: estimate the final value first. Then find the time at which the output reaches 63% of it.

Move the sliders until your curve passes through the dots, then check.
Measured output and your model● measurements; your model; true response (after checking)

Try these

  1. Exercise 5 in Section 8.13: when given a step input, a first-order system reaches 63% of its asymptotic value of 4.25 units at time 3 s. Set the sliders to match, and write down its transfer function.
    Show answer
    The asymptotic value is K times the unit step, so K = 4.25. The output reaches 63% of its final value at t = τ, so τ = 3 s. The transfer function is G(s) = 4.25/(1 + 3s), with a pole at −1/3. The readout shows y(τ) = 2.6865 = 0.6321 × 4.25.
  2. Start from Figure 8.3 and double the time constant to τ = 4. Where does the pole go, and how long does the system now take to settle?
    Show answer
    The pole moves from −0.5 to −0.25, half as far from the origin. The system now takes 5τ = 20 s to reach 99.3% of its final value, twice as long as before. Choose the 0 to 20 s time axis to see this. The final value is still 2.5.
  3. Does the time at which the output reaches 63% of its final value depend on K? Use the sliders, then explain from EQ 8.8.
    Show answer
    No. From EQ 8.8, y(t)/K = 1 − e−t/τ, which depends only on t/τ. The fraction of the final value reached at any time is the same for every gain, so y(τ)/K = 1 − 1/e ≈ 0.632 whatever K is.
  4. Turn on the tangent at t = 0. Where does it cross the dashed final-value line, and why?
    Show answer
    Differentiating EQ 8.8 gives y′(t) = (K/τ)e−t/τ, so the initial slope is K/τ. A line from the origin with this slope reaches height K at t = τ. This gives a second way to read τ off a measured step response.
  5. In the card above, press New system a few times and identify each one. Which of the two parameters is easier to estimate when the noise is on, and why?
    Show answer
    The gain is usually easier, because once the response has settled you can average many measurements to estimate the final value, and the noise averages out. The time constant depends on reading the single time at which the output crosses 63% of that value. Near that point the curve is fairly flat, so a small error in height becomes a larger error in time, and any error in your estimate of K carries over into τ too.