ENع
←Transfer functions
Lesson 07 · Modelling systems

The transfer function of a system

15 min10 steps5 questionsIntermediate
About this lesson

Take the cart from the lesson on equations of motion, 2ẍ + 4ẋ + 50x = f(t), and Laplace-transform it term by term. The ratio of output to input, G(s) = 1/(2s² + 4s + 50), is its transfer function: one block that turns any input into an output by multiplication. Read its DC gain and poles, then feed it a push and a tap and watch the exact responses it predicts.

You'll learn to

Tick what you feel confident about. These self-checks do not affect your lesson score.

Fig 7 · Interactive
01 / 10

Start from the equation

The 2 kg cart from the equations-of-motion lesson obeys 2ẍ + 4ẋ + 50x = f(t), where ẋ is velocity and ẍ is acceleration. The push f(t) is the input; the position x(t) is the output. Re-solving it for every push is slow.

the cart:  m = 2 kg   b = 4 N·s/m   k = 50 N/m

  2x'' + 4x' + 50x = f(t)

input   f(t)  push on the cart (N)
output  x(t)  position (m)

Goal of this lesson: one object, G(s), that
holds everything the cart does to ANY push.
Loading figure…
or ← →
Read the lesson step by step
  1. Start from the equation

    The 2 kg cart from the equations-of-motion lesson obeys 2ẍ + 4ẋ + 50x = f(t), where ẋ is velocity and ẍ is acceleration. The push f(t) is the input; the position x(t) is the output. Re-solving it for every push is slow.

    the cart:  m = 2 kg   b = 4 N·s/m   k = 50 N/m
    
      2x'' + 4x' + 50x = f(t)
    
    input   f(t)  push on the cart (N)
    output  x(t)  position (m)
    
    Goal of this lesson: one object, G(s), that
    holds everything the cart does to ANY push.
  2. Derivatives become multiplication

    The Laplace transform turns a function of time into a function of a new variable, s. Its key trick: if the cart starts at rest, a derivative becomes a multiplication by s. So ẋ becomes sX(s) and ẍ becomes s²X(s).

    Laplace transform:  x(t)  →  X(s)
    
    derivative rule (starting at rest,
    x(0) = 0 and x'(0) = 0):
    
      dx/dt    →  s·X(s)
      d²x/dt²  →  s²·X(s)
    
    Calculus in time becomes algebra in s.
    The transform itself is taught in the
    Circuits lesson on Laplace analysis.
  3. Transform every term

    Transform each term: 2ẍ becomes 2s²X(s), 4ẋ becomes 4sX(s), 50x becomes 50X(s) and f(t) becomes F(s). The differential equation is now plain algebra: (2s² + 4s + 50)X(s) = F(s).

    term by term (zero initial conditions):
    
      2x''   →  2s²·X(s)
      4x'    →  4s·X(s)
      50x    →  50·X(s)
      f(t)   →  F(s)
    
      (2s² + 4s + 50)·X(s) = F(s)
    
    X(s) is just a factor now: no derivatives.
  4. Output over input

    Divide the output by the input: G(s) = X(s)/F(s) = 1/(2s² + 4s + 50). That ratio is the transfer function. It holds only the cart's mass, damper and spring, and nothing about how hard we push.

    transfer function
    
             X(s)          1
      G(s) = ----  =  --------------
             F(s)     2s² + 4s + 50
    
    Defined for a linear, time-invariant system
    with every initial condition zero.
    m, b and k are the denominator's
    coefficients: 2, 4 and 50.
  5. One block in a diagram

    Draw the cart as one box holding G(s). An arrow carries the input F(s) in and another carries the output X(s) out. The box has one rule: output equals G(s) times input. This picture is a block diagram.

      F(s) ──▶ [ G(s) ] ──▶ X(s)
    
      X(s) = G(s) · F(s)
    
    Every block in a control diagram works
    this way: multiply what comes in by the
    block's transfer function.
  6. Push with a step

    Push with a steady 10 N from t = 0. Its transform is F(s) = 10/s, so X(s) = 10/(s(2s² + 4s + 50)). A transform table turns that back into x(t): the cart overshoots to 0.305 m, then settles.

    # X(s) = 10/(s(2s²+4s+50))
    #      = 0.2/s - 0.2(s+2)/((s+1)² + 24)
    # so x(t) = 0.2(1 - e^-t (cos wd·t + sin(wd·t)/wd))
    import math
    wd = math.sqrt(24)
    t = math.pi / wd                 # first peak
    x = 0.2 * (1 - math.exp(-t) * (math.cos(wd*t) + math.sin(wd*t)/wd))
    print(round(t, 2), round(x, 3))  # 0.64 0.305
  7. Where it settles: G(0)

    Set s = 0: G(0) = 1/50 = 0.02 m per newton, the DC gain. The final value theorem says a steady 10 N push ends at 10 × 0.02 = 0.2 m, the same answer as kx = F.

    DC gain  G(0) = 1/50 = 0.02 m/N
    
    final value theorem
      x(∞) = lim s→0  s·X(s)
           = lim s→0  s · (10/s) · G(s)
           = 10 · G(0) = 0.2 m
    
    Check: at rest the spring holds the push,
    kx = F, x = 10/50 = 0.2 m.
  8. The denominator shapes the motion

    Where 2s² + 4s + 50 = 0, G(s) blows up. Those values, s = −1 ± 4.90j, are the poles. The −1 sets the e^−t envelope the swings shrink inside. The 4.90 rad/s sets their 1.28 s period.

    poles: roots of 2s² + 4s + 50 = 0
      s = (-4 ± √(16 - 400)) / 4
        = -1 ± j√24 = -1 ± 4.90j
    
    real part  -1    → decays like e^-t
    imag part  4.90  → rings at 4.90 rad/s,
                       period 2π/4.90 = 1.28 s
    
    The next lesson puts poles on the s-plane.
  9. A tap instead of a push

    Now strike the cart with a quick tap of 2 N·s, an impulse. Its transform is just 2, so X(s) = 2G(s). Same box, new input: the cart jumps to 0.151 m, rings at the same rate and returns to rest.

    # X(s) = 2·G(s) = 1/((s+1)² + 24)
    # so x(t) = e^-t · sin(wd·t) / wd
    import math
    wd = math.sqrt(24)
    t = math.atan(wd / 1) / wd  # peak: atan(wd/sigma)/wd, sigma = 1
    x = math.exp(-t) * math.sin(wd*t) / wd
    print(round(t, 2), round(x, 3))  # 0.28 0.151
  10. G(s) in Python

    In Python, G(s) is just a function. G(0) gives the DC gain, and the quadratic formula on the denominator gives the poles. The python-control library builds the same object with ct.tf([1], [2, 4, 50]).

    import cmath
    def G(s):
        return 1 / (2*s**2 + 4*s + 50)
    a, b, c = 2, 4, 50
    p = (-b + cmath.sqrt(b*b - 4*a*c)) / (2*a)
    print(G(0), round(p.real, 2), round(p.imag, 2))  # 0.02 -1.0 4.9
    # python-control:  import control as ct
    #   G = ct.tf([1], [2, 4, 50])
    #   ct.dcgain(G) -> 0.02,  G.poles() -> -1 ± 4.899j

Quiz Unlocks after the last step.