ENع
←Electrical-mechanical analogies
Lesson 09 · Modelling systems

Electrical and mechanical analogies

14 min11 steps5 questionsIntermediate
About this lesson

A cart on a spring and damper and a series RLC circuit look nothing alike, yet they obey the same second-order equation. Match the parts term by term (force to voltage, mass to inductance, damper to resistor, spring to one over capacitance), then switch both on and watch the cart's position and the capacitor's charge trace one curve.

You'll learn to

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

Fig 9 · Interactive
01 / 11

A cart we already know

The cart from the lesson "Writing the equation of motion": 2 kg, a spring of 50 N/m and a damper of 4 N·s/m, pushed by a steady 10 N. Newton's second law gave its equation: 2ẍ + 4ẋ + 50x = 10.

cart     m = 2 kg
spring   k = 50 N/m
damper   b = 4 N·s/m
push     F = 10 N from t = 0

m·ẍ + b·ẋ + k·x = F(t)
2ẍ + 4ẋ + 50x = 10

x = position (m), ẋ = velocity (m/s),
ẍ = acceleration (m/s²)
Loading figure…
or ← →
Read the lesson step by step
  1. A cart we already know

    The cart from the lesson "Writing the equation of motion": 2 kg, a spring of 50 N/m and a damper of 4 N·s/m, pushed by a steady 10 N. Newton's second law gave its equation: 2ẍ + 4ẋ + 50x = 10.

    cart     m = 2 kg
    spring   k = 50 N/m
    damper   b = 4 N·s/m
    push     F = 10 N from t = 0
    
    m·ẍ + b·ẋ + k·x = F(t)
    2ẍ + 4ẋ + 50x = 10
    
    x = position (m), ẋ = velocity (m/s),
    ẍ = acceleration (m/s²)
  2. A circuit in one loop

    Now a circuit: a 10 V source, a 4 Ω resistor, a 2 H inductor and a 20 mF capacitor in one loop. In a single loop the same current i flows through every part. Let q be the charge stored on the capacitor.

    source     v = 10 V from t = 0
    resistor   R = 4 Ω
    inductor   L = 2 H
    capacitor  C = 20 mF = 0.02 F
    
    one loop, so one current i (amps)
    q = charge on the capacitor (coulombs)
    i = dq/dt: current is charge per second
  3. The loop's own equation

    Kirchhoff's voltage law: the voltages across the parts add up to the source. Resistor Ri, inductor L·di/dt, capacitor q/C. Write i as q̇: Lq̈ + Rq̇ + q/C = v(t). It has the same shape as the cart's equation.

    vR + vL + vC = v              (KVL)
    R·i + L·di/dt + q/C = v
    
    with i = q̇ and di/dt = q̈:
    L·q̈ + R·q̇ + (1/C)·q = v(t)
    
    cart:  m·ẍ + b·ẋ +   k  ·x = F(t)
    loop:  L·q̈ + R·q̇ + (1/C)·q = v(t)
  4. Push matches voltage

    Line the two equations up term by term. The push F sits where the source voltage v sits: both are the input that drives the whole system. So the 10 N push becomes a 10 V source. This pairing is the force-voltage analogy.

    mechanical        electrical
    force F (N)   ↔   voltage v (V)
    10 N          ↔   10 V
    
    The input sits on the right of
    both equations.
  5. Mass matches inductance

    Mass resists a change of speed: F = m·dẋ/dt. An inductor resists a change of current: v = L·di/dt. So velocity ẋ matches current i, and mass m matches inductance L: 2 kg becomes 2 H.

    F = m·dẋ/dt      ↔   v = L·di/dt
    velocity ẋ      ↔   current i
    mass m          ↔   inductance L
    2 kg            ↔   2 H
    
    stored energy:  ½·m·ẋ²  ↔  ½·L·i²
  6. Damper matches resistor

    A damper's force grows with speed, F = b·ẋ. A resistor's voltage grows with current, v = R·i. Both turn energy into heat and never give it back. So b matches R: 4 N·s/m becomes 4 Ω.

    F = b·ẋ          ↔   v = R·i
    damping b       ↔   resistance R
    4 N·s/m         ↔   4 Ω
    
    power lost as heat:  b·ẋ²  ↔  R·i²
  7. Spring matches capacitor

    A spring's force grows with stretch, F = k·x. A capacitor's voltage grows with stored charge, v = q/C. So position x matches charge q, and k matches 1/C: k = 50 N/m becomes C = 1/50 = 0.02 F.

    F = k·x          ↔   v = q/C
    position x      ↔   charge q
    stiffness k     ↔   1/C
    k = 50 N/m      ↔   C = 1/50 = 0.02 F
    
    stored energy:  ½·k·x²  ↔  q²/(2C)
  8. One equation, one transfer function

    Write y for x or q. With these values both equations read 2y'' + 4y' + 50y = 10, so both have the transfer function 1/(2s² + 4s + 50), with the same poles at s = −1 ± j4.9. Same poles, same motion.

    cart:  X(s)/F(s) = 1 / (2s² + 4s + 50)
    loop:  Q(s)/V(s) = 1 / (2s² + 4s + 50)
    
    poles: 2s² + 4s + 50 = 0
      s = −1 ± j4.9     (ωn = 5, ζ = 0.2)
    
    import control as ct
    G = ct.tf([1], [2, 4, 50])
    print(G.poles())
    # [-1.+4.89897949j -1.-4.89897949j]
  9. Switch both on

    Push the cart and close the circuit at the same moment. The cart's position x and the capacitor's charge q trace one curve: both peak at 0.305 at 0.64 s, then settle at 0.2. Each force arrow has a matching voltage.

    # one routine, two systems: a2·y'' + a1·y' + a0·y = u
    def peak(a2, a1, a0, u, dt=0.001):
        y = dy = top = 0.0
        for n in range(6000):         # 6 s
            ddy = (u - a1*dy - a0*y) / a2
            dy = dy + ddy*dt
            y = y + dy*dt
            top = max(top, y)
        return round(top, 3)
    m, b, k, F = 2, 4, 50, 10           # cart
    L, R, C, V = 2, 4, 0.02, 10         # circuit
    print(peak(m, b, k, F), peak(L, R, 1/C, V))   # 0.305 0.305
  10. Speed matches current

    Freeze at t = 0.28 s. The cart moves fastest, 0.76 m/s, and the ammeter reads 0.76 A. Spring 7.0 N matches capacitor 7.0 V; damper 3.0 N matches resistor 3.0 V. They add to 10, so the inductor's voltage is zero.

    t = 0.28 s (fastest moment, ẍ = 0)
      ẋ = 0.76 m/s      i = 0.76 A
      x = 0.14 m       q = 0.14 C
    
      k·x  = 7.0 N   ↔   q/C   = 7.0 V
      b·ẋ  = 3.0 N   ↔   R·i   = 3.0 V
      m·ẍ  = 0 N     ↔   L·di/dt = 0 V
      sum  = 10       =   v
  11. Why engineers use it

    One set of tools now covers both worlds: a circuit simulator can test a machine, and a damped spring explains a circuit. A second pairing, the force-current analogy, matches mass to capacitance and the spring to inductance instead.

    force-voltage (this lesson)     force-current
      F  ↔ v                          F  ↔ i
      ẋ  ↔ i                          ẋ  ↔ v
      m  ↔ L                          m  ↔ C
      b  ↔ R                          b  ↔ 1/R
      k  ↔ 1/C                        k  ↔ 1/L
      series loop                     parallel nodes
    
    Both give the same equation; pick the one
    whose circuit is easier to draw.

Quiz Unlocks after the last step.